refactor: migrate AuthCredentialAdditionalChallenge onto SignedRequestChallenge base#373
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✱ 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-python studio · code · diff
⏳ grid-typescript studio · code · diff
✅ grid-openapi studio · code · diff
⏳ These are partial results; builds are still running. This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile SummaryThis PR refactors Confidence Score: 5/5Safe to merge — pure schema refactor with identical wire shape and correct tooling update. All findings are P2 (documentation/example quality). No logic, wire shape, or discriminator regressions were found. The stainless.yml path update is correct. No files require special attention.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/auth/AuthCredentialAdditionalChallenge.yaml | Refactored from a flat object schema to allOf(SignedRequestChallenge, {type}), matching sibling schemas; wire shape is preserved but the payloadToSign example becomes a generic placeholder. |
| .stainless/stainless.yml | JSONPath target correctly updated from .properties to .allOf[1].properties to reach the type field now nested inside the allOf composition. |
| openapi.yaml | Generated file mirrors the YAML source change; discriminator, variant schemas, and AuthCredentialAdditionalChallengeOneOf are all unchanged and remain consistent. |
| mintlify/openapi.yaml | Mintlify copy of the spec updated identically to openapi.yaml; no issues found. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class SignedRequestChallenge {
+string payloadToSign
+string requestId
+string expiresAt
}
class AuthCredentialAdditionalChallenge {
+AuthMethodType type
}
class EmailOtpCredentialAdditionalChallenge {
+string type = "EMAIL_OTP"
+string email
}
class OauthCredentialAdditionalChallenge {
+string type = "OAUTH"
}
class PasskeyCredentialAdditionalChallenge {
+string type = "PASSKEY"
}
class AuthCredentialAdditionalChallengeOneOf {
<<oneOf discriminator: type>>
}
SignedRequestChallenge <|-- AuthCredentialAdditionalChallenge : allOf
AuthCredentialAdditionalChallenge <|-- EmailOtpCredentialAdditionalChallenge : allOf
AuthCredentialAdditionalChallenge <|-- OauthCredentialAdditionalChallenge : allOf
AuthCredentialAdditionalChallenge <|-- PasskeyCredentialAdditionalChallenge : allOf
AuthCredentialAdditionalChallengeOneOf --> EmailOtpCredentialAdditionalChallenge
AuthCredentialAdditionalChallengeOneOf --> OauthCredentialAdditionalChallenge
AuthCredentialAdditionalChallengeOneOf --> PasskeyCredentialAdditionalChallenge
Prompt To Fix All With AI
This is a comment left during a code review.
Path: openapi/components/schemas/auth/AuthCredentialAdditionalChallenge.yaml
Line: 1-9
Comment:
**`payloadToSign` example loses endpoint-specific fidelity**
The inherited `SignedRequestChallenge.payloadToSign` example (`Y2hhbGxlbmdlLXBheWxvYWQtdG8tc2lnbg`) is an opaque base64-like placeholder, whereas the old example was the literal JSON that callers must sign byte-for-byte:
```json
{"requestId":"7c4a8d09-…","type":"EMAIL_OTP","accountId":"InternalAccount:01HF3Z4QWERTY","expiresAt":"2026-04-08T15:35:00Z"}
```
Developers who need to implement signing for `POST /auth/credentials` now lose the concrete hint about the payload structure. The variant schemas (`EmailOtpCredentialAdditionalChallengeFields`, etc.) don't override the example either. Consider overriding `payloadToSign` in the `allOf[1]` object with a challenge-specific example, the same way the old schema did.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "refactor: migrate AuthCredentialAddition..." | Re-trigger Greptile
| title: Authentication Credential Additional Challenge | ||
| allOf: | ||
| - $ref: ../common/SignedRequestChallenge.yaml | ||
| - type: object | ||
| required: | ||
| - type | ||
| properties: | ||
| type: | ||
| $ref: ./AuthMethodType.yaml |
There was a problem hiding this comment.
payloadToSign example loses endpoint-specific fidelity
The inherited SignedRequestChallenge.payloadToSign example (Y2hhbGxlbmdlLXBheWxvYWQtdG8tc2lnbg) is an opaque base64-like placeholder, whereas the old example was the literal JSON that callers must sign byte-for-byte:
{"requestId":"7c4a8d09-…","type":"EMAIL_OTP","accountId":"InternalAccount:01HF3Z4QWERTY","expiresAt":"2026-04-08T15:35:00Z"}Developers who need to implement signing for POST /auth/credentials now lose the concrete hint about the payload structure. The variant schemas (EmailOtpCredentialAdditionalChallengeFields, etc.) don't override the example either. Consider overriding payloadToSign in the allOf[1] object with a challenge-specific example, the same way the old schema did.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/auth/AuthCredentialAdditionalChallenge.yaml
Line: 1-9
Comment:
**`payloadToSign` example loses endpoint-specific fidelity**
The inherited `SignedRequestChallenge.payloadToSign` example (`Y2hhbGxlbmdlLXBheWxvYWQtdG8tc2lnbg`) is an opaque base64-like placeholder, whereas the old example was the literal JSON that callers must sign byte-for-byte:
```json
{"requestId":"7c4a8d09-…","type":"EMAIL_OTP","accountId":"InternalAccount:01HF3Z4QWERTY","expiresAt":"2026-04-08T15:35:00Z"}
```
Developers who need to implement signing for `POST /auth/credentials` now lose the concrete hint about the payload structure. The variant schemas (`EmailOtpCredentialAdditionalChallengeFields`, etc.) don't override the example either. Consider overriding `payloadToSign` in the `allOf[1]` object with a challenge-specific example, the same way the old schema did.
How can I resolve this? If you propose a fix, please make it concise.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!
24ba40f to
9fe06f2
Compare
580af7e to
54aa238
Compare
54aa238 to
fc10ac7
Compare
9fe06f2 to
03b789b
Compare
03b789b to
a77502e
Compare
fc10ac7 to
12052ef
Compare
…tChallenge base
Retrofits the add-additional-credential 202 challenge (on `POST /auth/credentials`) to compose the shared `SignedRequestChallenge` base introduced earlier in this stack. Brings the add-credential flow onto the same footing as the delete-credential, delete-session, and export-wallet challenges.
**What changed**
- `AuthCredentialAdditionalChallenge.yaml` — rewritten from a flat `{ type, payloadToSign, requestId, expiresAt }` object to `allOf(../common/SignedRequestChallenge.yaml, { type: AuthMethodType })`.
- `.stainless/stainless.yml` — the existing "remove `type` from base schema properties" transform's target path for `AuthCredentialAdditionalChallenge` updated from `.properties` to `.allOf[1].properties`, since the inline `type` definition now lives in the second `allOf` element. Same behavior as before (the variant's single-value inline enum on `type` remains the sole definition), just the path reflects the new composition.
**What stays the same**
- Wire shape of 202 responses is unchanged — still `{ type, payloadToSign, requestId, expiresAt }` plus any per-variant fields.
- The discriminated `oneOf` wrapper `AuthCredentialAdditionalChallengeOneOf` and the three variant schemas (`EmailOtp…`, `Oauth…`, `Passkey…`) are untouched; they keep their `allOf(AuthCredentialAdditionalChallenge, …Fields)` structure and resolve to the same merged shape.
- `payloadToSign`, `requestId`, `expiresAt` descriptions shift to the slightly more generic phrasing already in `SignedRequestChallenge`, but the semantics are identical — the endpoint-specific context (that the retry goes to `POST /auth/credentials`) is already communicated by the endpoint description.
**Why now**
- Matches the pattern the other three signed-retry challenges in this stack already follow. Keeping the add-credential case on its own flat shape was a deferred-consolidation note that's no longer justified now that three sites share the base.
- Bundled `openapi.yaml` + `mintlify/openapi.yaml` regenerated via `make build`.
12052ef to
a5adbf9
Compare
a77502e to
089354f
Compare

Retrofits the add-additional-credential 202 challenge (on
POST /auth/credentials) to compose the sharedSignedRequestChallengebase introduced earlier in this stack. Brings the add-credential flow to match the other flows that use the http 202 signed ppayload challenge: delete-credential, delete-session, and export-wallet challenges.What changed
AuthCredentialAdditionalChallenge.yaml— rewritten from a flat{ type, payloadToSign, requestId, expiresAt }object toallOf(../common/SignedRequestChallenge.yaml, { type: AuthMethodType }).What stays the same
{ type, payloadToSign, requestId, expiresAt }plus any per-variant fields.oneOfwrapperAuthCredentialAdditionalChallengeOneOfand the three variant schemas (EmailOtp…,Oauth…,Passkey…) are untouchedpayloadToSign,requestId,expiresAtdescriptions shift to the slightly more generic phrasing already inSignedRequestChallenge, but the semantics are identical