[grid-api] Deprecate encryptedSessionSigningKey + accept compressed clientPublicKey for client-held sessions (SP-3690) - #817
Conversation
Client-held-key sessions (now the norm for every credential type) never populate this field; it remains only for legacy OAUTH/PASSKEY sessions not yet migrated. Marks it deprecated:true, reframes descriptions across the auth credential/session endpoints and schemas around the client-held-key model, and drops the stale encryptedSessionSigningKey from the EMAIL_OTP refresh example (EMAIL_OTP sessions never return it). Mirrors webdev lightsparkdev/webdev#32460 so the next regen-from-source doesn't overwrite the deprecation.
|
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-cli studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-go studio · code · diff
✅ grid-python studio · code · diff
✅ grid-php studio · code · diff
✅ grid-openapi 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. |
Greptile SummaryThe PR deprecates
Confidence Score: 4/5This PR should not merge until the related authentication guides and signing helper are aligned with the newly canonical client-held-key flow. The OpenAPI reference now tells OAuth, passkey, and refresh clients to retain their generated private key, while repository integration instructions still require decrypting response key material that migrated sessions omit. Files Needing Attention: openapi/components/schemas/auth/AuthSession.yaml, openapi/paths/auth/auth_credentials_{id}verify.yaml, openapi/paths/auth/auth_sessions{id}_refresh.yaml
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/auth/AuthSession.yaml | Deprecates the optional encrypted key and establishes client-held keys as canonical, but now conflicts with existing integration guides. |
| openapi/paths/auth/auth_credentials_{id}_verify.yaml | Updates verification semantics consistently with AuthSession, while unchanged guides still instruct OAuth and passkey clients to decrypt response key material. |
| openapi/paths/auth/auth_sessions_{id}_refresh.yaml | Documents client-held refresh keys and removes the EMAIL_OTP example field, but the session-management guide still prescribes decrypting a returned key. |
| openapi.yaml | Generated bundle accurately reflects the modular source changes. |
| mintlify/openapi.yaml | Generated Mintlify bundle remains synchronized with the root bundle. |
Prompt To Fix All With AI
### Issue 1
openapi/components/schemas/auth/AuthSession.yaml:7-11
**Conflicting session-key instructions**
When an integrator follows the existing OAuth, passkey, or refresh guides, those guides require decrypting `encryptedSessionSigningKey`, while this changed contract says migrated sessions omit that field and use the private key generated before authentication, causing integrations to fail before they can make subsequent signed requests. Update the associated Mintlify guides and signing helper alongside this contract.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Deprecate AuthSession.encryptedSessionSi..." | Re-trigger Greptile
| client-held-key model the client generates and retains the session | ||
| signing key, so session-issuing responses carry no key material. The | ||
| deprecated `encryptedSessionSigningKey` is populated only for legacy | ||
| sessions not yet migrated to that model and is never returned by the | ||
| list endpoint. |
There was a problem hiding this comment.
Conflicting session-key instructions
When an integrator follows the existing OAuth, passkey, or refresh guides, those guides require decrypting encryptedSessionSigningKey, while this changed contract says migrated sessions omit that field and use the private key generated before authentication, causing integrations to fail before they can make subsequent signed requests. Update the associated Mintlify guides and signing helper alongside this contract.
Knowledge Base Used: Auth and SCA
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/auth/AuthSession.yaml
Line: 7-11
Comment:
**Conflicting session-key instructions**
When an integrator follows the existing OAuth, passkey, or refresh guides, those guides require decrypting `encryptedSessionSigningKey`, while this changed contract says migrated sessions omit that field and use the private key generated before authentication, causing integrations to fail before they can make subsequent signed requests. Update the associated Mintlify guides and signing helper alongside this contract.
**Knowledge Base Used:** [Auth and SCA](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/auth-and-sca.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Declining this one for this PR. The gap is real (the Mintlify narrative guides and the embedded-wallet-sign.js decrypt-bundle helper still describe OAuth/PASSKEY as always decrypting encryptedSessionSigningKey, with no mention of the client-held-key model), but #817 is intentionally scoped to the OpenAPI reference only — it's Part 1 of SP-3690, syncing wording 1:1 from webdev's grid-api spec change, with field removal deferred to a gated Part 2.
The integration-guide side of this is already in flight in a separate PR (#811, "docs(auth): document client-held session key as the primary Embedded Wallet flow"), which reframes client-keys.mdx around the client-held-key model as primary. We keep spec/reference changes and narrative-guide rewrites in separate PRs rather than bundling them, so we won't fold the guide/helper updates into this one — they'll land via #811 (guides) and a follow-up for the dev-tool script.
…ld-key flow (SP-3690) The clientPublicKey encoding now selects the flow: compressed SEC1 (02/03 prefix, 66 hex) opts into the client-held session key model documented for EMAIL_OTP/SMS_OTP, extended here to OAUTH and PASSKEY; uncompressed SEC1 (04 prefix, 130 hex) keeps the deprecated legacy HPKE-sealed flow. Relaxes the challenge/refresh clientPublicKey patterns to accept both, switches representative examples to the compressed form, and documents the new "Client-held session key" flow in the client-keys.mdx guide. Also teaches the offramp scripts' gen-keypair helper a --compressed flag for generating client-held session keys. Consolidates #811 into this PR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Syncs the canonical spec with webdev #32460 (SP-3690 Part 1 — deprecate; keep functional). Part 2 (field removal) is the gated future follow-on.
Consolidates #811 — the
clientPublicKeyencoding now actively selects the flow, rather than the deprecation being announced with no way for a client to opt in.What changed
Deprecate
encryptedSessionSigningKeyAuthSession.encryptedSessionSigningKeymarkeddeprecated: true, with description reframed around the client-held-key model.createAuthCredential,verifyAuthCredential,challengeAuthCredential,refreshAuthSessionpath descriptions, plusAuthCredentialChallengeRequest,AuthSessionRefreshRequest, andOauthCredentialVerifyRequestFieldsschemas.encryptedSessionSigningKeyfrom theEMAIL_OTPrefresh example (EMAIL_OTPsessions never populate this field).Accept compressed keys to select the client-held-key flow (non-breaking)
clientPublicKeyencoding is now the flow selector: compressed SEC1 (02/03prefix, 66 hex) opts into the client-held session key model already used byEMAIL_OTP/SMS_OTP, now extended toOAUTHandPASSKEY; uncompressed SEC1 (04prefix, 130 hex) keeps the deprecated legacy HPKE-sealed flow.AuthCredentialChallengeRequest.yamlandAuthSessionRefreshRequest.yamlclientPublicKeypattern relaxed from^04[0-9a-fA-F]{128}$to^(0[23][0-9a-fA-F]{64}|04[0-9a-fA-F]{128})$(challengeminLength130 → 66).OauthCredentialVerifyRequestFields.yamlhad no pattern and already accepted both.clientPublicKeyexamples switched to the compressed encoding.mintlify/snippets/global-accounts/client-keys.mdxdescribing the recommended flow, mirroring the existing OTP client-held statement.scripts/embedded-wallet-sign.js:gen-keypairtakes a--compressedflag to generate a client-held session key for the OAuth/PASSKEY path.Rebundled
openapi.yaml/mintlify/openapi.yamlviamake build.Test plan
make buildregenerates the bundle cleanly from the modularopenapi/sourcemake lint— 0 errors, same warning/info baseline asmainoasdiff breaking main openapi.yaml --fail-on ERR— 0 errors (2request-property-pattern-changedwarnings for the relaxed patterns; a relaxation is a superset, so not a breaking change)node scripts/embedded-wallet-sign.js gen-keypair --compressed— verified output is 66 hex chars with a02/03prefix matching the relaxed pattern; default (no flag) unchanged at 130 hex chars with04prefix