-
Notifications
You must be signed in to change notification settings - Fork 39
Passkeys (experimental) #4234
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
base: main
Are you sure you want to change the base?
Passkeys (experimental) #4234
Changes from all commits
4ab6370
32b24e7
3bf4368
589ff86
cba3c52
a3cf2d6
518f203
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 |
---|---|---|
|
@@ -67,6 +67,7 @@ pub struct Authentication { | |
pub enum AuthenticationMethod { | ||
Password { user_password_id: Ulid }, | ||
UpstreamOAuth2 { upstream_oauth2_session_id: Ulid }, | ||
Passkey { user_passkey_id: Ulid }, | ||
Unknown, | ||
} | ||
|
||
|
@@ -215,3 +216,26 @@ pub struct UserRegistration { | |
pub created_at: DateTime<Utc>, | ||
pub completed_at: Option<DateTime<Utc>>, | ||
} | ||
|
||
#[derive(Debug, Clone, PartialEq, Eq, Serialize)] | ||
pub struct UserPasskey { | ||
pub id: Ulid, | ||
pub user_id: Ulid, | ||
pub credential_id: String, | ||
pub name: String, | ||
pub transports: serde_json::Value, | ||
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. I think I would rather have that the exact type, even if that means making mas-data-model depend on webauthn-rp? This way, potential errors comes at the repository level, and there is no need for post-processing those later |
||
pub static_state: Vec<u8>, | ||
pub dynamic_state: Vec<u8>, | ||
pub metadata: Vec<u8>, | ||
pub last_used_at: Option<DateTime<Utc>>, | ||
pub created_at: DateTime<Utc>, | ||
} | ||
|
||
#[derive(Debug, Clone, PartialEq, Eq, Serialize)] | ||
pub struct UserPasskeyChallenge { | ||
pub id: Ulid, | ||
pub user_session_id: Option<Ulid>, | ||
pub state: Vec<u8>, | ||
pub created_at: DateTime<Utc>, | ||
pub completed_at: Option<DateTime<Utc>>, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,7 @@ rand.workspace = true | |
rand_chacha.workspace = true | ||
headers.workspace = true | ||
ulid.workspace = true | ||
webauthn_rp = { version = "0.3.0", features = ["bin", "serde_relaxed", "custom", "serializable_server_state"] } | ||
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. Ideally can you put new dependencies at the workspace level? |
||
|
||
mas-axum-utils.workspace = true | ||
mas-config.workspace = true | ||
|
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.
This is supposed to be a 'buffersource', so raw bytes? Shouldn't that be a
Vec<u8>
/BYTEA
?Uh oh!
There was an error while loading. Please reload this page.
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.
Whichever works, the webauthn api provides both a base64 string and an ArrayBuffer (though both get sent as base64 thanks to toJSON). credential_id needs to be queried so a string format probably works better and that reminds me that it probably needs an index as well...