pub struct Coordinate {
pub scope: Scope,
pub environment: EnvSegment,
pub component: String,
pub key: String,
pub half: KeyHalf,
}Expand description
A parsed, canonical secret coordinate. Carries only the address — never a
value (I6: the command line carries the coordinate, the value enters
separately as a crate::SecretValue).
Fields§
§scope: ScopeOverride scope.
environment: EnvSegmentEnvironment segment (literal or ${ENV}).
component: StringComponent segment.
key: StringKey segment.
half: KeyHalfKeypair half selector (#public/#private). KeyHalf::Unspecified
for a plain coordinate; meaningful only for the Keypair modality.
Implementations§
Source§impl Coordinate
impl Coordinate
Sourcepub fn canonical_path(&self) -> Result<String, CoreError>
pub fn canonical_path(&self) -> Result<String, CoreError>
The canonical storage path <env>/<component>/<key> — the address a
secret is filed under on disk. The scope selector is a resolution
concern (which vault to read), never stored, so it is excluded here:
secret:prod/db/pw and secret://global/prod/db/pw map to the same
path in whichever vault is chosen.
Fails for an unresolved ${ENV} placeholder — placeholders are
substituted at resolution time (L4); only concrete coordinates are
storable.
Sourcepub fn with_env(&self, env: &str) -> Coordinate
pub fn with_env(&self, env: &str) -> Coordinate
Substitute the ${ENV} placeholder with a concrete environment, for
resolution at launch (spec §4.2/§4.3). A coordinate whose environment is
already literal is returned unchanged; only the Placeholder is replaced.
Sourcepub fn storage_id(&self) -> Result<String, CoreError>
pub fn storage_id(&self) -> Result<String, CoreError>
The opaque on-disk record id: lowercase-hex BLAKE3(canonical_path)
(ADR-0001 §A.1). Hashing the coordinate keeps the address off disk as a
filename while giving an O(1) point lookup. Inherits the placeholder
rejection from Coordinate::canonical_path.
Trait Implementations§
Source§impl Clone for Coordinate
impl Clone for Coordinate
Source§fn clone(&self) -> Coordinate
fn clone(&self) -> Coordinate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Coordinate
impl Debug for Coordinate
Source§impl Display for Coordinate
impl Display for Coordinate
impl Eq for Coordinate
Source§impl FromStr for Coordinate
impl FromStr for Coordinate
Source§impl PartialEq for Coordinate
impl PartialEq for Coordinate
Source§fn eq(&self, other: &Coordinate) -> bool
fn eq(&self, other: &Coordinate) -> bool
self and other values to be equal, and is used by ==.