Skip to main content

parse_credential_scope

Function parse_credential_scope 

Source
pub fn parse_credential_scope(input: &str) -> IResult<&str, (&str, &str)>
Expand description

Extract the (region, service) pair from a Credential=… scope string.

The credential scope has the form: <ACCESS_KEY>/<DATE>/<REGION>/<SERVICE>/aws4_request

Works whether the input starts directly at Credential= or has other text before it (e.g. a full Authorization: header value).

§Errors

Returns a nom parse error if Credential= is absent or the scope does not contain the mandatory /aws4_request trailer.