-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lagt til proxy for altinn3-tilgang-service i prod, oppdatert endepunkter for Altinn3-tilgang-service, oppdatert dolly-idporten frontend --------- Co-authored-by: stigus <[email protected]> Co-authored-by: Cato Olsen <[email protected]>
- Loading branch information
1 parent
7f51565
commit 1ea2342
Showing
52 changed files
with
618 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
services: | ||
|
||
cloud_sql_proxy: | ||
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.14.2 | ||
network_mode: host | ||
command: | ||
- "dolly-dev-ff83:europe-north1:testnav-altinn3-tilgang-local" | ||
- "--credentials-file=/application_default_credentials.json" | ||
- "--run-connection-test" | ||
volumes: | ||
- type: bind | ||
# Set a variable $DOLLY_APPLICATION_CREDENTIALS. We don't use | ||
# GOOGLE_APPLICATION_CREDENTIALS, as this causes an extra step during login. | ||
# | ||
# - $HOME/.config/gcloud/application_default_credentials.json for Linux/macOS. | ||
# - $APPDATA/gcloud/application_default_credentials.json for Windows. | ||
source: $DOLLY_APPLICATION_CREDENTIALS | ||
target: /application_default_credentials.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...av/testnav/altinn3tilgangservice/consumer/altinn/command/GetAuthorizedPartiesCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package no.nav.testnav.altinn3tilgangservice.consumer.altinn.command; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import no.nav.testnav.altinn3tilgangservice.consumer.altinn.dto.AltinnAuthorizedPartiesRequestDTO; | ||
import no.nav.testnav.altinn3tilgangservice.consumer.altinn.dto.AuthorizedPartyDTO; | ||
import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; | ||
import org.springframework.http.HttpHeaders; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
import reactor.core.publisher.Mono; | ||
|
||
import java.util.concurrent.Callable; | ||
|
||
@Slf4j | ||
@RequiredArgsConstructor | ||
public class GetAuthorizedPartiesCommand implements Callable<Mono<AuthorizedPartyDTO[]>> { | ||
|
||
private static final String ALTINN_URL = "/accessmanagement/api/v1/resourceowner/authorizedparties"; | ||
|
||
private final WebClient webClient; | ||
private final AltinnAuthorizedPartiesRequestDTO request; | ||
private final String token; | ||
|
||
@Override | ||
public Mono<AuthorizedPartyDTO[]> call() { | ||
|
||
log.info("Spørring på bruker {}", request); | ||
return webClient | ||
.post() | ||
.uri(builder -> builder.path(ALTINN_URL) | ||
.build()) | ||
.header(HttpHeaders.AUTHORIZATION, "Bearer " + token) | ||
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) | ||
.bodyValue(request) | ||
.retrieve() | ||
.bodyToMono(AuthorizedPartyDTO[].class) | ||
.doOnError(WebClientFilter::logErrorMessage); | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
.../testnav/altinn3tilgangservice/consumer/altinn/dto/AltinnAuthorizedPartiesRequestDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package no.nav.testnav.altinn3tilgangservice.consumer.altinn.dto; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class AltinnAuthorizedPartiesRequestDTO { | ||
|
||
private static final String IDENT_IDENTIFIKATOR = "urn:altinn:person:identifier-no"; | ||
|
||
private String type; | ||
private String value; | ||
|
||
public AltinnAuthorizedPartiesRequestDTO(String ident) { | ||
|
||
this.type = IDENT_IDENTIFIKATOR; | ||
this.value = ident; | ||
} | ||
} |
Oops, something went wrong.