1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-06 06:02:40 +03:00

Implement the device code authorisation request

This commit is contained in:
Quentin Gliech
2023-12-07 17:59:35 +01:00
parent 286fc57103
commit 50654d2e40
8 changed files with 256 additions and 8 deletions

View File

@@ -376,32 +376,32 @@ pub const DEFAULT_DEVICE_AUTHORIZATION_INTERVAL_SECONDS: i64 = 5;
#[derive(Serialize, Deserialize, Clone, PartialEq, Eq)]
pub struct DeviceAuthorizationResponse {
/// The device verification code.
device_code: String,
pub device_code: String,
/// The end-user verification code.
user_code: String,
pub user_code: String,
/// The end-user verification URI on the authorization server.
///
/// The URI should be short and easy to remember as end users will be asked
/// to manually type it into their user agent.
verification_uri: Url,
pub verification_uri: Url,
/// A verification URI that includes the `user_code` (or other information
/// with the same function as the `user_code`), which is designed for
/// non-textual transmission.
verification_uri_complete: Option<Url>,
pub verification_uri_complete: Option<Url>,
/// The lifetime of the `device_code` and `user_code`.
#[serde_as(as = "DurationSeconds<i64>")]
expires_in: Duration,
pub expires_in: Duration,
/// The minimum amount of time in seconds that the client should wait
/// between polling requests to the token endpoint.
///
/// Defaults to [`DEFAULT_DEVICE_AUTHORIZATION_INTERVAL_SECONDS`].
#[serde_as(as = "Option<DurationSeconds<i64>>")]
interval: Option<Duration>,
pub interval: Option<Duration>,
}
impl DeviceAuthorizationResponse {