pub struct ResourceBinding { /* private fields */ }Expand description
What an authorization grant was requested for, held until the code is redeemed.
The client builds one from the values it sent in the authorization request
and consults it before sending the token request. It is deliberately not
Copy and has no accessor that hands back a mutable vector: the point is
that what the grant is bound to cannot be edited between the two requests.
Implementations§
Source§impl ResourceBinding
impl ResourceBinding
Sourcepub fn bind(
model: &AuthorizationModel,
requested: ResourceParameters,
) -> Result<Self, ResourceIndicatorError>
pub fn bind( model: &AuthorizationModel, requested: ResourceParameters, ) -> Result<Self, ResourceIndicatorError>
Bind a grant to the resources an authorization request named.
§Errors
ResourceIndicatorError::Missing when the revision requires resource
indicators and the request named none. 2025-06-18 §4 makes this a
MUST on the client, so a caller cannot get a binding for one of
those revisions without naming a resource — the omission is not
representable rather than being checked later and forgotten.
Sourcepub const fn token_request(&self) -> &ResourceParameters
pub const fn token_request(&self) -> &ResourceParameters
The parameters the token request must carry.
RFC 8707 §2.1: in the code flow the requested resource is applicable to the full grant, so these repeat at redemption rather than being left behind in the authorization request.
Sourcepub fn matches_token_request(&self, offered: &ResourceParameters) -> bool
pub fn matches_token_request(&self, offered: &ResourceParameters) -> bool
Whether a token request still names what the grant was bound to.
false for a redemption that names a different resource, and also for
one that names none: omitting the parameter is how a client silently
asks for an unbounded token instead.