pub struct Client { /* private fields */ }
Expand description
The authly client handle.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Construct a new builder.
Sourcepub async fn metadata(&self) -> Result<ServiceMetadata, Error>
pub async fn metadata(&self) -> Result<ServiceMetadata, Error>
Retrieve the ServiceMetadata about service this client identifies as.
Sourcepub async fn metadata_stream(
&self,
) -> Result<BoxStream<'static, ServiceMetadata>, Error>
pub async fn metadata_stream( &self, ) -> Result<BoxStream<'static, ServiceMetadata>, Error>
Get a stream of ServiceMetadata changes.
The first metadata in the stream resolves immediately, and is the current metadata.
Sourcepub fn get_resource_property_mapping(&self) -> Arc<NamespacePropertyMapping>
pub fn get_resource_property_mapping(&self) -> Arc<NamespacePropertyMapping>
Get the current resource properties of this service, in the form of a NamespacePropertyMapping.
Sourcepub fn decode_access_token(
&self,
access_token: impl Into<String>,
) -> Result<Arc<AccessToken>, Error>
pub fn decode_access_token( &self, access_token: impl Into<String>, ) -> Result<Arc<AccessToken>, Error>
Decode and validate an Authly AccessToken. The access token usually represents an entity which is a user of the system.
Sourcepub async fn get_access_token(
&self,
session_token: &str,
) -> Result<Arc<AccessToken>, Error>
pub async fn get_access_token( &self, session_token: &str, ) -> Result<Arc<AccessToken>, Error>
Exchange a session token for an access token suitable for evaluating access control.
Sourcepub fn into_dyn_access_control(
self,
) -> Arc<dyn AccessControl + Send + Sync + 'static>
pub fn into_dyn_access_control( self, ) -> Arc<dyn AccessControl + Send + Sync + 'static>
Convert a clone of self into a dynamically dispatched access control object.
This can be useful in tests where access control needs to be mocked out.
Sourcepub async fn generate_server_tls_params(
&self,
subject_common_name: &str,
) -> Result<(CertificateDer<'static>, PrivateKeyDer<'static>), Error>
pub async fn generate_server_tls_params( &self, subject_common_name: &str, ) -> Result<(CertificateDer<'static>, PrivateKeyDer<'static>), Error>
Generate a server certificate and a key pair for the service.
This involves sending a Certificate Signing Request for Authly to resolve.
Returns a pair of Certificate signed by the Authly Local CA, and the matching private key to be used by the server.
The common name can be any chosen text identifying the service.
Sourcepub fn connection_params_stream(
&self,
) -> BoxStream<'static, Arc<ConnectionParams>>
pub fn connection_params_stream( &self, ) -> BoxStream<'static, Arc<ConnectionParams>>
Generates a stream of ConnectionParams that this client uses to connect to Authly.
The TLS-related parts of those parameters can be used by the client when communicating with other services in the Authly service mesh.
The first stream item will resolve immediately.
Trait Implementations§
Source§impl AccessControl for Client
impl AccessControl for Client
Source§fn access_control_request(&self) -> AccessControlRequestBuilder<'_>
fn access_control_request(&self) -> AccessControlRequestBuilder<'_>
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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