1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-09 04:22:45 +03:00

graphql: Always make the associated SSO login available in compatibility sessions

This commit is contained in:
Quentin Gliech
2023-08-29 15:52:56 +02:00
parent ba98b7c448
commit 1849b86a7d
7 changed files with 180 additions and 19 deletions

View File

@@ -122,6 +122,22 @@ pub trait CompatSsoLoginRepository: Send + Sync {
/// Returns [`Self::Error`] if the underlying repository fails
async fn lookup(&mut self, id: Ulid) -> Result<Option<CompatSsoLogin>, Self::Error>;
/// Find a compat SSO login by its session
///
/// Returns the compat SSO login if it exists, `None` otherwise
///
/// # Parameters
///
/// * `session`: The session of the compat SSO login to lookup
///
/// # Errors
///
/// Returns [`Self::Error`] if the underlying repository fails
async fn find_for_session(
&mut self,
session: &CompatSession,
) -> Result<Option<CompatSsoLogin>, Self::Error>;
/// Find a compat SSO login by its login token
///
/// Returns the compat SSO login if found, `None` otherwise
@@ -232,6 +248,11 @@ pub trait CompatSsoLoginRepository: Send + Sync {
repository_impl!(CompatSsoLoginRepository:
async fn lookup(&mut self, id: Ulid) -> Result<Option<CompatSsoLogin>, Self::Error>;
async fn find_for_session(
&mut self,
session: &CompatSession,
) -> Result<Option<CompatSsoLogin>, Self::Error>;
async fn find_by_token(
&mut self,
login_token: &str,