Skip to content

Commit

Permalink
Merge pull request #2339 from brendandburns/azure
Browse files Browse the repository at this point in the history
Add null handling for a missing expiresOn field.
  • Loading branch information
k8s-ci-robot authored Aug 18, 2022
2 parents 1a1529c + 55c304e commit 536f725
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public String getToken(Map<String, Object> config) {
@Override
public boolean isExpired(Map<String, Object> config) {
String expiresOn = (String) config.get(EXPIRES_ON);
if (expiresOn == null || expiresOn.length() == 0) {
return true;
}
Date expiry = new Date(Long.parseLong(expiresOn) * 1000);
return expiry.compareTo(new Date()) <= 0;
}
Expand Down

0 comments on commit 536f725

Please sign in to comment.