pub struct AwsRequest {Show 16 fields
pub service: String,
pub action: String,
pub region: String,
pub account_id: String,
pub request_id: String,
pub headers: HeaderMap,
pub query_params: HashMap<String, String>,
pub body: Bytes,
pub body_stream: Mutex<Option<RequestBodyStream>>,
pub path_segments: Vec<String>,
pub raw_path: String,
pub raw_query: String,
pub method: Method,
pub is_query_protocol: bool,
pub access_key_id: Option<String>,
pub principal: Option<Principal>,
}Expand description
A parsed AWS request.
Fields§
§service: String§action: String§region: String§account_id: String§request_id: String§headers: HeaderMap§query_params: HashMap<String, String>§body: BytesBuffered request body. For streaming routes this is Bytes::new()
and the raw body is available via AwsRequest::take_body_stream.
body_stream: Mutex<Option<RequestBodyStream>>Raw streaming body, populated only for streaming routes. Wrapped
in a Mutex so the per-service handler can .take() ownership
behind the shared &AwsRequest reference threaded through the
call chain.
path_segments: Vec<String>§raw_path: StringThe raw URI path, before splitting into segments.
raw_query: StringThe raw URI query string (everything after ?), preserving repeated keys.
method: Method§is_query_protocol: boolWhether this request came via Query (form-encoded) or JSON protocol.
access_key_id: Option<String>The access key ID from the SigV4 Authorization header, if present.
principal: Option<Principal>The resolved caller identity. None when the credential is unknown
or the caller used the reserved root-bypass credentials. Populated
by dispatch via the configured crate::auth::CredentialResolver
so service handlers can make identity-based decisions (e.g.
GetCallerIdentity, IAM enforcement) without re-parsing the
Authorization header.
Implementations§
Source§impl AwsRequest
impl AwsRequest
Sourcepub fn json_body(&self) -> Value
pub fn json_body(&self) -> Value
Parse the request body as JSON, returning Value::Null on failure.
Sourcepub fn take_body_stream(&self) -> Option<RequestBodyStream>
pub fn take_body_stream(&self) -> Option<RequestBodyStream>
Consume the streaming body if this request was dispatched as
streaming. Returns None for buffered requests; the buffered
body is available via AwsRequest::body. Calling this twice
returns None on the second call.