pub struct EnvAllowlist { /* private fields */ }Expand description
The environment variables a deployed agent config is permitted to reference
via ${VAR} — least privilege over the deploying process’s secrets.
Without this, any config the control plane accepts can name any variable the
control-plane process holds (description = "${AWS_SECRET_ACCESS_KEY}") and
have it expanded into the agent’s card, where anyone who can fetch the card
reads it back. The allowlist is the operator’s explicit statement of which
secrets the platform is willing to hand to agents.
Deny-by-default: deny_all is the Default, so a
runtime built without an explicit allowlist rejects every config that
references anything. Populate it at the composition edge (the --allow-env
flag on a2a control-plane).
Implementations§
Source§impl EnvAllowlist
impl EnvAllowlist
Sourcepub fn new(vars: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn new(vars: impl IntoIterator<Item = impl Into<String>>) -> Self
Allow exactly these variable names.
Sourcepub fn deny_all() -> Self
pub fn deny_all() -> Self
Allow nothing — any ${VAR} reference in a deployed config is rejected.
Sourcepub fn check(&self, raw_config: &str) -> Result<Vec<String>, RuntimeError>
pub fn check(&self, raw_config: &str) -> Result<Vec<String>, RuntimeError>
Check a raw, unexpanded config against the allowlist, returning the variables it legitimately references (in sorted order) for a runtime to inject.
Call this before parsing the config. Expansion resolves ${VAR}
against the host environment and errors differently for a set vs. unset
variable, so parsing first would let a rejected config probe which
secrets the control-plane process holds.
HOST is excluded from the result and exempt from the check: it is
adapter-owned (the container runtime sets HOST=0.0.0.0 itself).
Trait Implementations§
Source§impl Clone for EnvAllowlist
impl Clone for EnvAllowlist
Source§impl Debug for EnvAllowlist
impl Debug for EnvAllowlist
Auto Trait Implementations§
impl Freeze for EnvAllowlist
impl RefUnwindSafe for EnvAllowlist
impl Send for EnvAllowlist
impl Sync for EnvAllowlist
impl Unpin for EnvAllowlist
impl UnsafeUnpin for EnvAllowlist
impl UnwindSafe for EnvAllowlist
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more