pub struct SecretBuilder { /* private fields */ }Expand description
Fluent builder for a single SecretEntry.
ⓘ
SecretBuilder::new()
.env("OPENAI_API_KEY")
.value(api_key)
.allow_host("api.openai.com")
.build()Implementations§
Source§impl SecretBuilder
impl SecretBuilder
Sourcepub fn env(self, var: impl Into<String>) -> Self
pub fn env(self, var: impl Into<String>) -> Self
Set the environment variable to expose the placeholder as (required).
Sourcepub fn placeholder(self, placeholder: impl Into<String>) -> Self
pub fn placeholder(self, placeholder: impl Into<String>) -> Self
Set a custom placeholder string.
If not set, auto-generated as $MSB_<env_var>.
Sourcepub fn allow_host(self, host: impl Into<String>) -> Self
pub fn allow_host(self, host: impl Into<String>) -> Self
Add an allowed host (exact match).
Sourcepub fn allow_host_pattern(self, pattern: impl Into<String>) -> Self
pub fn allow_host_pattern(self, pattern: impl Into<String>) -> Self
Add an allowed host with wildcard pattern (e.g., *.openai.com).
Sourcepub fn allow_any_host_dangerous(self, i_understand_the_risk: bool) -> Self
pub fn allow_any_host_dangerous(self, i_understand_the_risk: bool) -> Self
Allow for any host. Dangerous: secret can be exfiltrated to any destination. Requires explicit acknowledgment.
Sourcepub fn require_tls_identity(self, enabled: bool) -> Self
pub fn require_tls_identity(self, enabled: bool) -> Self
Require verified TLS identity before substituting (default: true).
Sourcepub fn inject_headers(self, enabled: bool) -> Self
pub fn inject_headers(self, enabled: bool) -> Self
Configure header injection (default: true).
Sourcepub fn inject_basic_auth(self, enabled: bool) -> Self
pub fn inject_basic_auth(self, enabled: bool) -> Self
Configure Basic Auth injection (default: true).
Sourcepub fn inject_query(self, enabled: bool) -> Self
pub fn inject_query(self, enabled: bool) -> Self
Configure query parameter injection (default: false).
Sourcepub fn inject_body(self, enabled: bool) -> Self
pub fn inject_body(self, enabled: bool) -> Self
Configure body injection (default: false).
Sourcepub fn build(self) -> SecretEntry
pub fn build(self) -> SecretEntry
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SecretBuilder
impl RefUnwindSafe for SecretBuilder
impl Send for SecretBuilder
impl Sync for SecretBuilder
impl Unpin for SecretBuilder
impl UnsafeUnpin for SecretBuilder
impl UnwindSafe for SecretBuilder
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
Mutably borrows from an owned value. Read more