pub struct SecretPath(/* private fields */);Expand description
A validated secret path.
Construct one through SecretPath::parse (or "...".parse() via
FromStr). The wrapped string is guaranteed to satisfy every rule
in ADR-020 §2 at construction time, and the type is the only way
the rest of the framework consumes a path.
Implementations§
Source§impl SecretPath
impl SecretPath
Sourcepub fn parse(s: &str) -> Result<Self, PathError>
pub fn parse(s: &str) -> Result<Self, PathError>
Validate s and return an owned SecretPath.
Equivalent to s.parse::<SecretPath>().
Sourcepub fn parse_internal(s: &str) -> Result<Self, PathError>
pub fn parse_internal(s: &str) -> Result<Self, PathError>
Like SecretPath::parse but accepts internally-reserved
prefixes (__*, _test).
This entry point is only for the framework’s own
consumers — for example, the source-credential resolver in
ADR-021 §5 reading paths under __sources/.... Production
code that takes a path from the user must call
SecretPath::parse instead.
Sourcepub fn scope(&self) -> &str
pub fn scope(&self) -> &str
The first segment — the scope (e.g. team, personal,
client-acme, sandbox, or one of the reserved prefixes when
the path was constructed via SecretPath::parse_internal).
Sourcepub fn provider(&self) -> &str
pub fn provider(&self) -> &str
The second segment — usually a provider name
(gitlab, github, openai, …).
Sourcepub fn purpose(&self) -> &str
pub fn purpose(&self) -> &str
The third segment — usually a per-credential purpose
(token-deploy, pat, api-key, …).
Paths longer than three segments preserve the rest as part of
the purpose string returned here (joined with /).
Sourcepub fn segments(&self) -> impl Iterator<Item = &str>
pub fn segments(&self) -> impl Iterator<Item = &str>
Iterate over the path’s /-separated segments.
Sourcepub fn is_internal(&self) -> bool
pub fn is_internal(&self) -> bool
true if the path is in one of the reserved framework
namespaces (__* or _test/*). User-facing surfaces hide
such paths by default; see ADR-020 §2 and ADR-021 §5.
Trait Implementations§
Source§impl AsRef<str> for SecretPath
impl AsRef<str> for SecretPath
Source§impl Clone for SecretPath
impl Clone for SecretPath
Source§fn clone(&self) -> SecretPath
fn clone(&self) -> SecretPath
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 SecretPath
impl Debug for SecretPath
Source§impl<'de> Deserialize<'de> for SecretPath
impl<'de> Deserialize<'de> for SecretPath
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for SecretPath
impl Display for SecretPath
impl Eq for SecretPath
Source§impl FromStr for SecretPath
impl FromStr for SecretPath
Source§impl Hash for SecretPath
impl Hash for SecretPath
Source§impl Ord for SecretPath
impl Ord for SecretPath
Source§fn cmp(&self, other: &SecretPath) -> Ordering
fn cmp(&self, other: &SecretPath) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SecretPath
impl PartialEq for SecretPath
Source§fn eq(&self, other: &SecretPath) -> bool
fn eq(&self, other: &SecretPath) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for SecretPath
impl PartialOrd for SecretPath
Source§impl Serialize for SecretPath
impl Serialize for SecretPath
impl StructuralPartialEq for SecretPath
Auto Trait Implementations§
impl Freeze for SecretPath
impl RefUnwindSafe for SecretPath
impl Send for SecretPath
impl Sync for SecretPath
impl Unpin for SecretPath
impl UnsafeUnpin for SecretPath
impl UnwindSafe for SecretPath
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.