feat: configurable validation (validation: iss, aud, exp, nbf, leeway) (fixes #1) (#4)

This commit is contained in:
cduvray 2023-02-26 20:30:55 +01:00 committed by GitHub
parent 28c7eedcd5
commit 683f932468
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 471 additions and 75 deletions

View file

@ -101,6 +101,7 @@ fn build_header(alg: Algorithm, kid: &str) -> Header {
struct Claims {
iss: &'static str,
sub: &'static str,
aud: &'static str,
exp: usize,
nbf: usize,
}
@ -110,6 +111,7 @@ pub async fn tokens() -> Json<Value> {
let claims = Claims {
iss: ISSUER_URI,
sub: "b@b.com",
aud: "aud1",
exp: 2000000000, // May 2033
nbf: 1516239022, // Jan 2018
};