pub struct AuthorizationServiceAsyncClient<T>(/* private fields */);
Expand description
Authorization service manages the permissions for a user to access resources.
Implementations§
Source§impl<T> AuthorizationServiceAsyncClient<T>where
T: AsyncClient,
impl<T> AuthorizationServiceAsyncClient<T>where
T: AsyncClient,
Given a set of resources, returns the set of resources that the user is authorized to access.
Sourcepub async fn batch_get_workspace_for_resource(
&self,
auth_: &BearerToken,
request: &BTreeSet<ResourceIdentifier>,
) -> Result<BTreeMap<ResourceIdentifier, WorkspaceRid>, Error>
pub async fn batch_get_workspace_for_resource( &self, auth_: &BearerToken, request: &BTreeSet<ResourceIdentifier>, ) -> Result<BTreeMap<ResourceIdentifier, WorkspaceRid>, Error>
Given a set of resources, returns the workspace that each resource belongs to. If a user is not authorized on the resource, will omit the resource from the response.
Sourcepub async fn register_in_workspace(
&self,
auth_: &BearerToken,
request: &RegisterInWorkspaceRequest,
) -> Result<(), Error>
pub async fn register_in_workspace( &self, auth_: &BearerToken, request: &RegisterInWorkspaceRequest, ) -> Result<(), Error>
Marks a set of resources as belonging to a workspace. Either all resources are registered or none are. If the user is not in the workspace, this will throw. If a resource already belongs to a different workspace, this will throw. If a resource already belongs to this workspace, this is a no-op.
Sourcepub async fn check_admin(&self, auth_: &BearerToken) -> Result<(), Error>
pub async fn check_admin(&self, auth_: &BearerToken) -> Result<(), Error>
Given an authenticated session, this endpoint returns a HTTP 204 if the authenticated user is an admin and HTTP 403 otherwise.
Sourcepub async fn is_email_allowed(
&self,
request: &IsEmailAllowedRequest,
) -> Result<IsEmailAllowedResponse, Error>
pub async fn is_email_allowed( &self, request: &IsEmailAllowedRequest, ) -> Result<IsEmailAllowedResponse, Error>
Checks if the email is allowed to register.
Sourcepub async fn get_access_token(
&self,
request: &GetAccessTokenRequest,
) -> Result<GetAccessTokenResponse, Error>
pub async fn get_access_token( &self, request: &GetAccessTokenRequest, ) -> Result<GetAccessTokenResponse, Error>
Provide an OIDC ID and access token to get a Nominal access token, suitable for making API requests. Its expiry will match that of the input access token, capped at 24h. Throws NotAuthorized if either token is invalid or if the OIDC provider is not known.
Sourcepub async fn create_api_key(
&self,
auth_: &BearerToken,
request: &CreateApiKeyRequest,
) -> Result<CreateApiKeyResponse, Error>
pub async fn create_api_key( &self, auth_: &BearerToken, request: &CreateApiKeyRequest, ) -> Result<CreateApiKeyResponse, Error>
Provide a long-lived API key for making API requests. The API key is irretrievable after initial creation.
Sourcepub async fn list_api_keys_in_org(
&self,
auth_: &BearerToken,
request: &ListApiKeyRequest,
) -> Result<ListApiKeyResponse, Error>
pub async fn list_api_keys_in_org( &self, auth_: &BearerToken, request: &ListApiKeyRequest, ) -> Result<ListApiKeyResponse, Error>
List all API keys in the organization.
Sourcepub async fn list_user_api_keys(
&self,
auth_: &BearerToken,
request: &ListApiKeyRequest,
) -> Result<ListApiKeyResponse, Error>
pub async fn list_user_api_keys( &self, auth_: &BearerToken, request: &ListApiKeyRequest, ) -> Result<ListApiKeyResponse, Error>
List all API keys for the user.
Sourcepub async fn revoke_api_key(
&self,
auth_: &BearerToken,
rid: &ApiKeyRid,
) -> Result<(), Error>
pub async fn revoke_api_key( &self, auth_: &BearerToken, rid: &ApiKeyRid, ) -> Result<(), Error>
Delete an API key.
Trait Implementations§
Source§impl<T> AsyncService<T> for AuthorizationServiceAsyncClient<T>where
T: AsyncClient,
impl<T> AsyncService<T> for AuthorizationServiceAsyncClient<T>where
T: AsyncClient,
Source§impl<T: Clone> Clone for AuthorizationServiceAsyncClient<T>
impl<T: Clone> Clone for AuthorizationServiceAsyncClient<T>
Source§fn clone(&self) -> AuthorizationServiceAsyncClient<T>
fn clone(&self) -> AuthorizationServiceAsyncClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> Freeze for AuthorizationServiceAsyncClient<T>where
T: Freeze,
impl<T> RefUnwindSafe for AuthorizationServiceAsyncClient<T>where
T: RefUnwindSafe,
impl<T> Send for AuthorizationServiceAsyncClient<T>where
T: Send,
impl<T> Sync for AuthorizationServiceAsyncClient<T>where
T: Sync,
impl<T> Unpin for AuthorizationServiceAsyncClient<T>where
T: Unpin,
impl<T> UnwindSafe for AuthorizationServiceAsyncClient<T>where
T: UnwindSafe,
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request