Skip to content

Commit d818ead

Browse files
committed
Database model changes
1 parent 71cdd92 commit d818ead

25 files changed

+1584
-15
lines changed

crates/data-model/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub use self::{
4949
user_agent::{DeviceType, UserAgent},
5050
users::{
5151
Authentication, AuthenticationMethod, BrowserSession, Password, User, UserEmail,
52-
UserEmailAuthentication, UserEmailAuthenticationCode, UserRecoverySession,
53-
UserRecoveryTicket, UserRegistration, UserRegistrationPassword,
52+
UserEmailAuthentication, UserEmailAuthenticationCode, UserPasskey, UserPasskeyChallenge,
53+
UserRecoverySession, UserRecoveryTicket, UserRegistration, UserRegistrationPassword,
5454
},
5555
};

crates/data-model/src/users.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ pub struct Authentication {
6969
pub enum AuthenticationMethod {
7070
Password { user_password_id: Ulid },
7171
UpstreamOAuth2 { upstream_oauth2_session_id: Ulid },
72+
Passkey { user_passkey_id: Ulid },
7273
Unknown,
7374
}
7475

@@ -217,3 +218,26 @@ pub struct UserRegistration {
217218
pub created_at: DateTime<Utc>,
218219
pub completed_at: Option<DateTime<Utc>>,
219220
}
221+
222+
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
223+
pub struct UserPasskey {
224+
pub id: Ulid,
225+
pub user_id: Ulid,
226+
pub credential_id: String,
227+
pub name: String,
228+
pub transports: serde_json::Value,
229+
pub static_state: Vec<u8>,
230+
pub dynamic_state: Vec<u8>,
231+
pub metadata: Vec<u8>,
232+
pub last_used_at: Option<DateTime<Utc>>,
233+
pub created_at: DateTime<Utc>,
234+
}
235+
236+
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
237+
pub struct UserPasskeyChallenge {
238+
pub id: Ulid,
239+
pub user_session_id: Option<Ulid>,
240+
pub state: Vec<u8>,
241+
pub created_at: DateTime<Utc>,
242+
pub completed_at: Option<DateTime<Utc>>,
243+
}

crates/storage-pg/.sqlx/query-182ff71d6007b3607761a48971e43b6bdf6a41896d787a13be3399022fe5e43d.json

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-74e377397d05062d15b8b7a674390af5ecca2f977b8d74311b4cad401e2650e5.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-74f98b0965300fbd37c29e7d4fa02ffb44631d77b14796db971064ef27abb739.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-7fc5dc880ff8318ff34bb19378961e4f55b19405def7e2e51051b6f564f5e4c5.json

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-8b4a9cb99c562407aa697908b1c7b0bc4a2f963aadca4264f5e6e250afde4965.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-931498961affc31cff251f051828c4ccc2f6dbd7ba57dbd75d770453ac5221c3.json

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-a23cc4e35678d4421b998dfdba94d5215d39ea6d1390056c9e3ab0981673c84e.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-ab4faaeb099656b160a7e4b0324ea5812e8941c53e6acc4ecc030dcd6d5ed8fe.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)