Skip to content

Commit

Permalink
feat(jans-cedarling): implement Default for TokenEntityMetadata
Browse files Browse the repository at this point in the history
Signed-off-by: rmarinn <[email protected]>
  • Loading branch information
rmarinn committed Nov 11, 2024
1 parent c134ce5 commit 194e776
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde::{de, Deserialize};
use serde_json::Value;
use std::collections::HashMap;

#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Clone, Default)]
#[allow(dead_code)]
pub struct TokenEntityMetadata {
pub user_id: Option<String>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,14 @@ mod test {
description: "Consumer IDP".to_string(),
openid_configuration_endpoint:
"https://accounts.google.com/.well-known/openid-configuration".to_string(),
access_tokens: TokenEntityMetadata {
user_id: None,
role_mapping: None,
claim_mapping: None,
},
access_tokens: TokenEntityMetadata::default(),
id_tokens: TokenEntityMetadata {
user_id: Some("sub".to_string()),
role_mapping: Some("role".to_string()),
claim_mapping: None,
},
userinfo_tokens: TokenEntityMetadata {
user_id: None,
role_mapping: None,
claim_mapping: None,
},
tx_tokens: TokenEntityMetadata {
user_id: None,
role_mapping: None,
claim_mapping: None,
},
userinfo_tokens: TokenEntityMetadata::default(),
tx_tokens: TokenEntityMetadata::default(),
};

assert_eq!(
Expand Down

0 comments on commit 194e776

Please sign in to comment.