pub struct AuthorizationClient { /* private fields */ }Expand description
Client for authorization operations.
Implementations§
Source§impl AuthorizationClient
impl AuthorizationClient
Sourcepub async fn create_application(
&self,
request: &CreateOrUpdateApplicationRequest,
) -> Result<ConductorApplication>
pub async fn create_application( &self, request: &CreateOrUpdateApplicationRequest, ) -> Result<ConductorApplication>
Create an application.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn get_application(
&self,
application_id: &str,
) -> Result<ConductorApplication>
pub async fn get_application( &self, application_id: &str, ) -> Result<ConductorApplication>
Get an application by ID.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn list_applications(&self) -> Result<Vec<ConductorApplication>>
pub async fn list_applications(&self) -> Result<Vec<ConductorApplication>>
List all applications.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn update_application(
&self,
request: &CreateOrUpdateApplicationRequest,
application_id: &str,
) -> Result<ConductorApplication>
pub async fn update_application( &self, request: &CreateOrUpdateApplicationRequest, application_id: &str, ) -> Result<ConductorApplication>
Update an application.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn delete_application(&self, application_id: &str) -> Result<()>
pub async fn delete_application(&self, application_id: &str) -> Result<()>
Delete an application.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn get_app_by_access_key_id(
&self,
access_key_id: &str,
) -> Result<String>
pub async fn get_app_by_access_key_id( &self, access_key_id: &str, ) -> Result<String>
Get application ID by access key ID.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn add_role_to_application_user(
&self,
application_id: &str,
role: &str,
) -> Result<()>
pub async fn add_role_to_application_user( &self, application_id: &str, role: &str, ) -> Result<()>
Add a role to application user.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn remove_role_from_application_user(
&self,
application_id: &str,
role: &str,
) -> Result<()>
pub async fn remove_role_from_application_user( &self, application_id: &str, role: &str, ) -> Result<()>
Remove a role from application user.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Set tags for an application.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Get tags for an application.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Delete tags from an application.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn create_access_key(
&self,
application_id: &str,
) -> Result<CreatedAccessKey>
pub async fn create_access_key( &self, application_id: &str, ) -> Result<CreatedAccessKey>
Create an access key for an application.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn get_access_keys(
&self,
application_id: &str,
) -> Result<Vec<AccessKey>>
pub async fn get_access_keys( &self, application_id: &str, ) -> Result<Vec<AccessKey>>
Get access keys for an application.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn toggle_access_key_status(
&self,
application_id: &str,
key_id: &str,
) -> Result<AccessKey>
pub async fn toggle_access_key_status( &self, application_id: &str, key_id: &str, ) -> Result<AccessKey>
Toggle the status of an access key.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn delete_access_key(
&self,
application_id: &str,
key_id: &str,
) -> Result<()>
pub async fn delete_access_key( &self, application_id: &str, key_id: &str, ) -> Result<()>
Delete an access key.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn upsert_user(
&self,
request: &UpsertUserRequest,
user_id: &str,
) -> Result<ConductorUser>
pub async fn upsert_user( &self, request: &UpsertUserRequest, user_id: &str, ) -> Result<ConductorUser>
Create or update a user.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn get_user(&self, user_id: &str) -> Result<ConductorUser>
pub async fn get_user(&self, user_id: &str) -> Result<ConductorUser>
Get a user by ID.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn list_users(&self, apps: bool) -> Result<Vec<ConductorUser>>
pub async fn list_users(&self, apps: bool) -> Result<Vec<ConductorUser>>
List all users.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn delete_user(&self, user_id: &str) -> Result<()>
pub async fn delete_user(&self, user_id: &str) -> Result<()>
Delete a user.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn get_granted_permissions_for_user(
&self,
user_id: &str,
) -> Result<Vec<GrantedPermission>>
pub async fn get_granted_permissions_for_user( &self, user_id: &str, ) -> Result<Vec<GrantedPermission>>
Get permissions granted to a user.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn check_permissions(
&self,
user_id: &str,
target_type: &str,
target_id: &str,
) -> Result<HashMap<String, bool>>
pub async fn check_permissions( &self, user_id: &str, target_type: &str, target_id: &str, ) -> Result<HashMap<String, bool>>
Check if user has permissions over a target.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn upsert_group(
&self,
request: &UpsertGroupRequest,
group_id: &str,
) -> Result<Group>
pub async fn upsert_group( &self, request: &UpsertGroupRequest, group_id: &str, ) -> Result<Group>
Create or update a group.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn get_group(&self, group_id: &str) -> Result<Group>
pub async fn get_group(&self, group_id: &str) -> Result<Group>
Get a group by ID.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn list_groups(&self) -> Result<Vec<Group>>
pub async fn list_groups(&self) -> Result<Vec<Group>>
List all groups.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn delete_group(&self, group_id: &str) -> Result<()>
pub async fn delete_group(&self, group_id: &str) -> Result<()>
Delete a group.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn get_granted_permissions_for_group(
&self,
group_id: &str,
) -> Result<Vec<GrantedPermission>>
pub async fn get_granted_permissions_for_group( &self, group_id: &str, ) -> Result<Vec<GrantedPermission>>
Get permissions granted to a group.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn add_user_to_group(
&self,
group_id: &str,
user_id: &str,
) -> Result<()>
pub async fn add_user_to_group( &self, group_id: &str, user_id: &str, ) -> Result<()>
Add a user to a group.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn add_users_to_group(
&self,
group_id: &str,
user_ids: &[String],
) -> Result<()>
pub async fn add_users_to_group( &self, group_id: &str, user_ids: &[String], ) -> Result<()>
Add multiple users to a group.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn get_users_in_group(
&self,
group_id: &str,
) -> Result<Vec<ConductorUser>>
pub async fn get_users_in_group( &self, group_id: &str, ) -> Result<Vec<ConductorUser>>
Get all users in a group.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn remove_user_from_group(
&self,
group_id: &str,
user_id: &str,
) -> Result<()>
pub async fn remove_user_from_group( &self, group_id: &str, user_id: &str, ) -> Result<()>
Remove a user from a group.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn remove_users_from_group(
&self,
group_id: &str,
user_ids: &[String],
) -> Result<()>
pub async fn remove_users_from_group( &self, group_id: &str, user_ids: &[String], ) -> Result<()>
Remove multiple users from a group.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn grant_permissions(
&self,
subject: &SubjectRef,
target: &TargetRef,
access: &[AccessType],
) -> Result<()>
pub async fn grant_permissions( &self, subject: &SubjectRef, target: &TargetRef, access: &[AccessType], ) -> Result<()>
Grant permissions to a subject over a target.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn get_permissions(
&self,
target: &TargetRef,
) -> Result<HashMap<String, Vec<SubjectRef>>>
pub async fn get_permissions( &self, target: &TargetRef, ) -> Result<HashMap<String, Vec<SubjectRef>>>
Get permissions for a target.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn remove_permissions(
&self,
subject: &SubjectRef,
target: &TargetRef,
access: &[AccessType],
) -> Result<()>
pub async fn remove_permissions( &self, subject: &SubjectRef, target: &TargetRef, access: &[AccessType], ) -> Result<()>
Remove permissions from a subject over a target.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn list_all_roles(&self) -> Result<Vec<Value>>
pub async fn list_all_roles(&self) -> Result<Vec<Value>>
List all roles.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn list_system_roles(&self) -> Result<HashMap<String, Value>>
pub async fn list_system_roles(&self) -> Result<HashMap<String, Value>>
List system roles.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn list_custom_roles(&self) -> Result<Vec<Value>>
pub async fn list_custom_roles(&self) -> Result<Vec<Value>>
List custom roles.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn list_available_permissions(&self) -> Result<HashMap<String, Value>>
pub async fn list_available_permissions(&self) -> Result<HashMap<String, Value>>
List available permissions.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn create_role(&self, request: &Value) -> Result<Value>
pub async fn create_role(&self, request: &Value) -> Result<Value>
Create a custom role.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn get_role(&self, role_name: &str) -> Result<Value>
pub async fn get_role(&self, role_name: &str) -> Result<Value>
Get a role by name.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn update_role(
&self,
role_name: &str,
request: &Value,
) -> Result<Value>
pub async fn update_role( &self, role_name: &str, request: &Value, ) -> Result<Value>
Update a custom role.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn delete_role(&self, role_name: &str) -> Result<()>
pub async fn delete_role(&self, role_name: &str) -> Result<()>
Delete a custom role.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.
Sourcepub async fn get_user_info_from_token(&self) -> Result<Value>
pub async fn get_user_info_from_token(&self) -> Result<Value>
Get user info from the current token.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn generate_token(
&self,
key_id: &str,
key_secret: &str,
) -> Result<Value>
pub async fn generate_token( &self, key_id: &str, key_secret: &str, ) -> Result<Value>
Generate a token using access key credentials.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn create_gateway_auth_config(
&self,
auth_config: &Value,
) -> Result<Value>
pub async fn create_gateway_auth_config( &self, auth_config: &Value, ) -> Result<Value>
Create API Gateway authentication configuration.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn get_gateway_auth_config(&self, config_id: &str) -> Result<Value>
pub async fn get_gateway_auth_config(&self, config_id: &str) -> Result<Value>
Get API Gateway authentication configuration by ID.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn list_gateway_auth_configs(&self) -> Result<Vec<Value>>
pub async fn list_gateway_auth_configs(&self) -> Result<Vec<Value>>
List all API Gateway authentication configurations.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn update_gateway_auth_config(
&self,
config_id: &str,
auth_config: &Value,
) -> Result<Value>
pub async fn update_gateway_auth_config( &self, config_id: &str, auth_config: &Value, ) -> Result<Value>
Update API Gateway authentication configuration.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status, or crate::error::ConductorError::Json if the response body can’t be deserialized.
Sourcepub async fn delete_gateway_auth_config(&self, config_id: &str) -> Result<()>
pub async fn delete_gateway_auth_config(&self, config_id: &str) -> Result<()>
Delete API Gateway authentication configuration.
§Errors
Returns crate::error::ConductorError::Http if the request fails at the transport level, or an crate::error::ConductorError::Auth/crate::error::ConductorError::Api/crate::error::ConductorError::Server variant if the server responds with a non-2xx status.