[grid] clarify email OTP registration bundle docs#562
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript ✅ grid-ruby studio · code
|
Greptile SummaryThis PR clarifies the EMAIL_OTP registration documentation to accurately reflect that
Confidence Score: 4/5Documentation-only change; safe to merge after resolving the inconsistency between the API spec and the MDX walkthrough on whether the bundle is guaranteed in the signed-retry path. The API spec (auth_credentials.yaml) unconditionally states the signed-retry response carries otpEncryptionTargetBundle, while the MDX add-credential walkthrough says when present, or call /challenge if absent — a developer following one source will write different client logic than one following the other. mintlify/snippets/global-accounts/authentication.mdx — the add-credential activation step needs its when present wording reconciled with the unconditional language in openapi/paths/auth/auth_credentials.yaml.
|
| Filename | Overview |
|---|---|
| openapi/paths/auth/auth_credentials.yaml | 201 description updated to distinguish signed-retry (bundle always present) from first-time bootstrap (bundle may be absent); source change will survive make build. |
| openapi/paths/auth/auth_credentials_{id}_verify.yaml | EMAIL_OTP verify description updated to say from registration when present, or from /challenge when registration omitted it; language is consistent with the other source files. |
| openapi/components/schemas/auth/AuthMethodResponse.yaml | Schema description and otpEncryptionTargetBundle property description updated to reflect conditional bundle presence; wording is clear and internally consistent. |
| openapi/components/schemas/auth/EmailOtpCredentialVerifyRequestFields.yaml | Verify-request description updated to state from registration when present, or from /challenge when omitted; consistent with peer schema files. |
| mintlify/snippets/global-accounts/authentication.mdx | Add-credential step updated with defensive when present / if absent wording that conflicts with auth_credentials.yaml which unconditionally states the bundle is present in the signed-retry flow. |
| mintlify/snippets/global-accounts/client-keys.mdx | Bundle-source explanation and inline comment updated to reflect first-time bootstrap may omit the bundle; clear and actionable guidance added. |
| openapi.yaml | Generated file updated identically to the source files; changes will be preserved as long as make build is run from the updated source. |
| mintlify/openapi.yaml | Generated Mintlify copy updated to mirror the main openapi.yaml changes; matches source changes exactly. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[POST /auth/credentials] --> B{Which flow?}
B -->|First-time EMAIL_OTP bootstrap| C[201 AuthMethod response]
B -->|Add EMAIL_OTP via signed-retry| D[201 AuthMethod + otpEncryptionTargetBundle]
C --> E{otpEncryptionTargetBundle present?}
E -->|Yes| F[HPKE-encrypt OTP with bundle]
E -->|No| G[POST /auth/credentials/id/challenge]
G --> H[Receive otpEncryptionTargetBundle]
H --> F
D --> F
F --> I[POST /auth/credentials/id/verify with encryptedOtpBundle]
I --> J[202 payloadToSign + verificationToken]
J --> K[Sign verificationToken with TEK private key]
K --> L[Retry POST /auth/credentials/id/verify with Grid-Wallet-Signature]
L --> M[200 AuthSession issued]
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
mintlify/snippets/global-accounts/authentication.mdx:718
**Inconsistency between add-credential docs and the API spec description**
The updated step says `EMAIL_OTP` uses the `otpEncryptionTargetBundle` "from the signed-retry registration response **when present**, or first calls `POST /auth/credentials/{id}/challenge` if the bundle is absent." However, `openapi/paths/auth/auth_credentials.yaml` (also updated in this PR) says the signed-retry response unconditionally "also carries `otpEncryptionTargetBundle`" — making the bundle always present in that flow. A developer reading the MDX add-credential walkthrough would conclude the bundle is optional in the signed-retry case and defensively add a challenge call, while the API spec implies it is always delivered. If the backend truly can omit the bundle even on the signed-retry path, the spec language should be softened to "may carry"; if it is always present there, the MDX should say "use the bundle from the signed-retry response" without the "when present / if absent" hedge.
Reviews (3): Last reviewed commit: "[grid] clarify email OTP registration bu..." | Re-trigger Greptile
ce529cd to
2509d31
Compare
f771c40 to
4863409
Compare
2509d31 to
c585b8e
Compare
|
Valid comment about the edit to the merged openapi file instead of the source files |
pengying
left a comment
There was a problem hiding this comment.
update the source openapi files vs the merged one
c585b8e to
f7e3508
Compare
pengying
left a comment
There was a problem hiding this comment.
probably need to regenerate the openapi after the schema changes
|
already regenerated w 'make build' and it profuced no diff |
|
so openapi.yaml and mintlify/openapi.yaml are up to date |
Merge activity
|
## Summary - Fixed `buildEurBeneficiary` in Kotlin sample to match the `EurBeneficiary` OpenAPI schema - The schema requires `countryOfResidence` (not `address`) as a required field - Made `address` optional since it's not required in the schema ## Context This fix was identified during the documentation sync review of recent schema changes: - `ca99dc5` - chore: Sync account schemas (#568) - `20eb971` - [grid] clarify email OTP registration bundle docs (#562) The `EurBeneficiary.yaml` schema has: ```yaml required: - beneficiaryType - countryOfResidence - fullName ``` But the Kotlin sample was: 1. Requiring `address` (which is optional in the schema) 2. Not setting `countryOfResidence` (which is required) ## Test plan - [x] Run `make lint` - passes - [ ] Verify Kotlin sample compiles with Grid SDK 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Clarifies the Global Accounts EMAIL_OTP docs source to match backend behavior. Registration may include otpEncryptionTargetBundle when adding EMAIL_OTP back through the signed-retry flow, but first-time EMAIL_OTP wallet bootstrap can omit it. Clients should call POST /auth/credentials/{id}/challenge when the bundle is absent before building encryptedOtpBundle.