Skip to main content

ConditionContext

Struct ConditionContext 

Source
pub struct ConditionContext {
Show 14 fields pub aws_username: Option<String>, pub aws_userid: Option<String>, pub aws_principal_arn: Option<String>, pub aws_principal_account: Option<String>, pub aws_principal_type: Option<String>, pub aws_source_ip: Option<IpAddr>, pub aws_current_time: Option<DateTime<Utc>>, pub aws_epoch_time: Option<i64>, pub aws_secure_transport: Option<bool>, pub aws_requested_region: Option<String>, pub service_keys: BTreeMap<String, Vec<String>>, pub resource_tags: Option<HashMap<String, String>>, pub request_tags: Option<HashMap<String, String>>, pub principal_tags: Option<HashMap<String, String>>,
}
Expand description

Request-time values consulted when a policy statement carries a Condition block. Populated at dispatch time from the resolved Principal and the incoming HTTP request, then handed to IamPolicyEvaluator::evaluate.

Lives in fakecloud-core (not fakecloud-iam) so the trait can reference it without creating a circular crate dependency. All fields are optional — a missing field means the key wasn’t knowable at dispatch time, and any operator that references it safe-fails to false (unless the operator carries the IfExists suffix, in which case it evaluates to true, matching AWS).

The service_keys map is reserved for service-specific condition keys (s3:prefix, sqs:MessageAttribute, …) which Phase 2 ships empty; service-specific support lands in a follow-up batch without a signature change.

Fields§

§aws_username: Option<String>

aws:username — username segment of an IAM user ARN, or None for assumed roles / federated users where AWS does not set the key.

§aws_userid: Option<String>

aws:userid — the unique AIDA.../AROA... identifier.

§aws_principal_arn: Option<String>

aws:PrincipalArn — full principal ARN.

§aws_principal_account: Option<String>

aws:PrincipalAccount — 12-digit account ID sourced from the credential, not global config (#381 multi-account alignment).

§aws_principal_type: Option<String>

aws:PrincipalType"User", "AssumedRole", etc.

§aws_source_ip: Option<IpAddr>

aws:SourceIp — remote address of the HTTP connection.

§aws_current_time: Option<DateTime<Utc>>

aws:CurrentTime — evaluation timestamp (UTC).

§aws_epoch_time: Option<i64>

aws:EpochTime — same moment as aws_current_time in seconds since the Unix epoch.

§aws_secure_transport: Option<bool>

aws:SecureTransporttrue iff the request came in over TLS.

§aws_requested_region: Option<String>

aws:RequestedRegion — region extracted from SigV4 / config.

§service_keys: BTreeMap<String, Vec<String>>

Service-specific keys (s3:prefix, sqs:MessageAttribute, …).

§resource_tags: Option<HashMap<String, String>>

aws:ResourceTag/<key> — tags on the target resource. Populated by crate::service::AwsService::resource_tags_for. None means the service doesn’t expose resource tags for ABAC.

§request_tags: Option<HashMap<String, String>>

aws:RequestTag/<key> — tags sent in the request body/headers. Populated by crate::service::AwsService::request_tags_from. Also drives aws:TagKeys (the list of request tag keys).

§principal_tags: Option<HashMap<String, String>>

aws:PrincipalTag/<key> — tags on the calling IAM user or role. Populated from Principal::tags at dispatch time.

Implementations§

Source§

impl ConditionContext

Source

pub fn lookup(&self, key: &str) -> Option<Vec<String>>

Resolve a condition key (e.g. "aws:username") to the list of context values. Returns None if the key is not populated. Key names are matched case-insensitively — AWS treats aws:username and AWS:UserName as the same key.

Trait Implementations§

Source§

impl Clone for ConditionContext

Source§

fn clone(&self) -> ConditionContext

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConditionContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ConditionContext

Source§

fn default() -> ConditionContext

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,