Skip to content

Commit

Permalink
Merge branch 'main' into ttl_corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniotarricone authored Jun 15, 2024
2 parents 95b8b53 + a9d9459 commit 764c198
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>it.pagopa.swclient.mil</groupId>
<artifactId>auth</artifactId>
<version>2.4.0</version>
<version>2.4.2</version>
<description>Authorization Microservice for Multi-channel Integration Layer of SW Client Project.</description>

<developers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ public class KeyIdCache {
*/
public boolean isValid(long remainingLife) {
if (kid == null) {
Log.trace("kid is null");
Log.debug("kid is null");
return false;
}

long now = Instant.now().getEpochSecond();
if ((exp - now) < remainingLife) {
Log.trace("Key is expired");
Log.debug("Key is expired");
return false;
}

if ((now - storedAt) > expireAfterWrite) {
Log.trace("Cache is expired");
Log.debug("Cache is expired");
return false;
}

Expand Down

0 comments on commit 764c198

Please sign in to comment.