add Embedded Wallet OAUTH credential verify#361
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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 buildsThis PR will update the kotlin openapi python typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-openapi studio · code · diff
✅ grid-python studio · code · diff
✅ grid-typescript studio · code · diff
✅ grid-kotlin studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
ca6461a to
ed7f4ba
Compare
e4e2996 to
79c6d70
Compare
Greptile SummaryThis PR adds the Confidence Score: 5/5Safe to merge — schema additions are additive, well-structured, and consistent with existing patterns. All changes are OpenAPI schema additions with no breaking modifications. The new schemas follow the exact same allOf + discriminator pattern as the EmailOtp variant, the stainless SDK config is updated correctly, and generated bundles match the source. No logic, security, or correctness issues found. No files require special attention.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/auth/OauthCredentialVerifyRequestFields.yaml | New schema defining the OAUTH verify request body fields (type, oidcToken, clientPublicKey) — mirrors EmailOtpCredentialVerifyRequestFields pattern exactly. |
| openapi/components/schemas/auth/OauthCredentialVerifyRequest.yaml | New allOf composition of AuthCredentialVerifyRequest and OauthCredentialVerifyRequestFields — consistent with EmailOtpCredentialVerifyRequest pattern. |
| openapi/components/schemas/auth/AuthCredentialVerifyRequestOneOf.yaml | Discriminator map extended with OAUTH → OauthCredentialVerifyRequest; both oneOf and mapping updated correctly. |
| openapi/paths/auth/auth_credentials_{id}_verify.yaml | Path description updated to cover OAUTH flow, OAuth example request added, and 401 description expanded to include OIDC failure conditions. |
| .stainless/stainless.yml | Added OauthCredentialVerifyRequest and OauthCredentialVerifyRequestFields to SDK resource mapping and transform targets — mirrors EmailOtp entries correctly. |
| openapi.yaml | Generated bundle updated via make build — consistent with source changes in openapi/. |
| mintlify/openapi.yaml | Generated Mintlify bundle updated via make build — identical changes to openapi.yaml, consistent with source. |
Sequence Diagram
sequenceDiagram
participant Client
participant Grid API
participant IdP as Identity Provider
Note over Client,IdP: Create phase (prior PR)
Client->>IdP: Authenticate → obtain OIDC token
Client->>Grid API: POST /auth/credentials {type: OAUTH, oidcToken}
Grid API-->>Client: 201 AuthMethod {id}
Note over Client,Grid API: Verify phase (this PR)
Client->>Client: Generate ephemeral P-256 key pair
Client->>IdP: Obtain fresh OIDC token (iat < 60s ago)
Client->>Grid API: POST /auth/credentials/{id}/verify {type: OAUTH, oidcToken, clientPublicKey}
Grid API->>IdP: Fetch signing key via iss/.well-known/openid-configuration
IdP-->>Grid API: JWKS
Grid API->>Grid API: Verify token signature, issuer, iat freshness
alt Valid token
Grid API-->>Client: 200 AuthSession {encryptedSessionSigningKey, expiresAt}
Note over Client: Decrypt session key with ephemeral private key
else Invalid/expired token
Grid API-->>Client: 401 Unauthorized
end
Reviews (1): Last reviewed commit: "feat: add OAUTH branch to auth credentia..." | Re-trigger Greptile
79c6d70 to
a72bd51
Compare
1555e46 to
6269e92
Compare
Adds the OAUTH branch to `AuthCredentialVerifyRequestOneOf`, completing the create + verify flow for OIDC-backed authentication credentials on Embedded Wallet internal accounts.
**Request shape**
- `POST /auth/credentials/{id}/verify` body: `{ type: "OAUTH", oidcToken, clientPublicKey }` → 200 `AuthSession`.
- `{id}` is the `AuthMethod.id` returned from `POST /auth/credentials`.
**Schemas added**
- `OauthCredentialVerifyRequestFields` — `{ type: "OAUTH", oidcToken, clientPublicKey }` (variant single-value enum on `type`).
- `OauthCredentialVerifyRequest` — `allOf(AuthCredentialVerifyRequest, OauthCredentialVerifyRequestFields)`.
**Wire-up**
- `AuthCredentialVerifyRequestOneOf.yaml` discriminator map extended with `OAUTH → OauthCredentialVerifyRequest`.
- OAuth example added on `POST /auth/credentials/{id}/verify`.
- Endpoint description updated to cover the OAuth verify path, including its double-duty as the reauth path after a prior session expired.
- 401 response description extended to cover OIDC validation failures (signature / issuer / `iat` freshness).
- `.stainless/stainless.yml` registers the two new schemas and extends the "remove allOf $ref to AuthCredentialVerifyRequest" transform target list to include `OauthCredentialVerifyRequest.allOf[0]`.
**OIDC constraints (documented on the `oidcToken` field)**
- Fresh token required on every verify: `iat` must be less than 60 seconds before the request timestamp.
- Grid re-validates the signature against the issuer's `.well-known` configuration on each verify.
**Notes**
- Pairs with `04-21-feat_add_oauth_branch_to_auth_credential_create` (the prior PR in the stack); together they make OAuth credentials usable end-to-end. The additional-credential challenge flow gets its own OAUTH branch in the next PR in the stack.
- Bundled `openapi.yaml` and `mintlify/openapi.yaml` regenerated via `make build`.
a72bd51 to
d5f7e4e
Compare

Adds the OAUTH branch to
AuthCredentialVerifyRequestOneOf, completing the create + verify flow for OIDC-backed authentication credentials on Embedded Wallet internal accounts.Request shape
POST /auth/credentials/{id}/verifybody:{ type: "OAUTH", oidcToken, clientPublicKey }→ 200AuthSession.{id}is theAuthMethod.idreturned fromPOST /auth/credentials.Schemas added
OauthCredentialVerifyRequestFields—{ type: "OAUTH", oidcToken, clientPublicKey }(variant single-value enum ontype).OauthCredentialVerifyRequest—allOf(AuthCredentialVerifyRequest, OauthCredentialVerifyRequestFields).AuthCredentialVerifyRequestOneOf.yamldiscriminator map extended withOAUTH → OauthCredentialVerifyRequest.Notes
04-21-feat_add_oauth_branch_to_auth_credential_create(the prior PR in the stack); together they make OAuth credentials usable end-to-end. The additional-credential challenge flow gets its own OAUTH branch in the next PR in the stack.openapi.yamlandmintlify/openapi.yamlregenerated viamake build.