pub enum SecretAccess {
AllowAny,
Workloads(Vec<WorkloadMatch>),
Recipes(Vec<RecipeMatch>),
}Expand description
Who may be served a given cluster secret.
Stored alongside the ciphertext (yubaba’s SecretRecord) so the check rides
on the record itself and is evaluated on the node at mount time — a rule
checked only by the tool that authors a deploy is a lint, not a rule.
Default is Workloads(vec![]), which admits nobody. That is what makes
the migration fail closed: a record serialized before this field existed
deserializes (via #[serde(default)]) to an empty allow-list and is refused,
rather than being implicitly granted to everyone.
Variants§
AllowAny
Deliberately unrestricted: any workload that names this secret gets it.
This is the explicit escape hatch, never an implicit one. It has to be
written into the record by whoever put the secret there, and it shows up
in yah cloud secret ls as allow-any, so an unrestricted secret is an
auditable choice rather than the silent default.
Workloads(Vec<WorkloadMatch>)
Only workloads matching one of these entries. An empty list admits nobody — see the type-level note on fail-closed defaulting.
Recipes(Vec<RecipeMatch>)
Only runs of one of these signed recipes (R555-F5 / W235 §(c)).
The rule a dispatched build needs: its workload name is a per-run
forge-<uuid> that no allow-list can name in advance, so
SecretAccess::Workloads cannot express “the rusty-v8-musl build may
read the R2 write key” and SecretAccess::AllowAny over-answers it by
handing that key to anything that can reach the node.
Matching consumes a RecipeIdentity that only exists on the far side
of a verified Ed25519 grant, so this is narrower than the workload
rule, not a loophole in it: the requester has to be running argv the
recipe author signed, on a node that pins the author’s key.
Implementations§
Source§impl SecretAccess
impl SecretAccess
Sourcepub fn workloads<I, S>(names: I) -> Self
pub fn workloads<I, S>(names: I) -> Self
Allow exactly the named workloads, in the singleton tenant/namespace.
Sourcepub fn recipes<I, N, K>(entries: I) -> Self
pub fn recipes<I, N, K>(entries: I) -> Self
Whether consumer may be served the secret this rule guards.
Allow exactly the named recipes, each signed by the given hex key.
pub fn admits(&self, consumer: &SecretConsumer) -> bool
Trait Implementations§
Source§impl Clone for SecretAccess
impl Clone for SecretAccess
Source§fn clone(&self) -> SecretAccess
fn clone(&self) -> SecretAccess
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 SecretAccess
impl Debug for SecretAccess
Source§impl Default for SecretAccess
impl Default for SecretAccess
Source§impl<'de> Deserialize<'de> for SecretAccess
impl<'de> Deserialize<'de> for SecretAccess
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 SecretAccess
Source§impl PartialEq for SecretAccess
impl PartialEq for SecretAccess
Source§impl Serialize for SecretAccess
impl Serialize for SecretAccess
impl StructuralPartialEq for SecretAccess
Auto Trait Implementations§
impl Freeze for SecretAccess
impl RefUnwindSafe for SecretAccess
impl Send for SecretAccess
impl Sync for SecretAccess
impl Unpin for SecretAccess
impl UnsafeUnpin for SecretAccess
impl UnwindSafe for SecretAccess
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.