Add a way to discover the GraphQL endpoint in the .well-known/openid-configuration

This adds a `org.matrix.matrix-authentication-service.graphql_endpoint` key to it
This commit is contained in:
Quentin Gliech
2023-09-18 19:19:39 +02:00
parent 4329c00087
commit 20d7770011
4 changed files with 40 additions and 4 deletions

View File

@@ -692,3 +692,17 @@ impl Route for StaticAsset {
format!("/assets/{}", self.path).into()
}
}
/// `GET|POST /graphql`
pub struct GraphQL;
impl SimpleRoute for GraphQL {
const PATH: &'static str = "/graphql";
}
/// `GET /graphql/playground`
pub struct GraphQLPlayground;
impl SimpleRoute for GraphQLPlayground {
const PATH: &'static str = "/graphql/playground";
}

View File

@@ -121,6 +121,12 @@ impl UrlBuilder {
&self.assets_base
}
/// GraphQL endpoint
#[must_use]
pub fn graphql_endpoint(&self) -> Url {
self.url_for(&crate::endpoints::GraphQL)
}
/// Upstream redirect URI
#[must_use]
pub fn upstream_oauth_callback(&self, id: Ulid) -> Url {