Add card tokenization 2FA platform config - #718
Conversation
|
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 ✅ grid-ruby studio · code
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
24040da to
6e7992f
Compare
6e7992f to
1c1c976
Compare
Greptile SummaryThis PR adds platform-level configuration for card-tokenization authentication messages. The main changes are:
Confidence Score: 4/5The HTTPS validation gap needs to be fixed before merging.
openapi/components/schemas/config/CardTokenization2FAConfig.yaml and openapi/components/schemas/config/CardTokenization2FASmsConfig.yaml
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/config/CardTokenization2FAConfig.yaml | Adds the aggregate configuration, but does not enforce the documented HTTPS-only logo URL. |
| openapi/components/schemas/config/CardTokenization2FAEmailConfig.yaml | Adds optional email sender and branding fields with basic format and length constraints. |
| openapi/components/schemas/config/CardTokenization2FASmsConfig.yaml | Adds SMS template settings, but describes fallback behavior that conflicts with the stated delivery contract. |
| openapi/components/schemas/config/PlatformConfig.yaml | Adds the optional card-tokenization configuration to platform responses. |
| openapi/components/schemas/config/PlatformConfigUpdateRequest.yaml | Adds the optional configuration to the existing partial-update request. |
| openapi/paths/platform/config.yaml | Extends the PATCH example with the new configuration. |
| openapi.yaml | Updates the generated root bundle with the new schemas and example. |
| mintlify/openapi.yaml | Keeps the Mintlify bundle aligned with the generated root specification. |
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
openapi/components/schemas/config/CardTokenization2FAConfig.yaml:12-16
**HTTPS Restriction Is Not Enforced**
The description requires an HTTPS logo, but `format: uri` also accepts values such as `http://example.com/logo.png`. The PATCH schema therefore permits configuration outside its stated contract, which can produce insecure or broken logo rendering in later authentication emails.
```suggestion
logoUrl:
type: string
format: uri
pattern: '^https://'
maxLength: 512
description: HTTPS URL of the logo displayed in email messages.
```
Reviews (1): Last reviewed commit: "Add card tokenization 2FA platform confi..." | Re-trigger Greptile
1c1c976 to
b7fe273
Compare
|

Reason
Grid will deliver card-network tokenization authentication codes through Twilio and Amazon SES. Platforms need per-platform branding and sender configuration that is independent of embedded-wallet eligibility.
Overview
This PR does not add an endpoint. It extends only the existing platform configuration endpoints:
GET /platform/configPATCH /platform/configBoth endpoints now include an optional
cardTokenization2faConfig. The configuration follows the direct storage model used for Turnkey OTP customization: a successful PATCH is the configuration returned by GET and used by subsequent delivery attempts. There is no approvalstatus, rejection reason, or requested/effective split.Platforms may set a custom SES
fromAddressand a per-platform Twilio VerifytemplateSid. V1 intentionally does not preflight provider readiness: an unverified SES identity or unavailable Twilio template may cause delivery to fail and retry. The schema enforces thatlogoUrlstarts withhttps://.Example PATCH body:
{ "cardTokenization2faConfig": { "displayName": "Acme", "logoUrl": "https://acme.com/card-email-logo.png", "email": { "fromAddress": "cards@acme.com", "fromName": "Acme Cards", "replyToAddress": "support@acme.com", "subject": "Your Acme card verification code", "bodyText": "Use this code to finish adding your Acme card." }, "sms": { "templateSid": "HJ00000000000000000000000000000000", "bodyText": "Use this code to finish adding your Acme card." } } }The relevant portion of the GET and PATCH response has the same shape:
{ "cardTokenization2faConfig": { "displayName": "Acme", "logoUrl": "https://acme.com/card-email-logo.png", "email": { "fromAddress": "cards@acme.com", "fromName": "Acme Cards", "replyToAddress": "support@acme.com", "subject": "Your Acme card verification code", "bodyText": "Use this code to finish adding your Acme card." }, "sms": { "templateSid": "HJ00000000000000000000000000000000", "bodyText": "Use this code to finish adding your Acme card." } } }The JSON property uses
2fato follow the API lower-camel-case convention; component schema names retain the conventional2FAacronym. Shared Twilio/SES service credentials and default fallbacks remain internal.This is the source OpenAPI change. Generated webdev artifacts and the sparkcore implementation are separate PRs in the implementation stack.
Test Plan
make buildmake lint