Skip to content

Commit

Permalink
Justere levetid assertions og cache-evict
Browse files Browse the repository at this point in the history
  • Loading branch information
jolarsen committed Aug 21, 2024
1 parent 20bb106 commit af19901
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class MaskinportenAssertionGenerator {
String assertion(String scope, String resource) {
try {
var expirationTime = NumericDate.now();
expirationTime.addSeconds(90);
expirationTime.addSeconds(60);
JwtClaims claims = new JwtClaims();
claims.setIssuer(clientId);
claims.setAudience(issuer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private MaskinportenTokenKlient() {
this.tokenEndpoint = URI.create(getMaskinportenProperty(MaskinportenProperty.MASKINPORTEN_TOKEN_ENDPOINT));
this.scopes = Arrays.stream(getMaskinportenProperty(MaskinportenProperty.MASKINPORTEN_SCOPES)
.split("\\s+")).toList();
this.obocache = new LRUCache<>(200, TimeUnit.MILLISECONDS.convert(1, TimeUnit.HOURS));
this.obocache = new LRUCache<>(200, TimeUnit.MILLISECONDS.convert(60, TimeUnit.MINUTES));
this.proxyUrl = ProxyProperty.getProxyIfFSS();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final class TokenXAssertionGenerator {
String assertion() {
try {
var expirationTime = NumericDate.now();
expirationTime.addSeconds(90);
expirationTime.addSeconds(60);

JwtClaims claims = new JwtClaims();
claims.setSubject(clientId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private TokenXExchangeKlient() {
var provider = ConfigProvider.getOpenIDConfiguration(OpenIDProvider.TOKENX);
this.assertionGenerator = new TokenXAssertionGenerator(provider.orElse(null));
this.tokenEndpoint = provider.map(OpenIDConfiguration::tokenEndpoint).orElse(null);
this.obocache = new LRUCache<>(2500, TimeUnit.MILLISECONDS.convert(110, TimeUnit.SECONDS));
this.obocache = new LRUCache<>(2500, TimeUnit.MILLISECONDS.convert(60, TimeUnit.MINUTES));
}

public static synchronized TokenXExchangeKlient instance() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package no.nav.vedtak.felles.integrasjon.rest;

public enum TokenFlow {
ADAPTIVE, // DWIM for targets accepting both azuread, sts tokens, and tokenx. STS->AzureCC
ADAPTIVE, // DWIM for kall til endepunkt velger azuread eller tokenx ut fra kontekst.
AZUREAD_CC, // Mot endepunkt som bare støtter AzureCC, ikke AzureOBO-flow
NO_AUTH_NEEDED;
NO_AUTH_NEEDED; // Enten endepunkt som ikke krever autentisering eller otherAuthorizationSupplier (Maskinporten)

// Does the endpoint require an Azure AD token?
public boolean isAzureAD() {
Expand Down

0 comments on commit af19901

Please sign in to comment.