-
Notifications
You must be signed in to change notification settings - Fork 5
add Embedded Wallet Auth endpoints for Email OTP create + verify #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DhruvPareek
wants to merge
2
commits into
main
Choose a base branch
from
04-17-feat_add_embedded_wallet_auth_endpoints_for_email_otp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
openapi/components/schemas/auth/AuthCredentialAdditionalChallenge.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| type: object | ||
| required: | ||
| - type | ||
| - payloadToSign | ||
| - requestId | ||
| - expiresAt | ||
| properties: | ||
| type: | ||
| $ref: ./AuthMethodType.yaml | ||
| payloadToSign: | ||
| type: string | ||
| description: >- | ||
| Payload that must be signed with the session private key of an existing | ||
| verified authentication credential on the internal account. The resulting | ||
| signature is passed as the `Grid-Wallet-Signature` header on the retry of | ||
| `POST /auth/credentials` to complete registration of the additional | ||
| credential. | ||
| example: Y2hhbGxlbmdlLXBheWxvYWQtdG8tc2lnbg== | ||
| requestId: | ||
| type: string | ||
| description: >- | ||
| Unique identifier for this additional-credential registration request. | ||
| Must be echoed in the `Request-Id` header on the signed retry of | ||
| `POST /auth/credentials` so the server can correlate the retry with the | ||
| issued challenge. | ||
| example: 7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21 | ||
| expiresAt: | ||
| type: string | ||
| format: date-time | ||
| description: >- | ||
| Timestamp after which this challenge is no longer valid. The signed retry | ||
| must be submitted before this time. | ||
| example: '2026-04-08T15:35:00Z' |
6 changes: 6 additions & 0 deletions
6
openapi/components/schemas/auth/AuthCredentialAdditionalChallengeOneOf.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| oneOf: | ||
| - $ref: ./EmailOtpCredentialAdditionalChallenge.yaml | ||
| discriminator: | ||
| propertyName: type | ||
| mapping: | ||
| EMAIL_OTP: ./EmailOtpCredentialAdditionalChallenge.yaml |
12 changes: 12 additions & 0 deletions
12
openapi/components/schemas/auth/AuthCredentialCreateRequest.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| type: object | ||
| required: | ||
| - type | ||
| - accountId | ||
| properties: | ||
| type: | ||
| $ref: ./AuthMethodType.yaml | ||
| accountId: | ||
| type: string | ||
| description: >- | ||
| Identifier of the internal account that this credential will authenticate. | ||
| example: InternalAccount:019542f5-b3e7-1d02-0000-000000000002 |
6 changes: 6 additions & 0 deletions
6
openapi/components/schemas/auth/AuthCredentialCreateRequestOneOf.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| oneOf: | ||
| - $ref: ./EmailOtpCredentialCreateRequest.yaml | ||
| discriminator: | ||
| propertyName: type | ||
| mapping: | ||
| EMAIL_OTP: ./EmailOtpCredentialCreateRequest.yaml |
6 changes: 6 additions & 0 deletions
6
openapi/components/schemas/auth/AuthCredentialVerifyRequest.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| type: object | ||
| required: | ||
| - type | ||
| properties: | ||
| type: | ||
| $ref: ./AuthMethodType.yaml |
6 changes: 6 additions & 0 deletions
6
openapi/components/schemas/auth/AuthCredentialVerifyRequestOneOf.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| oneOf: | ||
| - $ref: ./EmailOtpCredentialVerifyRequest.yaml | ||
| discriminator: | ||
| propertyName: type | ||
| mapping: | ||
| EMAIL_OTP: ./EmailOtpCredentialVerifyRequest.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| type: object | ||
| required: | ||
| - id | ||
| - accountId | ||
| - type | ||
| - nickname | ||
| - createdAt | ||
| - updatedAt | ||
| properties: | ||
| id: | ||
| type: string | ||
| description: System-generated unique identifier for the authentication credential. | ||
| example: AuthMethod:019542f5-b3e7-1d02-0000-000000000001 | ||
| accountId: | ||
| type: string | ||
| description: Identifier of the internal account that this credential authenticates. | ||
| example: InternalAccount:019542f5-b3e7-1d02-0000-000000000002 | ||
| type: | ||
| $ref: ./AuthMethodType.yaml | ||
| nickname: | ||
| type: string | ||
| description: >- | ||
| Human-readable identifier for this credential. For EMAIL_OTP credentials | ||
| this is the email address; for OAUTH credentials it is typically the email | ||
| claim from the OIDC token; for PASSKEY credentials it is the nickname | ||
| provided at registration time. | ||
| example: example@lightspark.com | ||
| createdAt: | ||
| type: string | ||
| format: date-time | ||
| description: Creation timestamp. | ||
| example: '2026-04-08T15:30:01Z' | ||
| updatedAt: | ||
| type: string | ||
| format: date-time | ||
| description: Last update timestamp. | ||
| example: '2026-04-08T15:35:00Z' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| type: string | ||
| enum: | ||
| - OAUTH | ||
| - EMAIL_OTP | ||
| - PASSKEY | ||
| description: >- | ||
| The type of authentication credential. | ||
|
|
||
| - `OAUTH`: OpenID Connect (OIDC) token issued by an identity provider such as | ||
| Google or Apple. | ||
|
|
||
| - `EMAIL_OTP`: A one-time password delivered to the user's email address. | ||
|
|
||
| - `PASSKEY`: A WebAuthn passkey bound to the user's device. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| allOf: | ||
| - $ref: ./AuthMethod.yaml | ||
| - type: object | ||
| required: | ||
| - encryptedSessionSigningKey | ||
| - expiresAt | ||
| properties: | ||
| encryptedSessionSigningKey: | ||
| type: string | ||
| description: >- | ||
| HPKE-encrypted session signing key, sealed to the `clientPublicKey` | ||
| supplied when the credential was created. Encoded as a base58check | ||
| string: the decoded payload is a 33-byte compressed P-256 encapsulated | ||
| public key followed by AES-256-GCM ciphertext. The client decrypts | ||
| this key with its private key and uses it to sign subsequent Embedded | ||
| Wallet requests until `expiresAt`. | ||
| example: w99a5xV6A75TfoAUkZn869fVyDYvgVsKrawMALZXmrauZd8hEv66EkPU1Z42CUaHESQjcA5bqd8dynTGBMLWB9ewtXWPEVbZvocB4Tw2K1vQVp7uwjf | ||
| expiresAt: | ||
| type: string | ||
| format: date-time | ||
| description: Timestamp after which the session signing key is no longer valid. | ||
| example: '2026-04-08T15:35:00Z' |
4 changes: 4 additions & 0 deletions
4
openapi/components/schemas/auth/EmailOtpCredentialAdditionalChallenge.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| title: Email OTP Credential Additional Challenge | ||
| allOf: | ||
| - $ref: ./AuthCredentialAdditionalChallenge.yaml | ||
| - $ref: ./EmailOtpCredentialAdditionalChallengeFields.yaml |
20 changes: 20 additions & 0 deletions
20
openapi/components/schemas/auth/EmailOtpCredentialAdditionalChallengeFields.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| type: object | ||
| required: | ||
| - type | ||
| properties: | ||
| type: | ||
| type: string | ||
| enum: | ||
| - EMAIL_OTP | ||
| description: >- | ||
| Discriminator value identifying this as an additional-credential | ||
| challenge for an email OTP credential. | ||
| email: | ||
| type: string | ||
| format: email | ||
| description: >- | ||
| Email address associated with the internal account's customer record, | ||
| returned here so the client knows which mailbox will receive the OTP on | ||
| the signed retry. | ||
| example: example@lightspark.com | ||
|
DhruvPareek marked this conversation as resolved.
|
||
4 changes: 4 additions & 0 deletions
4
openapi/components/schemas/auth/EmailOtpCredentialCreateRequest.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| title: Email OTP Credential Create Request | ||
| allOf: | ||
| - $ref: ./AuthCredentialCreateRequest.yaml | ||
| - $ref: ./EmailOtpCredentialCreateRequestFields.yaml |
9 changes: 9 additions & 0 deletions
9
openapi/components/schemas/auth/EmailOtpCredentialCreateRequestFields.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| type: object | ||
|
pengying marked this conversation as resolved.
|
||
| required: | ||
| - type | ||
| properties: | ||
| type: | ||
| type: string | ||
| enum: | ||
| - EMAIL_OTP | ||
| description: Discriminator value identifying this as an email OTP credential. | ||
4 changes: 4 additions & 0 deletions
4
openapi/components/schemas/auth/EmailOtpCredentialVerifyRequest.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| title: Email OTP Credential Verify Request | ||
| allOf: | ||
| - $ref: ./AuthCredentialVerifyRequest.yaml | ||
| - $ref: ./EmailOtpCredentialVerifyRequestFields.yaml |
25 changes: 25 additions & 0 deletions
25
openapi/components/schemas/auth/EmailOtpCredentialVerifyRequestFields.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| type: object | ||
| required: | ||
| - type | ||
| - otp | ||
| - clientPublicKey | ||
| properties: | ||
| type: | ||
| type: string | ||
| enum: | ||
| - EMAIL_OTP | ||
| description: Discriminator value identifying this as an email OTP verification. | ||
| otp: | ||
| type: string | ||
| description: The one-time password received by the user via email. | ||
| example: '123456' | ||
| clientPublicKey: | ||
| type: string | ||
| description: >- | ||
| Client-generated P-256 public key, hex-encoded in uncompressed SEC1 | ||
| format (0x04 prefix followed by the 32-byte X and 32-byte Y | ||
| coordinates; 130 hex characters total). The matching private key | ||
| must remain on the client. Grid encrypts the session signing key | ||
| returned in the response to this public key. The key is ephemeral | ||
| and one-time-use per verification request. | ||
| example: 04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is updated at always returned? I think I remember seeing somewhere that it may not be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I double checked, its always returned