1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Add loads of server metadata in the discovery document

This commit is contained in:
Quentin Gliech
2022-01-11 12:54:26 +01:00
parent b4f0f0d0be
commit 97ab75fb15
2 changed files with 132 additions and 30 deletions

View File

@ -23,6 +23,21 @@ use crate::{
requests::{ClientAuthenticationMethod, Display, GrantType, ResponseMode},
};
#[derive(Serialize, Clone, Copy, PartialEq, Eq, Hash)]
#[serde(rename_all = "lowercase")]
pub enum SubjectType {
Public,
Pairwise,
}
#[derive(Serialize, Clone, Copy, PartialEq, Eq, Hash)]
#[serde(rename_all = "lowercase")]
pub enum ClaimType {
Normal,
Aggregated,
Distributed,
}
#[derive(Serialize, Clone, Copy, PartialEq, Eq, Hash)]
#[serde(rename_all = "UPPERCASE")]
pub enum SigningAlgorithm {
@ -146,7 +161,7 @@ pub struct Metadata {
/// JSON array containing a list of the Subject Identifier types that this
/// OP supports.
pub subject_types_supported: Option<HashSet<String>>,
pub subject_types_supported: Option<HashSet<SubjectType>>,
/// JSON array containing a list of the JWS "alg" values supported by the OP
/// for the ID Token.
@ -194,10 +209,9 @@ pub struct Metadata {
/// OpenID Provider supports.
pub display_values_supported: Option<HashSet<Display>>,
// TODO: type
/// JSON array containing a list of the Claim Types that the OpenID Provider
/// supports.
pub claim_types_supported: Option<HashSet<String>>,
pub claim_types_supported: Option<HashSet<ClaimType>>,
/// JSON array containing a list of the Claim Names of the Claims that the
/// OpenID Provider MAY be able to supply values for.