kanidm_client/
scim.rs

1use crate::{ClientError, KanidmClient};
2use kanidm_proto::scim_v1::{ScimEntryGeneric, ScimEntryGetQuery, ScimSyncRequest, ScimSyncState};
3
4impl KanidmClient {
5    // TODO: testing for this
6    pub async fn scim_v1_sync_status(&self) -> Result<ScimSyncState, ClientError> {
7        self.perform_get_request("/scim/v1/Sync").await
8    }
9
10    // TODO: testing for this
11    pub async fn scim_v1_sync_update(
12        &self,
13        scim_sync_request: &ScimSyncRequest,
14    ) -> Result<(), ClientError> {
15        self.perform_post_request("/scim/v1/Sync", scim_sync_request)
16            .await
17    }
18
19    /// Retrieve a Generic SCIM Entry as a JSON Value. This can retrieve any
20    /// type of entry that Kanidm supports.
21    pub async fn scim_v1_entry_get(
22        &self,
23        name_or_uuid: &str,
24        query: Option<ScimEntryGetQuery>,
25    ) -> Result<ScimEntryGeneric, ClientError> {
26        self.perform_get_request_query(format!("/scim/v1/Entry/{}", name_or_uuid).as_str(), query)
27            .await
28    }
29
30    /// Retrieve a Person as a SCIM JSON Value.
31    pub async fn scim_v1_person_get(
32        &self,
33        name_or_uuid: &str,
34        query: Option<ScimEntryGetQuery>,
35    ) -> Result<ScimEntryGeneric, ClientError> {
36        self.perform_get_request_query(format!("/scim/v1/Person/{}", name_or_uuid).as_str(), query)
37            .await
38    }
39}