Skip to content

Commit

Permalink
Add profile photo fetching
Browse files Browse the repository at this point in the history
Signed-off-by: David Mulder <[email protected]>
  • Loading branch information
dmulder committed Dec 20, 2024
1 parent 65ca497 commit 9888a66
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tracing-subscriber = "^0.3.17"
tracing = "^0.1.37"
himmelblau_unix_common = { path = "src/common" }
kanidm_unix_common = { path = "src/glue" }
libhimmelblau = { version = "0.5.0" }
libhimmelblau = { version = "0.5.1" }
clap = { version = "^4.5", features = ["derive", "env"] }
clap_complete = "^4.4.1"
reqwest = { version = "^0.12.2", features = ["json"] }
Expand Down
9 changes: 9 additions & 0 deletions src/common/src/idprovider/himmelblau.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use kanidm_hsm_crypto::{LoadableIdentityKey, LoadableMsOapxbcRsaKey, PinValue, S
use reqwest;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::fs::File;
use std::sync::Arc;
use std::thread::sleep;
use std::time::Duration;
Expand Down Expand Up @@ -1528,6 +1529,14 @@ impl HimmelblauProvider {
vec![]
}
};
// Set the profile picture
if let Ok(file) = File::create(format!("/var/lib/AccountsService/icons/{}", spn)) {
// Ignore failures, since this isn't critical
let _ = self
.graph
.fetch_user_profile_photo(access_token, file)
.await;
}
}
None => {
debug!("Failed fetching user groups for {}", &spn);
Expand Down

0 comments on commit 9888a66

Please sign in to comment.