Skip to content

Commit

Permalink
Remove max expiration field
Browse files Browse the repository at this point in the history
  • Loading branch information
augustuswm committed Nov 28, 2023
1 parent cc59c59 commit 639b041
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
3 changes: 0 additions & 3 deletions rfd-api/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ database_url = ""
# Duration that a JWT is valid for
default_expiration = 3600

# Deprecated: To be removed
max_expiration = 1209600

# Keys for signing JWTs and generating secrets. Currently GCP Cloud KMS keys and local static keys
# are supported

Expand Down
1 change: 0 additions & 1 deletion rfd-api/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ impl<'de> Deserialize<'de> for ServerLogFormat {
#[derive(Debug, Default, Deserialize)]
pub struct JwtConfig {
pub default_expiration: i64,
pub max_expiration: i64,
}

#[derive(Debug, Deserialize)]
Expand Down
7 changes: 0 additions & 7 deletions rfd-api/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ pub struct ApiContext {

pub struct JwtContext {
pub default_expiration: i64,
pub max_expiration: i64,
// pub signers: Vec<Box<dyn JwtSigner<Claims = Claims>>>,
pub signers: Vec<JwtSigner>,
pub jwks: JwkSet,
}
Expand Down Expand Up @@ -233,7 +231,6 @@ impl ApiContext {
},
jwt: JwtContext {
default_expiration: jwt.default_expiration,
max_expiration: jwt.max_expiration,
jwks: JwkSet {
keys: jwt_signers.iter().map(|k| k.jwk()).cloned().collect(),
},
Expand Down Expand Up @@ -284,10 +281,6 @@ impl ApiContext {
self.jwt.default_expiration
}

pub fn max_jwt_expiration(&self) -> i64 {
self.jwt.max_expiration
}

pub async fn jwks(&self) -> &JwkSet {
&self.jwt.jwks
}
Expand Down
2 changes: 0 additions & 2 deletions rfd-api/src/endpoints/login/oauth/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,6 @@ pub async fn authz_code_exchange(
.map(|s| s.to_string())
.collect::<Vec<_>>();

// Generate a new access token for the user with an expiration matching the value given to us
// by the remote service
let token = ctx
.register_access_token(&api_user, &api_user_provider, scope)
.await?;
Expand Down

0 comments on commit 639b041

Please sign in to comment.