-
Couldn't load subscription status.
- Fork 585
feat: keys.updateKey #3561
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
feat: keys.updateKey #3561
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
📝 WalkthroughWalkthroughThis change introduces the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant APIHandler
participant DB
participant AuditLog
Client->>APIHandler: POST /v2/keys.updateKey (with key update payload)
APIHandler->>DB: Authenticate root key, fetch target key
APIHandler->>DB: Verify permissions/roles
APIHandler->>DB: Begin transaction
alt Field specified
APIHandler->>DB: Conditionally update key fields (three-state logic)
end
alt ExternalId specified
APIHandler->>DB: Find or create identity, update key.identity_id
end
alt Permissions specified
APIHandler->>DB: Delete all key permissions
APIHandler->>DB: Upsert new permissions
end
alt Roles specified
APIHandler->>DB: Delete all key roles
APIHandler->>DB: Upsert new roles
end
APIHandler->>AuditLog: Insert audit log event
APIHandler->>DB: Commit transaction
APIHandler-->>Client: 200 OK + updated key info
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learningsgo/apps/api/routes/v2_keys_update_key/handler.go (15)⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (7)
✨ Finishing Touches
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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
|
Thank you for following the naming conventions for pull request titles! 🙏 |
…sponseData and KeysDeleteKeyResponseData
…o feat/v2/keys.updateKey
📝 CodeRabbit Chat: Restrict unspecified properties in KeysUpdateKeyResponseData and KeysDeleteKeyResponseData
|
mhm will check in a sec |
|
no rush, can be tomorrow too 😉 |
Graphite Automations"Post a GIF when PR approved" took an action on this PR • (07/16/25)1 gif was posted to this PR based on Andreas Thomas's automation. |
|
➕ Pushed commit: fix: comment |
What does this PR do?
Fixes #3539
Fixes #3419
Fixes nullable validation issues from openapi spec validator which doesnt support it
If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists
Type of change
How should this be tested?
Checklist
Required
pnpm buildpnpm fmtconsole.logsgit pull origin mainAppreciated
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores