pub struct SecretRef {
pub name: String,
pub description: Option<String>,
pub backend: BackendKind,
pub generation: Option<SecretGenPolicy>,
pub rotation: RotationPolicy,
pub labels: Vec<String>,
}Fields§
§name: StringLogical identifier — used by humans + inventories. Slug-shape
([a-z0-9-]+). Validators reject anything else.
description: Option<String>Optional human-readable description. Renders into the inventory
- plan, never into the secret value itself.
backend: BackendKindWhere the materialized secret lives.
generation: Option<SecretGenPolicy>How the secret is born. None ⇒ cofre never generates this
secret (operator owns its lifecycle); cofre may still verify
existence via cofre verify.
rotation: RotationPolicyWhen the secret should be rotated.
labels: Vec<String>Free-form labels — used for filtering + grouping in cofre plan.
Implementations§
Source§impl SecretRef
impl SecretRef
Sourcepub fn materialization_targets(&self) -> Vec<String>
pub fn materialization_targets(&self) -> Vec<String>
Returns the list of concrete backend paths this ref materializes.
For a singleton policy: [self.backend.stable_id()]. For
keypair policies: two suffixed paths.
Source§impl SecretRef
impl SecretRef
Sourcepub fn password(
name: impl Into<String>,
backend: BackendKind,
length: u8,
) -> Self
pub fn password( name: impl Into<String>, backend: BackendKind, length: u8, ) -> Self
A vanilla random alphanumeric password, no length cap, manual rotation.
Sourcepub fn capped_password(
name: impl Into<String>,
backend: BackendKind,
length: u8,
max_length: u8,
) -> Self
pub fn capped_password( name: impl Into<String>, backend: BackendKind, length: u8, max_length: u8, ) -> Self
A capped password — for protocols with hard length limits (e.g. macOS legacy VNC at 16 chars).
Sourcepub fn with_rotation(self, r: RotationPolicy) -> Self
pub fn with_rotation(self, r: RotationPolicy) -> Self
Builder helper.
Sourcepub fn with_description(self, d: impl Into<String>) -> Self
pub fn with_description(self, d: impl Into<String>) -> Self
Builder helper.
Sourcepub fn with_labels(self, labels: Vec<String>) -> Self
pub fn with_labels(self, labels: Vec<String>) -> Self
Builder helper.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SecretRef
impl<'de> Deserialize<'de> for SecretRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SecretRef
impl StructuralPartialEq for SecretRef
Auto Trait Implementations§
impl Freeze for SecretRef
impl RefUnwindSafe for SecretRef
impl Send for SecretRef
impl Sync for SecretRef
impl Unpin for SecretRef
impl UnsafeUnpin for SecretRef
impl UnwindSafe for SecretRef
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.