add /auth/delegated-keys endpoints#574
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. This stack of pull requests is managed by Graphite. Learn more about stacking. |
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-openapi studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-typescript studio · code · diff
✅ grid-go studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-python studio · code · diff
✅ grid-csharp studio · code · diff
✅ grid-php studio · code · diff
✅ grid-cli studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile SummaryThis PR adds three new OpenAPI endpoints for delegated signing key management (
Confidence Score: 5/5Safe to merge — the spec is internally consistent, schemas compose correctly via allOf, and the flows are well-documented with appropriate error codes for all error paths. All changed files are OpenAPI spec additions with no runtime logic. The schemas are well-formed, the signed-retry pattern mirrors the existing credential revocation design, and all relevant edge cases (PENDING keys, expired challenges, conflict on duplicate active keys) are covered by documented response codes. No files require special attention; the one note about the stale PR description does not affect the spec files themselves.
|
| Filename | Overview |
|---|---|
| openapi/paths/auth/auth_delegated-keys.yaml | New file defining POST (three-leg create) and GET (list) for delegated keys; well-documented with 201/202/400/401/404/409/500 responses and examples. |
| openapi/paths/auth/auth_delegated-keys_{id}.yaml | New file defining DELETE (single-leg revocation via DELETE_USER) with 202/204/400/401/404/500 responses; consistent with credential revocation pattern. |
| openapi/components/schemas/auth/DelegatedKeyChallengeStep.yaml | Removes DELETE_POLICY from the enum, simplifying revocation to a single DELETE_USER leg; description updated to match. |
| openapi/openapi.yaml | Adds two new path $ref entries for /auth/delegated-keys and /auth/delegated-keys/{id}. |
| openapi.yaml | Regenerated bundle identical to mintlify/openapi.yaml; adds all delegated-key schemas and path operations inline. |
| mintlify/openapi.yaml | Regenerated Mintlify bundle; content mirrors openapi.yaml with all delegated-key additions. |
Sequence Diagram
sequenceDiagram
participant C as Client
participant G as Grid API
rect rgb(220, 240, 255)
Note over C,G: POST /auth/delegated-keys (Create — 3 legs)
C->>G: "POST /auth/delegated-keys {accountId, nickname}"
G-->>C: "202 {step: CREATE_USER, payloadToSign, requestId}"
C->>G: POST + Grid-Wallet-Signature + Request-Id
G-->>C: "202 {step: CREATE_POLICY, payloadToSign, requestId}"
C->>G: POST + Grid-Wallet-Signature + Request-Id
G-->>C: "201 DelegatedKey {status: ACTIVE}"
end
rect rgb(220, 255, 220)
Note over C,G: GET /auth/delegated-keys?accountId= (List)
C->>G: "GET /auth/delegated-keys?accountId=..."
G-->>C: "200 {data: [DelegatedKey, ...]}"
end
rect rgb(255, 235, 220)
Note over C,G: DELETE /auth/delegated-keys/{id} (Revoke — 1 leg)
C->>G: "DELETE /auth/delegated-keys/{id}"
G-->>C: "202 {step: DELETE_USER, payloadToSign, requestId}"
C->>G: DELETE + Grid-Wallet-Signature + Request-Id
G-->>C: 204 (key REVOKED, Turnkey user deleted)
end
Reviews (6): Last reviewed commit: "feat(openapi): add /auth/delegated-keys ..." | Re-trigger Greptile
357e5a5 to
6c65f64
Compare
91998d0 to
87f26f1
Compare
87f26f1 to
2b2e4d1
Compare
d784a24 to
de24d16
Compare
910e44e to
be20645
Compare
POST /auth/delegated-keys (three-leg signed-retry creation),
GET /auth/delegated-keys (list), and DELETE /auth/delegated-keys/{id}
(signed-retry revocation, user-deletion first) for delegating Spark
token-transaction signing authority on an embedded wallet to a
platform-held P-256 API key.
Includes the regenerated bundles (openapi.yaml, mintlify/openapi.yaml)
via make build. make lint passes with no new findings.
be20645 to
cc2e38f
Compare

What
Adds the delegated signing key endpoints to the spec, wired to the schemas from the PR downstack:
POST /auth/delegated-keysGET /auth/delegated-keys?accountId=PENDINGandREVOKEDDELETE /auth/delegated-keys/{id}Includes the regenerated bundles (
openapi.yaml,mintlify/openapi.yaml) viamake build.How the flows work
Delegation creates a non-root signer user holding a Grid-generated public key, then a policy granting that user raw-payload signing. The wallet owner alone constitutes the sub-org root quorum, so every activity must be stamped by the owner's session key — hence signed-retry legs mirroring
DELETE /auth/credentials/{id}:202(step: CREATE_USER) → stamped retry →202(step: CREATE_POLICY) → stamped retry →201DelegatedKey(ACTIVE). Each account may hold at most one non-revoked key (409otherwise). Abandoning mid-flow leaves aPENDINGkey that cannot sign.202(step: DELETE_USER) → stamped retry deletes the signer user and its API key →204. That is the complete kill switch: signing stops because the credential is gone. The policy is intentionally left in place — its consensus references the deleted user (signer user IDs are never reused), so it is permanently inert and deleting it is unnecessary.DelegatedKeyChallengeStepaccordingly has noDELETE_POLICYvalue.After activation, Grid uses the custodied key to authorize signing on the account's behalf (e.g. funding card payments from the wallet balance) — the platform never handles key material and the quote-execute contract is unchanged.
Security notes
Verification
make build— bundle regenerated;make lint— passes, no new findingsNotes for reviewers
🤖 Generated with Claude Code