1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +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

@@ -695,6 +695,13 @@ pub struct DeviceCodeLink {
code: Option<String>,
}
impl DeviceCodeLink {
#[must_use]
pub fn with_code(code: String) -> Self {
Self { code: Some(code) }
}
}
impl Route for DeviceCodeLink {
type Query = DeviceCodeLink;
fn route() -> &'static str {
@@ -706,6 +713,14 @@ impl Route for DeviceCodeLink {
}
}
/// `POST /oauth2/device`
#[derive(Default, Serialize, Deserialize, Debug, Clone)]
pub struct OAuth2DeviceAuthorizationEndpoint;
impl SimpleRoute for OAuth2DeviceAuthorizationEndpoint {
const PATH: &'static str = "/oauth2/device";
}
/// `GET /assets`
pub struct StaticAsset {
path: String,