Skip to content

feat: add PASSKEY branch to auth credential verify#364

Draft
DhruvPareek wants to merge 1 commit into04-21-feat_add_passkey_branch_to_auth_credential_createfrom
04-21-feat_add_passkey_branch_to_auth_credential_verify
Draft

feat: add PASSKEY branch to auth credential verify#364
DhruvPareek wants to merge 1 commit into04-21-feat_add_passkey_branch_to_auth_credential_createfrom
04-21-feat_add_passkey_branch_to_auth_credential_verify

Conversation

@DhruvPareek
Copy link
Copy Markdown
Contributor

Adds the PASSKEY branch to AuthCredentialVerifyRequestOneOf, completing the create + verify flow for WebAuthn-passkey-backed authentication credentials on Embedded Wallet internal accounts.

Request shape

  • POST /auth/credentials/{id}/verify body: { type: "PASSKEY", assertion, clientPublicKey } → 200 AuthSession.
  • {id} is the AuthMethod.id returned from POST /auth/credentials.

Schemas added

  • PasskeyAssertion{ credentialId, clientDataJson, authenticatorData, signature, userHandle? }, all base64url-encoded strings. Shape mirrors the W3C AuthenticatorAssertionResponse plus the optional userHandle; pass-through to the downstream passkey provider.
  • PasskeyCredentialVerifyRequestFields{ type: "PASSKEY", assertion, clientPublicKey } (variant single-value enum on type).
  • PasskeyCredentialVerifyRequestallOf(AuthCredentialVerifyRequest, PasskeyCredentialVerifyRequestFields).

Wire-up

  • AuthCredentialVerifyRequestOneOf.yaml discriminator map extended with PASSKEY → PasskeyCredentialVerifyRequest.
  • PASSKEY example added on POST /auth/credentials/{id}/verify.
  • Endpoint description updated to cover the PASSKEY path: client runs navigator.credentials.get() against a platform-backend-issued challenge and submits the assertion; Grid verifies the WebAuthn signature against the stored credential.
  • 401 response description extended to cover passkey-specific failures (assertion signature / challenge / credential mismatch).
  • .stainless/stainless.yml registers the three new schemas and extends the "remove allOf $ref to AuthCredentialVerifyRequest" transform target list to include PasskeyCredentialVerifyRequest.allOf[0].

Design notes

  • The PDF verify-body shape on p.7 omits an explicit type field, but every other branch in AuthCredentialVerifyRequestOneOf carries one and the discriminator requires it. PASSKEY is modeled consistently with EMAIL_OTP and OAUTH — type: "PASSKEY" is required on the request body.
  • assertion is a structured object at the Grid API surface (not an opaque stamp string). WebAuthn signature verification reconstructs from the individual base64url-encoded fields, so structured + pass-through preserves byte integrity without forcing clients to JSON-encode the stamp themselves.
  • clientPublicKey format matches EMAIL_OTP/OAUTH verify: P-256 uncompressed SEC1 hex (130 chars, 0x04-prefixed).

Notes

  • Pairs with 04-21-feat_add_passkey_branch_to_auth_credential_create; together they make passkey credentials usable end-to-end. The additional-credential challenge flow gets its own PASSKEY branch in the next PR.
  • Bundled openapi.yaml and mintlify/openapi.yaml regenerated via make build.

Adds the PASSKEY branch to `AuthCredentialVerifyRequestOneOf`, completing the create + verify flow for WebAuthn-passkey-backed authentication credentials on Embedded Wallet internal accounts.

**Request shape**
- `POST /auth/credentials/{id}/verify` body: `{ type: "PASSKEY", assertion, clientPublicKey }` → 200 `AuthSession`.
- `{id}` is the `AuthMethod.id` returned from `POST /auth/credentials`.

**Schemas added**
- `PasskeyAssertion` — `{ credentialId, clientDataJson, authenticatorData, signature, userHandle? }`, all base64url-encoded strings. Shape mirrors the W3C `AuthenticatorAssertionResponse` plus the optional `userHandle`; pass-through to the downstream passkey provider.
- `PasskeyCredentialVerifyRequestFields` — `{ type: "PASSKEY", assertion, clientPublicKey }` (variant single-value enum on `type`).
- `PasskeyCredentialVerifyRequest` — `allOf(AuthCredentialVerifyRequest, PasskeyCredentialVerifyRequestFields)`.

**Wire-up**
- `AuthCredentialVerifyRequestOneOf.yaml` discriminator map extended with `PASSKEY → PasskeyCredentialVerifyRequest`.
- PASSKEY example added on `POST /auth/credentials/{id}/verify`.
- Endpoint description updated to cover the PASSKEY path: client runs `navigator.credentials.get()` against a platform-backend-issued challenge and submits the assertion; Grid verifies the WebAuthn signature against the stored credential.
- 401 response description extended to cover passkey-specific failures (assertion signature / challenge / credential mismatch).
- `.stainless/stainless.yml` registers the three new schemas and extends the "remove allOf $ref to AuthCredentialVerifyRequest" transform target list to include `PasskeyCredentialVerifyRequest.allOf[0]`.

**Design notes**
- The PDF verify-body shape on p.7 omits an explicit `type` field, but every other branch in `AuthCredentialVerifyRequestOneOf` carries one and the discriminator requires it. PASSKEY is modeled consistently with EMAIL_OTP and OAUTH — `type: "PASSKEY"` is required on the request body.
- `assertion` is a structured object at the Grid API surface (not an opaque stamp string). WebAuthn signature verification reconstructs from the individual base64url-encoded fields, so structured + pass-through preserves byte integrity without forcing clients to JSON-encode the stamp themselves.
- `clientPublicKey` format matches EMAIL_OTP/OAUTH verify: P-256 uncompressed SEC1 hex (130 chars, 0x04-prefixed).

**Notes**
- Pairs with `04-21-feat_add_passkey_branch_to_auth_credential_create`; together they make passkey credentials usable end-to-end. The additional-credential challenge flow gets its own PASSKEY branch in the next PR.
- Bundled `openapi.yaml` and `mintlify/openapi.yaml` regenerated via `make build`.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment Apr 22, 2026 4:43am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

✱ Stainless preview builds

This PR will update the grid SDKs with the following commit messages.

kotlin

feat(api): add passkey support to credentials verify method

openapi

feat(api): add passkey support to auth credential verification

python

feat(api): add passkey verification support to auth credentials

typescript

feat(api): add passkey verification support to auth.credentials.verify

Edit this comment to update them. They will appear in their respective SDK's changelogs.

grid-openapi studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅

grid-typescript studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/grid-typescript/09a9c0b741220049168b30986a8e41a41d2d5723/dist.tar.gz
grid-python studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅

pip install https://pkg.stainless.com/s/grid-python/fbb7060f4c1b89a44991069691d918ab652101f8/grid-0.0.1-py3-none-any.whl
grid-kotlin studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-04-22 04:48:44 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant