1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

WIP: upstream OIDC provider support

This commit is contained in:
Quentin Gliech
2022-11-22 18:28:16 +01:00
parent 7f9be07e8d
commit bedcf44741
28 changed files with 1505 additions and 96 deletions

View File

@@ -524,6 +524,52 @@ impl Route for CompatLoginSsoComplete {
}
}
/// `GET /upstream/authorize/:id`
pub struct UpstreamOAuth2Authorize {
id: Ulid,
}
impl UpstreamOAuth2Authorize {
#[must_use]
pub const fn new(id: Ulid) -> Self {
Self { id }
}
}
impl Route for UpstreamOAuth2Authorize {
type Query = ();
fn route() -> &'static str {
"/upstream/authorize/:provider_id"
}
fn path(&self) -> std::borrow::Cow<'static, str> {
format!("/upstream/authorize/{}", self.id).into()
}
}
/// `GET /upstream/callback/:id`
pub struct UpstreamOAuth2Callback {
id: Ulid,
}
impl UpstreamOAuth2Callback {
#[must_use]
pub const fn new(id: Ulid) -> Self {
Self { id }
}
}
impl Route for UpstreamOAuth2Callback {
type Query = ();
fn route() -> &'static str {
"/upstream/callback/:provider_id"
}
fn path(&self) -> std::borrow::Cow<'static, str> {
format!("/upstream/callback/{}", self.id).into()
}
}
/// `GET /assets`
pub struct StaticAsset {
path: String,