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

Log more errors and setup Sentry integration

This commit is contained in:
Quentin Gliech
2023-01-30 17:28:59 +01:00
parent 694e97e96c
commit 875025467e
37 changed files with 439 additions and 16 deletions

View File

@@ -72,6 +72,17 @@ pub enum Credentials {
}
impl Credentials {
/// Get the `client_id` of the credentials
#[must_use]
pub fn client_id(&self) -> &str {
match self {
Credentials::None { client_id }
| Credentials::ClientSecretBasic { client_id, .. }
| Credentials::ClientSecretPost { client_id, .. }
| Credentials::ClientAssertionJwtBearer { client_id, .. } => client_id,
}
}
pub async fn fetch<E>(
&self,
repo: &mut impl RepositoryAccess<Error = E>,
@@ -217,6 +228,14 @@ pub struct ClientAuthorization<F = ()> {
pub form: Option<F>,
}
impl<F> ClientAuthorization<F> {
/// Get the `client_id` from the credentials.
#[must_use]
pub fn client_id(&self) -> &str {
self.credentials.client_id()
}
}
#[derive(Debug)]
pub enum ClientAuthorizationError {
InvalidHeader,