1use std::time::Duration;
2
3use crate::ClaimName;
4
5pub const VERSION: &str = "1.0";
6pub const MEDIA_TYPE: &str = "application/aep+json";
7pub const PROBLEM_MEDIA_TYPE: &str = "application/problem+json";
8pub const AUTHORIZATION_SCHEME: &str = "AEP";
9pub const AUTHORIZATION_HEADER: &str = "AEP-Authorization";
10pub const WELL_KNOWN_PATH: &str = "/.well-known/aep";
11pub const DEFAULT_HTTP_ENDPOINT_BASE: &str = "/aep/";
12pub const MAX_AUTHENTICATION_METHODS: usize = 16;
13pub const MAX_ASSERTION_LIFETIME: Duration = Duration::from_secs(300);
14pub const RECOMMENDED_CLOCK_SKEW: Duration = Duration::from_secs(30);
15pub const DEFAULT_INSPECT_FRESHNESS: Duration = Duration::from_secs(300);
16pub const MINIMUM_IDEMPOTENCY_TTL: Duration = Duration::from_secs(3600);
17
18pub fn registered_claims() -> Vec<ClaimName> {
19 vec![
20 ClaimName::ContactAddressPrimary,
21 ClaimName::ContactEmail,
22 ClaimName::ContactMobile,
23 ClaimName::PersonBirthdate,
24 ClaimName::PersonFirstName,
25 ClaimName::PersonLastName,
26 ClaimName::PersonUsername,
27 ]
28}
29
30#[cfg(test)]
31mod tests {
32 use super::*;
33
34 #[test]
35 fn lists_each_registered_claim() {
36 let claims = registered_claims();
37 assert_eq!(claims.len(), 7);
38 assert!(claims.contains(&ClaimName::ContactAddressPrimary));
39 }
40}