Add 200/PROCESSING (WalletOperationProcessing) response to all 6 still-processing Global Accounts endpoints - #850
Add 200/PROCESSING (WalletOperationProcessing) response to all 6 still-processing Global Accounts endpoints#850carsonp6 wants to merge 6 commits into
Conversation
…d challenge endpoints
Grid's embedded-wallet auth endpoints forward to Turnkey, whose consensus-
or approval-gated activities are only optimistically synchronous. When
the underlying activity is still in flight, POST /auth/credentials and
POST /auth/credentials/{id}/challenge now document a 200 response
carrying a WalletOperationProcessing body (status: "PROCESSING") instead
of forcing a 5xx or blocking — the client re-sends the byte-identical
request until the operation settles, and the backend reconciles it to
terminal on its own.
WalletOperationProcessing lives in components/schemas/common since
follow-on endpoints (contact update, session refresh, OTP verify) will
reuse the same shape. The challenge endpoint's prior single-schema 200
response becomes an anyOf-wrapped AuthCredentialChallengeResponse (not a
discriminated oneOf — WalletOperationProcessing has no shared
discriminator field with AuthCredentialResponseOneOf's `type`).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
✱ Stainless preview builds for gridThis PR will update the cli go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-typescript studio · code · diff
✅ grid-openapi studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-go studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-python 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 SummaryThe PR extends two embedded-wallet authentication contracts so provider activities that remain in flight can return a documented
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified. The new response branches are structurally distinguishable, references resolve, endpoint-specific retry guidance remains compatible with the documented flows, and both generated bundles consistently reflect the modular source changes.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/common/WalletOperationProcessing.yaml | Defines a reusable, structurally distinct processing response with required status: PROCESSING. |
| openapi/components/schemas/auth/AuthCredentialChallengeResponse.yaml | Wraps the existing credential challenge response and processing response in an anyOf union. |
| openapi/paths/auth/auth_credentials.yaml | Documents the new processing response and preserves the stamped-retry requirements for credential creation. |
| openapi/paths/auth/auth_credentials_{id}_challenge.yaml | Widens the successful challenge response contract to represent an in-flight OTP send. |
| openapi.yaml | Regenerated bundle consistently incorporates the new source schemas and endpoint responses. |
| mintlify/openapi.yaml | Regenerated documentation bundle remains aligned with the root OpenAPI bundle. |
Sequence Diagram
sequenceDiagram
participant Client
participant Grid
participant WalletProvider
Client->>Grid: POST credential operation
Grid->>WalletProvider: Submit activity
alt Activity settled
WalletProvider-->>Grid: Terminal result
Grid-->>Client: Success response
else Activity still in flight
WalletProvider-->>Grid: Processing
Grid-->>Client: 200 WalletOperationProcessing
Client->>Grid: Retry operation
Grid-->>Client: Terminal result when settled
end
Reviews (1): Last reviewed commit: "feat: add WalletOperationProcessing 200 ..." | Re-trigger Greptile
…d contact-update
Rounds out the 200/PROCESSING contract to the remaining Turnkey sync-SM
endpoints (SP-3579), matching the reshape stack's actual return sites:
- POST /auth/credentials/{id}/verify (VERIFY_OTP/OTP_LOGIN/OAUTH_LOGIN/
STAMP_LOGIN): 200 widened to a new AuthCredentialVerifyResponse
wrapper — anyOf: [AuthSession, WalletOperationProcessing].
- POST /auth/sessions/{id}/refresh (CREATE_READ_WRITE_SESSION): new 200
sibling to the existing 201, single $ref to WalletOperationProcessing
(no union needed — 201 is a distinct success code, same shape as the
add-credential endpoint from the prior commit).
- PATCH /customers/{customerId} (contact-update: email/phone + tied
OTP credentials): 200 widened to a new CustomerUpdateResponse wrapper
— anyOf: [CustomerOneOf, WalletOperationProcessing]. CustomerOneOf
keeps its own discriminator untouched; get/delete on this resource
still return CustomerOneOf directly, unaffected.
Same anyOf-over-oneOf reasoning as the challenge endpoint: none of
AuthSession or CustomerOneOf share a discriminator field with
WalletOperationProcessing's `status`, so a discriminated oneOf doesn't
fit and this repo's spectral rules require one on every oneOf.
Existing 202 responses on these endpoints are untouched — they signal
a different state (client must sign and resubmit a challenge), not
"still settling." No inconsistency found across the reshape stack's
five endpoint groups (this commit's three plus the prior commit's
add-credential and challenge): all uniformly answer still-in-flight
activity with 200/PROCESSING, never 202.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
DELETE /auth/credentials/{id} (revokeAuthCredential, DELETE_AUTHENTICATORS
/ DELETE_OAUTH_PROVIDERS) and DELETE /auth/sessions/{id} (revokeAuthSession,
DELETE_API_KEYS) are moving off the older SP-3611 async 202+operationId
shape onto the same sync-SM 200/PROCESSING contract as the other 5
reshape endpoints (Carson-approved unification; sparkcore side lands in
parallel).
Both get a new 200 sibling response, single $ref to
common/WalletOperationProcessing — no union needed, matching the
add-credential and session-refresh pattern (200 sits alongside a
separate terminal code, here 204, not competing with it).
The existing 202 (AuthSignedRequestChallenge, the sign-and-resubmit
challenge leg) is untouched — that's a different state in the flow and
stays as-is. The old still-processing 202+operationId shape was never
documented in this spec, so there's nothing to remove.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Grid's Embedded Wallet auth endpoints forward to a wallet provider that is only optimistically synchronous, so the signed-retry step can settle non-terminal instead of completing inline. Document this as the normal case to build for, not a rare edge — it surfaces most when integrators have the most traffic, since provider-side consensus delay under load is exactly when a "rare" response becomes routine. Extends the canonical "signed-retry pattern" section (authentication.mdx, linked from managing-sessions.mdx for session refresh/revoke) with: - the WalletOperationProcessing body shape and what it means - the full list of the 7 endpoints that can return it - how to handle it: re-send the identical original request (not a fresh one), show a pending UI state, and rely on Grid's own reconciliation as a backstop - a callout that verify/challenge/customer-update share their terminal status code (200) with the still-processing response, so those three need a body check where the other four (201/204 terminal) don't Also drops a one-line pointer at each of the 7 endpoints' existing worked examples (add-credential, revoke-credential, verify, challenge, email-change, session refresh, session revoke) so a reader following just one flow still finds it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Tying "still processing" to traffic spikes could read as advice to throttle integrator traffic to avoid triggering it. Keep the "this is the normal path, build for it" framing without linking it to load. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…icated endpoints
Removes the WalletOperationProcessing additions from PATCH /customers/{customerId}
(the new CustomerUpdateResponse schema, the 200-response description, and the three
supporting mentions in the auth guide) so this PR only covers the six auth-credential
and auth-session endpoints.
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: ../../components/schemas/common/WalletOperationProcessing.yaml |
There was a problem hiding this comment.
should we also send webhooks here so clients dont have to poll? im not sure which resource / id we would send the webhook on tho since theres no id here yet
There was a problem hiding this comment.
Good question. Worth splitting by endpoint: for the other 5 of the 6 touched here (challenge/verify, session revoke/refresh), a credential or session id already exists at the point PROCESSING is returned, so a resource-keyed webhook is possible later if we want one. This create-credential endpoint is the one case where there's genuinely no id yet — the credential doesn't exist until the activity settles, so any notification here would have to key off the client's Request-Id rather than a resource id.
Adding webhooks alongside polling for these auth operations is a bigger scope call than this PR (webhook coverage for this surface is being staged separately), so I don't want to fold it in here. Flagging for Carson to weigh in on whether/when to add it rather than deciding unilaterally.
There was a problem hiding this comment.
Decision (Carson): staging webhooks separately — we'll likely want them for these ops eventually (the webhook infra already exists), but not in this PR. Polling via the 200/PROCESSING re-send stays the contract here.
|
🦣 Congratulations @shreyav - your substantive review earned a Neosclerocalyptus! (common)
View your Frost-dex: https://zeus.dev.dev.sparkinfra.net/#/dinodex/shreyav?section=ice-age |
Summary
Grid's embedded-wallet auth endpoints forward to Turnkey, whose consensus- or approval-gated activities are only optimistically synchronous. This adds a documented
200/PROCESSINGresponse option so a still-in-flight activity doesn't have to surface as a 5xx:POST /auth/credentials(add credential): new200response, bodyWalletOperationProcessing(status: "PROCESSING"). Client re-sends the byte-identical stamped retry (sameRequest-Id) until the credential is added.POST /auth/credentials/{id}/challenge(re-issue challenge):200response widened from a bareAuthCredentialResponseOneOfto a newAuthCredentialChallengeResponsewrapper —anyOf: [AuthCredentialResponseOneOf, WalletOperationProcessing]— so a still-processing OTP send is now representable.WalletOperationProcessingis placed incomponents/schemas/common/(notauth/) because upcoming PRs reuse the identical shape on other Embedded Wallet endpoints (contact update, session refresh, OTP verify) as part of the Turnkey sync-state-machine work (SP-3579).anyOfrather thanoneOfonAuthCredentialChallengeResponse:WalletOperationProcessing'sstatusfield isn't a discriminator shared withAuthCredentialResponseOneOf'stypefield, so a discriminatedoneOfdoesn't fit — this repo's spectral rules require a discriminator on everyoneOfand flag inline (non-$ref) response schemas, both satisfied here.Test plan
make build— rebundledopenapi.yaml+mintlify/openapi.yamlfromopenapi/sources, committedmake lint— 0 errors (was 2:no-inline-response-schema,oneOf-must-have-discriminator, both fixed by wrapping in a named$refdanyOfschema instead of an inlineoneOf); remaining warnings/infos are pre-existing and unrelated to this changeThis is the first step of a grid-api-first rollout: after this merges, the webdev repo's vendored
grid-api/Python client gets regenerated (update_schema.sh) in a separate PR, bumpingpackageVersion, before any consumer code lands on top.🤖 Generated with Claude Code
PATCH /customers excised — contact updates move to dedicated contact-changes endpoints (design in progress).