Skip to content

Commit

Permalink
Add a validation config that reflects we aren't setting metadata fiel…
Browse files Browse the repository at this point in the history
…ds when checking server token. Fixes crossbeam-rs#414
  • Loading branch information
chmanchester committed May 1, 2019
1 parent c1615ae commit 38f6592
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/bin/sccache-dist/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,16 @@ fn run(command: Command) -> Result<i32> {
if secret_key.len() != 256 / 8 {
bail!("Size of secret key incorrect")
}
let validation = jwt::Validation::new(jwt::Algorithm::HS256);
let validation = jwt::Validation {
leeway: 0,
validate_exp: false,
validate_iat: false,
validate_nbf: false,
aud: None,
iss: None,
sub: None,
algorithms: vec![jwt::Algorithm::HS256],
};
Box::new(move |server_token| {
check_jwt_server_token(server_token, &secret_key, &validation)
})
Expand Down

0 comments on commit 38f6592

Please sign in to comment.