pub struct NatsSecretsManager { /* private fields */ }Expand description
A manager for fetching secrets from a secret store, caching secrets clients for efficiency.
Implementations§
Source§impl NatsSecretsManager
impl NatsSecretsManager
Sourcepub fn new(
config_store: Arc<dyn StoreManager>,
secret_store_topic: Option<&String>,
nats_client: &Client,
) -> Self
pub fn new( config_store: Arc<dyn StoreManager>, secret_store_topic: Option<&String>, nats_client: &Client, ) -> Self
Create a new secret manager with the given configuration store, secret store topic, and NATS client.
All secret references will be fetched from this configuration store and the actual secrets will be
fetched by sending requests to the configured topic. If the provided secret_store_topic is None, this manager
will always return an error if Self::fetch_secrets is called with a list of secrets.
Trait Implementations§
Source§impl SecretsManager for NatsSecretsManager
impl SecretsManager for NatsSecretsManager
Source§fn fetch_secrets<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
secret_names: Vec<String>,
entity_jwt: Option<&'life1 String>,
host_jwt: &'life2 str,
application: Option<&'life3 String>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, SecretBox<SecretValue>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn fetch_secrets<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
secret_names: Vec<String>,
entity_jwt: Option<&'life1 String>,
host_jwt: &'life2 str,
application: Option<&'life3 String>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, SecretBox<SecretValue>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Fetches secret references from the CONFIGDATA bucket by name and then fetches the actual secrets from the configured secret store. Any error returned from this function should result in a failure to start a component, start a provider, or establish a link as a missing secret is a critical error.
§Arguments
secret_names- A list of secret names to fetch from the secret storeentity_jwt- The JWT of the entity requesting the secrets. Must be provided unless this SecretsManager is not configured with a secret store topic.host_jwt- The JWT of the host requesting the secretsapplication- The name of the application the entity is a part of, if any
§Returns
A HashMap from secret name to the SecretBox wrapped SecretValue.
Auto Trait Implementations§
impl Freeze for NatsSecretsManager
impl !RefUnwindSafe for NatsSecretsManager
impl Send for NatsSecretsManager
impl Sync for NatsSecretsManager
impl Unpin for NatsSecretsManager
impl !UnwindSafe for NatsSecretsManager
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§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>
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>
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 moreSource§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::RequestSource§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