Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ COPY Cargo.toml Cargo.lock ./
COPY .git .git
COPY .sqlx .sqlx
COPY crates crates
COPY tools tools
COPY proto proto
COPY migrations migrations
RUN cargo install --locked --bin defguard --path ./crates/defguard --root /build
Expand Down
2 changes: 1 addition & 1 deletion crates/defguard_common/src/db/models/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub struct User<I = NoId> {
}

// TODO: Refactor the user struct to use SecretStringWrapper instead of this
impl<I: std::fmt::Debug> fmt::Debug for User<I> {
impl<I: fmt::Debug> fmt::Debug for User<I> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let Self {
id,
Expand Down
8 changes: 4 additions & 4 deletions crates/defguard_core/src/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,19 +383,19 @@ mod tests {

// No requested scopes
let all_scopes = vec!["email".to_string(), "profile".to_string()];
let requested_scopes = vec![];
let requested_scopes = Vec::new();
let result = get_available_scopes(&all_scopes, &requested_scopes);
assert_eq!(result, Vec::<&str>::new());

// No available scopes
let all_scopes = vec![];
let all_scopes = Vec::new();
let requested_scopes = vec!["email".to_string(), "profile".to_string()];
let result = get_available_scopes(&all_scopes, &requested_scopes);
assert_eq!(result, Vec::<&str>::new());

// Both empty
let all_scopes = vec![];
let requested_scopes = vec![];
let all_scopes = Vec::new();
let requested_scopes = Vec::new();
let result = get_available_scopes(&all_scopes, &requested_scopes);
assert_eq!(result, Vec::<&str>::new());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ mod tests {
let group_empty_ldap = UserGroup {
id: "group789".to_string(),
compiled_attributes: CompiledAttributes {
ldap_groups: vec![],
ldap_groups: Vec::new(),
},
};
let directory_group_empty_ldap: DirectoryGroup = group_empty_ldap.into();
Expand All @@ -743,7 +743,7 @@ mod tests {
fn test_response_collection_conversions() {
// Test empty UsersResponse conversion
let empty_users_response = UsersResponse {
results: vec![],
results: Vec::new(),
total_count: 0,
};
let empty_directory_users: Vec<DirectoryUser> = empty_users_response.into();
Expand Down
24 changes: 12 additions & 12 deletions crates/defguard_core/src/enterprise/directory_sync/microsoft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ mod tests {
"client_id".to_string(),
"client_secret".to_string(),
"https://login.microsoftonline.com/tenant-id-123/v2.0".to_string(),
vec![],
Vec::new(),
);
let tenant = provider.extract_tenant().unwrap();
assert_eq!(tenant, "tenant-id-123");
Expand All @@ -593,7 +593,7 @@ mod tests {
"id".to_string(),
"secret".to_string(),
"https://login.microsoftonline.com/tenant-id-123/v2.0".to_string(),
vec![],
Vec::new(),
);

// no token
Expand Down Expand Up @@ -644,12 +644,12 @@ mod tests {
display_name: "User 1".to_string(),
mail: Some("email@email.com".to_string()),
account_enabled: true,
other_mails: vec![],
other_mails: Vec::new(),
id: "user1-id".into(),
given_name: Some("User".into()),
surname: Some("One".into()),
mobile_phone: Some("555555555".into()),
business_phones: vec![],
business_phones: Vec::new(),
},
User {
display_name: "User 2".to_string(),
Expand All @@ -660,18 +660,18 @@ mod tests {
given_name: Some("User".into()),
surname: Some("Two".into()),
mobile_phone: None,
business_phones: vec![],
business_phones: Vec::new(),
},
User {
display_name: "User 3".to_string(),
mail: None,
account_enabled: true,
other_mails: vec![],
other_mails: Vec::new(),
id: "user3-id".into(),
given_name: Some("User".into()),
surname: Some("Three".into()),
mobile_phone: None,
business_phones: vec![],
business_phones: Vec::new(),
},
],
};
Expand All @@ -691,12 +691,12 @@ mod tests {
display_name: "User 1".to_string(),
mail: Some("email@email.com".to_string()),
account_enabled: true,
other_mails: vec![],
other_mails: Vec::new(),
id: "user1-id".into(),
given_name: Some("User".into()),
surname: None,
mobile_phone: None,
business_phones: vec![],
business_phones: Vec::new(),
},
User {
display_name: "User 2".to_string(),
Expand All @@ -707,18 +707,18 @@ mod tests {
given_name: None,
surname: None,
mobile_phone: Some("555555555".into()),
business_phones: vec![],
business_phones: Vec::new(),
},
User {
display_name: "User 3".to_string(),
mail: None,
account_enabled: true,
other_mails: vec![],
other_mails: Vec::new(),
id: "user3-id".into(),
given_name: Some("User".into()),
surname: Some("Three".into()),
mobile_phone: Some("555555555".into()),
business_phones: vec![],
business_phones: Vec::new(),
},
],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ mod test {
target,
None,
None,
vec![],
Vec::new(),
None,
prefetch_users,
)
Expand Down
Loading
Loading