Skip to content

Commit

Permalink
Add leeway for bridge token validation
Browse files Browse the repository at this point in the history
  • Loading branch information
CBenoit committed Jul 28, 2021
1 parent cca926f commit abe9b1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion devolutions-gateway/src/http/controllers/http_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl HttpBridgeController {
.duration_since(UNIX_EPOCH)
.expect("UNIX EPOCH is in the past")
.as_secs();
let date = jwt::JwtDate::new(i64::try_from(numeric_date).unwrap());
let date = jwt::JwtDate::new_with_leeway(i64::try_from(numeric_date).unwrap(), 60);
let validator = jwt::JwtValidator::strict(&date);

let jws = jwt::JwtSig::decode(token_str, key, &validator).map_err(|e| (StatusCode::FORBIDDEN, e))?;
Expand Down

0 comments on commit abe9b1b

Please sign in to comment.