pub struct SecretRef {
pub from_store: Option<String>,
pub from_env: Option<String>,
pub from_file: Option<PathBuf>,
}Expand description
A reference to a secret. Exactly one of the three sources must be
populated; validation is performed by the host crate’s
validate_ref (policy lives where it’s enforced).
Round-trips through serde_json for persistence in the VM record DB
and in .smolmachine pack manifests. Refs are not sensitive; the
resolved plaintext is produced only at the workload launch site and
never touches any of these stores.
Fields§
§from_store: Option<String>Look up the secret by name in the host secret store.
from_env: Option<String>Read the secret from a host environment variable.
from_file: Option<PathBuf>Read the secret from a host file path (must be absolute).
Implementations§
Source§impl SecretRef
impl SecretRef
Sourcepub fn source_kind(&self) -> Option<SecretSourceKind>
pub fn source_kind(&self) -> Option<SecretSourceKind>
Return the source kind for this ref, if exactly one source is set.
Returns None for structurally invalid refs (0 or >1 sources).
Callers are expected to have already validated with the host
crate’s validate_ref before calling this; this function is
primarily for audit logging of a known-good ref.