[go: nahoru, domu]

Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Thomas <taylor@oftaylor.com>
  • Loading branch information
thomastaylor312 committed Oct 12, 2021
1 parent 26ceb48 commit 12d690d
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions crates/oci-distribution/src/token_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,17 @@ impl TokenCache {
RegistryTokenType::Bearer(ref t) => {
let token_str = t.token();
match jwt::Token::<
jwt::header::Header,
jwt::claims::Claims,
jwt::token::Unverified,
>::parse_unverified(token_str) {
Ok(token) => {
token
.claims()
.registered
.expiration
.unwrap_or(u64::MAX)
},
Err(error) => {
warn!(?error, "Invalid bearer token");
return;
jwt::header::Header,
jwt::claims::Claims,
jwt::token::Unverified,
>::parse_unverified(token_str)
{
Ok(token) => token.claims().registered.expiration.unwrap_or(u64::MAX),
Err(error) => {
warn!(?error, "Invalid bearer token");
return;
}
}
}
}
};
let registry = reference.resolve_registry().to_string();
Expand Down

0 comments on commit 12d690d

Please sign in to comment.