-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Add GET/PATCH /api/accounts/me/telephony_api_keys to OpenAPI #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds a new account-level telephony key management endpoint to the OpenAPI spec. Introduces GET and PATCH operations at /api/accounts/me/telephony_api_keys, secured by apiKeyAuth. Defines AccountTelephonyKeys and PatchedSetTelephonyApiKeysRequest schemas, exposing and updating a Telnyx API key field. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant API as Ultravox API
participant Auth as apiKeyAuth
participant Keys as Telephony Key Store
Note over API,Keys: GET /api/accounts/me/telephony_api_keys
Client->>API: GET /accounts/me/telephony_api_keys
API->>Auth: Validate API key
Auth-->>API: Auth OK
API->>Keys: Fetch AccountTelephonyKeys
Keys-->>API: AccountTelephonyKeys { telnyx: KeyPrefix... }
API-->>Client: 200 application/json (AccountTelephonyKeys)
rect rgba(240,250,255,0.6)
Note right of API: Error path
API-->>Client: 401/403 on auth failure
end
sequenceDiagram
autonumber
actor Client
participant API as Ultravox API
participant Auth as apiKeyAuth
participant Keys as Telephony Key Store
Note over API,Keys: PATCH /api/accounts/me/telephony_api_keys
Client->>API: PATCH ... { telnyx?: string|null }
API->>Auth: Validate API key
Auth-->>API: Auth OK
API->>Keys: Partially update telnyx key
Keys-->>API: Updated AccountTelephonyKeys
API-->>Client: 200 application/json (AccountTelephonyKeys)
rect rgba(255,245,240,0.6)
Note right of API: Validation errors
API-->>Client: 400 on invalid body
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/libs/Ultravox/openapi.yaml (2)
112-143: Add concise operation descriptions (parity with other endpoints).Helps docs/codegen consumers understand behavior (prefix-only on GET; PATCH accepts full secret, returns prefix).
/api/accounts/me/telephony_api_keys: get: tags: - accounts + description: Gets account-level telephony provider API keys. Response returns key prefixes only. operationId: accounts_me_telephony_api_keys_retrieve @@ patch: tags: - accounts + description: Partially updates account-level telephony provider API keys. Accepts full secrets; response returns key prefixes only. Set a field to null to clear. operationId: accounts_me_telephony_api_keys_partial_update
2592-2599: Clarify response field describes a prefix, not the full key.Matches usage of KeyPrefix and avoids confusion.
AccountTelephonyKeys: type: object properties: telnyx: allOf: - $ref: '#/components/schemas/KeyPrefix' - description: The Telnyx API key. + description: The Telnyx API key prefix.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (9)
src/libs/Ultravox/Generated/Ultravox.AccountsClient.AccountsMeTelephonyApiKeysPartialUpdate.g.csis excluded by!**/generated/**src/libs/Ultravox/Generated/Ultravox.AccountsClient.AccountsMeTelephonyApiKeysRetrieve.g.csis excluded by!**/generated/**src/libs/Ultravox/Generated/Ultravox.IAccountsClient.AccountsMeTelephonyApiKeysPartialUpdate.g.csis excluded by!**/generated/**src/libs/Ultravox/Generated/Ultravox.IAccountsClient.AccountsMeTelephonyApiKeysRetrieve.g.csis excluded by!**/generated/**src/libs/Ultravox/Generated/Ultravox.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/Ultravox/Generated/Ultravox.Models.AccountTelephonyKeys.Json.g.csis excluded by!**/generated/**src/libs/Ultravox/Generated/Ultravox.Models.AccountTelephonyKeys.g.csis excluded by!**/generated/**src/libs/Ultravox/Generated/Ultravox.Models.PatchedSetTelephonyApiKeysRequest.Json.g.csis excluded by!**/generated/**src/libs/Ultravox/Generated/Ultravox.Models.PatchedSetTelephonyApiKeysRequest.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Ultravox/openapi.yaml(3 hunks)
| type: object | ||
| properties: | ||
| telnyx: | ||
| type: string | ||
| description: "Your Telnyx API key.\nhttps://portal.telnyx.com/#/api-keys" | ||
| nullable: true | ||
| PatchedSetTtsApiKeysRequest: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Mark secrets as writeOnly and add minimal validation.
Prevents accidental echo in clients, hints UIs to mask, and rejects empty strings while still allowing null to clear.
PatchedSetTelephonyApiKeysRequest:
type: object
properties:
telnyx:
type: string
- description: "Your Telnyx API key.\nhttps://portal.telnyx.com/#/api-keys"
+ description: "Your Telnyx API key.\nhttps://portal.telnyx.com/#/api-keys"
+ format: password
+ writeOnly: true
+ minLength: 1
nullable: true📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| type: object | |
| properties: | |
| telnyx: | |
| type: string | |
| description: "Your Telnyx API key.\nhttps://portal.telnyx.com/#/api-keys" | |
| nullable: true | |
| PatchedSetTtsApiKeysRequest: | |
| PatchedSetTelephonyApiKeysRequest: | |
| type: object | |
| properties: | |
| telnyx: | |
| type: string | |
| description: "Your Telnyx API key.\nhttps://portal.telnyx.com/#/api-keys" | |
| format: password | |
| writeOnly: true | |
| minLength: 1 | |
| nullable: true | |
| PatchedSetTtsApiKeysRequest: |
🤖 Prompt for AI Agents
In src/libs/Ultravox/openapi.yaml around lines 3667 to 3673, the telnyx API key
property should be marked writeOnly and validate against empty strings while
still allowing null to clear; change the telnyx property to include writeOnly:
true and a minimal validation (minLength: 1) while keeping nullable: true, e.g.
keep type: string and add writeOnly: true and minLength: 1; apply the same
pattern to any other API key/secret properties in this object so clients don't
echo secrets and empty strings are rejected but null is allowed to clear.
Summary by CodeRabbit