Skip to content

Commit

Permalink
Update environment variables and config settings in TenorSearchServic…
Browse files Browse the repository at this point in the history
…e #deploy-tenor-search-service
  • Loading branch information
krharum authored and rfc3092 committed Jan 10, 2024
1 parent 4840c55 commit 1d12749
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 46 deletions.
11 changes: 2 additions & 9 deletions apps/tenor-search-service/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ spec:
tenant: nav.no
tokenx:
enabled: true
maskinporten:
enabled: true
scopes:
consumes:
- name: skatteetaten:tjenestepensjonsavtale
accessPolicy:
inbound:
rules:
Expand Down Expand Up @@ -63,7 +58,5 @@ spec:
env:
- name: SPRING_PROFILES_ACTIVE
value: prod
- name: ACCEPTED_AUDIENCE
value: dev-gcp:dolly:testnav-tenor-search-service
- name: TOKENDINGS_URL
value: https://tokenx.dev-gcp.nav.cloud.nais.io
- name: MASKINPORTEN_TENOR_SCOPE
value: "skatteetaten:testnorge/testdata.read"
Original file line number Diff line number Diff line change
@@ -1,40 +1,22 @@
package no.nav.testnav.apps.tenorsearchservice.config;

import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

@Getter
@Configuration
public class MaskinportenConfig {

private final String clientId;
private final String jwkPrivate;
private final String scope;
private final String wellKnownUrl;
@Value("${MASKINPORTEN_CLIENT_ID}")
private String clientId;

public MaskinportenConfig(
@Value("${MASKINPORTEN_CLIENT_ID}") String clientId,
@Value("${MASKINPORTEN_CLIENT_JWK}") String jwkPrivate,
@Value("${MASKINPORTEN_WELL_KNOWN_URL}") String wellKnownUrl
) {
this.clientId = clientId;
this.scope = "skatteetaten:tjenestepensjonsavtale";
this.jwkPrivate = jwkPrivate;
this.wellKnownUrl = wellKnownUrl;
}
@Value("${MASKINPORTEN_CLIENT_JWK}")
private String jwkPrivate;

public String getClientId() {
return clientId;
}
@Value("${MASKINPORTEN_TENOR_SCOPE}")
private String scope;

public String getJwkPrivate() {
return jwkPrivate;
}

public String getScope() {
return scope;
}

public String getWellKnownUrl() {
return wellKnownUrl;
}
@Value("${MASKINPORTEN_WELL_KNOWN_URL}")
private String wellKnownUrl;
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
ACCEPTED_AUDIENCE: dev-gcp:dolly:testnav-tenor-search-service

TOKENDINGS_URL: dummy
TOKEN_X_ISSUER: dummy

MASKINPORTEN_CLIENT_ID: dummy
MASKINPORTEN_CLIENT_JWK: dummy
MASKINPORTEN_SCOPES: dummy
MASKINPORTEN_TENOR_SCOPE: dummy
MASKINPORTEN_WELL_KNOWN_URL: dummy
6 changes: 3 additions & 3 deletions apps/tenor-search-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ spring:
jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys
accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id}
tokenx:
issuer-uri: ${TOKENDINGS_URL}
jwk-set-uri: ${TOKENDINGS_URL}/jwks
accepted-audience: ${ACCEPTED_AUDIENCE}
issuer-uri: ${TOKEN_X_ISSUER}
jwk-set-uri: ${TOKEN_X_JWKS_URI}
accepted-audience: ${TOKEN_X_CLIENT_ID}
jackson:
serialization:
write_dates_as_timestamps: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TOKENDINGS_URL: dummy
TOKEN_X_ISSUER: dummy
MASKINPORTEN_CLIENT_ID: dummy
MASKINPORTEN_CLIENT_JWK: dummy
MASKINPORTEN_SCOPES: dummy
MASKINPORTEN_TENOR_SCOPE: dummy
MASKINPORTEN_WELL_KNOWN_URL: dummy

0 comments on commit 1d12749

Please sign in to comment.