pub struct TenantScopedSecrets<P: SecretProvider> { /* private fields */ }Available on crate feature
multi-tenant only.Expand description
Implementations§
Source§impl<P: SecretProvider> TenantScopedSecrets<P>
impl<P: SecretProvider> TenantScopedSecrets<P>
Sourcepub fn read(
&self,
tenant: &TenantId,
key: &str,
) -> Result<Option<String>, ServerError>
pub fn read( &self, tenant: &TenantId, key: &str, ) -> Result<Option<String>, ServerError>
Reads tenant secret.
§Examples
use http_handle::tenant_isolation::{StaticSecretProvider, TenantId, TenantScopedSecrets};
let s = TenantScopedSecrets::new(StaticSecretProvider::default());
let _ = s.read(&TenantId("acme".into()), "token");
assert_eq!(1, 1);§Errors
Returns provider-specific errors for secret lookup failures.
§Panics
This function does not panic.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for TenantScopedSecrets<P>where
P: Freeze,
impl<P> RefUnwindSafe for TenantScopedSecrets<P>where
P: RefUnwindSafe,
impl<P> Send for TenantScopedSecrets<P>
impl<P> Sync for TenantScopedSecrets<P>
impl<P> Unpin for TenantScopedSecrets<P>where
P: Unpin,
impl<P> UnsafeUnpin for TenantScopedSecrets<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for TenantScopedSecrets<P>where
P: 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
Mutably borrows from an owned value. Read more