pub struct SecretRef { /* private fields */ }Expand description
secret:<realm>/<name>. Deliberately a separate parser from Locator:
sharing the grammar would mean a read path could resolve a secret
(7.1’s type-level answer). Malformed shapes are E_CONFIG_INVALID.
Implementations§
Source§impl SecretRef
impl SecretRef
Sourcepub fn new(realm: &str, name: &str) -> Result<SecretRef, AxError>
pub fn new(realm: &str, name: &str) -> Result<SecretRef, AxError>
The one place a reference is built from its two segments, and so
the one place the grammar is spelled. Every writer of a vault
place calls this: a caller that assembled secret:<realm>/<name>
from a format string could name a place no reader resolves, and
the two spellings would drift the first time either is changed.
§Errors
E_CONFIG_INVALID when a segment is empty or carries a character
outside the reference alphabet.
Sourcepub fn parse(raw: &str) -> Result<SecretRef, AxError>
pub fn parse(raw: &str) -> Result<SecretRef, AxError>
Reads a reference back out of its text. Text that carries the
prefix and a / is handed to SecretRef::new, whose refusal
names this same text: the two halves of the grammar answer with
one error.
§Errors
E_CONFIG_INVALID for text that is not a reference.