pub struct AuthorizationServiceClient<T>(/* private fields */);
Expand description
Authorization service manages the permissions for a user to access resources.
Implementations§
Source§impl<T> AuthorizationServiceClient<T>where
T: Client,
impl<T> AuthorizationServiceClient<T>where
T: Client,
Given a set of resources, returns the set of resources that the user is authorized to access.
Sourcepub fn batch_get_workspace_for_resource(
&self,
auth_: &BearerToken,
request: &BTreeSet<ResourceIdentifier>,
) -> Result<BTreeMap<ResourceIdentifier, WorkspaceRid>, Error>
pub 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 fn register_in_workspace(
&self,
auth_: &BearerToken,
request: &RegisterInWorkspaceRequest,
) -> Result<(), Error>
pub 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 fn check_admin(&self, auth_: &BearerToken) -> Result<(), Error>
pub 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 fn is_email_allowed(
&self,
request: &IsEmailAllowedRequest,
) -> Result<IsEmailAllowedResponse, Error>
pub fn is_email_allowed( &self, request: &IsEmailAllowedRequest, ) -> Result<IsEmailAllowedResponse, Error>
Checks if the email is allowed to register.
Sourcepub fn get_access_token(
&self,
request: &GetAccessTokenRequest,
) -> Result<GetAccessTokenResponse, Error>
pub 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 fn create_api_key(
&self,
auth_: &BearerToken,
request: &CreateApiKeyRequest,
) -> Result<CreateApiKeyResponse, Error>
pub 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 fn list_api_keys_in_org(
&self,
auth_: &BearerToken,
request: &ListApiKeyRequest,
) -> Result<ListApiKeyResponse, Error>
pub fn list_api_keys_in_org( &self, auth_: &BearerToken, request: &ListApiKeyRequest, ) -> Result<ListApiKeyResponse, Error>
List all API keys in the organization.
Sourcepub fn list_user_api_keys(
&self,
auth_: &BearerToken,
request: &ListApiKeyRequest,
) -> Result<ListApiKeyResponse, Error>
pub fn list_user_api_keys( &self, auth_: &BearerToken, request: &ListApiKeyRequest, ) -> Result<ListApiKeyResponse, Error>
List all API keys for the user.
Sourcepub fn revoke_api_key(
&self,
auth_: &BearerToken,
rid: &ApiKeyRid,
) -> Result<(), Error>
pub fn revoke_api_key( &self, auth_: &BearerToken, rid: &ApiKeyRid, ) -> Result<(), Error>
Delete an API key.
Trait Implementations§
Source§impl<T: Clone> Clone for AuthorizationServiceClient<T>
impl<T: Clone> Clone for AuthorizationServiceClient<T>
Source§fn clone(&self) -> AuthorizationServiceClient<T>
fn clone(&self) -> AuthorizationServiceClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T: Debug> Debug for AuthorizationServiceClient<T>
impl<T: Debug> Debug for AuthorizationServiceClient<T>
Auto Trait Implementations§
impl<T> Freeze for AuthorizationServiceClient<T>where
T: Freeze,
impl<T> RefUnwindSafe for AuthorizationServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for AuthorizationServiceClient<T>where
T: Send,
impl<T> Sync for AuthorizationServiceClient<T>where
T: Sync,
impl<T> Unpin for AuthorizationServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for AuthorizationServiceClient<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