Repository navigation
feat: passkey id verification #183
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
Changes from all commits
53f2c59
afc64af
0c79e82
ce43245
8e14472
4cd0895
89014a0
58de6e8
4a5fe89
4779ba2
6068115
15e9640
c757b4d
79af3b9
c6654c4
d5cd0d2
7989937
273d3be
ab392ac
1fc4e8d
f13cfc1
475ecf0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| "passkey", "email", "phone", "totp", "push-notification", "recovery-code", "password" | ||
| ] | ||
| PreferredAuthMethod = Literal["sms", "voice"] | ||
| PasskeyDeliveryMethod = Literal["text", "voice"] | ||
|
|
||
| # Deprecated public aliases resolved lazily (PEP 562) so access emits a warning | ||
| # while imports keep working. Remove in a future release. | ||
|
|
@@ -734,29 +735,39 @@ class PasskeyLoginResult(BaseModel): | |
|
|
||
|
|
||
| class PasskeyRpInfo(BaseModel): | ||
| """Relying party identity for a WebAuthn ceremony.""" | ||
|
|
||
| id: str | ||
| name: str | ||
|
|
||
|
|
||
| class PasskeyUserInfo(BaseModel): | ||
| """User identity for a WebAuthn registration.""" | ||
|
|
||
| model_config = ConfigDict(populate_by_name=True) | ||
| id: str | ||
| name: str | ||
| display_name: Optional[str] = Field(None, alias="displayName") | ||
|
|
||
|
|
||
| class PasskeyPubKeyCredParam(BaseModel): | ||
| """Public key type and algorithm the relying party accepts.""" | ||
|
|
||
| type: str | ||
| alg: int | ||
|
|
||
|
|
||
| class PasskeyAuthenticatorSelection(BaseModel): | ||
| """Authenticator requirements for a WebAuthn registration.""" | ||
|
|
||
| model_config = ConfigDict(populate_by_name=True) | ||
| resident_key: Optional[str] = Field(None, alias="residentKey") | ||
| user_verification: Optional[str] = Field(None, alias="userVerification") | ||
|
|
||
|
|
||
| class PasskeyPublicKeyOptions(BaseModel): | ||
| """WebAuthn public key options to pass to the browser credentials API.""" | ||
|
|
||
| model_config = ConfigDict(populate_by_name=True, extra="allow") | ||
| challenge: str | ||
| rp: Optional[PasskeyRpInfo] = None | ||
|
|
@@ -789,6 +800,8 @@ class EnrollmentChallengeResponse(BaseModel): | |
|
|
||
|
|
||
| class PasskeyAuthResponse(BaseModel): | ||
| """WebAuthn credential returned by the browser, passed to signin_with_passkey.""" | ||
|
|
||
| model_config = ConfigDict(populate_by_name=True) | ||
| id: str | ||
| raw_id: str = Field(alias="rawId") | ||
|
|
@@ -851,6 +864,8 @@ class GetFactorsResponse(BaseModel): | |
|
|
||
|
|
||
| class PasskeyUserProfile(BaseModel): | ||
| """User profile attributes sent with a passkey signup challenge.""" | ||
|
|
||
| model_config = ConfigDict(extra="allow") | ||
| email: Optional[str] = None | ||
| name: Optional[str] = None | ||
|
|
@@ -863,20 +878,25 @@ class PasskeyUserProfile(BaseModel): | |
|
|
||
|
|
||
| class _PasskeyChallengeResponseBase(BaseModel): | ||
| auth_session: str | ||
| model_config = ConfigDict(hide_input_in_errors=True) | ||
| auth_session: str = Field(repr=False) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Adding
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added on |
||
| authn_params_public_key: PasskeyPublicKeyOptions | ||
|
|
||
|
|
||
| class PasskeySignupChallengeResponse(_PasskeyChallengeResponseBase): | ||
| pass | ||
| """Signup challenge, with verification_required set when the user must enter codes first. auth_session is hidden from repr and str.""" | ||
|
|
||
| verification_required: Optional[list[str]] = None | ||
|
|
||
|
|
||
| class PasskeyLoginChallengeResponse(_PasskeyChallengeResponseBase): | ||
| pass | ||
| """Login challenge with the auth_session and WebAuthn options for the browser. auth_session is hidden from repr and str.""" | ||
|
|
||
|
|
||
| class PasskeyTokenResponse(BaseModel): | ||
| model_config = ConfigDict(extra="allow") | ||
| """Token endpoint response for the passkey grant.""" | ||
|
|
||
| model_config = ConfigDict(extra="allow", hide_input_in_errors=True) | ||
| access_token: str | ||
| token_type: str = "Bearer" | ||
| expires_in: int | ||
|
|
||
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.
should we mark it as EA
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.
Will hold off marking EA until we have a confirmation.