feat: api v2 identities.createIdentity#2955
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@Flo4604 is attempting to deploy a commit to the Unkey Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for following the naming conventions for pull request titles! 🙏 |
📝 WalkthroughWalkthroughThis pull request implements the new V2 identity creation endpoint and its supporting infrastructure in the Go API. It introduces a new route and handler for Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant A as API Handler
participant K as Keys Service
participant P as Permissions Service
participant DB as Database
participant AL as Audit Log Service
C->>A: HTTP POST /v2/identities.createIdentity
A->>K: VerifyRootKey
K-->>A: Key Validated / Error
A->>P: Check Permissions
P-->>A: Authorized / Unauthorized
A->>DB: Begin Transaction & Insert Identity
alt Duplicate Identity
DB-->>A: Conflict Error
A-->>C: 409 Conflict Response (via CONFLICT fault)
else Successful Creation
A->>AL: Insert Audit Log Entry
DB-->>A: Commit Transaction
A-->>C: 200 Success (with IdentityId)
end
Assessment against linked issues
Suggested Reviewers
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
…/v2/identities.createIdentity
What does this PR do?
Fixes #2952
Type of change
How should this be tested?
Tests
Checklist
Required
pnpm buildpnpm fmtconsole.logsgit pull origin mainAppreciated
Summary by CodeRabbit
New Features
Tests