kanidm_client/
system.rs

1use crate::{ClientError, KanidmClient};
2
3impl KanidmClient {
4    pub async fn system_password_badlist_get(&self) -> Result<Vec<String>, ClientError> {
5        let list: Option<Vec<String>> = self
6            .perform_get_request("/v1/system/_attr/badlist_password")
7            .await?;
8        Ok(list.unwrap_or_default())
9    }
10
11    pub async fn system_password_badlist_append(
12        &self,
13        list: Vec<String>,
14    ) -> Result<(), ClientError> {
15        self.perform_post_request("/v1/system/_attr/badlist_password", list)
16            .await
17    }
18
19    pub async fn system_password_badlist_remove(
20        &self,
21        list: Vec<String>,
22    ) -> Result<(), ClientError> {
23        self.perform_delete_request_with_body("/v1/system/_attr/badlist_password", list)
24            .await
25    }
26
27    pub async fn system_denied_names_get(&self) -> Result<Vec<String>, ClientError> {
28        let list: Option<Vec<String>> = self
29            .perform_get_request("/v1/system/_attr/denied_name")
30            .await?;
31        Ok(list.unwrap_or_default())
32    }
33
34    pub async fn system_denied_names_append(&self, list: &Vec<String>) -> Result<(), ClientError> {
35        self.perform_post_request("/v1/system/_attr/denied_name", list)
36            .await
37    }
38
39    pub async fn system_denied_names_remove(&self, list: &Vec<String>) -> Result<(), ClientError> {
40        self.perform_delete_request_with_body("/v1/system/_attr/denied_name", list)
41            .await
42    }
43}