Enum CredentialsRef
pub enum CredentialsRef<'a> {
RootSeed(&'a RootSeed),
ClientCredentials(&'a ClientCredentials),
}Expand description
Borrowed credentials required to connect to a user node via mTLS.
Variants§
RootSeed(&'a RootSeed)
Using a RootSeed. Ex: app.
ClientCredentials(&'a ClientCredentials)
Using a revocable client cert. Ex: SDK sidecar.
Implementations§
§impl<'a> CredentialsRef<'a>
impl<'a> CredentialsRef<'a>
pub fn user_pk(&self) -> Option<UserPk>
pub fn user_pk(&self) -> Option<UserPk>
Returns the user public key.
Always Some(_) if the credentials were created by node-v0.8.11+.
pub fn bearer_authenticator(&self) -> Arc<BearerAuthenticator>
pub fn bearer_authenticator(&self) -> Arc<BearerAuthenticator>
Create a [BearerAuthenticator] appropriate for the given credentials.
Currently limits to [Scope::NodeConnect] for RootSeed credentials.
pub fn tls_config(
&self,
rng: &mut impl Crng,
deploy_env: DeployEnv,
) -> Result<ClientConfig, Error>
pub fn tls_config( &self, rng: &mut impl Crng, deploy_env: DeployEnv, ) -> Result<ClientConfig, Error>
Build a TLS client config appropriate for the given credentials.
Trait Implementations§
§impl<'a> Clone for CredentialsRef<'a>
impl<'a> Clone for CredentialsRef<'a>
§fn clone(&self) -> CredentialsRef<'a>
fn clone(&self) -> CredentialsRef<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<'a> From<&'a ClientCredentials> for CredentialsRef<'a>
impl<'a> From<&'a ClientCredentials> for CredentialsRef<'a>
§fn from(client_credentials: &'a ClientCredentials) -> CredentialsRef<'a>
fn from(client_credentials: &'a ClientCredentials) -> CredentialsRef<'a>
Converts to this type from the input type.
§impl<'a> From<&'a RootSeed> for CredentialsRef<'a>
impl<'a> From<&'a RootSeed> for CredentialsRef<'a>
§fn from(root_seed: &'a RootSeed) -> CredentialsRef<'a>
fn from(root_seed: &'a RootSeed) -> CredentialsRef<'a>
Converts to this type from the input type.
impl<'a> Copy for CredentialsRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for CredentialsRef<'a>
impl<'a> RefUnwindSafe for CredentialsRef<'a>
impl<'a> Send for CredentialsRef<'a>
impl<'a> Sync for CredentialsRef<'a>
impl<'a> Unpin for CredentialsRef<'a>
impl<'a> UnwindSafe for CredentialsRef<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
Mutably borrows from an owned value. Read more