Public Access
fix: format and lint
This commit is contained in:
@@ -179,7 +179,8 @@ impl KeycloakClient {
|
||||
pub async fn authenticate(&self) -> Result<()> {
|
||||
info!("Authenticating with Keycloak (client credentials grant)");
|
||||
|
||||
let response = self.raw_client
|
||||
let response = self
|
||||
.raw_client
|
||||
.post(&self.token_url)
|
||||
.form(&[
|
||||
("grant_type", "client_credentials"),
|
||||
@@ -222,7 +223,8 @@ impl KeycloakClient {
|
||||
|
||||
let url = format!("{}/{}", self.http.base_url(), path.trim_start_matches('/'));
|
||||
|
||||
let response = self.raw_client
|
||||
let response = self
|
||||
.raw_client
|
||||
.get(&url)
|
||||
.header("Authorization", format!("Bearer {}", token))
|
||||
.header("Accept", "application/json")
|
||||
@@ -258,7 +260,11 @@ impl KeycloakClient {
|
||||
first += page_size;
|
||||
}
|
||||
|
||||
info!("Fetched {} users from Keycloak realm '{}'", all_users.len(), self.realm);
|
||||
info!(
|
||||
"Fetched {} users from Keycloak realm '{}'",
|
||||
all_users.len(),
|
||||
self.realm
|
||||
);
|
||||
Ok(all_users)
|
||||
}
|
||||
|
||||
@@ -266,7 +272,11 @@ impl KeycloakClient {
|
||||
pub async fn fetch_groups(&self) -> Result<Vec<KeycloakGroup>> {
|
||||
let response = self.get("groups?briefRepresentation=false").await?;
|
||||
let groups: Vec<KeycloakGroup> = serde_json::from_value(response)?;
|
||||
info!("Fetched {} top-level groups from Keycloak realm '{}'", groups.len(), self.realm);
|
||||
info!(
|
||||
"Fetched {} top-level groups from Keycloak realm '{}'",
|
||||
groups.len(),
|
||||
self.realm
|
||||
);
|
||||
Ok(groups)
|
||||
}
|
||||
|
||||
|
||||
@@ -194,10 +194,7 @@ fn build_group_entity(
|
||||
|
||||
let mut annotations = HashMap::new();
|
||||
annotations.insert("keycloak.com/group-id".to_string(), kc_group.id.clone());
|
||||
annotations.insert(
|
||||
"keycloak.com/group-path".to_string(),
|
||||
kc_group.path.clone(),
|
||||
);
|
||||
annotations.insert("keycloak.com/group-path".to_string(), kc_group.path.clone());
|
||||
annotations.insert("keycloak.com/realm".to_string(), config.realm.clone());
|
||||
annotations.insert(
|
||||
"keycloak.com/member-count".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user