diff --git a/CHANGELOG.md b/CHANGELOG.md index a5c6779..0a4eb93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # ChangeLog +## 3rd June 2024 + +### ft-sdk: `0.1.6` + +- added `#[serde(default)]` to `ft_sdk::auth::ProviderData` +- added `#[derive(Default)` to `ft_sdk::auth::ProviderData` +- added `#[derive(Debug)` to `ft_sdk::auth::{UserId, SessionID, Counter}` + ## 31st May 2024 ### ft-sdk: `0.1.5` diff --git a/Cargo.lock b/Cargo.lock index 3876e60..620c5ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -180,7 +180,7 @@ dependencies = [ [[package]] name = "ft-sdk" -version = "0.1.5" +version = "0.1.6" dependencies = [ "anyhow", "bytes", diff --git a/ft-sdk/Cargo.toml b/ft-sdk/Cargo.toml index eb5e3bc..b821b4d 100644 --- a/ft-sdk/Cargo.toml +++ b/ft-sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ft-sdk" -version = "0.1.5" +version = "0.1.6" description = "ft-sdk: SDK for building FifthTry Applications" authors.workspace = true edition.workspace = true diff --git a/ft-sdk/src/auth/mod.rs b/ft-sdk/src/auth/mod.rs index 0b2b74b..78f4527 100644 --- a/ft-sdk/src/auth/mod.rs +++ b/ft-sdk/src/auth/mod.rs @@ -11,10 +11,11 @@ pub use schema::{fastn_session, fastn_user}; pub use session::SessionID; pub use utils::Counter; -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct UserId(pub i64); -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, Default)] +#[serde(default)] pub struct ProviderData { pub identity: String, pub username: Option, diff --git a/ft-sdk/src/auth/session.rs b/ft-sdk/src/auth/session.rs index 04e61c3..120f2f8 100644 --- a/ft-sdk/src/auth/session.rs +++ b/ft-sdk/src/auth/session.rs @@ -1,4 +1,4 @@ -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct SessionID(pub String); #[cfg(feature = "auth-provider")] diff --git a/ft-sdk/src/auth/utils.rs b/ft-sdk/src/auth/utils.rs index c6b8e5a..82238f5 100644 --- a/ft-sdk/src/auth/utils.rs +++ b/ft-sdk/src/auth/utils.rs @@ -29,7 +29,7 @@ pub(crate) fn user_data_by_query( Ok((ft_sdk::auth::UserId(ud.id), serde_json::from_str(&ud.data)?)) } -#[derive(diesel::QueryableByName)] +#[derive(diesel::QueryableByName, Debug)] pub struct Counter { #[diesel(sql_type = diesel::sql_types::BigInt)] pub count: i64,