From 91ce8ff5fe03a858d5cb128c7239efac955f3c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 5 Sep 2022 10:22:17 +0200 Subject: [PATCH] Add Pushed Authorization Request response type --- crates/oauth2-types/src/requests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/oauth2-types/src/requests.rs b/crates/oauth2-types/src/requests.rs index 147afa1b..a85926f0 100644 --- a/crates/oauth2-types/src/requests.rs +++ b/crates/oauth2-types/src/requests.rs @@ -529,6 +529,24 @@ pub struct IntrospectionResponse { pub jti: Option, } +/// A successful response from the [Pushed Authorization Request Endpoint]. +/// +/// Note that there is no request type because it is by definition the same as +/// [`AuthorizationRequest`]. +/// +/// [Pushed Authorization Request Endpoint]: https://datatracker.ietf.org/doc/html/rfc9126 +#[serde_as] +#[skip_serializing_none] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] +pub struct PushedAuthorizationResponse { + /// The `request_uri` to use for the request to the authorization endpoint. + pub request_uri: String, + + /// The duration for which the request URI is valid. + #[serde_as(as = "DurationSeconds")] + pub expires_in: Duration, +} + #[cfg(test)] mod tests { use serde_json::json;