You've already forked authentication-service
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user