Skip to content

Commit

Permalink
Merge pull request #1252 from atlanhq/APP-5003
Browse files Browse the repository at this point in the history
Fixes maximum token TTE to 5 years
  • Loading branch information
cmgrote authored Jan 23, 2025
2 parents da09a1e + ebb66cd commit f8db6cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdk/src/main/java/com/atlan/api/ApiTokensEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/
public class ApiTokensEndpoint extends HeraclesEndpoint {

private static final long MAX_VALIDITY = 157680000L;
private static final String endpoint = "/apikeys";

public ApiTokensEndpoint(AtlanClient client) {
Expand Down Expand Up @@ -298,10 +299,10 @@ public ApiTokenRequest(String displayName, String description, Set<String> perso
if (validitySeconds != null) {
if (validitySeconds < 0) {
// Treat negative numbers as "infinite" (never expire)
this.validitySeconds = 409968000L;
this.validitySeconds = MAX_VALIDITY;
} else {
// Otherwise use "infinite" as the ceiling for values
this.validitySeconds = Math.min(validitySeconds, 409968000L);
this.validitySeconds = Math.min(validitySeconds, MAX_VALIDITY);
}
}
}
Expand Down

0 comments on commit f8db6cb

Please sign in to comment.