Implement SSO/OIDC support. (closes #7)

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk committed 2025-12-26 07:24:49 +00:00
1 parent d665a34f30
commit 11309062a2
23 files changed
+1959 -27

No files matched your search

+5
View File
@@ -1,6 +1,7 @@
use std::{fmt::Debug, mem, ops::Deref};
use axum::{body::Body, extract::FromRequest};
use axum_extra::extract::cookie::CookieJar;
use bytes::{BufMut, Bytes, BytesMut};
use ruma::{
CanonicalJsonObject, CanonicalJsonValue, DeviceId, OwnedDeviceId, OwnedServerName,
@@ -18,6 +19,9 @@ pub(crate) struct Args<T> {
/// Request struct body
pub(crate) body: T,
/// Cookies received from the useragent.
pub(crate) cookie: CookieJar,
/// Federation server authentication: X-Matrix origin
/// None when not a federation server.
pub(crate) origin: Option<OwnedServerName>,
@@ -110,6 +114,7 @@ where
let auth = auth::auth(services, &mut request, json_body.as_ref(), &T::METADATA).await?;
Ok(Self {
body: make_body::<T>(services, &mut request, json_body.as_mut(), &auth)?,
cookie: request.cookie,
origin: auth.origin,
sender_user: auth.sender_user,
sender_device: auth.sender_device,