pub enum Secret {
Value(String),
Env(String),
}Expand description
A value resolved at runtime: either a literal baked into the config or a
reference to an environment variable read when the pipeline runs. Deferring
resolution is what lets a compiled config travel without its secrets — a
literal is carried as-is, an Env reference carries only the
variable name, and the real value is read in the environment that runs it.
Serialized exactly as it is written in flusso.toml: a plain string for a
literal, { env = "VAR" } for a reference. The Deserialize is hand-written
(not #[serde(untagged)]) so a wrong shape reports what was expected instead
of serde’s opaque “data did not match any variant”.
Variants§
Value(String)
A literal value, stored verbatim.
Env(String)
Read from this environment variable at resolution time.
Implementations§
Source§impl Secret
impl Secret
Sourcepub fn env(var: impl Into<String>) -> Self
pub fn env(var: impl Into<String>) -> Self
A reference to the environment variable var, read at resolution time.
Sourcepub fn resolve(&self, override_var: &str) -> Result<String, ResolveError>
pub fn resolve(&self, override_var: &str) -> Result<String, ResolveError>
Resolve a required secret with override_var as its deployment
override (see override_var). Precedence: an
explicit Env reference names its own source and wins; otherwise the
override variable, if set; otherwise the literal.
Sourcepub fn resolve_optional(
secret: Option<&Secret>,
override_var: &str,
) -> Result<Option<String>, ResolveError>
pub fn resolve_optional( secret: Option<&Secret>, override_var: &str, ) -> Result<Option<String>, ResolveError>
Resolve an optional secret: same precedence as resolve,
and when the config omits it the override variable fills it if set.
Trait Implementations§
Source§impl Debug for Secret
Redacted, so a debug-printed config never leaks a literal. An Env reference
shows its variable name (not a secret); a literal shows ***.
impl Debug for Secret
Redacted, so a debug-printed config never leaks a literal. An Env reference
shows its variable name (not a secret); a literal shows ***.
Source§impl<'de> Deserialize<'de> for Secret
impl<'de> Deserialize<'de> for Secret
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for Secret
Source§impl JsonSchema for Secret
A secret is a string or { env = "VAR" }; the schema says so and plants the
SECRET_MARKER so an adapter description can list its override variable.
impl JsonSchema for Secret
A secret is a string or { env = "VAR" }; the schema says so and plants the
SECRET_MARKER so an adapter description can list its override variable.
Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for Secret
Auto Trait Implementations§
impl Forget for Secret
impl Freeze for Secret
impl Move for Secret
impl RefUnwindSafe for Secret
impl Send for Secret
impl Sync for Secret
impl Unpin for Secret
impl UnsafeUnpin for Secret
impl UnwindSafe for Secret
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.