pub struct RequestContext {
pub account_id: String,
pub region: String,
pub service: String,
pub access_key: Option<String>,
pub request_id: String,
pub method: String,
pub uri: String,
pub event_bus: Option<EventBus>,
pub source_ip: Option<String>,
pub is_secure: bool,
}Expand description
Context extracted from an incoming AWS API request.
Contains the account ID, region, service, and request metadata needed by service handlers to process the request.
Fields§
§account_id: StringAWS account ID (default: “000000000000” in bypass mode)
region: StringAWS region (e.g., “us-east-1”)
service: StringService name extracted from the request
access_key: Option<String>Access key ID (if present in Authorization header)
request_id: StringUnique request ID for this API call
method: StringHTTP method of the original request
uri: StringURI path of the original request
event_bus: Option<EventBus>Internal event bus — present for requests routed through the gateway;
None in unit tests or any context where no bus was configured.
source_ip: Option<String>Source IP of the caller, if recoverable from X-Forwarded-For (or
any future axum-side wiring of ConnectInfo). Surfaced into
aws:SourceIp for IAM condition evaluation.
is_secure: boolWhether the original request reached us over TLS, recovered from
X-Forwarded-Proto when present. Surfaced as aws:SecureTransport.
Implementations§
Source§impl RequestContext
impl RequestContext
pub fn new(service: impl Into<String>, region: impl Into<String>) -> Self
Sourcepub fn new_with_account(
service: impl Into<String>,
region: impl Into<String>,
account_id: impl Into<String>,
) -> Self
pub fn new_with_account( service: impl Into<String>, region: impl Into<String>, account_id: impl Into<String>, ) -> Self
Like [new] but with an explicit account id — used by background
pollers that fan out across every (account, region) pair.
Sourcepub fn arn_prefix(&self, service: &str) -> String
pub fn arn_prefix(&self, service: &str) -> String
Returns an ARN prefix for this account and region. e.g., “arn:aws:s3:us-east-1:000000000000”
Trait Implementations§
Source§impl Clone for RequestContext
impl Clone for RequestContext
Source§fn clone(&self) -> RequestContext
fn clone(&self) -> RequestContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more