Struct CtsClient
pub struct CtsClient<C>{ /* private fields */ }Implementations§
§impl<C> CtsClient<C>
impl<C> CtsClient<C>
pub fn new(credentials: C) -> Self
pub fn new(credentials: C) -> Self
Create a new CtsClient that resolves its base URL from the JWT
iss claim on each request.
let client = CtsClient::new(strategy);pub fn with_base_url(self, base_url: Url) -> Self
pub fn with_base_url(self, base_url: Url) -> Self
Set an explicit base URL override, bypassing the JWT iss claim.
This is useful in tests where the token’s iss claim does not point
to the CTS server (e.g. mock-auth-server-signed tokens).
pub async fn create_workspace( &self, name: &str, region: Region, ) -> Result<CreateWorkspaceResponse, CtsClientError>
pub async fn list_workspaces(&self) -> Result<Vec<Workspace>, CtsClientError>
pub async fn create_access_key(
&self,
name: &str,
workspace_id: WorkspaceId,
role: Role,
) -> Result<String, CtsClientError>
pub async fn create_access_key( &self, name: &str, workspace_id: WorkspaceId, role: Role, ) -> Result<String, CtsClientError>
Create a new access key used to access ZeroKMS
pub async fn list_access_keys(&self) -> Result<Vec<AccessKey>, CtsClientError>
pub async fn list_access_keys(&self) -> Result<Vec<AccessKey>, CtsClientError>
List all the access keys visible to the current user.
User must have the access_key:list permission in that workspace.
pub async fn revoke_access_key(
&self,
name: &str,
workspace_id: WorkspaceId,
) -> Result<String, CtsClientError>
pub async fn revoke_access_key( &self, name: &str, workspace_id: WorkspaceId, ) -> Result<String, CtsClientError>
Revoke a certain access key by name in the specified workspace
pub async fn list_oidc_providers(
&self,
) -> Result<Vec<OidcProvider>, CtsClientError>
pub async fn list_oidc_providers( &self, ) -> Result<Vec<OidcProvider>, CtsClientError>
List all OIDC providers visible to the current user.
pub async fn create_oidc_provider( &self, issuer: &Url, vendor: OidcVendor, ) -> Result<OidcProvider, CtsClientError>
pub async fn delete_oidc_provider( &self, provider_id: Uuid, ) -> Result<(), CtsClientError>
pub async fn create_membership( &self, user_id: &str, workspace_id: &str, ) -> Result<Membership, CtsClientError>
pub async fn list_memberships(&self) -> Result<Vec<Membership>, CtsClientError>
pub async fn list_memberships_for_workspace( &self, ws_id: WorkspaceId, ) -> Result<Vec<Membership>, CtsClientError>
pub async fn delete_membership( &self, membership_id: Uuid, ) -> Result<Membership, CtsClientError>
Auto Trait Implementations§
impl<C> !RefUnwindSafe for CtsClient<C>
impl<C> !UnwindSafe for CtsClient<C>
impl<C> Freeze for CtsClient<C>where
C: Freeze,
impl<C> Send for CtsClient<C>
impl<C> Sync for CtsClient<C>
impl<C> Unpin for CtsClient<C>where
C: Unpin,
impl<C> UnsafeUnpin for CtsClient<C>where
C: UnsafeUnpin,
Blanket Implementations§
impl<T> AuthStrategyBounds for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more