From 837ae1a39eeee4d961f837ea3812a1050bc45a95 Mon Sep 17 00:00:00 2001 From: Cato Olsen Date: Tue, 24 Sep 2024 16:10:42 +0200 Subject: [PATCH] change/local-vault-cleanup (#3624) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eget lib for Vault-integrasjon, som også støtter Vault CLI. --- apps/adresse-service/build.gradle | 15 ++--- apps/adresse-service/settings.gradle | 1 + .../config/LocalVaultConfig.java | 10 ++++ .../config/VaultLocalConfig.java | 36 ----------- apps/amelding-service/build.gradle | 21 +++---- apps/amelding-service/settings.gradle | 1 + .../ameldingservice/config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/app-tilgang-analyse-service/build.gradle | 29 ++++----- .../settings.gradle | 1 + .../config/LocalConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/arbeidsforhold-service/build.gradle | 25 ++++---- apps/arbeidsforhold-service/settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/batch-bestilling-service/build.gradle | 23 ++++---- apps/batch-bestilling-service/settings.gradle | 1 + .../config/DevConfig.java | 39 ------------ .../config/LocalVaultConfig.java | 10 ++++ apps/brreg-stub/build.gradle | 59 ++++++++++--------- apps/brreg-stub/settings.gradle | 1 + .../nav/brregstub/config/DevVaultConfig.java | 33 ----------- .../brregstub/config/LocalVaultConfig.java | 10 ++++ apps/bruker-service/build.gradle | 31 +++++----- apps/bruker-service/settings.gradle | 1 + .../brukerservice/config/LocalConfig.java | 37 ------------ .../config/LocalVaultConfig.java | 10 ++++ apps/budpro-service/build.gradle | 2 + apps/budpro-service/settings.gradle | 1 + .../no/nav/dolly/budpro/LocalVaultConfig.java | 10 ++++ .../java/no/nav/dolly/budpro/VaultConfig.java | 38 ------------ apps/dolly-frontend/build.gradle | 37 ++++++------ apps/dolly-frontend/settings.gradle | 1 + .../dolly/web/config/LocalVaultConfig.java | 34 +---------- apps/endringsmelding-frontend/build.gradle | 30 +++++----- apps/endringsmelding-frontend/settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/endringsmelding-service/build.gradle | 17 +++--- apps/endringsmelding-service/settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/faste-data-frontend/build.gradle | 30 +++++----- apps/faste-data-frontend/settings.gradle | 1 + .../fastedatafrontend/config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../build.gradle | 22 ++++--- .../settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/generer-navn-service/build.gradle | 20 +++---- apps/generer-navn-service/settings.gradle | 1 + .../generernavnservice/config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../build.gradle | 52 ++++++++-------- .../settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../build.gradle | 22 +++---- .../settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/helsepersonell-service/build.gradle | 18 +++--- apps/helsepersonell-service/settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../build.gradle | 21 +++---- .../settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/inntektsmelding-service/build.gradle | 32 +++++----- apps/inntektsmelding-service/settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../jenkins-batch-status-service/build.gradle | 24 ++++---- .../settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/joark-dokument-service/build.gradle | 22 +++---- apps/joark-dokument-service/settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/kodeverk-service/build.gradle | 32 +++++----- apps/kodeverk-service/settings.gradle | 1 + .../kodeverkservice/config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../build.gradle | 45 +++++++------- .../settings.gradle | 2 +- .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../build.gradle | 1 + .../settings.gradle | 2 +- .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../build.gradle | 1 + .../settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/miljoer-service/build.gradle | 20 +++---- apps/miljoer-service/settings.gradle | 1 + .../miljoerservice/config/DevConfig.java | 39 ------------ .../config/LocalVaultConfig.java | 10 ++++ .../build.gradle | 23 ++++---- .../settings.gradle | 1 + .../config/DevConfig.java | 37 ------------ .../config/LocalVaultConfig.java | 12 ++++ .../build.gradle | 41 +++++++------ .../settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../build.gradle | 46 +++++++-------- .../settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/organisasjon-forvalter/build.gradle | 51 ++++++++-------- apps/organisasjon-forvalter/settings.gradle | 1 + .../config/LocalConfig.java | 46 --------------- .../config/LocalVaultConfig.java | 17 ++++++ apps/organisasjon-mottak-service/build.gradle | 38 ++++++------ .../settings.gradle | 1 + .../organisasjonmottak/config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/organisasjon-service/build.gradle | 26 ++++---- apps/organisasjon-service/settings.gradle | 1 + .../organisasjonservice/config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../organisasjon-tilgang-service/build.gradle | 21 +++---- .../settings.gradle | 1 + .../config/LocalVaultConfig.java | 30 +--------- apps/orgnummer-service/build.gradle | 34 +++++------ apps/orgnummer-service/settings.gradle | 1 + .../orgnrservice/config/DevConfig.java | 36 ----------- .../orgnrservice/config/LocalVaultConfig.java | 10 ++++ apps/oversikt-frontend/build.gradle | 24 ++++---- apps/oversikt-frontend/settings.gradle | 1 + .../oversiktfrontend/config/DevConfig.java | 39 ------------ .../config/LocalVaultConfig.java | 10 ++++ apps/pdl-forvalter/build.gradle | 40 ++++++------- apps/pdl-forvalter/settings.gradle | 1 + .../nav/pdl/forvalter/config/LocalConfig.java | 43 -------------- .../forvalter/config/LocalVaultConfig.java | 17 ++++++ apps/person-faste-data-service/build.gradle | 26 ++++---- .../person-faste-data-service/settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../build.gradle | 13 ++-- .../settings.gradle | 1 + .../config/LocalVaultConfig.java | 30 +--------- apps/person-search-service/build.gradle | 26 ++++---- apps/person-search-service/settings.gradle | 1 + .../config/DevVaultConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/person-service/build.gradle | 24 ++++---- apps/person-service/settings.gradle | 1 + .../apps/personservice/config/DevConfig.java | 37 ------------ .../config/LocalVaultConfig.java | 10 ++++ apps/profil-api/build.gradle | 24 ++++---- apps/profil-api/settings.gradle | 1 + .../testnorge/profil/config/DevConfig.java | 36 ----------- .../profil/config/LocalVaultConfig.java | 10 ++++ apps/skattekort-service/build.gradle | 25 ++++---- apps/skattekort-service/settings.gradle | 1 + .../skattekortservice/config/DevConfig.java | 37 ------------ .../config/LocalVaultConfig.java | 10 ++++ apps/sykemelding-api/build.gradle | 29 ++++----- apps/sykemelding-api/settings.gradle | 1 + .../sykemelding/config/DevConfig.java | 36 ----------- .../sykemelding/config/LocalVaultConfig.java | 10 ++++ apps/synt-sykemelding-api/build.gradle | 26 ++++---- apps/synt-sykemelding-api/settings.gradle | 1 + .../syntsykemeldingapi/config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ .../build.gradle | 23 ++++---- .../settings.gradle | 1 + .../config/DevConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 10 ++++ apps/tenor-search-service/build.gradle | 15 ++--- apps/tenor-search-service/settings.gradle | 1 + .../config/LocalVaultConfig.java | 30 +--------- apps/testnav-ident-pool/build.gradle | 49 +++++++-------- apps/testnav-ident-pool/settings.gradle | 1 + .../testnav/identpool/config/LocalConfig.java | 43 -------------- .../identpool/config/LocalVaultConfig.java | 17 ++++++ .../build.gradle | 57 +++++++++--------- .../settings.gradle | 1 + .../sdforvalter/config/DevConfig.java | 37 ------------ .../sdforvalter/config/LocalVaultConfig.java | 12 ++++ apps/tilbakemelding-api/build.gradle | 30 +++++----- apps/tilbakemelding-api/settings.gradle | 1 + .../tilbakemeldingapi/config/DevConfig.java | 37 ------------ .../config/LocalVaultConfig.java | 12 ++++ apps/tps-messaging-service/build.gradle | 33 ++++++----- apps/tps-messaging-service/settings.gradle | 1 + .../config/LocalVaultConfig.java | 12 ++++ .../config/VaultLocalConfig.java | 37 ------------ apps/udi-stub/build.gradle | 52 ++++++++-------- apps/udi-stub/settings.gradle | 1 + .../java/no/nav/udistub/config/DevConfig.java | 37 ------------ .../nav/udistub/config/LocalVaultConfig.java | 10 ++++ apps/varslinger-service/build.gradle | 39 ++++++------ apps/varslinger-service/settings.gradle | 1 + .../varslingerservice/config/LocalConfig.java | 38 ------------ .../config/LocalVaultConfig.java | 10 ++++ docs/local_vault.md | 20 +++++++ examples/reactive-rest-example/build.gradle | 29 ++++----- .../reactive-rest-example/settings.gradle | 1 + .../config/LocalConfig.java | 36 ----------- .../config/LocalVaultConfig.java | 12 ++++ libs/reactive-proxy/build.gradle | 20 +++---- .../libs/reactiveproxy/config/DevConfig.java | 36 ----------- libs/vault/build.gradle | 1 - .../java/src/main/groovy/dolly-proxies.gradle | 1 + proxies/aareg-proxy/build.gradle | 2 + proxies/aareg-proxy/settings.gradle | 1 + .../proxies/aareg/LocalVaultConfig.java | 26 +------- .../aareg-synt-services-proxy/build.gradle | 4 ++ .../aareg-synt-services-proxy/settings.gradle | 7 ++- ...regSyntServiceProxyApplicationStarter.java | 2 - .../LocalVaultConfig.java | 12 ++++ proxies/arbeidsplassencv-proxy/build.gradle | 2 + .../arbeidsplassencv-proxy/settings.gradle | 11 ++-- ...beidsplassenCVProxyApplicationStarter.java | 2 - .../config/LocalVaultConfig.java | 25 +------- proxies/arena-forvalteren-proxy/build.gradle | 5 +- .../arena-forvalteren-proxy/settings.gradle | 11 ++-- ...enaForvalterenProxyApplicationStarter.java | 2 - .../LocalVaultConfig.java | 12 ++++ proxies/batch-adeo-proxy/build.gradle | 4 ++ proxies/batch-adeo-proxy/settings.gradle | 7 ++- .../BatchAdeoProxyApplicationStarter.java | 2 - .../batchadeoproxy/LocalVaultConfig.java | 12 ++++ proxies/brregstub-proxy/build.gradle | 3 +- proxies/brregstub-proxy/settings.gradle | 9 +-- .../BrregstubProxyApplicationStarter.java | 2 - .../brregstubproxy/LocalVaultConfig.java | 12 ++++ proxies/dokarkiv-proxy/build.gradle | 2 + proxies/dokarkiv-proxy/settings.gradle | 1 + .../config/LocalVaultConfig.java | 28 +-------- proxies/ereg-proxy/build.gradle | 4 +- proxies/ereg-proxy/settings.gradle | 7 ++- .../EregProxyApplicationStarter.java | 2 - .../proxies/eregproxy/LocalVaultConfig.java | 12 ++++ proxies/histark-proxy/build.gradle | 3 +- proxies/histark-proxy/settings.gradle | 9 +-- .../HistarkProxyApplicationStarter.java | 2 - .../histarkproxy/LocalVaultConfig.java | 12 ++++ proxies/inntektstub-proxy/build.gradle | 3 +- proxies/inntektstub-proxy/settings.gradle | 9 +-- .../InntektstubProxyApplicationStarter.java | 2 - .../inntektstubproxy/LocalVaultConfig.java | 12 ++++ proxies/inst-proxy/build.gradle | 7 ++- proxies/inst-proxy/settings.gradle | 13 ++-- .../InstProxyApplicationStarter.java | 3 - .../proxies/instproxy/LocalVaultConfig.java | 12 ++++ .../kontoregister-person-proxy/build.gradle | 2 + .../settings.gradle | 1 + .../config/LocalVaultConfig.java | 28 +-------- proxies/krrstub-proxy/build.gradle | 2 + proxies/krrstub-proxy/settings.gradle | 1 + .../krrstubproxy/config/LocalVaultConfig.java | 28 +-------- proxies/medl-proxy/build.gradle | 2 + proxies/medl-proxy/settings.gradle | 1 + .../medlproxy/config/LocalVaultConfig.java | 28 +-------- proxies/norg2-proxy/build.gradle | 5 +- proxies/norg2-proxy/settings.gradle | 9 +-- .../proxies/norg2proxy/LocalVaultConfig.java | 12 ++++ .../Norg2ProxyApplicationStarter.java | 2 - proxies/pdl-proxy/build.gradle | 2 + proxies/pdl-proxy/settings.gradle | 13 ++-- .../pdlproxy/PdlProxyApplicationStarter.java | 2 - .../pdlproxy/config/DevVaultConfig.java | 36 ----------- .../pdlproxy/config/LocalVaultConfig.java | 13 ++++ .../build.gradle | 2 + .../settings.gradle | 13 ++-- ...TestdataFacadeProxyApplicationStarter.java | 2 - .../config/LocalVaultConfig.java | 20 +------ proxies/saf-proxy/build.gradle | 7 ++- proxies/saf-proxy/settings.gradle | 13 ++-- .../proxies/safproxy/LocalVaultConfig.java | 12 ++++ .../safproxy/SafProxyApplicationStarter.java | 2 - proxies/sigrunstub-proxy/build.gradle | 3 +- proxies/sigrunstub-proxy/settings.gradle | 9 +-- .../sigrunstubproxy/LocalVaultConfig.java | 12 ++++ .../SigrunstubProxyApplicationStarter.java | 2 - .../synthdata-meldekort-proxy/build.gradle | 2 + .../synthdata-meldekort-proxy/settings.gradle | 1 + ...hdataMeldekortProxyApplicationStarter.java | 4 +- .../config/LocalVaultConfig.java | 12 ++++ .../config/VaultConfig.java | 36 ----------- proxies/udistub-proxy/build.gradle | 9 +-- proxies/udistub-proxy/settings.gradle | 13 ++-- .../udistubproxy/LocalVaultConfig.java | 12 ++++ .../UdistubProxyApplicationStarter.java | 2 - 294 files changed, 1710 insertions(+), 3082 deletions(-) create mode 100644 apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/LocalVaultConfig.java delete mode 100644 apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/VaultLocalConfig.java delete mode 100644 apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/config/DevConfig.java create mode 100644 apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/config/LocalVaultConfig.java delete mode 100644 apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/config/LocalConfig.java create mode 100644 apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/config/LocalVaultConfig.java delete mode 100644 apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/DevConfig.java create mode 100644 apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/LocalVaultConfig.java delete mode 100644 apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java create mode 100644 apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/LocalVaultConfig.java delete mode 100644 apps/brreg-stub/src/main/java/no/nav/brregstub/config/DevVaultConfig.java create mode 100644 apps/brreg-stub/src/main/java/no/nav/brregstub/config/LocalVaultConfig.java delete mode 100644 apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/config/LocalConfig.java create mode 100644 apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/config/LocalVaultConfig.java create mode 100644 apps/budpro-service/src/main/java/no/nav/dolly/budpro/LocalVaultConfig.java delete mode 100644 apps/budpro-service/src/main/java/no/nav/dolly/budpro/VaultConfig.java delete mode 100644 apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/config/DevConfig.java create mode 100644 apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/config/LocalVaultConfig.java delete mode 100644 apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/DevConfig.java create mode 100644 apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/LocalVaultConfig.java delete mode 100644 apps/faste-data-frontend/src/main/java/no/nav/testnav/apps/fastedatafrontend/config/DevConfig.java create mode 100644 apps/faste-data-frontend/src/main/java/no/nav/testnav/apps/fastedatafrontend/config/LocalVaultConfig.java delete mode 100644 apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/DevConfig.java create mode 100644 apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/LocalVaultConfig.java delete mode 100644 apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/DevConfig.java create mode 100644 apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/LocalVaultConfig.java delete mode 100644 apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/DevConfig.java create mode 100644 apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/LocalVaultConfig.java delete mode 100644 apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/DevConfig.java create mode 100644 apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/LocalVaultConfig.java delete mode 100644 apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/DevConfig.java create mode 100644 apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/LocalVaultConfig.java delete mode 100644 apps/inntektsmelding-generator-service/src/main/java/no/nav/testnav/inntektsmeldinggeneratorservice/config/DevConfig.java create mode 100644 apps/inntektsmelding-generator-service/src/main/java/no/nav/testnav/inntektsmeldinggeneratorservice/config/LocalVaultConfig.java delete mode 100644 apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/DevConfig.java create mode 100644 apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/LocalVaultConfig.java delete mode 100644 apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/DevConfig.java create mode 100644 apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/LocalVaultConfig.java delete mode 100644 apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/DevConfig.java create mode 100644 apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/LocalVaultConfig.java delete mode 100644 apps/kodeverk-service/src/main/java/no/nav/testnav/kodeverkservice/config/DevConfig.java create mode 100644 apps/kodeverk-service/src/main/java/no/nav/testnav/kodeverkservice/config/LocalVaultConfig.java delete mode 100644 apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/DevConfig.java create mode 100644 apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/LocalVaultConfig.java delete mode 100644 apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/config/DevConfig.java create mode 100644 apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/config/LocalVaultConfig.java delete mode 100644 apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/config/DevConfig.java create mode 100644 apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/config/LocalVaultConfig.java delete mode 100644 apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java create mode 100644 apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/LocalVaultConfig.java delete mode 100644 apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/DevConfig.java create mode 100644 apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/LocalVaultConfig.java delete mode 100644 apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/DevConfig.java create mode 100644 apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/LocalVaultConfig.java delete mode 100644 apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/DevConfig.java create mode 100644 apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/LocalVaultConfig.java delete mode 100644 apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalConfig.java create mode 100644 apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalVaultConfig.java delete mode 100644 apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/DevConfig.java create mode 100644 apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/LocalVaultConfig.java delete mode 100644 apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/DevConfig.java create mode 100644 apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/LocalVaultConfig.java delete mode 100644 apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/DevConfig.java create mode 100644 apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/LocalVaultConfig.java delete mode 100644 apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java create mode 100644 apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/LocalVaultConfig.java delete mode 100644 apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/LocalConfig.java create mode 100644 apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/LocalVaultConfig.java delete mode 100644 apps/person-faste-data-service/src/main/java/no/nav/testnav/personfastedataservice/config/DevConfig.java create mode 100644 apps/person-faste-data-service/src/main/java/no/nav/testnav/personfastedataservice/config/LocalVaultConfig.java delete mode 100644 apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/DevVaultConfig.java create mode 100644 apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/LocalVaultConfig.java delete mode 100644 apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/DevConfig.java create mode 100644 apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/LocalVaultConfig.java delete mode 100644 apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/DevConfig.java create mode 100644 apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/LocalVaultConfig.java delete mode 100644 apps/skattekort-service/src/main/java/no/nav/skattekortservice/config/DevConfig.java create mode 100644 apps/skattekort-service/src/main/java/no/nav/skattekortservice/config/LocalVaultConfig.java delete mode 100644 apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/DevConfig.java create mode 100644 apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/LocalVaultConfig.java delete mode 100644 apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/DevConfig.java create mode 100644 apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/LocalVaultConfig.java delete mode 100644 apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/DevConfig.java create mode 100644 apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/LocalVaultConfig.java delete mode 100644 apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/LocalConfig.java create mode 100644 apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/LocalVaultConfig.java delete mode 100644 apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/DevConfig.java create mode 100644 apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/LocalVaultConfig.java delete mode 100644 apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/DevConfig.java create mode 100644 apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/LocalVaultConfig.java create mode 100644 apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/LocalVaultConfig.java delete mode 100644 apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/VaultLocalConfig.java delete mode 100644 apps/udi-stub/src/main/java/no/nav/udistub/config/DevConfig.java create mode 100644 apps/udi-stub/src/main/java/no/nav/udistub/config/LocalVaultConfig.java delete mode 100644 apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/LocalConfig.java create mode 100644 apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/LocalVaultConfig.java create mode 100644 docs/local_vault.md delete mode 100644 examples/reactive-rest-example/src/main/java/no/nav/testnav/examples/reactiverestexample/config/LocalConfig.java create mode 100644 examples/reactive-rest-example/src/main/java/no/nav/testnav/examples/reactiverestexample/config/LocalVaultConfig.java create mode 100644 proxies/aareg-synt-services-proxy/src/main/java/no/nav/testnav/proxies/aaregsyntservicesproxy/LocalVaultConfig.java create mode 100644 proxies/arena-forvalteren-proxy/src/main/java/no/nav/testnav/proxies/arenaforvalterenproxy/LocalVaultConfig.java create mode 100644 proxies/batch-adeo-proxy/src/main/java/no/nav/testnav/proxies/batchadeoproxy/LocalVaultConfig.java create mode 100644 proxies/brregstub-proxy/src/main/java/no/nav/testnav/proxies/brregstubproxy/LocalVaultConfig.java create mode 100644 proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/LocalVaultConfig.java create mode 100644 proxies/histark-proxy/src/main/java/no/nav/testnav/proxies/histarkproxy/LocalVaultConfig.java create mode 100644 proxies/inntektstub-proxy/src/main/java/no/nav/testnav/proxies/inntektstubproxy/LocalVaultConfig.java create mode 100644 proxies/inst-proxy/src/main/java/no/nav/testnav/proxies/instproxy/LocalVaultConfig.java create mode 100644 proxies/norg2-proxy/src/main/java/no/nav/testnav/proxies/norg2proxy/LocalVaultConfig.java delete mode 100644 proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/DevVaultConfig.java create mode 100644 proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/LocalVaultConfig.java create mode 100644 proxies/saf-proxy/src/main/java/no/nav/testnav/proxies/safproxy/LocalVaultConfig.java create mode 100644 proxies/sigrunstub-proxy/src/main/java/no/nav/testnav/proxies/sigrunstubproxy/LocalVaultConfig.java create mode 100644 proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/config/LocalVaultConfig.java delete mode 100644 proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/config/VaultConfig.java create mode 100644 proxies/udistub-proxy/src/main/java/no/nav/testnav/proxies/udistubproxy/LocalVaultConfig.java diff --git a/apps/adresse-service/build.gradle b/apps/adresse-service/build.gradle index a7c60fde2e8..bdf5ed3cd78 100644 --- a/apps/adresse-service/build.gradle +++ b/apps/adresse-service/build.gradle @@ -10,14 +10,15 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" implementation "ma.glasnost.orika:orika-core:$versions.orika" implementation "org.aspectj:aspectjweaver:$versions.jweaver" diff --git a/apps/adresse-service/settings.gradle b/apps/adresse-service/settings.gradle index 6a2058d2d50..4d35f0bf0f4 100644 --- a/apps/adresse-service/settings.gradle +++ b/apps/adresse-service/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/LocalVaultConfig.java b/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..b0a329e7ca7 --- /dev/null +++ b/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.apps.adresseservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("local") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/VaultLocalConfig.java b/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/VaultLocalConfig.java deleted file mode 100644 index 7558f09e3f2..00000000000 --- a/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/VaultLocalConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.apps.adresseservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("local") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class VaultLocalConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/amelding-service/build.gradle b/apps/amelding-service/build.gradle index c2a4bbf4d5f..bd7beae1b48 100644 --- a/apps/amelding-service/build.gradle +++ b/apps/amelding-service/build.gradle @@ -11,21 +11,22 @@ sonarqube { dependencies { - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:reactive-security' + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:avro-schema' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:avro-schema" + implementation "no.nav.testnav.libs:data-transfer-objects" - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/amelding-service/settings.gradle b/apps/amelding-service/settings.gradle index 09582fbd408..805045195b3 100644 --- a/apps/amelding-service/settings.gradle +++ b/apps/amelding-service/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/config/DevConfig.java b/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/config/DevConfig.java deleted file mode 100644 index 0faab5af908..00000000000 --- a/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnav.ameldingservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/config/LocalVaultConfig.java b/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..25a97458e07 --- /dev/null +++ b/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnav.ameldingservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/app-tilgang-analyse-service/build.gradle b/apps/app-tilgang-analyse-service/build.gradle index dec83579f53..a5f907e8394 100644 --- a/apps/app-tilgang-analyse-service/build.gradle +++ b/apps/app-tilgang-analyse-service/build.gradle @@ -10,24 +10,25 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:reactive-security' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-data-r2dbc' - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' + implementation "org.springframework.boot:spring-boot-starter-data-r2dbc" + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" - runtimeOnly 'com.h2database:h2' - runtimeOnly 'org.postgresql:postgresql' - implementation 'io.r2dbc:r2dbc-h2' - implementation 'org.postgresql:r2dbc-postgresql' - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' - implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml' + runtimeOnly "com.h2database:h2" + runtimeOnly "org.postgresql:postgresql" + implementation "io.r2dbc:r2dbc-h2" + implementation "org.postgresql:r2dbc-postgresql" + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml" implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/app-tilgang-analyse-service/settings.gradle b/apps/app-tilgang-analyse-service/settings.gradle index 9dbb9e11e77..8ff81fe0643 100644 --- a/apps/app-tilgang-analyse-service/settings.gradle +++ b/apps/app-tilgang-analyse-service/settings.gradle @@ -9,6 +9,7 @@ includeBuild "../../plugins/java" includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/config/LocalConfig.java b/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/config/LocalConfig.java deleted file mode 100644 index 087e62cf15f..00000000000 --- a/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/config/LocalConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.apps.apptilganganalyseservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile({"local", "localdb"}) -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class LocalConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/config/LocalVaultConfig.java b/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..7de354716ed --- /dev/null +++ b/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.apps.apptilganganalyseservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile({"local", "localdb"}) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/arbeidsforhold-service/build.gradle b/apps/arbeidsforhold-service/build.gradle index 089e3d8c9fc..9f7c5b47406 100644 --- a/apps/arbeidsforhold-service/build.gradle +++ b/apps/arbeidsforhold-service/build.gradle @@ -15,23 +15,24 @@ dependencies { implementation "jakarta.xml.bind:jakarta.xml.bind-api:$versions.jakartaXmlBindApi" implementation "javax.activation:activation:$versions.javaxActivation" implementation "org.glassfish.jaxb:jaxb-runtime:$versions.jaxb" - implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml' + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml" - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config implementation "javax.annotation:javax.annotation-api:$versions.javaxAnnotation" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/arbeidsforhold-service/settings.gradle b/apps/arbeidsforhold-service/settings.gradle index 936af046ee4..dfcdf5023f1 100644 --- a/apps/arbeidsforhold-service/settings.gradle +++ b/apps/arbeidsforhold-service/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/DevConfig.java b/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/DevConfig.java deleted file mode 100644 index 8f5689b3cc8..00000000000 --- a/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnorge.arbeidsforholdservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/LocalVaultConfig.java b/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..0e6ad5ab37f --- /dev/null +++ b/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.arbeidsforholdservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/batch-bestilling-service/build.gradle b/apps/batch-bestilling-service/build.gradle index 5cfd5693cab..129a68b9273 100644 --- a/apps/batch-bestilling-service/build.gradle +++ b/apps/batch-bestilling-service/build.gradle @@ -11,20 +11,21 @@ sonarqube { dependencies { - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-insecure-security' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:servlet-security' + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-insecure-security" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/batch-bestilling-service/settings.gradle b/apps/batch-bestilling-service/settings.gradle index c3664eb2a8d..2c9010e2117 100644 --- a/apps/batch-bestilling-service/settings.gradle +++ b/apps/batch-bestilling-service/settings.gradle @@ -13,6 +13,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-insecure-security' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java b/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java deleted file mode 100644 index 7f2ce2bae18..00000000000 --- a/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java +++ /dev/null @@ -1,39 +0,0 @@ -package no.nav.registre.testnorge.batchbestillingservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.lang.NonNull; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static net.logstash.logback.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - @NonNull - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - @NonNull - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/LocalVaultConfig.java b/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..efc8549b2a5 --- /dev/null +++ b/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.batchbestillingservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/brreg-stub/build.gradle b/apps/brreg-stub/build.gradle index a4219f897c6..a87ac6709a9 100644 --- a/apps/brreg-stub/build.gradle +++ b/apps/brreg-stub/build.gradle @@ -18,47 +18,48 @@ wsimport { } dependencies { - implementation('io.dropwizard:dropwizard-jackson:4.0.7') { + implementation("io.dropwizard:dropwizard-jackson:4.0.7") { exclude group: "com.google.code.findbugs" } - implementation 'no.nav.testnav.libs:database' - implementation 'no.nav.testnav.libs:servlet-core' + implementation "no.nav.testnav.libs:database" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-web-services' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-web-services" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" - implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' - implementation 'org.springframework.boot:spring-boot-starter-validation' + implementation "org.springframework.cloud:spring-cloud-vault-config-databases" + implementation "org.springframework.boot:spring-boot-starter-validation" - implementation 'org.apache.cxf:cxf-rt-bindings-soap' - implementation 'org.apache.cxf:cxf-rt-ws-policy' - implementation 'org.apache.cxf:cxf-core' - implementation 'org.apache.cxf:cxf-rt-frontend-jaxws' - implementation 'org.apache.cxf:cxf-rt-transports-http' - implementation 'org.apache.cxf:cxf-rt-ws-security' - implementation 'jakarta.servlet:jakarta.servlet-api' + implementation "org.apache.cxf:cxf-rt-bindings-soap" + implementation "org.apache.cxf:cxf-rt-ws-policy" + implementation "org.apache.cxf:cxf-core" + implementation "org.apache.cxf:cxf-rt-frontend-jaxws" + implementation "org.apache.cxf:cxf-rt-transports-http" + implementation "org.apache.cxf:cxf-rt-ws-security" + implementation "jakarta.servlet:jakarta.servlet-api" - implementation 'org.postgresql:postgresql' - implementation 'com.zaxxer:HikariCP' + implementation "org.postgresql:postgresql" + implementation "com.zaxxer:HikariCP" - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' - implementation 'com.h2database:h2' + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" + implementation "com.h2database:h2" - implementation 'wsdl4j:wsdl4j' + implementation "wsdl4j:wsdl4j" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - implementation 'no.nav.common:auth' - implementation 'no.nav.common:util' - implementation 'no.nav.common:cxf:3.2023.10.17_06.55-4e30d96bba05' + implementation "no.nav.common:auth" + implementation "no.nav.common:util" + implementation "no.nav.common:cxf:3.2023.10.17_06.55-4e30d96bba05" - implementation 'com.h2database:h2' + implementation "com.h2database:h2" implementation "com.sun.xml.ws:jaxws-rt:$versions.jaxws" - testImplementation 'org.testcontainers:junit-jupiter' - testImplementation 'org.testcontainers:postgresql' - implementation 'jakarta.jws:jakarta.jws-api:3.0.0' - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.testcontainers:junit-jupiter" + testImplementation "org.testcontainers:postgresql" + implementation "jakarta.jws:jakarta.jws-api:3.0.0" + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/brreg-stub/settings.gradle b/apps/brreg-stub/settings.gradle index 2126bfa8ba8..dda5fadcdfc 100644 --- a/apps/brreg-stub/settings.gradle +++ b/apps/brreg-stub/settings.gradle @@ -8,6 +8,7 @@ includeBuild "../../plugins/java" includeBuild '../../libs/database' includeBuild '../../libs/servlet-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/brreg-stub/src/main/java/no/nav/brregstub/config/DevVaultConfig.java b/apps/brreg-stub/src/main/java/no/nav/brregstub/config/DevVaultConfig.java deleted file mode 100644 index 2b42e25f307..00000000000 --- a/apps/brreg-stub/src/main/java/no/nav/brregstub/config/DevVaultConfig.java +++ /dev/null @@ -1,33 +0,0 @@ -package no.nav.brregstub.config; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -@Configuration -@Profile("local") -public class DevVaultConfig extends AbstractVaultConfiguration { - - private static final String TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(TOKEN); - if (StringUtils.isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property '%s' er ikke satt.".formatted(TOKEN)); - } - return new TokenAuthentication(System.getProperty(TOKEN)); - } -} \ No newline at end of file diff --git a/apps/brreg-stub/src/main/java/no/nav/brregstub/config/LocalVaultConfig.java b/apps/brreg-stub/src/main/java/no/nav/brregstub/config/LocalVaultConfig.java new file mode 100644 index 00000000000..feb88f5e4b5 --- /dev/null +++ b/apps/brreg-stub/src/main/java/no/nav/brregstub/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.brregstub.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("local") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/bruker-service/build.gradle b/apps/bruker-service/build.gradle index d4f5e8f8a73..6c67a5154dd 100644 --- a/apps/bruker-service/build.gradle +++ b/apps/bruker-service/build.gradle @@ -25,31 +25,32 @@ sonarqube { dependencies { implementation "com.auth0:java-jwt:$versions.jwt" - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:reactive-security' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:vault" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:security-core" - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-data-r2dbc' + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-data-r2dbc" - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - implementation 'io.r2dbc:r2dbc-h2' - implementation 'org.postgresql:r2dbc-postgresql' - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' + implementation "io.r2dbc:r2dbc-h2" + implementation "org.postgresql:r2dbc-postgresql" + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" - runtimeOnly 'org.postgresql:postgresql' - runtimeOnly 'com.h2database:h2' + runtimeOnly "org.postgresql:postgresql" + runtimeOnly "com.h2database:h2" testImplementation "io.projectreactor:reactor-test:$versions.reactorTest" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" testImplementation "org.assertj:assertj-core:$versions.assertj" - testImplementation 'no.nav.testnav.libs:integration-test' + testImplementation "no.nav.testnav.libs:integration-test" testImplementation "com.squareup.okhttp3:okhttp:$versions.okhttp" testImplementation "com.squareup.okhttp3:mockwebserver:$versions.okhttp" } diff --git a/apps/bruker-service/settings.gradle b/apps/bruker-service/settings.gradle index dabd186654a..55f05ce5ca5 100644 --- a/apps/bruker-service/settings.gradle +++ b/apps/bruker-service/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/integration-test' includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/config/LocalConfig.java b/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/config/LocalConfig.java deleted file mode 100644 index 108989b0755..00000000000 --- a/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/config/LocalConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package no.nav.testnav.apps.brukerservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - - -@Configuration -@Profile("local") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class LocalConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/config/LocalVaultConfig.java b/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..ef803603f38 --- /dev/null +++ b/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.apps.brukerservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("local") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/budpro-service/build.gradle b/apps/budpro-service/build.gradle index ca5df53ed97..1746c789889 100644 --- a/apps/budpro-service/build.gradle +++ b/apps/budpro-service/build.gradle @@ -10,6 +10,8 @@ dependencies { implementation "no.nav.testnav.libs:servlet-core" implementation "no.nav.testnav.libs:servlet-insecure-security" implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "org.springframework.boot:spring-boot-starter-oauth2-client" implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" diff --git a/apps/budpro-service/settings.gradle b/apps/budpro-service/settings.gradle index 1c99b24ef24..8c47d75f7c5 100644 --- a/apps/budpro-service/settings.gradle +++ b/apps/budpro-service/settings.gradle @@ -13,6 +13,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-insecure-security' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/budpro-service/src/main/java/no/nav/dolly/budpro/LocalVaultConfig.java b/apps/budpro-service/src/main/java/no/nav/dolly/budpro/LocalVaultConfig.java new file mode 100644 index 00000000000..f1db761cd03 --- /dev/null +++ b/apps/budpro-service/src/main/java/no/nav/dolly/budpro/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.dolly.budpro; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("local") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/apps/budpro-service/src/main/java/no/nav/dolly/budpro/VaultConfig.java b/apps/budpro-service/src/main/java/no/nav/dolly/budpro/VaultConfig.java deleted file mode 100644 index 8cc4992aa64..00000000000 --- a/apps/budpro-service/src/main/java/no/nav/dolly/budpro/VaultConfig.java +++ /dev/null @@ -1,38 +0,0 @@ -package no.nav.dolly.budpro; - -import io.micrometer.common.lang.NonNullApi; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import java.util.Optional; - -@Configuration -@Profile("local") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -@NonNullApi -public class VaultConfig extends AbstractVaultConfiguration { - - private static final String PROPERTY = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - Optional - .ofNullable(System.getenv().get("VAULT_TOKEN")) - .ifPresent(token -> System.setProperty(PROPERTY, token)); - var token = Optional - .ofNullable(System.getProperty(PROPERTY)) - .orElseThrow(() -> new IllegalArgumentException("Required system property '" + PROPERTY + "' not set; cannot get secrets from Vault")); - return new TokenAuthentication(token); - } - -} diff --git a/apps/dolly-frontend/build.gradle b/apps/dolly-frontend/build.gradle index 92c4a4dae0e..eac576f67e8 100644 --- a/apps/dolly-frontend/build.gradle +++ b/apps/dolly-frontend/build.gradle @@ -6,36 +6,37 @@ sonarqube { properties { property "sonar.projectKey", "dolly-frontend" property "sonar.projectName", "dolly-frontend" - property 'sonar.sources', 'src/main/java,src/main/js' + property "sonar.sources", "src/main/java,src/main/js" } } configurations { configureEach { - exclude group: 'org.springframework.boot', module: 'spring-boot-starter-actuator' + exclude group: "org.springframework.boot", module: "spring-boot-starter-actuator" } } dependencies { - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:reactive-proxy' - implementation 'no.nav.testnav.libs:reactive-session-security' - implementation 'no.nav.testnav.libs:reactive-security' - implementation 'no.nav.testnav.libs:reactive-frontend' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-frontend" + implementation "no.nav.testnav.libs:reactive-proxy" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:reactive-session-security" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" // Session - implementation 'redis.clients:jedis:5.1.2' - implementation 'org.springframework.session:spring-session-core' - implementation 'org.springframework.session:spring-session-data-redis' + implementation "redis.clients:jedis:5.1.2" + implementation "org.springframework.session:spring-session-core" + implementation "org.springframework.session:spring-session-data-redis" - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-data-redis' + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-data-redis" - implementation 'org.springframework.cloud:spring-cloud-starter-gateway' + implementation "org.springframework.cloud:spring-cloud-starter-gateway" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } \ No newline at end of file diff --git a/apps/dolly-frontend/settings.gradle b/apps/dolly-frontend/settings.gradle index aff0f7d00e4..43a27cdf7f7 100644 --- a/apps/dolly-frontend/settings.gradle +++ b/apps/dolly-frontend/settings.gradle @@ -15,6 +15,7 @@ includeBuild '../../libs/reactive-security' includeBuild '../../libs/reactive-session-security' includeBuild '../../libs/security-core' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java index 9d48992a2e6..8e2b997adb5 100644 --- a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java +++ b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java @@ -1,40 +1,10 @@ package no.nav.dolly.web.config; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; -import org.springframework.lang.NonNull; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; @Configuration @Profile("local") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class LocalVaultConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - @NonNull - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - @NonNull - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } - +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { } \ No newline at end of file diff --git a/apps/endringsmelding-frontend/build.gradle b/apps/endringsmelding-frontend/build.gradle index 24a8ee7adbc..1a65769c6d4 100644 --- a/apps/endringsmelding-frontend/build.gradle +++ b/apps/endringsmelding-frontend/build.gradle @@ -6,34 +6,32 @@ sonarqube { properties { property "sonar.projectKey", "testnav-endringsmelding-frontend" property "sonar.projectName", "testnav-endringsmelding-frontend" - property 'sonar.sources', 'src/main/java,src/main/js' - property 'sonar.tests', 'src/test/java' + property "sonar.sources", "src/main/java,src/main/js" + property "sonar.tests", "src/test/java" } } configurations { configureEach { - exclude group: 'org.springframework.boot', module: 'spring-boot-starter-actuator' + exclude group: "org.springframework.boot", module: "spring-boot-starter-actuator" } } dependencies { - implementation('no.nav.testnav.libs:security-core') { - exclude group: 'org.springframework.session', module: 'spring-session-data-redis' + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-frontend" + implementation("no.nav.testnav.libs:reactive-session-security") { + exclude group: "org.springframework.session", module: "spring-session-data-redis" + exclude group: "org.springframework.boot", module: "spring-boot-starter-data-redis" } - - implementation 'no.nav.testnav.libs:reactive-core' - - implementation('no.nav.testnav.libs:reactive-session-security') { - exclude group: 'org.springframework.session', module: 'spring-session-data-redis' - exclude group: 'org.springframework.boot', module: 'spring-boot-starter-data-redis' + implementation("no.nav.testnav.libs:security-core") { + exclude group: "org.springframework.session", module: "spring-session-data-redis" } + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:reactive-frontend' - - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" - implementation 'org.springframework.cloud:spring-cloud-starter-gateway' + implementation "org.springframework.cloud:spring-cloud-starter-gateway" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/endringsmelding-frontend/settings.gradle b/apps/endringsmelding-frontend/settings.gradle index 6f85d6501c5..69f5ef27e77 100644 --- a/apps/endringsmelding-frontend/settings.gradle +++ b/apps/endringsmelding-frontend/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-frontend' includeBuild '../../libs/reactive-session-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/config/DevConfig.java b/apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/config/DevConfig.java deleted file mode 100644 index 9e70b2ca6a4..00000000000 --- a/apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.apps.endringsmeldingfrontend.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/config/LocalVaultConfig.java b/apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/config/LocalVaultConfig.java new file mode 100644 index 00000000000..b8a0962a7c5 --- /dev/null +++ b/apps/endringsmelding-frontend/src/main/java/no/nav/testnav/apps/endringsmeldingfrontend/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.apps.endringsmeldingfrontend.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/endringsmelding-service/build.gradle b/apps/endringsmelding-service/build.gradle index 06911756cd6..43f8cd67284 100644 --- a/apps/endringsmelding-service/build.gradle +++ b/apps/endringsmelding-service/build.gradle @@ -10,18 +10,19 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:reactive-security' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:data-transfer-search-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:data-transfer-search-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/endringsmelding-service/settings.gradle b/apps/endringsmelding-service/settings.gradle index 4d0b0949ca0..c9cf7b46e18 100644 --- a/apps/endringsmelding-service/settings.gradle +++ b/apps/endringsmelding-service/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/data-transfer-search-objects' includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/DevConfig.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/DevConfig.java deleted file mode 100644 index ab63771de9f..00000000000 --- a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.endringsmeldingservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/LocalVaultConfig.java b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..9eac3d9aa08 --- /dev/null +++ b/apps/endringsmelding-service/src/main/java/no/nav/testnav/endringsmeldingservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.endringsmeldingservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/faste-data-frontend/build.gradle b/apps/faste-data-frontend/build.gradle index 8c9baa24c51..27e3a8889ca 100644 --- a/apps/faste-data-frontend/build.gradle +++ b/apps/faste-data-frontend/build.gradle @@ -6,34 +6,32 @@ sonarqube { properties { property "sonar.projectKey", "testnav-faste-data-frontend" property "sonar.projectName", "testnav-faste-data-frontend" - property 'sonar.sources', 'src/main/java,src/main/js' - property 'sonar.tests', 'src/test/java' + property "sonar.sources", "src/main/java,src/main/js" + property "sonar.tests", "src/test/java" } } configurations { configureEach { - exclude group: 'ch.qos.logback', module: 'logback-classic' + exclude group: "ch.qos.logback", module: "logback-classic" } } dependencies { - implementation('no.nav.testnav.libs:security-core') { - exclude group: 'org.springframework.session', module: 'spring-session-data-redis' + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-frontend" + implementation("no.nav.testnav.libs:reactive-session-security") { + exclude group: "org.springframework.session", module: "spring-session-data-redis" + exclude group: "org.springframework.boot", module: "spring-boot-starter-data-redis" } - - implementation 'no.nav.testnav.libs:reactive-core' - - implementation('no.nav.testnav.libs:reactive-session-security') { - exclude group: 'org.springframework.session', module: 'spring-session-data-redis' - exclude group: 'org.springframework.boot', module: 'spring-boot-starter-data-redis' + implementation("no.nav.testnav.libs:security-core") { + exclude group: "org.springframework.session", module: "spring-session-data-redis" } + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:reactive-frontend' - - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" - implementation 'org.springframework.cloud:spring-cloud-starter-gateway' + implementation "org.springframework.cloud:spring-cloud-starter-gateway" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/faste-data-frontend/settings.gradle b/apps/faste-data-frontend/settings.gradle index 921b9e7763e..0f37fce794f 100644 --- a/apps/faste-data-frontend/settings.gradle +++ b/apps/faste-data-frontend/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-frontend' includeBuild '../../libs/reactive-session-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/faste-data-frontend/src/main/java/no/nav/testnav/apps/fastedatafrontend/config/DevConfig.java b/apps/faste-data-frontend/src/main/java/no/nav/testnav/apps/fastedatafrontend/config/DevConfig.java deleted file mode 100644 index aa61e831d7b..00000000000 --- a/apps/faste-data-frontend/src/main/java/no/nav/testnav/apps/fastedatafrontend/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.apps.fastedatafrontend.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/faste-data-frontend/src/main/java/no/nav/testnav/apps/fastedatafrontend/config/LocalVaultConfig.java b/apps/faste-data-frontend/src/main/java/no/nav/testnav/apps/fastedatafrontend/config/LocalVaultConfig.java new file mode 100644 index 00000000000..2875b0a6ff4 --- /dev/null +++ b/apps/faste-data-frontend/src/main/java/no/nav/testnav/apps/fastedatafrontend/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.apps.fastedatafrontend.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/generer-arbeidsforhold-populasjon-service/build.gradle b/apps/generer-arbeidsforhold-populasjon-service/build.gradle index 96d217a72ff..dfd817591a0 100644 --- a/apps/generer-arbeidsforhold-populasjon-service/build.gradle +++ b/apps/generer-arbeidsforhold-populasjon-service/build.gradle @@ -10,21 +10,19 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-insecure-security" + implementation "no.nav.testnav.libs:vault" - - implementation 'no.nav.testnav.libs:security-core' - - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-insecure-security' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:commands' - - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-web' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-web" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/generer-arbeidsforhold-populasjon-service/settings.gradle b/apps/generer-arbeidsforhold-populasjon-service/settings.gradle index 8489d0c4c11..cb622304069 100644 --- a/apps/generer-arbeidsforhold-populasjon-service/settings.gradle +++ b/apps/generer-arbeidsforhold-populasjon-service/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-insecure-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/DevConfig.java b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/DevConfig.java deleted file mode 100644 index 760e5ebfca7..00000000000 --- a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnav.genererarbeidsforholdpopulasjonservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/LocalVaultConfig.java b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..9ad9109e77e --- /dev/null +++ b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnav.genererarbeidsforholdpopulasjonservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/generer-navn-service/build.gradle b/apps/generer-navn-service/build.gradle index daed7ca1a1f..9f184de8c41 100644 --- a/apps/generer-navn-service/build.gradle +++ b/apps/generer-navn-service/build.gradle @@ -10,19 +10,19 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/generer-navn-service/settings.gradle b/apps/generer-navn-service/settings.gradle index cd3395308ff..9d6adf62155 100644 --- a/apps/generer-navn-service/settings.gradle +++ b/apps/generer-navn-service/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' includeBuild '../../libs/testing' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/DevConfig.java b/apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/DevConfig.java deleted file mode 100644 index bb204187a9f..00000000000 --- a/apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnorge.generernavnservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/LocalVaultConfig.java b/apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..dd1f7038efd --- /dev/null +++ b/apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.generernavnservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/generer-organisasjon-populasjon-service/build.gradle b/apps/generer-organisasjon-populasjon-service/build.gradle index a3fccd570c7..fd28ad05b83 100644 --- a/apps/generer-organisasjon-populasjon-service/build.gradle +++ b/apps/generer-organisasjon-populasjon-service/build.gradle @@ -10,40 +10,40 @@ sonarqube { } dependencies { - - implementation 'no.nav.testnav.libs:avro-schema' - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:database' - implementation 'no.nav.testnav.libs:kafka-config' - implementation 'no.nav.testnav.libs:kafka-producers' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - - implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' + implementation "no.nav.testnav.libs:avro-schema" + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:database" + implementation "no.nav.testnav.libs:kafka-config" + implementation "no.nav.testnav.libs:kafka-producers" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" + + implementation "org.springframework.cloud:spring-cloud-vault-config-databases" - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config - implementation 'org.springframework.kafka:spring-kafka' + implementation "org.springframework.kafka:spring-kafka" implementation "io.confluent:kafka-avro-serializer:$versions.avro" implementation "jakarta.validation:jakarta.validation-api:$versions.jakartaValidation" - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' - implementation 'com.h2database:h2' - implementation 'com.zaxxer:HikariCP' + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" + implementation "com.h2database:h2" + implementation "com.zaxxer:HikariCP" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" implementation "org.projectreactor:reactor-spring:$versions.reactorSpring" - implementation 'org.postgresql:postgresql' + implementation "org.postgresql:postgresql" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/generer-organisasjon-populasjon-service/settings.gradle b/apps/generer-organisasjon-populasjon-service/settings.gradle index 27ad3a8130f..ccf59c03fa9 100644 --- a/apps/generer-organisasjon-populasjon-service/settings.gradle +++ b/apps/generer-organisasjon-populasjon-service/settings.gradle @@ -16,6 +16,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/DevConfig.java b/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/DevConfig.java deleted file mode 100644 index 2003c646d5f..00000000000 --- a/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnav.genererorganisasjonpopulasjonservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/LocalVaultConfig.java b/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..981f2580c3d --- /dev/null +++ b/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnav.genererorganisasjonpopulasjonservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/generer-synt-amelding-service/build.gradle b/apps/generer-synt-amelding-service/build.gradle index 582abaf023a..ac3cbd6f43a 100644 --- a/apps/generer-synt-amelding-service/build.gradle +++ b/apps/generer-synt-amelding-service/build.gradle @@ -10,21 +10,21 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:domain" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:domain' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' - - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/generer-synt-amelding-service/settings.gradle b/apps/generer-synt-amelding-service/settings.gradle index ef0b90b9536..8f3249c185e 100644 --- a/apps/generer-synt-amelding-service/settings.gradle +++ b/apps/generer-synt-amelding-service/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/DevConfig.java b/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/DevConfig.java deleted file mode 100644 index 52cf51fc286..00000000000 --- a/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnorge.generersyntameldingservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/LocalVaultConfig.java b/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..72f4c56e31c --- /dev/null +++ b/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.generersyntameldingservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/helsepersonell-service/build.gradle b/apps/helsepersonell-service/build.gradle index f7535f9d68f..71da5ae729f 100644 --- a/apps/helsepersonell-service/build.gradle +++ b/apps/helsepersonell-service/build.gradle @@ -10,16 +10,16 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" diff --git a/apps/helsepersonell-service/settings.gradle b/apps/helsepersonell-service/settings.gradle index 68390be5bd8..27bbf168265 100644 --- a/apps/helsepersonell-service/settings.gradle +++ b/apps/helsepersonell-service/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' includeBuild '../../libs/testing' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/DevConfig.java b/apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/DevConfig.java deleted file mode 100644 index a809dc7ff44..00000000000 --- a/apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnorge.helsepersonellservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/LocalVaultConfig.java b/apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..39fb1767499 --- /dev/null +++ b/apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.helsepersonellservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/inntektsmelding-generator-service/build.gradle b/apps/inntektsmelding-generator-service/build.gradle index 22e95963649..e1fcef6e6b0 100644 --- a/apps/inntektsmelding-generator-service/build.gradle +++ b/apps/inntektsmelding-generator-service/build.gradle @@ -10,13 +10,14 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:servlet-security' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" @@ -30,9 +31,9 @@ dependencies { implementation "ma.glasnost.orika:orika-core:$versions.orika" - implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml' - implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0' - implementation 'org.apache.commons:commons-text:1.11.0' + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0" + implementation "org.apache.commons:commons-text:1.11.0" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/inntektsmelding-generator-service/settings.gradle b/apps/inntektsmelding-generator-service/settings.gradle index 3935a9c629f..9100c860bef 100644 --- a/apps/inntektsmelding-generator-service/settings.gradle +++ b/apps/inntektsmelding-generator-service/settings.gradle @@ -9,6 +9,7 @@ includeBuild "../../plugins/java" includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/inntektsmelding-generator-service/src/main/java/no/nav/testnav/inntektsmeldinggeneratorservice/config/DevConfig.java b/apps/inntektsmelding-generator-service/src/main/java/no/nav/testnav/inntektsmeldinggeneratorservice/config/DevConfig.java deleted file mode 100644 index 63cd14425e4..00000000000 --- a/apps/inntektsmelding-generator-service/src/main/java/no/nav/testnav/inntektsmeldinggeneratorservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.inntektsmeldinggeneratorservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/inntektsmelding-generator-service/src/main/java/no/nav/testnav/inntektsmeldinggeneratorservice/config/LocalVaultConfig.java b/apps/inntektsmelding-generator-service/src/main/java/no/nav/testnav/inntektsmeldinggeneratorservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..14e707c8b34 --- /dev/null +++ b/apps/inntektsmelding-generator-service/src/main/java/no/nav/testnav/inntektsmeldinggeneratorservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.inntektsmeldinggeneratorservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/inntektsmelding-service/build.gradle b/apps/inntektsmelding-service/build.gradle index 1f291182f3a..3a07a3c963c 100644 --- a/apps/inntektsmelding-service/build.gradle +++ b/apps/inntektsmelding-service/build.gradle @@ -10,27 +10,27 @@ sonarqube { } dependencies { - - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-security' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.cloud:spring-cloud-vault-config-databases" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" + implementation "org.springframework.boot:spring-boot-starter-security" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" implementation "no.nav.tjenestespesifikasjoner:nav-altinn-inntektsmelding:$versions.navAltinnInntektsmelding" - implementation 'org.apache.commons:commons-io:1.3.2' + implementation "org.apache.commons:commons-io:1.3.2" - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' - implementation 'com.h2database:h2' - implementation 'org.postgresql:postgresql' + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" + implementation "com.h2database:h2" + implementation "org.postgresql:postgresql" } diff --git a/apps/inntektsmelding-service/settings.gradle b/apps/inntektsmelding-service/settings.gradle index c21b8727a14..712f6c842d3 100644 --- a/apps/inntektsmelding-service/settings.gradle +++ b/apps/inntektsmelding-service/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/DevConfig.java b/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/DevConfig.java deleted file mode 100644 index b2122036136..00000000000 --- a/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnav.inntektsmeldingservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/LocalVaultConfig.java b/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..5946d0541ba --- /dev/null +++ b/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnav.inntektsmeldingservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/jenkins-batch-status-service/build.gradle b/apps/jenkins-batch-status-service/build.gradle index 96be491762b..93b20139330 100644 --- a/apps/jenkins-batch-status-service/build.gradle +++ b/apps/jenkins-batch-status-service/build.gradle @@ -10,22 +10,22 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' - - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/jenkins-batch-status-service/settings.gradle b/apps/jenkins-batch-status-service/settings.gradle index fc49d836f47..9fd9b69933d 100644 --- a/apps/jenkins-batch-status-service/settings.gradle +++ b/apps/jenkins-batch-status-service/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/DevConfig.java b/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/DevConfig.java deleted file mode 100644 index 6e4fb8571af..00000000000 --- a/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnorge.jenkinsbatchstatusservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} diff --git a/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/LocalVaultConfig.java b/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..d97f122e6bc --- /dev/null +++ b/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.jenkinsbatchstatusservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/apps/joark-dokument-service/build.gradle b/apps/joark-dokument-service/build.gradle index 27ac16d7327..ed4bdc88323 100644 --- a/apps/joark-dokument-service/build.gradle +++ b/apps/joark-dokument-service/build.gradle @@ -10,20 +10,20 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:domain" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:domain' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/joark-dokument-service/settings.gradle b/apps/joark-dokument-service/settings.gradle index 3616ad10c4e..0a7aaa0bcc4 100644 --- a/apps/joark-dokument-service/settings.gradle +++ b/apps/joark-dokument-service/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/DevConfig.java b/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/DevConfig.java deleted file mode 100644 index a68d1cb1c37..00000000000 --- a/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.joarkdokumentservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/LocalVaultConfig.java b/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..5f9ec2f564d --- /dev/null +++ b/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.joarkdokumentservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/kodeverk-service/build.gradle b/apps/kodeverk-service/build.gradle index 56d1d5fe8fc..68778960bd4 100644 --- a/apps/kodeverk-service/build.gradle +++ b/apps/kodeverk-service/build.gradle @@ -10,29 +10,29 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-insecure-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:servlet-insecure-security' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' + implementation "org.springframework.cloud:spring-cloud-starter-vault-config" + implementation "org.springframework.boot:spring-boot-starter-actuator" - implementation 'org.springframework.cloud:spring-cloud-starter-vault-config' - implementation 'org.springframework.boot:spring-boot-starter-actuator' - - implementation 'io.micrometer:micrometer-registry-prometheus' + implementation "io.micrometer:micrometer-registry-prometheus" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" - implementation 'org.springframework.boot:spring-boot-starter-cache' + implementation "org.springframework.boot:spring-boot-starter-cache" - implementation 'com.github.ben-manes.caffeine:caffeine' + implementation "com.github.ben-manes.caffeine:caffeine" } -description = 'kodeverk-service' +description = "kodeverk-service" diff --git a/apps/kodeverk-service/settings.gradle b/apps/kodeverk-service/settings.gradle index 7b680dfe7ba..6535871e728 100644 --- a/apps/kodeverk-service/settings.gradle +++ b/apps/kodeverk-service/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/servlet-core' includeBuild '../../libs/reactive-core' includeBuild '../../libs/servlet-insecure-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/kodeverk-service/src/main/java/no/nav/testnav/kodeverkservice/config/DevConfig.java b/apps/kodeverk-service/src/main/java/no/nav/testnav/kodeverkservice/config/DevConfig.java deleted file mode 100644 index 1024a309eab..00000000000 --- a/apps/kodeverk-service/src/main/java/no/nav/testnav/kodeverkservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.kodeverkservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} diff --git a/apps/kodeverk-service/src/main/java/no/nav/testnav/kodeverkservice/config/LocalVaultConfig.java b/apps/kodeverk-service/src/main/java/no/nav/testnav/kodeverkservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..de370850363 --- /dev/null +++ b/apps/kodeverk-service/src/main/java/no/nav/testnav/kodeverkservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.kodeverkservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/apps/levende-arbeidsforhold-ansettelse/build.gradle b/apps/levende-arbeidsforhold-ansettelse/build.gradle index 58bdaf642ac..90dcde18837 100644 --- a/apps/levende-arbeidsforhold-ansettelse/build.gradle +++ b/apps/levende-arbeidsforhold-ansettelse/build.gradle @@ -23,35 +23,36 @@ sonarqube { dependencies { - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-insecure-security' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:data-transfer-search-objects' - implementation 'no.nav.testnav.libs:database' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:data-transfer-search-objects" + implementation "no.nav.testnav.libs:database" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-insecure-security" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" - implementation 'org.springframework.cloud:spring-cloud-starter-vault-config' + implementation "org.springframework.cloud:spring-cloud-starter-vault-config" - implementation 'org.postgresql:postgresql:42.7.3' + implementation "org.postgresql:postgresql:42.7.3" - implementation 'io.micrometer:micrometer-registry-prometheus' - implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0' - implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.21' + implementation "io.micrometer:micrometer-registry-prometheus" + implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0" + implementation "io.swagger.core.v3:swagger-annotations-jakarta:2.2.21" - implementation 'org.hibernate.validator:hibernate-validator' + implementation "org.hibernate.validator:hibernate-validator" - testImplementation 'org.springframework.boot:spring-boot-starter-test' - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.boot:spring-boot-starter-test" + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" - implementation 'org.projectlombok:lombok' - annotationProcessor 'org.projectlombok:lombok' - testAnnotationProcessor 'org.projectlombok:lombok' + implementation "org.projectlombok:lombok" + annotationProcessor "org.projectlombok:lombok" + testAnnotationProcessor "org.projectlombok:lombok" - implementation 'com.zaxxer:HikariCP' - implementation 'com.h2database:h2' + implementation "com.zaxxer:HikariCP" + implementation "com.h2database:h2" } diff --git a/apps/levende-arbeidsforhold-ansettelse/settings.gradle b/apps/levende-arbeidsforhold-ansettelse/settings.gradle index dae427bd2bc..7c8a740fb8c 100644 --- a/apps/levende-arbeidsforhold-ansettelse/settings.gradle +++ b/apps/levende-arbeidsforhold-ansettelse/settings.gradle @@ -11,7 +11,7 @@ includeBuild '../../libs/servlet-insecure-security' includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/data-transfer-search-objects' includeBuild '../../libs/database' -includeBuild '../../.github/workflows' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/DevConfig.java b/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/DevConfig.java deleted file mode 100644 index 18bb9580a1e..00000000000 --- a/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.levendearbeidsforholdansettelse.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/LocalVaultConfig.java b/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/LocalVaultConfig.java new file mode 100644 index 00000000000..99bd73b3072 --- /dev/null +++ b/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.levendearbeidsforholdansettelse.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/levende-arbeidsforhold-scheduler/build.gradle b/apps/levende-arbeidsforhold-scheduler/build.gradle index f0cc5802adc..5436a38c43e 100644 --- a/apps/levende-arbeidsforhold-scheduler/build.gradle +++ b/apps/levende-arbeidsforhold-scheduler/build.gradle @@ -15,6 +15,7 @@ dependencies { implementation "no.nav.testnav.libs:data-transfer-objects" implementation "no.nav.testnav.libs:servlet-security" implementation "no.nav.testnav.libs:servlet-insecure-security" + implementation "no.nav.testnav.libs:vault" implementation "org.springframework.boot:spring-boot-starter-web" implementation "org.springframework.boot:spring-boot-starter-quartz" diff --git a/apps/levende-arbeidsforhold-scheduler/settings.gradle b/apps/levende-arbeidsforhold-scheduler/settings.gradle index 2639ddf73a9..a71ddd1e37e 100644 --- a/apps/levende-arbeidsforhold-scheduler/settings.gradle +++ b/apps/levende-arbeidsforhold-scheduler/settings.gradle @@ -11,7 +11,7 @@ includeBuild '../../libs/servlet-security' includeBuild '../../libs/servlet-insecure-security' includeBuild '../../libs/testing' includeBuild '../../.github/workflows' - +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/config/DevConfig.java b/apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/config/DevConfig.java deleted file mode 100644 index 91cb01e9e00..00000000000 --- a/apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.levendearbeidsforholdscheduler.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/config/LocalVaultConfig.java b/apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/config/LocalVaultConfig.java new file mode 100644 index 00000000000..cdd4484e175 --- /dev/null +++ b/apps/levende-arbeidsforhold-scheduler/src/main/java/no/nav/testnav/levendearbeidsforholdscheduler/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.levendearbeidsforholdscheduler.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/levende-arbeidsforhold-service/build.gradle b/apps/levende-arbeidsforhold-service/build.gradle index 1ff86f414b6..d99b1976de8 100644 --- a/apps/levende-arbeidsforhold-service/build.gradle +++ b/apps/levende-arbeidsforhold-service/build.gradle @@ -20,6 +20,7 @@ dependencies { implementation "no.nav.testnav.libs:security-core" implementation "no.nav.testnav.libs:servlet-core" implementation "no.nav.testnav.libs:servlet-insecure-security" + implementation "no.nav.testnav.libs:vault" implementation "org.apache.kafka:kafka-clients:$versions.apacheKafka" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" diff --git a/apps/levende-arbeidsforhold-service/settings.gradle b/apps/levende-arbeidsforhold-service/settings.gradle index b20e80d0ce7..564bb75acd1 100644 --- a/apps/levende-arbeidsforhold-service/settings.gradle +++ b/apps/levende-arbeidsforhold-service/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/servlet-insecure-security' includeBuild '../../libs/data-transfer-objects' includeBuild '../../.github/workflows' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/config/DevConfig.java b/apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/config/DevConfig.java deleted file mode 100644 index 7d72c0cabd5..00000000000 --- a/apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.levendearbeidsforholdservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/config/LocalVaultConfig.java b/apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..be631e12346 --- /dev/null +++ b/apps/levende-arbeidsforhold-service/src/main/java/no/nav/testnav/levendearbeidsforholdservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.levendearbeidsforholdservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/miljoer-service/build.gradle b/apps/miljoer-service/build.gradle index 6ba4a6a7266..eaab96c581f 100644 --- a/apps/miljoer-service/build.gradle +++ b/apps/miljoer-service/build.gradle @@ -10,19 +10,19 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/miljoer-service/settings.gradle b/apps/miljoer-service/settings.gradle index 339b7c0335f..296f776b0dc 100644 --- a/apps/miljoer-service/settings.gradle +++ b/apps/miljoer-service/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java b/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java deleted file mode 100644 index cffa79859bc..00000000000 --- a/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java +++ /dev/null @@ -1,39 +0,0 @@ -package no.nav.registre.testnorge.miljoerservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.lang.NonNull; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - @NonNull - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - @NonNull - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/LocalVaultConfig.java b/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..8f786521066 --- /dev/null +++ b/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.miljoerservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/oppsummeringsdokument-service/build.gradle b/apps/oppsummeringsdokument-service/build.gradle index 98a6449f8ae..afe4654c998 100644 --- a/apps/oppsummeringsdokument-service/build.gradle +++ b/apps/oppsummeringsdokument-service/build.gradle @@ -14,26 +14,27 @@ dependencies { implementation "javax.activation:activation:$versions.javaxActivation" implementation "org.glassfish.jaxb:jaxb-runtime:$versions.jaxb" - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:servlet-security' - implementation 'no.nav.testnav.xsd:arbeidsforhold-xsd' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + implementation "no.nav.testnav.xsd:arbeidsforhold-xsd" - implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml' + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml" - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" implementation "org.opensearch.client:spring-data-opensearch:$versions.opensearch" - implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch' + implementation "org.springframework.boot:spring-boot-starter-data-elasticsearch" implementation "com.fasterxml.jackson.core:jackson-core:$versions.jackson" - implementation 'org.springframework.kafka:spring-kafka' + implementation "org.springframework.kafka:spring-kafka" implementation "org.apache.kafka:kafka-clients:$versions.apacheKafka" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/oppsummeringsdokument-service/settings.gradle b/apps/oppsummeringsdokument-service/settings.gradle index c63fd9917c8..f74780146e5 100644 --- a/apps/oppsummeringsdokument-service/settings.gradle +++ b/apps/oppsummeringsdokument-service/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' includeBuild '../../xsd/arbeidsforhold-xsd' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/DevConfig.java b/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/DevConfig.java deleted file mode 100644 index 63d3ab126c4..00000000000 --- a/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/DevConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package no.nav.testnav.apps.oppsummeringsdokumentservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static com.nimbusds.oauth2.sdk.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -@VaultPropertySource(value = "kv/preprod/fss/oppsummeringsdokument-service/dev", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/LocalVaultConfig.java b/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..6a0af60770b --- /dev/null +++ b/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.apps.oppsummeringsdokumentservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "kv/preprod/fss/oppsummeringsdokument-service/dev", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/organisasjon-bestilling-service/build.gradle b/apps/organisasjon-bestilling-service/build.gradle index 7d6eccd8cc8..2a3d06ffb1d 100644 --- a/apps/organisasjon-bestilling-service/build.gradle +++ b/apps/organisasjon-bestilling-service/build.gradle @@ -10,29 +10,28 @@ sonarqube { } dependencies { - - - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config - - implementation 'com.h2database:h2' - implementation 'com.zaxxer:HikariCP' - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' - implementation 'org.postgresql:postgresql' + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config + + implementation "com.h2database:h2" + implementation "com.zaxxer:HikariCP" + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" + implementation "org.postgresql:postgresql" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/organisasjon-bestilling-service/settings.gradle b/apps/organisasjon-bestilling-service/settings.gradle index 4f619dfb811..488d5c3efcb 100644 --- a/apps/organisasjon-bestilling-service/settings.gradle +++ b/apps/organisasjon-bestilling-service/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/DevConfig.java b/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/DevConfig.java deleted file mode 100644 index c5faa0db80b..00000000000 --- a/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.apps.organisasjonbestillingservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/LocalVaultConfig.java b/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..56bd1e1a613 --- /dev/null +++ b/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.apps.organisasjonbestillingservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/organisasjon-faste-data-service/build.gradle b/apps/organisasjon-faste-data-service/build.gradle index f7c5315e881..86dac56730b 100644 --- a/apps/organisasjon-faste-data-service/build.gradle +++ b/apps/organisasjon-faste-data-service/build.gradle @@ -10,36 +10,36 @@ sonarqube { } dependencies { - - implementation 'no.nav.testnav.libs:avro-schema' - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:database' - implementation 'no.nav.testnav.libs:kafka-config' - implementation 'no.nav.testnav.libs:kafka-producers' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' + implementation "no.nav.testnav.libs:avro-schema" + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:database" + implementation "no.nav.testnav.libs:kafka-config" + implementation "no.nav.testnav.libs:kafka-producers" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" + implementation "org.springframework.cloud:spring-cloud-vault-config-databases" implementation "jakarta.validation:jakarta.validation-api:$versions.jakartaValidation" implementation "io.confluent:kafka-avro-serializer:$versions.avro" - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' - implementation 'com.zaxxer:HikariCP' - implementation 'com.h2database:h2' - implementation 'org.postgresql:postgresql' + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" + implementation "com.zaxxer:HikariCP" + implementation "com.h2database:h2" + implementation "org.postgresql:postgresql" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" implementation "org.projectreactor:reactor-spring:$versions.reactorSpring" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/organisasjon-faste-data-service/settings.gradle b/apps/organisasjon-faste-data-service/settings.gradle index d46480ab27e..6f4fbf24de9 100644 --- a/apps/organisasjon-faste-data-service/settings.gradle +++ b/apps/organisasjon-faste-data-service/settings.gradle @@ -16,6 +16,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/DevConfig.java b/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/DevConfig.java deleted file mode 100644 index b43babe19d3..00000000000 --- a/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnorge.organisasjonfastedataservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static org.apache.commons.lang3.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/LocalVaultConfig.java b/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..0c91c21b267 --- /dev/null +++ b/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.organisasjonfastedataservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/organisasjon-forvalter/build.gradle b/apps/organisasjon-forvalter/build.gradle index fbe57eb5f33..483ad83f868 100644 --- a/apps/organisasjon-forvalter/build.gradle +++ b/apps/organisasjon-forvalter/build.gradle @@ -10,42 +10,41 @@ sonarqube { } properties { - compileJava.options.encoding = 'UTF-8' + compileJava.options.encoding = "UTF-8" } dependencies { - - implementation 'no.nav.testnav.libs:kafka-config' - implementation 'no.nav.testnav.libs:kafka-producers' - implementation 'no.nav.testnav.libs:avro-schema' - - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:database' - implementation 'no.nav.testnav.libs:servlet-security' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:data-transfer-objects' - - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-security' - - implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' + implementation "no.nav.testnav.libs:avro-schema" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:database" + implementation "no.nav.testnav.libs:kafka-config" + implementation "no.nav.testnav.libs:kafka-producers" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" + implementation "org.springframework.boot:spring-boot-starter-security" + + implementation "org.springframework.cloud:spring-cloud-vault-config-databases" implementation "org.apache.avro:avro:$versions.apacheAvro" - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' - implementation 'org.postgresql:postgresql' + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" + implementation "org.postgresql:postgresql" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "ma.glasnost.orika:orika-core:$versions.orika" - testImplementation 'com.h2database:h2' - testImplementation 'no.nav.testnav.libs:testing' - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "com.h2database:h2" + testImplementation "no.nav.testnav.libs:testing" + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } -description = 'organisasjon-forvalter' +description = "organisasjon-forvalter" diff --git a/apps/organisasjon-forvalter/settings.gradle b/apps/organisasjon-forvalter/settings.gradle index dd5c7f21ef4..8f646528c2d 100644 --- a/apps/organisasjon-forvalter/settings.gradle +++ b/apps/organisasjon-forvalter/settings.gradle @@ -16,6 +16,7 @@ includeBuild '../../libs/servlet-core' includeBuild '../../libs/reactive-core' includeBuild '../../libs/servlet-security' includeBuild '../../libs/testing' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalConfig.java b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalConfig.java deleted file mode 100644 index 13f35d6caac..00000000000 --- a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalConfig.java +++ /dev/null @@ -1,46 +0,0 @@ -package no.nav.organisasjonforvalter.config; - -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import no.nav.testnav.libs.database.config.FlywayConfiguration; -import no.nav.testnav.libs.database.config.VaultHikariConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Slf4j -@Configuration -@Profile("local") -@Import({ - FlywayConfiguration.class, - VaultHikariConfiguration.class -}) -@RequiredArgsConstructor -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -class LocalConfig extends AbstractVaultConfiguration { - - private static final String VAULT_PROPERTY = "spring.cloud.vault.token"; - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_PROPERTY, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_PROPERTY); - if (isBlank(token)) { - throw new IllegalArgumentException(String.format("Påkrevet property '%s' er ikke satt.", VAULT_PROPERTY)); - } - return new TokenAuthentication(System.getProperty(VAULT_PROPERTY)); - } -} \ No newline at end of file diff --git a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalVaultConfig.java b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalVaultConfig.java new file mode 100644 index 00000000000..3a04b89a775 --- /dev/null +++ b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalVaultConfig.java @@ -0,0 +1,17 @@ +package no.nav.organisasjonforvalter.config; + +import no.nav.testnav.libs.database.config.FlywayConfiguration; +import no.nav.testnav.libs.database.config.VaultHikariConfiguration; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("local") +@Import({ + FlywayConfiguration.class, + VaultHikariConfiguration.class +}) +class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/organisasjon-mottak-service/build.gradle b/apps/organisasjon-mottak-service/build.gradle index e2205e6ad42..746d66520c0 100644 --- a/apps/organisasjon-mottak-service/build.gradle +++ b/apps/organisasjon-mottak-service/build.gradle @@ -10,28 +10,28 @@ sonarqube { } dependencies { - - implementation 'no.nav.testnav.libs:avro-schema' - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:kafka-config' - implementation 'no.nav.testnav.libs:kafka-producers' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-insecure-security' - - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config - - implementation 'org.springframework.kafka:spring-kafka' + implementation "no.nav.testnav.libs:avro-schema" + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:kafka-config" + implementation "no.nav.testnav.libs:kafka-producers" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-insecure-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config + + implementation "org.springframework.kafka:spring-kafka" implementation "org.apache.kafka:kafka-clients:$versions.apacheKafka" implementation "io.confluent:kafka-avro-serializer:$versions.avro" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/organisasjon-mottak-service/settings.gradle b/apps/organisasjon-mottak-service/settings.gradle index 9e68b2ca4c2..46f0e1fc819 100644 --- a/apps/organisasjon-mottak-service/settings.gradle +++ b/apps/organisasjon-mottak-service/settings.gradle @@ -15,6 +15,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-insecure-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/DevConfig.java b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/DevConfig.java deleted file mode 100644 index 1d957e5cc49..00000000000 --- a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnorge.organisasjonmottak.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/LocalVaultConfig.java b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/LocalVaultConfig.java new file mode 100644 index 00000000000..728679b4093 --- /dev/null +++ b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.organisasjonmottak.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/organisasjon-service/build.gradle b/apps/organisasjon-service/build.gradle index 504d05dcd93..8d8ea932c79 100644 --- a/apps/organisasjon-service/build.gradle +++ b/apps/organisasjon-service/build.gradle @@ -10,22 +10,22 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-web' + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-web" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" - testImplementation 'junit:junit:4.13.2' //TODO upgrade to JUnit5 - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' - testImplementation 'no.nav.testnav.libs:testing' + testImplementation "junit:junit:4.13.2" //TODO upgrade to JUnit5 + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" + testImplementation "no.nav.testnav.libs:testing" testImplementation "org.assertj:assertj-core:$versions.assertj" } diff --git a/apps/organisasjon-service/settings.gradle b/apps/organisasjon-service/settings.gradle index 4539eac79ba..cbd3b36a2c5 100644 --- a/apps/organisasjon-service/settings.gradle +++ b/apps/organisasjon-service/settings.gradle @@ -13,6 +13,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' includeBuild '../../libs/testing' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/DevConfig.java b/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/DevConfig.java deleted file mode 100644 index 9ca233dcbb4..00000000000 --- a/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnorge.organisasjonservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/LocalVaultConfig.java b/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..c0ef187cd8d --- /dev/null +++ b/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.organisasjonservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/organisasjon-tilgang-service/build.gradle b/apps/organisasjon-tilgang-service/build.gradle index 6e7f58f08af..47645eaf712 100644 --- a/apps/organisasjon-tilgang-service/build.gradle +++ b/apps/organisasjon-tilgang-service/build.gradle @@ -10,23 +10,24 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:reactive-security' + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" - implementation 'org.springframework.boot:spring-boot-starter-data-r2dbc' - runtimeOnly 'org.postgresql:postgresql' - implementation 'io.r2dbc:r2dbc-h2' - implementation 'org.postgresql:r2dbc-postgresql' - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' + implementation "org.springframework.boot:spring-boot-starter-data-r2dbc" + runtimeOnly "org.postgresql:postgresql" + implementation "io.r2dbc:r2dbc-h2" + implementation "org.postgresql:r2dbc-postgresql" + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" implementation "ma.glasnost.orika:orika-core:$versions.orika" implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/organisasjon-tilgang-service/settings.gradle b/apps/organisasjon-tilgang-service/settings.gradle index 29ccda116b3..05bb93a9147 100644 --- a/apps/organisasjon-tilgang-service/settings.gradle +++ b/apps/organisasjon-tilgang-service/settings.gradle @@ -8,6 +8,7 @@ includeBuild "../../plugins/java" includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/config/LocalVaultConfig.java b/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/config/LocalVaultConfig.java index ae4e7dc88bf..75e01aaa877 100644 --- a/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/config/LocalVaultConfig.java +++ b/apps/organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/organisasjontilgangservice/config/LocalVaultConfig.java @@ -1,36 +1,10 @@ package no.nav.testnav.apps.organisasjontilgangservice.config; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; @Configuration @Profile("local") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class LocalVaultConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { } \ No newline at end of file diff --git a/apps/orgnummer-service/build.gradle b/apps/orgnummer-service/build.gradle index 250446959fa..8bc4b427b81 100644 --- a/apps/orgnummer-service/build.gradle +++ b/apps/orgnummer-service/build.gradle @@ -10,28 +10,28 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:database" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:database' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" + implementation "org.springframework.cloud:spring-cloud-vault-config-databases" implementation "jakarta.validation:jakarta.validation-api:$versions.jakartaValidation" - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' - implementation 'com.h2database:h2' - implementation 'com.zaxxer:HikariCP' + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" + implementation "com.h2database:h2" + implementation "com.zaxxer:HikariCP" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - implementation 'org.postgresql:postgresql' + implementation "org.postgresql:postgresql" } diff --git a/apps/orgnummer-service/settings.gradle b/apps/orgnummer-service/settings.gradle index c2f25516dae..07ba9d46d01 100644 --- a/apps/orgnummer-service/settings.gradle +++ b/apps/orgnummer-service/settings.gradle @@ -13,6 +13,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/DevConfig.java b/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/DevConfig.java deleted file mode 100644 index d6c2e53e3da..00000000000 --- a/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.orgnrservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/LocalVaultConfig.java b/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..418c7b0df1d --- /dev/null +++ b/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.orgnrservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/oversikt-frontend/build.gradle b/apps/oversikt-frontend/build.gradle index a396a86e94f..6a0dae2b5c5 100644 --- a/apps/oversikt-frontend/build.gradle +++ b/apps/oversikt-frontend/build.gradle @@ -6,27 +6,25 @@ sonarqube { properties { property "sonar.projectKey", "testnav-oversikt-frontend" property "sonar.projectName", "testnav-oversikt-frontend" - property 'sonar.sources', 'src/main/java,src/main/js' + property "sonar.sources", "src/main/java,src/main/js" } } dependencies { - implementation('no.nav.testnav.libs:security-core') { - exclude group: 'org.springframework.session', module: 'spring-session-data-redis' + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-frontend" + implementation "no.nav.testnav.libs:reactive-security" + implementation("no.nav.testnav.libs:security-core") { + exclude group: "org.springframework.session", module: "spring-session-data-redis" } + implementation "no.nav.testnav.libs:vault" - - implementation 'no.nav.testnav.libs:reactive-core' - - implementation 'no.nav.testnav.libs:reactive-frontend' - implementation 'no.nav.testnav.libs:reactive-security' - - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.cloud:spring-cloud-starter-gateway' + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.cloud:spring-cloud-starter-gateway" - implementation 'org.springframework.session:spring-session-core' + implementation "org.springframework.session:spring-session-core" implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/oversikt-frontend/settings.gradle b/apps/oversikt-frontend/settings.gradle index 77232fe6e5f..24ff295c1a7 100644 --- a/apps/oversikt-frontend/settings.gradle +++ b/apps/oversikt-frontend/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-frontend' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java deleted file mode 100644 index 02e7974a2d0..00000000000 --- a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java +++ /dev/null @@ -1,39 +0,0 @@ -package no.nav.testnav.apps.oversiktfrontend.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.lang.NonNull; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - @NonNull - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - @NonNull - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/LocalVaultConfig.java b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/LocalVaultConfig.java new file mode 100644 index 00000000000..b8b572f6a2d --- /dev/null +++ b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.apps.oversiktfrontend.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/pdl-forvalter/build.gradle b/apps/pdl-forvalter/build.gradle index 2857450a8eb..ff7449b0f7e 100644 --- a/apps/pdl-forvalter/build.gradle +++ b/apps/pdl-forvalter/build.gradle @@ -10,36 +10,36 @@ sonarqube { } properties { - compileJava.options.encoding = 'UTF-8' + compileJava.options.encoding = "UTF-8" } dependencies { - - implementation 'no.nav.testnav.libs:database' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:data-transfer-search-objects' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-insecure-security' - - implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' - - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-validation' + implementation "no.nav.testnav.libs:database" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:data-transfer-search-objects" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-insecure-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.cloud:spring-cloud-vault-config-databases" + + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" + implementation "org.springframework.boot:spring-boot-starter-validation" implementation "ma.glasnost.orika:orika-core:$versions.orika" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - implementation 'org.postgresql:postgresql' - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' + implementation "org.postgresql:postgresql" + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" implementation "com.fasterxml.jackson.core:jackson-core:$versions.jackson" - testImplementation 'no.nav.testnav.libs:testing' + testImplementation "no.nav.testnav.libs:testing" } \ No newline at end of file diff --git a/apps/pdl-forvalter/settings.gradle b/apps/pdl-forvalter/settings.gradle index c5eee4e5ef0..441b3644a61 100644 --- a/apps/pdl-forvalter/settings.gradle +++ b/apps/pdl-forvalter/settings.gradle @@ -14,6 +14,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-insecure-security' includeBuild '../../libs/testing' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/LocalConfig.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/LocalConfig.java deleted file mode 100644 index 0ff4a1aa528..00000000000 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/LocalConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -package no.nav.pdl.forvalter.config; - -import no.nav.testnav.libs.database.config.FlywayConfiguration; -import no.nav.testnav.libs.database.config.VaultHikariConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("local") -@Import({ - FlywayConfiguration.class, - VaultHikariConfiguration.class -}) -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class LocalConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/LocalVaultConfig.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/LocalVaultConfig.java new file mode 100644 index 00000000000..65026b7c5b9 --- /dev/null +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/LocalVaultConfig.java @@ -0,0 +1,17 @@ +package no.nav.pdl.forvalter.config; + +import no.nav.testnav.libs.database.config.FlywayConfiguration; +import no.nav.testnav.libs.database.config.VaultHikariConfiguration; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("local") +@Import({ + FlywayConfiguration.class, + VaultHikariConfiguration.class +}) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/person-faste-data-service/build.gradle b/apps/person-faste-data-service/build.gradle index 7051cd1700b..1b451ac5549 100644 --- a/apps/person-faste-data-service/build.gradle +++ b/apps/person-faste-data-service/build.gradle @@ -10,26 +10,26 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:reactive-security' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config - - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" - implementation 'com.h2database:h2' - implementation 'com.zaxxer:HikariCP' - implementation 'org.postgresql:postgresql' + implementation "com.h2database:h2" + implementation "com.zaxxer:HikariCP" + implementation "org.postgresql:postgresql" implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/person-faste-data-service/settings.gradle b/apps/person-faste-data-service/settings.gradle index 1afbd34226a..943ea9907cb 100644 --- a/apps/person-faste-data-service/settings.gradle +++ b/apps/person-faste-data-service/settings.gradle @@ -9,6 +9,7 @@ includeBuild "../../plugins/java" includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/person-faste-data-service/src/main/java/no/nav/testnav/personfastedataservice/config/DevConfig.java b/apps/person-faste-data-service/src/main/java/no/nav/testnav/personfastedataservice/config/DevConfig.java deleted file mode 100644 index ef810156209..00000000000 --- a/apps/person-faste-data-service/src/main/java/no/nav/testnav/personfastedataservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.personfastedataservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static org.apache.commons.lang3.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/person-faste-data-service/src/main/java/no/nav/testnav/personfastedataservice/config/LocalVaultConfig.java b/apps/person-faste-data-service/src/main/java/no/nav/testnav/personfastedataservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..5de39260231 --- /dev/null +++ b/apps/person-faste-data-service/src/main/java/no/nav/testnav/personfastedataservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.personfastedataservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/person-organisasjon-tilgang-service/build.gradle b/apps/person-organisasjon-tilgang-service/build.gradle index d7959ce9df3..6498a92c45c 100644 --- a/apps/person-organisasjon-tilgang-service/build.gradle +++ b/apps/person-organisasjon-tilgang-service/build.gradle @@ -22,18 +22,19 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:reactive-security' - implementation 'no.nav.testnav.libs:security-core' + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" implementation "com.fasterxml.jackson.core:jackson-core:$versions.jackson" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' - testImplementation 'no.nav.testnav.libs:integration-test' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" + testImplementation "no.nav.testnav.libs:integration-test" testImplementation "com.squareup.okhttp3:okhttp:$versions.okhttp" testImplementation "com.squareup.okhttp3:mockwebserver:$versions.okhttp" } diff --git a/apps/person-organisasjon-tilgang-service/settings.gradle b/apps/person-organisasjon-tilgang-service/settings.gradle index 6c93b49e1a4..3b9b14e0aa5 100644 --- a/apps/person-organisasjon-tilgang-service/settings.gradle +++ b/apps/person-organisasjon-tilgang-service/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/integration-test' includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/person-organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/persontilgangservice/config/LocalVaultConfig.java b/apps/person-organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/persontilgangservice/config/LocalVaultConfig.java index c4a0f0e1aba..2772ad8e8e7 100644 --- a/apps/person-organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/persontilgangservice/config/LocalVaultConfig.java +++ b/apps/person-organisasjon-tilgang-service/src/main/java/no/nav/testnav/apps/persontilgangservice/config/LocalVaultConfig.java @@ -1,36 +1,10 @@ package no.nav.testnav.apps.persontilgangservice.config; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; @Configuration @Profile("local") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class LocalVaultConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { } \ No newline at end of file diff --git a/apps/person-search-service/build.gradle b/apps/person-search-service/build.gradle index 02965927619..63c36ef991a 100644 --- a/apps/person-search-service/build.gradle +++ b/apps/person-search-service/build.gradle @@ -10,26 +10,26 @@ sonarqube { } dependencies { - - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.boot:spring-boot-starter-data-elasticsearch" implementation "org.opensearch.client:spring-data-opensearch:$versions.opensearch" implementation "com.fasterxml.jackson.core:jackson-core:$versions.jackson" - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-cache' + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-cache" implementation "ma.glasnost.orika:orika-core:$versions.orika" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } \ No newline at end of file diff --git a/apps/person-search-service/settings.gradle b/apps/person-search-service/settings.gradle index 373092ece6d..ec9890b0ad9 100644 --- a/apps/person-search-service/settings.gradle +++ b/apps/person-search-service/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/DevVaultConfig.java b/apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/DevVaultConfig.java deleted file mode 100644 index 18545f22d53..00000000000 --- a/apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/DevVaultConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnorge.personsearchservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevVaultConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/LocalVaultConfig.java b/apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..56334534dc9 --- /dev/null +++ b/apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.personsearchservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/person-service/build.gradle b/apps/person-service/build.gradle index 1b0944a8593..89e71af63a4 100644 --- a/apps/person-service/build.gradle +++ b/apps/person-service/build.gradle @@ -10,21 +10,21 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-cache' + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-cache" implementation "ma.glasnost.orika:orika-core:$versions.orika" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/person-service/settings.gradle b/apps/person-service/settings.gradle index 9ebfc24c114..1a495388428 100644 --- a/apps/person-service/settings.gradle +++ b/apps/person-service/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/DevConfig.java b/apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/DevConfig.java deleted file mode 100644 index 43c451c2a73..00000000000 --- a/apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/DevConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package no.nav.testnav.apps.personservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; -import static java.lang.String.format; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String TOKEN_PROPERTY = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(TOKEN_PROPERTY, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(TOKEN_PROPERTY); - if (isBlank(token)) { - throw new IllegalArgumentException(format("Påkrevet property '%s' er ikke satt.", TOKEN_PROPERTY)); - } - return new TokenAuthentication(System.getProperty(TOKEN_PROPERTY)); - } -} \ No newline at end of file diff --git a/apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/LocalVaultConfig.java b/apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..d7bfa2a5777 --- /dev/null +++ b/apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.apps.personservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/profil-api/build.gradle b/apps/profil-api/build.gradle index 05b7ac72f0d..cc5fb156a3c 100644 --- a/apps/profil-api/build.gradle +++ b/apps/profil-api/build.gradle @@ -10,23 +10,23 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' + implementation "no.nav.testnav.libs:data-transfer-objects" - implementation 'no.nav.testnav.libs:data-transfer-objects' - - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-web' + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-web" - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } -description = 'profil-api' +description = "profil-api" diff --git a/apps/profil-api/settings.gradle b/apps/profil-api/settings.gradle index 3ad637cb7fa..cad24f303ed 100644 --- a/apps/profil-api/settings.gradle +++ b/apps/profil-api/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/DevConfig.java b/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/DevConfig.java deleted file mode 100644 index f0130a45055..00000000000 --- a/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnorge.profil.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/LocalVaultConfig.java b/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/LocalVaultConfig.java new file mode 100644 index 00000000000..7daebbcbf11 --- /dev/null +++ b/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.profil.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/skattekort-service/build.gradle b/apps/skattekort-service/build.gradle index a49aaa40e38..ea0d35ce0f7 100644 --- a/apps/skattekort-service/build.gradle +++ b/apps/skattekort-service/build.gradle @@ -1,7 +1,7 @@ plugins { id "dolly-apps" - id 'org.unbroken-dome.xjc' version '2.0.0' + id "org.unbroken-dome.xjc" version "2.0.0" } sonarqube { @@ -13,29 +13,30 @@ sonarqube { sourceSets { main { - xjcBinding.srcDirs = ['resources/xjb'] + xjcBinding.srcDirs = ["resources/xjb"] } } xjc { - xjcVersion = '3.0' - srcDirName = 'resources/schema' + xjcVersion = "3.0" + srcDirName = "resources/schema" } dependencies { implementation "jakarta.xml.bind:jakarta.xml.bind-api:$versions.jakartaXmlBindApi" implementation "org.glassfish.jaxb:jaxb-runtime:$versions.jaxb" - implementation 'org.json:json:20231013' + implementation "org.json:json:20231013" - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:reactive-security' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" diff --git a/apps/skattekort-service/settings.gradle b/apps/skattekort-service/settings.gradle index a35cbdbc703..c8a9fc1bea1 100644 --- a/apps/skattekort-service/settings.gradle +++ b/apps/skattekort-service/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' includeBuild '../../libs/data-transfer-objects' +includeBuild '../../libs/vault' gradleEnterprise { buildScan { diff --git a/apps/skattekort-service/src/main/java/no/nav/skattekortservice/config/DevConfig.java b/apps/skattekort-service/src/main/java/no/nav/skattekortservice/config/DevConfig.java deleted file mode 100644 index c2d763946ef..00000000000 --- a/apps/skattekort-service/src/main/java/no/nav/skattekortservice/config/DevConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package no.nav.skattekortservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_PROPERTY = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_PROPERTY, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_PROPERTY); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property '%s' er ikke satt.".formatted(VAULT_PROPERTY)); - } - return new TokenAuthentication(System.getProperty(VAULT_PROPERTY)); - } -} \ No newline at end of file diff --git a/apps/skattekort-service/src/main/java/no/nav/skattekortservice/config/LocalVaultConfig.java b/apps/skattekort-service/src/main/java/no/nav/skattekortservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..d1a4512c101 --- /dev/null +++ b/apps/skattekort-service/src/main/java/no/nav/skattekortservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.skattekortservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/sykemelding-api/build.gradle b/apps/sykemelding-api/build.gradle index ca0ef57453e..e7893d2c807 100644 --- a/apps/sykemelding-api/build.gradle +++ b/apps/sykemelding-api/build.gradle @@ -10,31 +10,32 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:avro-schema' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:avro-schema" + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-security' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-security" implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" implementation "com.ibm.mq:mq-jms-spring-boot-starter:$versions.mq" - implementation 'org.springframework.kafka:spring-kafka' + implementation "org.springframework.kafka:spring-kafka" implementation "jakarta.xml.bind:jakarta.xml.bind-api:$versions.jakartaXmlBindApi" implementation "jakarta.activation:jakarta.activation-api:$versions.jakartaActivation" implementation "org.glassfish.jaxb:jaxb-runtime:$versions.jaxb" - implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml' + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml" implementation "org.apache.kafka:kafka-clients:$versions.apacheKafka" implementation "io.confluent:kafka-avro-serializer:$versions.avro" - testImplementation 'no.nav.testnav.libs:testing' - testImplementation 'org.springframework.security:spring-security-test' - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "no.nav.testnav.libs:testing" + testImplementation "org.springframework.security:spring-security-test" + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/sykemelding-api/settings.gradle b/apps/sykemelding-api/settings.gradle index 8dce3838ae4..8caaf392e5b 100644 --- a/apps/sykemelding-api/settings.gradle +++ b/apps/sykemelding-api/settings.gradle @@ -14,6 +14,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' includeBuild '../../libs/testing' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/DevConfig.java b/apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/DevConfig.java deleted file mode 100644 index ec5a5459157..00000000000 --- a/apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.registre.testnorge.sykemelding.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static org.apache.commons.lang3.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/LocalVaultConfig.java b/apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/LocalVaultConfig.java new file mode 100644 index 00000000000..c35a141e2f2 --- /dev/null +++ b/apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.testnorge.sykemelding.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/synt-sykemelding-api/build.gradle b/apps/synt-sykemelding-api/build.gradle index d16feb5f7f2..64a1eabed6e 100644 --- a/apps/synt-sykemelding-api/build.gradle +++ b/apps/synt-sykemelding-api/build.gradle @@ -10,21 +10,21 @@ sonarqube { } dependencies { + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" - testImplementation 'no.nav.testnav.libs:testing' - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' - testImplementation 'junit:junit:4.13.2' //TODO upgrade to JUnit5 + testImplementation "no.nav.testnav.libs:testing" + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" + testImplementation "junit:junit:4.13.2" //TODO upgrade to JUnit5 } diff --git a/apps/synt-sykemelding-api/settings.gradle b/apps/synt-sykemelding-api/settings.gradle index 1effa97ad87..ebfcf4716b2 100644 --- a/apps/synt-sykemelding-api/settings.gradle +++ b/apps/synt-sykemelding-api/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' includeBuild '../../libs/testing' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/DevConfig.java b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/DevConfig.java deleted file mode 100644 index 91d2828b5d0..00000000000 --- a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.apps.syntsykemeldingapi.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/LocalVaultConfig.java b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/LocalVaultConfig.java new file mode 100644 index 00000000000..be09110b7fa --- /dev/null +++ b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.apps.syntsykemeldingapi.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/synt-vedtakshistorikk-service/build.gradle b/apps/synt-vedtakshistorikk-service/build.gradle index 1cc0aa03dd3..a69261890cb 100644 --- a/apps/synt-vedtakshistorikk-service/build.gradle +++ b/apps/synt-vedtakshistorikk-service/build.gradle @@ -10,21 +10,22 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - implementation 'no.nav.testnav.libs:servlet-insecure-security' - implementation 'no.nav.testnav.libs:domain' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:domain" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-insecure-security" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-security' + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-security" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "com.google.guava:guava:$versions.guava" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' - testImplementation 'junit:junit:4.13.2' //TODO upgrade to JUnit5 + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" + testImplementation "junit:junit:4.13.2" //TODO upgrade to JUnit5 } diff --git a/apps/synt-vedtakshistorikk-service/settings.gradle b/apps/synt-vedtakshistorikk-service/settings.gradle index 26c841f5cbd..b64b87a9193 100644 --- a/apps/synt-vedtakshistorikk-service/settings.gradle +++ b/apps/synt-vedtakshistorikk-service/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-insecure-security' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/DevConfig.java b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/DevConfig.java deleted file mode 100644 index b88e7345942..00000000000 --- a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/DevConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.apps.syntvedtakshistorikkservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/LocalVaultConfig.java b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..139e0c57b1f --- /dev/null +++ b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.testnav.apps.syntvedtakshistorikkservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("dev") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/tenor-search-service/build.gradle b/apps/tenor-search-service/build.gradle index ea1398e40d3..fba9a1fb78e 100644 --- a/apps/tenor-search-service/build.gradle +++ b/apps/tenor-search-service/build.gradle @@ -10,15 +10,16 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:reactive-security' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' - testImplementation 'no.nav.testnav.libs:integration-test' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" + testImplementation "no.nav.testnav.libs:integration-test" } diff --git a/apps/tenor-search-service/settings.gradle b/apps/tenor-search-service/settings.gradle index 39bbdfb050c..a9888f93d70 100644 --- a/apps/tenor-search-service/settings.gradle +++ b/apps/tenor-search-service/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/integration-test' includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/config/LocalVaultConfig.java b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/config/LocalVaultConfig.java index 4beafe1501b..16e6860d3bd 100644 --- a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/config/LocalVaultConfig.java +++ b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/config/LocalVaultConfig.java @@ -1,36 +1,10 @@ package no.nav.testnav.apps.tenorsearchservice.config; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; @Configuration @Profile("local") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class LocalVaultConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property '" + VAULT_TOKEN + "' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { } \ No newline at end of file diff --git a/apps/testnav-ident-pool/build.gradle b/apps/testnav-ident-pool/build.gradle index f1bd50720e7..b37ac17d49b 100644 --- a/apps/testnav-ident-pool/build.gradle +++ b/apps/testnav-ident-pool/build.gradle @@ -10,40 +10,41 @@ sonarqube { } properties { - compileJava.options.encoding = 'UTF-8' + compileJava.options.encoding = "UTF-8" } dependencies { - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - implementation 'no.nav.testnav.libs:servlet-insecure-security' - implementation 'no.nav.testnav.libs:database' - - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.security:spring-security-oauth2-jose' - implementation 'org.springframework.boot:spring-boot-starter-validation' - - implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config - implementation 'org.springframework.retry:spring-retry' + implementation "no.nav.testnav.libs:database" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-insecure-security" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.security:spring-security-oauth2-jose" + implementation "org.springframework.boot:spring-boot-starter-validation" + + implementation "org.springframework.cloud:spring-cloud-vault-config-databases" + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config + implementation "org.springframework.retry:spring-retry" implementation "org.aspectj:aspectjweaver:$versions.jweaver" - implementation 'com.h2database:h2' + implementation "com.h2database:h2" - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' - implementation 'org.postgresql:postgresql' + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" + implementation "org.postgresql:postgresql" implementation "ma.glasnost.orika:orika-core:$versions.orika" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' - testImplementation 'org.springframework.security:spring-security-test' - testImplementation 'no.nav.testnav.libs:testing' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" + testImplementation "org.springframework.security:spring-security-test" + testImplementation "no.nav.testnav.libs:testing" } -description = 'testnav-ident-pool' +description = "testnav-ident-pool" diff --git a/apps/testnav-ident-pool/settings.gradle b/apps/testnav-ident-pool/settings.gradle index 3e7b8c08fd6..04d6c4d706a 100644 --- a/apps/testnav-ident-pool/settings.gradle +++ b/apps/testnav-ident-pool/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-insecure-security' includeBuild '../../libs/servlet-security' includeBuild '../../libs/testing' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/LocalConfig.java b/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/LocalConfig.java deleted file mode 100644 index 988c0aa4ecd..00000000000 --- a/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/LocalConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -package no.nav.testnav.identpool.config; - -import no.nav.testnav.libs.database.config.FlywayConfiguration; -import no.nav.testnav.libs.database.config.VaultHikariConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("local") -@Import({ - FlywayConfiguration.class, - VaultHikariConfiguration.class -}) -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class LocalConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/LocalVaultConfig.java b/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/LocalVaultConfig.java new file mode 100644 index 00000000000..122cd8d948e --- /dev/null +++ b/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/LocalVaultConfig.java @@ -0,0 +1,17 @@ +package no.nav.testnav.identpool.config; + +import no.nav.testnav.libs.database.config.FlywayConfiguration; +import no.nav.testnav.libs.database.config.VaultHikariConfiguration; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("local") +@Import({ + FlywayConfiguration.class, + VaultHikariConfiguration.class +}) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/testnorge-statisk-data-forvalter/build.gradle b/apps/testnorge-statisk-data-forvalter/build.gradle index e05f2943d50..d6b76061f85 100644 --- a/apps/testnorge-statisk-data-forvalter/build.gradle +++ b/apps/testnorge-statisk-data-forvalter/build.gradle @@ -12,46 +12,47 @@ sonarqube { dependencies { implementation "com.google.guava:guava:$versions.guava" - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-security' - implementation 'no.nav.testnav.libs:kafka-config' - implementation 'no.nav.testnav.libs:kafka-producers' - implementation 'no.nav.testnav.libs:avro-schema' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:database' - implementation 'no.nav.testnav.libs:commands' - implementation 'no.nav.testnav.libs:csv-converter' - - implementation 'org.springframework.kafka:spring-kafka' + implementation "no.nav.testnav.libs:avro-schema" + implementation "no.nav.testnav.libs:commands" + implementation "no.nav.testnav.libs:csv-converter" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:database" + implementation "no.nav.testnav.libs:kafka-config" + implementation "no.nav.testnav.libs:kafka-producers" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.kafka:spring-kafka" implementation "io.confluent:kafka-avro-serializer:$versions.avro" - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config - implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' + implementation "org.springframework.boot:spring-boot-starter-data-jpa" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-vault-config-databases" - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" implementation "org.aspectj:aspectjweaver:$versions.jweaver" - implementation 'org.postgresql:postgresql' - implementation 'com.zaxxer:HikariCP' + implementation "org.postgresql:postgresql" + implementation "com.zaxxer:HikariCP" - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" - implementation 'com.h2database:h2' + implementation "com.h2database:h2" - implementation 'org.apache.httpcomponents.client5:httpclient5:5.3.1' + implementation "org.apache.httpcomponents.client5:httpclient5:5.3.1" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" implementation "com.squareup.okhttp3:okhttp:$versions.okhttp" - testImplementation 'no.nav.testnav.libs:testing' - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' - testImplementation 'org.springframework.security:spring-security-test' + testImplementation "no.nav.testnav.libs:testing" + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" + testImplementation "org.springframework.security:spring-security-test" testImplementation "com.squareup.okhttp3:mockwebserver:$versions.okhttp" } -description = 'testnorge-statisk-data-forvalter' +description = "testnorge-statisk-data-forvalter" diff --git a/apps/testnorge-statisk-data-forvalter/settings.gradle b/apps/testnorge-statisk-data-forvalter/settings.gradle index 1acf1847522..adf6eef2ad7 100644 --- a/apps/testnorge-statisk-data-forvalter/settings.gradle +++ b/apps/testnorge-statisk-data-forvalter/settings.gradle @@ -17,6 +17,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' includeBuild '../../libs/testing' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/DevConfig.java b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/DevConfig.java deleted file mode 100644 index 579ae804cf9..00000000000 --- a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/DevConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package no.nav.registre.sdforvalter.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("local") -@VaultPropertySource(value = "kv/preprod/fss/testnorge-statisk-data-forvalter/local", ignoreSecretNotFound = false) -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/LocalVaultConfig.java b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/LocalVaultConfig.java new file mode 100644 index 00000000000..d2d7a3a2897 --- /dev/null +++ b/apps/testnorge-statisk-data-forvalter/src/main/java/no/nav/registre/sdforvalter/config/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.registre.sdforvalter.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("local") +@VaultPropertySource(value = "kv/preprod/fss/testnorge-statisk-data-forvalter/local", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/tilbakemelding-api/build.gradle b/apps/tilbakemelding-api/build.gradle index cbb640e8bfe..67b3ce5db55 100644 --- a/apps/tilbakemelding-api/build.gradle +++ b/apps/tilbakemelding-api/build.gradle @@ -10,25 +10,25 @@ sonarqube { } dependencies { - - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - implementation 'no.nav.testnav.libs:slack' - - implementation 'no.nav.testnav.libs:data-transfer-objects' - - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-security' + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:slack" + implementation "no.nav.testnav.libs:vault" + + implementation "no.nav.testnav.libs:data-transfer-objects" + + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-security" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config - implementation 'org.reactivestreams:reactive-streams:1.0.4' + implementation "org.reactivestreams:reactive-streams:1.0.4" implementation "org.projectreactor:reactor-spring:$versions.reactorSpring" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } diff --git a/apps/tilbakemelding-api/settings.gradle b/apps/tilbakemelding-api/settings.gradle index ff9d177fc6e..47e3294afbd 100644 --- a/apps/tilbakemelding-api/settings.gradle +++ b/apps/tilbakemelding-api/settings.gradle @@ -12,6 +12,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' includeBuild '../../libs/slack' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/DevConfig.java b/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/DevConfig.java deleted file mode 100644 index 5e0d1a637a4..00000000000 --- a/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/DevConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package no.nav.registre.testnorge.tilbakemeldingapi.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "kv/preprod/fss/testnorge-tilbakemelding-api/dev", ignoreSecretNotFound = false) -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/LocalVaultConfig.java b/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/LocalVaultConfig.java new file mode 100644 index 00000000000..343cff4e4d8 --- /dev/null +++ b/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.registre.testnorge.tilbakemeldingapi.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "kv/preprod/fss/testnorge-tilbakemelding-api/dev", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/tps-messaging-service/build.gradle b/apps/tps-messaging-service/build.gradle index f6c23a4d1d4..a2c244db4ed 100644 --- a/apps/tps-messaging-service/build.gradle +++ b/apps/tps-messaging-service/build.gradle @@ -10,31 +10,32 @@ sonarqube { } configurations.implementation { - exclude group: 'io.netty', module: 'netty-transport-native-epoll' + exclude group: "io.netty", module: "netty-transport-native-epoll" // Avoid native Linux/Mac on non-Linux/Mac systems. } dependencies { - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - implementation 'no.nav.testnav.libs:data-transfer-search-objects' - - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'io.netty:netty-transport-native-epoll' // See above exclusion. - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' - - implementation 'com.fasterxml.jackson.core:jackson-annotations' - implementation 'com.fasterxml.jackson.core:jackson-databind' + implementation "no.nav.testnav.libs:data-transfer-search-objects" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "io.netty:netty-transport-native-epoll" // See above exclusion. + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" + + implementation "com.fasterxml.jackson.core:jackson-annotations" + implementation "com.fasterxml.jackson.core:jackson-databind" implementation "com.ibm.mq:mq-jms-spring-boot-starter:$versions.mq" - implementation 'com.ibm.icu:icu4j:74.2' + implementation "com.ibm.icu:icu4j:74.2" implementation "jakarta.xml.bind:jakarta.xml.bind-api:$versions.jakartaXmlBindApi" implementation "com.sun.xml.bind:jaxb-core:$versions.jaxb" implementation "org.glassfish.jaxb:jaxb-runtime:$versions.jaxb" - implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml' + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml" implementation "no.nav.repository.fellesreg.tpsws:nav-repository-fellesregister-jaxb-tps-s610-domain:$versions.navFellesregister" implementation "no.nav.repository.fellesreg.tpsws:nav-repository-fellesregister-jaxb-tps-m201-domain:$versions.navFellesregister" diff --git a/apps/tps-messaging-service/settings.gradle b/apps/tps-messaging-service/settings.gradle index 4eef351ae4e..cf84b0dd2d8 100644 --- a/apps/tps-messaging-service/settings.gradle +++ b/apps/tps-messaging-service/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/data-transfer-search-objects' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/LocalVaultConfig.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..9b460eca5b7 --- /dev/null +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.apps.tpsmessagingservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("local") +@VaultPropertySource(value = "serviceuser/dev/srvtestnav-tps-messa", propertyNamePrefix = "credentials.mq.", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/VaultLocalConfig.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/VaultLocalConfig.java deleted file mode 100644 index 9608b43bcad..00000000000 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/VaultLocalConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package no.nav.testnav.apps.tpsmessagingservice.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("local") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -@VaultPropertySource(value = "serviceuser/dev/srvtestnav-tps-messa", propertyNamePrefix = "credentials.mq.", ignoreSecretNotFound = false) -public class VaultLocalConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/udi-stub/build.gradle b/apps/udi-stub/build.gradle index 0a8aca55b93..b19ffb6e90f 100644 --- a/apps/udi-stub/build.gradle +++ b/apps/udi-stub/build.gradle @@ -21,38 +21,40 @@ configurations { } dependencies { - implementation platform('org.testcontainers:testcontainers-bom:1.19.8') + implementation platform("org.testcontainers:testcontainers-bom:1.19.8") implementation "com.sun.xml.ws:jaxws-rt:$versions.jaxws" - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:servlet-security' - implementation 'no.nav.testnav.libs:database' - - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-web-services' - implementation 'org.springframework.ws:spring-ws-security' - jaxb 'org.glassfish.jaxb:jaxb-xjc' - implementation 'wsdl4j:wsdl4j' - - implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' - - implementation 'org.postgresql:postgresql' - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' - implementation 'com.zaxxer:HikariCP' + + implementation "no.nav.testnav.libs:database" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" + implementation "org.springframework.boot:spring-boot-starter-web-services" + implementation "org.springframework.ws:spring-ws-security" + jaxb "org.glassfish.jaxb:jaxb-xjc" + implementation "wsdl4j:wsdl4j" + + implementation "org.springframework.cloud:spring-cloud-vault-config-databases" + + implementation "org.postgresql:postgresql" + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" + implementation "com.zaxxer:HikariCP" implementation "ma.glasnost.orika:orika-core:$versions.orika" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" - testImplementation 'com.h2database:h2' - testImplementation 'org.testcontainers:junit-jupiter' - testImplementation 'org.testcontainers:postgresql' - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' //TODO upgrade to JUnit5 + testImplementation "com.h2database:h2" + testImplementation "org.testcontainers:junit-jupiter" + testImplementation "org.testcontainers:postgresql" + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" //TODO upgrade to JUnit5 - testImplementation 'org.mockito:mockito-junit-jupiter:5.12.0' + testImplementation "org.mockito:mockito-junit-jupiter:5.12.0" } diff --git a/apps/udi-stub/settings.gradle b/apps/udi-stub/settings.gradle index 8eabd549fb1..768a4c41be3 100644 --- a/apps/udi-stub/settings.gradle +++ b/apps/udi-stub/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/database' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/udi-stub/src/main/java/no/nav/udistub/config/DevConfig.java b/apps/udi-stub/src/main/java/no/nav/udistub/config/DevConfig.java deleted file mode 100644 index fe56290eff2..00000000000 --- a/apps/udi-stub/src/main/java/no/nav/udistub/config/DevConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package no.nav.udistub.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("local") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_PROPERTY = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_PROPERTY, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_PROPERTY); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property '%s' er ikke satt.".formatted(VAULT_PROPERTY)); - } - return new TokenAuthentication(System.getProperty(VAULT_PROPERTY)); - } -} \ No newline at end of file diff --git a/apps/udi-stub/src/main/java/no/nav/udistub/config/LocalVaultConfig.java b/apps/udi-stub/src/main/java/no/nav/udistub/config/LocalVaultConfig.java new file mode 100644 index 00000000000..f928da09121 --- /dev/null +++ b/apps/udi-stub/src/main/java/no/nav/udistub/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.udistub.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("local") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/apps/varslinger-service/build.gradle b/apps/varslinger-service/build.gradle index 1d73768f5a4..fb8da68e8c9 100644 --- a/apps/varslinger-service/build.gradle +++ b/apps/varslinger-service/build.gradle @@ -10,32 +10,33 @@ sonarqube { } dependencies { - implementation "com.google.guava:guava:$versions.guava" - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:servlet-core' - implementation 'no.nav.testnav.libs:database' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:servlet-security' - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:database" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:servlet-core" + implementation "no.nav.testnav.libs:servlet-security" + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config - implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' + implementation "org.springframework.cloud:spring-cloud-vault-config-databases" - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-web' + implementation "org.springframework.boot:spring-boot-starter-security" + implementation "org.springframework.boot:spring-boot-starter-data-jpa" + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-web" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" - implementation 'com.h2database:h2' - implementation 'com.zaxxer:HikariCP' - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' - implementation 'org.postgresql:postgresql' + implementation "com.h2database:h2" + implementation "com.zaxxer:HikariCP" + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" + implementation "org.postgresql:postgresql" - testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' + testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock" } -description = 'varslinger-service' +description = "varslinger-service" diff --git a/apps/varslinger-service/settings.gradle b/apps/varslinger-service/settings.gradle index 4f583e6c517..a8de5bf5f9e 100644 --- a/apps/varslinger-service/settings.gradle +++ b/apps/varslinger-service/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/database' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/LocalConfig.java b/apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/LocalConfig.java deleted file mode 100644 index a83d6e37cdc..00000000000 --- a/apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/LocalConfig.java +++ /dev/null @@ -1,38 +0,0 @@ -package no.nav.registre.varslingerservice.config; - -import io.micrometer.common.lang.NonNullApi; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("local") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -@NonNullApi -public class LocalConfig extends AbstractVaultConfiguration { - - private static final String TOKEN_SYSTEM_PROPERTY = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(TOKEN_SYSTEM_PROPERTY, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(TOKEN_SYSTEM_PROPERTY); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(TOKEN_SYSTEM_PROPERTY)); - } -} \ No newline at end of file diff --git a/apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/LocalVaultConfig.java b/apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/LocalVaultConfig.java new file mode 100644 index 00000000000..4eef1029192 --- /dev/null +++ b/apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/LocalVaultConfig.java @@ -0,0 +1,10 @@ +package no.nav.registre.varslingerservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +@Configuration +@Profile("local") +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/docs/local_vault.md b/docs/local_vault.md new file mode 100644 index 00000000000..0acf1256fed --- /dev/null +++ b/docs/local_vault.md @@ -0,0 +1,20 @@ +# Hvordan bruke Vault for kjøring lokalt + +Enkelte applikasjoner/proxyer er avhengig av tilgang til Vault for å hente ut enkelte properties under lokal kjøring. + +Det er 3 måter å konfigurere tilgang til Vault på. Uansett hvilken metode du velger så er token gyldig i 8 timer. Du trenger altså ikke å autentisere deg på nytt før token utgår. + +### 1. Bruke Vault CLI. +Avhenger av at du har [Vault CLI](https://developer.hashicorp.com/vault/docs/commands) installert, og har autentisert deg på forhånd vha. `vault login -method=oidc`. +### 2. Sette VM option `spring.cloud.vault.token`. +Avhenger av at du henter token fra [Vault](https://vault.adeo.no/) og oppdaterer runtime configuration med VM option `-Dspring.cloud.vault.token=`. +### 3. Sette system environment variable `VAULT_TOKEN`. +Avhenger av at du henter token fra Vault og oppdaterer runtime configuration med environment variable `VAULT_TOKEN=`. + +### Prioritering +Vault token hentes i rekkefølgen: +1. Environment variable `VAULT_TOKEN`. +2. VM option `spring.cloud.vault.token`. +3. Vault CLI `vault print token`. + +Koden for dette ligger i [AbstractLocalVaultConfiguration](../libs/vault/src/main/java/no/nav/testnav/libs/vault/AbstractLocalVaultConfiguration.java). \ No newline at end of file diff --git a/examples/reactive-rest-example/build.gradle b/examples/reactive-rest-example/build.gradle index ea04abc3846..4435bd50eb9 100644 --- a/examples/reactive-rest-example/build.gradle +++ b/examples/reactive-rest-example/build.gradle @@ -10,26 +10,27 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:reactive-security' + implementation "no.nav.testnav.libs:reactive-core" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.boot:spring-boot-starter-webflux' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-data-r2dbc' + implementation "org.springframework.boot:spring-boot-starter-webflux" + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-data-r2dbc" - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config - implementation 'org.springframework.cloud:spring-cloud-starter-vault-config' + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-starter-vault-config" - implementation 'io.r2dbc:r2dbc-h2' - implementation 'org.postgresql:r2dbc-postgresql' - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-database-postgresql' + implementation "io.r2dbc:r2dbc-h2" + implementation "org.postgresql:r2dbc-postgresql" + implementation "org.flywaydb:flyway-core" + implementation "org.flywaydb:flyway-database-postgresql" - runtimeOnly 'org.postgresql:postgresql' - runtimeOnly 'com.h2database:h2' + runtimeOnly "org.postgresql:postgresql" + runtimeOnly "com.h2database:h2" implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" implementation "net.logstash.logback:logstash-logback-encoder:$versions.logback" - implementation 'org.hibernate.validator:hibernate-validator' + implementation "org.hibernate.validator:hibernate-validator" } diff --git a/examples/reactive-rest-example/settings.gradle b/examples/reactive-rest-example/settings.gradle index 4b0053dd8f8..7526f2828e8 100644 --- a/examples/reactive-rest-example/settings.gradle +++ b/examples/reactive-rest-example/settings.gradle @@ -8,6 +8,7 @@ includeBuild "../../plugins/java" includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/examples/reactive-rest-example/src/main/java/no/nav/testnav/examples/reactiverestexample/config/LocalConfig.java b/examples/reactive-rest-example/src/main/java/no/nav/testnav/examples/reactiverestexample/config/LocalConfig.java deleted file mode 100644 index d0527757e3d..00000000000 --- a/examples/reactive-rest-example/src/main/java/no/nav/testnav/examples/reactiverestexample/config/LocalConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.examples.reactiverestexample.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - - -@Configuration -@Profile("local") -@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) -public class LocalConfig extends AbstractVaultConfiguration { - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/examples/reactive-rest-example/src/main/java/no/nav/testnav/examples/reactiverestexample/config/LocalVaultConfig.java b/examples/reactive-rest-example/src/main/java/no/nav/testnav/examples/reactiverestexample/config/LocalVaultConfig.java new file mode 100644 index 00000000000..afcd86c9291 --- /dev/null +++ b/examples/reactive-rest-example/src/main/java/no/nav/testnav/examples/reactiverestexample/config/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.examples.reactiverestexample.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("local") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/libs/reactive-proxy/build.gradle b/libs/reactive-proxy/build.gradle index 4cb6a426e9e..08259481245 100644 --- a/libs/reactive-proxy/build.gradle +++ b/libs/reactive-proxy/build.gradle @@ -1,7 +1,7 @@ plugins { id "dolly-libs" - id 'maven-publish' + id "maven-publish" } sonarqube { @@ -19,7 +19,7 @@ publishing { repositories { maven { name = "github" - url = uri('https://maven.pkg.github.com/navikt/testnorge') + url = uri("https://maven.pkg.github.com/navikt/testnorge") credentials(PasswordCredentials) { username = System.getenv("GITHUB_ACTOR") password = System.getenv("GITHUB_TOKEN") @@ -31,10 +31,10 @@ publishing { from(components.java) versionMapping { - usage('java-api') { - fromResolutionOf('runtimeClasspath') + usage("java-api") { + fromResolutionOf("runtimeClasspath") } - usage('java-runtime') { + usage("java-runtime") { fromResolutionResult() } } @@ -43,12 +43,10 @@ publishing { } dependencies { + implementation "no.nav.testnav.libs:reactive-security" - implementation 'no.nav.testnav.libs:reactive-security' - - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation 'org.springframework.boot:spring-boot-starter-webflux' - - implementation "org.springframework.cloud:spring-cloud-starter-vault-config" + implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" + implementation "org.springframework.boot:spring-boot-starter-webflux" + implementation "org.springframework.cloud:spring-cloud-starter-gateway" } \ No newline at end of file diff --git a/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/DevConfig.java b/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/DevConfig.java index 4a34d70612d..e69de29bb2d 100644 --- a/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/DevConfig.java +++ b/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/DevConfig.java @@ -1,36 +0,0 @@ -package no.nav.testnav.libs.reactiveproxy.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -public class DevConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/libs/vault/build.gradle b/libs/vault/build.gradle index 66117faafb7..fca4297e516 100644 --- a/libs/vault/build.gradle +++ b/libs/vault/build.gradle @@ -3,6 +3,5 @@ plugins { } dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.cloud:spring-cloud-vault-config-databases' } \ No newline at end of file diff --git a/plugins/java/src/main/groovy/dolly-proxies.gradle b/plugins/java/src/main/groovy/dolly-proxies.gradle index ea907c260bf..32d66f2e394 100644 --- a/plugins/java/src/main/groovy/dolly-proxies.gradle +++ b/plugins/java/src/main/groovy/dolly-proxies.gradle @@ -29,6 +29,7 @@ dependencies { implementation "org.springframework.boot:spring-boot-starter-actuator" implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" implementation "org.springframework.cloud:spring-cloud-starter-gateway" + implementation "org.springframework.cloud:spring-cloud-starter-vault-config" runtimeOnly "io.micrometer:micrometer-registry-prometheus" diff --git a/proxies/aareg-proxy/build.gradle b/proxies/aareg-proxy/build.gradle index aa9e185cc03..33156f84549 100644 --- a/proxies/aareg-proxy/build.gradle +++ b/proxies/aareg-proxy/build.gradle @@ -12,6 +12,8 @@ sonarqube { dependencies { implementation "no.nav.testnav.libs:reactive-security" implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" + implementation "org.springframework.boot:spring-boot-starter-webflux" implementation "org.springframework.cloud:spring-cloud-starter-vault-config" } diff --git a/proxies/aareg-proxy/settings.gradle b/proxies/aareg-proxy/settings.gradle index a2b3817b5a1..7903b34c17e 100644 --- a/proxies/aareg-proxy/settings.gradle +++ b/proxies/aareg-proxy/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-proxy' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/proxies/aareg-proxy/src/main/java/no/nav/testnav/proxies/aareg/LocalVaultConfig.java b/proxies/aareg-proxy/src/main/java/no/nav/testnav/proxies/aareg/LocalVaultConfig.java index 1a56590c0d2..4aa730bc0dc 100644 --- a/proxies/aareg-proxy/src/main/java/no/nav/testnav/proxies/aareg/LocalVaultConfig.java +++ b/proxies/aareg-proxy/src/main/java/no/nav/testnav/proxies/aareg/LocalVaultConfig.java @@ -1,32 +1,10 @@ package no.nav.testnav.proxies.aareg; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; -import org.springframework.lang.NonNull; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; @Configuration @Profile("local") -@VaultPropertySource( - value = "secret/dolly/lokal", - ignoreSecretNotFound = false -) -public class LocalVaultConfig extends AbstractVaultConfiguration { - - @Override - @NonNull - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - @NonNull - public ClientAuthentication clientAuthentication() { - return new TokenAuthentication(System.getProperty("spring.cloud.vault.token")); - } - +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { } diff --git a/proxies/aareg-synt-services-proxy/build.gradle b/proxies/aareg-synt-services-proxy/build.gradle index 71c8a758344..8c1f7f043bc 100644 --- a/proxies/aareg-synt-services-proxy/build.gradle +++ b/proxies/aareg-synt-services-proxy/build.gradle @@ -8,3 +8,7 @@ sonarqube { property "sonar.projectName", "aareg-synt-services-proxy" } } + +dependencies { + implementation "no.nav.testnav.libs:vault" +} \ No newline at end of file diff --git a/proxies/aareg-synt-services-proxy/settings.gradle b/proxies/aareg-synt-services-proxy/settings.gradle index f3bd3e404e8..f92b7385eef 100644 --- a/proxies/aareg-synt-services-proxy/settings.gradle +++ b/proxies/aareg-synt-services-proxy/settings.gradle @@ -2,12 +2,13 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'aareg-synt-services-proxy' +rootProject.name = "aareg-synt-services-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/aareg-synt-services-proxy/src/main/java/no/nav/testnav/proxies/aaregsyntservicesproxy/AaregSyntServiceProxyApplicationStarter.java b/proxies/aareg-synt-services-proxy/src/main/java/no/nav/testnav/proxies/aaregsyntservicesproxy/AaregSyntServiceProxyApplicationStarter.java index 652c65f783d..93107774ee1 100644 --- a/proxies/aareg-synt-services-proxy/src/main/java/no/nav/testnav/proxies/aaregsyntservicesproxy/AaregSyntServiceProxyApplicationStarter.java +++ b/proxies/aareg-synt-services-proxy/src/main/java/no/nav/testnav/proxies/aaregsyntservicesproxy/AaregSyntServiceProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.aaregsyntservicesproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -12,7 +11,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class }) @SpringBootApplication diff --git a/proxies/aareg-synt-services-proxy/src/main/java/no/nav/testnav/proxies/aaregsyntservicesproxy/LocalVaultConfig.java b/proxies/aareg-synt-services-proxy/src/main/java/no/nav/testnav/proxies/aaregsyntservicesproxy/LocalVaultConfig.java new file mode 100644 index 00000000000..9c92afc614c --- /dev/null +++ b/proxies/aareg-synt-services-proxy/src/main/java/no/nav/testnav/proxies/aaregsyntservicesproxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.aaregsyntservicesproxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/arbeidsplassencv-proxy/build.gradle b/proxies/arbeidsplassencv-proxy/build.gradle index 79f23c05157..1baa5fee142 100644 --- a/proxies/arbeidsplassencv-proxy/build.gradle +++ b/proxies/arbeidsplassencv-proxy/build.gradle @@ -12,6 +12,8 @@ sonarqube { dependencies { implementation "no.nav.testnav.libs:reactive-security" implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" + implementation "org.springframework.boot:spring-boot-starter-webflux" implementation "org.springframework.cloud:spring-cloud-starter-vault-config" } diff --git a/proxies/arbeidsplassencv-proxy/settings.gradle b/proxies/arbeidsplassencv-proxy/settings.gradle index fffa0bc93a9..74e006e346d 100644 --- a/proxies/arbeidsplassencv-proxy/settings.gradle +++ b/proxies/arbeidsplassencv-proxy/settings.gradle @@ -2,14 +2,15 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'arbeidsplassencv-proxy' +rootProject.name = "arbeidsplassencv-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' -includeBuild '../../libs/reactive-security' -includeBuild '../../libs/security-core' +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/reactive-security" +includeBuild "../../libs/security-core" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/ArbeidsplassenCVProxyApplicationStarter.java b/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/ArbeidsplassenCVProxyApplicationStarter.java index f9bfbb412dd..de6558a90bf 100644 --- a/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/ArbeidsplassenCVProxyApplicationStarter.java +++ b/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/ArbeidsplassenCVProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.arbeidsplassencvproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import no.nav.testnav.libs.reactivesecurity.exchange.tokenx.TokenXService; import no.nav.testnav.proxies.arbeidsplassencvproxy.config.Consumers; @@ -22,7 +21,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class }) @SpringBootApplication diff --git a/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/config/LocalVaultConfig.java b/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/config/LocalVaultConfig.java index 6ac94990938..46245f662c6 100644 --- a/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/config/LocalVaultConfig.java +++ b/proxies/arbeidsplassencv-proxy/src/main/java/no/nav/testnav/proxies/arbeidsplassencvproxy/config/LocalVaultConfig.java @@ -1,31 +1,10 @@ package no.nav.testnav.proxies.arbeidsplassencvproxy.config; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; -import org.springframework.lang.NonNull; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; @Configuration @Profile("dev") -@VaultPropertySource( - value = "secret/dolly/lokal", - ignoreSecretNotFound = false -) -public class LocalVaultConfig extends AbstractVaultConfiguration { - - @Override - @NonNull - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - @NonNull - public ClientAuthentication clientAuthentication() { - return new TokenAuthentication(System.getProperty("spring.cloud.vault.token")); - } +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { } diff --git a/proxies/arena-forvalteren-proxy/build.gradle b/proxies/arena-forvalteren-proxy/build.gradle index c6f0b1257e3..6ed16f55979 100644 --- a/proxies/arena-forvalteren-proxy/build.gradle +++ b/proxies/arena-forvalteren-proxy/build.gradle @@ -10,6 +10,7 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:vault" } diff --git a/proxies/arena-forvalteren-proxy/settings.gradle b/proxies/arena-forvalteren-proxy/settings.gradle index 0cff2b5dcf1..bf548522b8d 100644 --- a/proxies/arena-forvalteren-proxy/settings.gradle +++ b/proxies/arena-forvalteren-proxy/settings.gradle @@ -2,14 +2,15 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'arena-forvalteren-proxy' +rootProject.name = "arena-forvalteren-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/data-transfer-objects' -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' -includeBuild '../../libs/security-core' +includeBuild "../../libs/data-transfer-objects" +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/security-core" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/arena-forvalteren-proxy/src/main/java/no/nav/testnav/proxies/arenaforvalterenproxy/ArenaForvalterenProxyApplicationStarter.java b/proxies/arena-forvalteren-proxy/src/main/java/no/nav/testnav/proxies/arenaforvalterenproxy/ArenaForvalterenProxyApplicationStarter.java index 437a159ebb9..efdcc2e919e 100644 --- a/proxies/arena-forvalteren-proxy/src/main/java/no/nav/testnav/proxies/arenaforvalterenproxy/ArenaForvalterenProxyApplicationStarter.java +++ b/proxies/arena-forvalteren-proxy/src/main/java/no/nav/testnav/proxies/arenaforvalterenproxy/ArenaForvalterenProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.arenaforvalterenproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import no.nav.testnav.libs.securitycore.domain.ServerProperties; import org.springframework.boot.SpringApplication; @@ -19,7 +18,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class }) @SpringBootApplication diff --git a/proxies/arena-forvalteren-proxy/src/main/java/no/nav/testnav/proxies/arenaforvalterenproxy/LocalVaultConfig.java b/proxies/arena-forvalteren-proxy/src/main/java/no/nav/testnav/proxies/arenaforvalterenproxy/LocalVaultConfig.java new file mode 100644 index 00000000000..8a90898af77 --- /dev/null +++ b/proxies/arena-forvalteren-proxy/src/main/java/no/nav/testnav/proxies/arenaforvalterenproxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.arenaforvalterenproxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/batch-adeo-proxy/build.gradle b/proxies/batch-adeo-proxy/build.gradle index 12df8fce778..d16da131e3a 100644 --- a/proxies/batch-adeo-proxy/build.gradle +++ b/proxies/batch-adeo-proxy/build.gradle @@ -8,3 +8,7 @@ sonarqube { property "sonar.projectName", "testnorge-batch-adeo-proxy" } } + +dependencies { + implementation "no.nav.testnav.libs:vault" +} diff --git a/proxies/batch-adeo-proxy/settings.gradle b/proxies/batch-adeo-proxy/settings.gradle index f9b06323d97..2631848caec 100644 --- a/proxies/batch-adeo-proxy/settings.gradle +++ b/proxies/batch-adeo-proxy/settings.gradle @@ -2,12 +2,13 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'batch-adeo-proxy' +rootProject.name = "batch-adeo-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/batch-adeo-proxy/src/main/java/no/nav/testnav/proxies/batchadeoproxy/BatchAdeoProxyApplicationStarter.java b/proxies/batch-adeo-proxy/src/main/java/no/nav/testnav/proxies/batchadeoproxy/BatchAdeoProxyApplicationStarter.java index c9404c773e1..42699493c54 100644 --- a/proxies/batch-adeo-proxy/src/main/java/no/nav/testnav/proxies/batchadeoproxy/BatchAdeoProxyApplicationStarter.java +++ b/proxies/batch-adeo-proxy/src/main/java/no/nav/testnav/proxies/batchadeoproxy/BatchAdeoProxyApplicationStarter.java @@ -8,12 +8,10 @@ import org.springframework.context.annotation.Import; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class }) @SpringBootApplication diff --git a/proxies/batch-adeo-proxy/src/main/java/no/nav/testnav/proxies/batchadeoproxy/LocalVaultConfig.java b/proxies/batch-adeo-proxy/src/main/java/no/nav/testnav/proxies/batchadeoproxy/LocalVaultConfig.java new file mode 100644 index 00000000000..d9a6ce94724 --- /dev/null +++ b/proxies/batch-adeo-proxy/src/main/java/no/nav/testnav/proxies/batchadeoproxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.batchadeoproxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/brregstub-proxy/build.gradle b/proxies/brregstub-proxy/build.gradle index d01cc5da0b9..727cb55c9d1 100644 --- a/proxies/brregstub-proxy/build.gradle +++ b/proxies/brregstub-proxy/build.gradle @@ -10,5 +10,6 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:vault" } diff --git a/proxies/brregstub-proxy/settings.gradle b/proxies/brregstub-proxy/settings.gradle index d62fa6c4630..35c45c9e81f 100644 --- a/proxies/brregstub-proxy/settings.gradle +++ b/proxies/brregstub-proxy/settings.gradle @@ -2,13 +2,14 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'brregstub-proxy' +rootProject.name = "brregstub-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/data-transfer-objects' -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' +includeBuild "../../libs/data-transfer-objects" +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/brregstub-proxy/src/main/java/no/nav/testnav/proxies/brregstubproxy/BrregstubProxyApplicationStarter.java b/proxies/brregstub-proxy/src/main/java/no/nav/testnav/proxies/brregstubproxy/BrregstubProxyApplicationStarter.java index 7aa8dec9ff6..da8305b2a4a 100644 --- a/proxies/brregstub-proxy/src/main/java/no/nav/testnav/proxies/brregstubproxy/BrregstubProxyApplicationStarter.java +++ b/proxies/brregstub-proxy/src/main/java/no/nav/testnav/proxies/brregstubproxy/BrregstubProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.brregstubproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -12,7 +11,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class }) @SpringBootApplication diff --git a/proxies/brregstub-proxy/src/main/java/no/nav/testnav/proxies/brregstubproxy/LocalVaultConfig.java b/proxies/brregstub-proxy/src/main/java/no/nav/testnav/proxies/brregstubproxy/LocalVaultConfig.java new file mode 100644 index 00000000000..df9c43061b6 --- /dev/null +++ b/proxies/brregstub-proxy/src/main/java/no/nav/testnav/proxies/brregstubproxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.brregstubproxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/dokarkiv-proxy/build.gradle b/proxies/dokarkiv-proxy/build.gradle index 8af2a3da534..02dc52af06c 100644 --- a/proxies/dokarkiv-proxy/build.gradle +++ b/proxies/dokarkiv-proxy/build.gradle @@ -13,6 +13,8 @@ dependencies { implementation "no.nav.testnav.libs:data-transfer-objects" implementation "no.nav.testnav.libs:reactive-security" implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" + implementation "org.springframework.boot:spring-boot-starter-webflux" implementation "org.springframework.cloud:spring-cloud-starter-vault-config" } diff --git a/proxies/dokarkiv-proxy/settings.gradle b/proxies/dokarkiv-proxy/settings.gradle index 67900969191..da9216c0046 100644 --- a/proxies/dokarkiv-proxy/settings.gradle +++ b/proxies/dokarkiv-proxy/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-proxy' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/proxies/dokarkiv-proxy/src/main/java/no/nav/testnav/proxies/dokarkivproxy/config/LocalVaultConfig.java b/proxies/dokarkiv-proxy/src/main/java/no/nav/testnav/proxies/dokarkivproxy/config/LocalVaultConfig.java index dd58a39b988..8c80cc2141f 100644 --- a/proxies/dokarkiv-proxy/src/main/java/no/nav/testnav/proxies/dokarkivproxy/config/LocalVaultConfig.java +++ b/proxies/dokarkiv-proxy/src/main/java/no/nav/testnav/proxies/dokarkivproxy/config/LocalVaultConfig.java @@ -1,36 +1,12 @@ package no.nav.testnav.proxies.dokarkivproxy.config; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; @Configuration @Profile("dev") @VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) -public class LocalVaultConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { } \ No newline at end of file diff --git a/proxies/ereg-proxy/build.gradle b/proxies/ereg-proxy/build.gradle index c6691217659..63df2bb6870 100644 --- a/proxies/ereg-proxy/build.gradle +++ b/proxies/ereg-proxy/build.gradle @@ -10,5 +10,7 @@ sonarqube { } dependencies { - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "no.nav.testnav.libs:vault" + + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config } diff --git a/proxies/ereg-proxy/settings.gradle b/proxies/ereg-proxy/settings.gradle index e9af2b16174..46adff985f6 100644 --- a/proxies/ereg-proxy/settings.gradle +++ b/proxies/ereg-proxy/settings.gradle @@ -2,12 +2,13 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'ereg-proxy' +rootProject.name = "ereg-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/EregProxyApplicationStarter.java b/proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/EregProxyApplicationStarter.java index b5f7b4f5d37..4ed13328c23 100644 --- a/proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/EregProxyApplicationStarter.java +++ b/proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/EregProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.eregproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -18,7 +17,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class }) @SpringBootApplication diff --git a/proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/LocalVaultConfig.java b/proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/LocalVaultConfig.java new file mode 100644 index 00000000000..1dd30afbd14 --- /dev/null +++ b/proxies/ereg-proxy/src/main/java/no/nav/testnav/proxies/eregproxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.eregproxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/histark-proxy/build.gradle b/proxies/histark-proxy/build.gradle index 8f7add698c7..5b7ad95f9f4 100644 --- a/proxies/histark-proxy/build.gradle +++ b/proxies/histark-proxy/build.gradle @@ -10,5 +10,6 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:vault" } diff --git a/proxies/histark-proxy/settings.gradle b/proxies/histark-proxy/settings.gradle index bc95d92dfa8..3664ec0c0d4 100644 --- a/proxies/histark-proxy/settings.gradle +++ b/proxies/histark-proxy/settings.gradle @@ -2,13 +2,14 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'histark-proxy' +rootProject.name = "histark-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/data-transfer-objects' -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' +includeBuild "../../libs/data-transfer-objects" +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/histark-proxy/src/main/java/no/nav/testnav/proxies/histarkproxy/HistarkProxyApplicationStarter.java b/proxies/histark-proxy/src/main/java/no/nav/testnav/proxies/histarkproxy/HistarkProxyApplicationStarter.java index 2306c5e8137..8f5b14747a5 100644 --- a/proxies/histark-proxy/src/main/java/no/nav/testnav/proxies/histarkproxy/HistarkProxyApplicationStarter.java +++ b/proxies/histark-proxy/src/main/java/no/nav/testnav/proxies/histarkproxy/HistarkProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.histarkproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -12,7 +11,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class }) @SpringBootApplication diff --git a/proxies/histark-proxy/src/main/java/no/nav/testnav/proxies/histarkproxy/LocalVaultConfig.java b/proxies/histark-proxy/src/main/java/no/nav/testnav/proxies/histarkproxy/LocalVaultConfig.java new file mode 100644 index 00000000000..2e825162de7 --- /dev/null +++ b/proxies/histark-proxy/src/main/java/no/nav/testnav/proxies/histarkproxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.histarkproxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/inntektstub-proxy/build.gradle b/proxies/inntektstub-proxy/build.gradle index 9eb49e640bc..d197c1556b0 100644 --- a/proxies/inntektstub-proxy/build.gradle +++ b/proxies/inntektstub-proxy/build.gradle @@ -10,5 +10,6 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:vault" } diff --git a/proxies/inntektstub-proxy/settings.gradle b/proxies/inntektstub-proxy/settings.gradle index cbfbd25ac18..631909031d6 100644 --- a/proxies/inntektstub-proxy/settings.gradle +++ b/proxies/inntektstub-proxy/settings.gradle @@ -2,13 +2,14 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'inntektstub-proxy' +rootProject.name = "inntektstub-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/data-transfer-objects' -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' +includeBuild "../../libs/data-transfer-objects" +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/inntektstub-proxy/src/main/java/no/nav/testnav/proxies/inntektstubproxy/InntektstubProxyApplicationStarter.java b/proxies/inntektstub-proxy/src/main/java/no/nav/testnav/proxies/inntektstubproxy/InntektstubProxyApplicationStarter.java index 0aedfddb27b..0a2b39e4a8c 100644 --- a/proxies/inntektstub-proxy/src/main/java/no/nav/testnav/proxies/inntektstubproxy/InntektstubProxyApplicationStarter.java +++ b/proxies/inntektstub-proxy/src/main/java/no/nav/testnav/proxies/inntektstubproxy/InntektstubProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.inntektstubproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -12,7 +11,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class }) @SpringBootApplication diff --git a/proxies/inntektstub-proxy/src/main/java/no/nav/testnav/proxies/inntektstubproxy/LocalVaultConfig.java b/proxies/inntektstub-proxy/src/main/java/no/nav/testnav/proxies/inntektstubproxy/LocalVaultConfig.java new file mode 100644 index 00000000000..8d619b3ab12 --- /dev/null +++ b/proxies/inntektstub-proxy/src/main/java/no/nav/testnav/proxies/inntektstubproxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.inntektstubproxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/inst-proxy/build.gradle b/proxies/inst-proxy/build.gradle index 118496766d2..ea42b084e65 100644 --- a/proxies/inst-proxy/build.gradle +++ b/proxies/inst-proxy/build.gradle @@ -10,7 +10,8 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:data-transfer-objects' - implementation 'no.nav.testnav.libs:reactive-security' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" } \ No newline at end of file diff --git a/proxies/inst-proxy/settings.gradle b/proxies/inst-proxy/settings.gradle index c45b408e9f9..1118b88f555 100644 --- a/proxies/inst-proxy/settings.gradle +++ b/proxies/inst-proxy/settings.gradle @@ -2,15 +2,16 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'inst-proxy' +rootProject.name = "inst-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/data-transfer-objects' -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' -includeBuild '../../libs/reactive-security' -includeBuild '../../libs/security-core' +includeBuild "../../libs/data-transfer-objects" +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/reactive-security" +includeBuild "../../libs/security-core" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/inst-proxy/src/main/java/no/nav/testnav/proxies/instproxy/InstProxyApplicationStarter.java b/proxies/inst-proxy/src/main/java/no/nav/testnav/proxies/instproxy/InstProxyApplicationStarter.java index 721f71309f0..a41d02d6804 100644 --- a/proxies/inst-proxy/src/main/java/no/nav/testnav/proxies/instproxy/InstProxyApplicationStarter.java +++ b/proxies/inst-proxy/src/main/java/no/nav/testnav/proxies/instproxy/InstProxyApplicationStarter.java @@ -1,11 +1,9 @@ package no.nav.testnav.proxies.instproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import no.nav.testnav.libs.reactiveproxy.filter.AddAuthenticationRequestGatewayFilterFactory; import no.nav.testnav.libs.reactivesecurity.config.SecureOAuth2ServerToServerConfiguration; -import no.nav.testnav.libs.reactivesecurity.exchange.TokenExchange; import no.nav.testnav.libs.reactivesecurity.exchange.azuread.TrygdeetatenAzureAdTokenService; import no.nav.testnav.libs.securitycore.domain.AccessToken; import org.springframework.boot.SpringApplication; @@ -17,7 +15,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class, SecureOAuth2ServerToServerConfiguration.class }) diff --git a/proxies/inst-proxy/src/main/java/no/nav/testnav/proxies/instproxy/LocalVaultConfig.java b/proxies/inst-proxy/src/main/java/no/nav/testnav/proxies/instproxy/LocalVaultConfig.java new file mode 100644 index 00000000000..2b85871801d --- /dev/null +++ b/proxies/inst-proxy/src/main/java/no/nav/testnav/proxies/instproxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.instproxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/kontoregister-person-proxy/build.gradle b/proxies/kontoregister-person-proxy/build.gradle index fc7754f76fd..d0d9049d4ad 100644 --- a/proxies/kontoregister-person-proxy/build.gradle +++ b/proxies/kontoregister-person-proxy/build.gradle @@ -13,6 +13,8 @@ dependencies { implementation "no.nav.testnav.libs:data-transfer-objects" implementation "no.nav.testnav.libs:reactive-security" implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" + implementation "org.springframework.boot:spring-boot-starter-webflux" implementation "org.springframework.cloud:spring-cloud-starter-vault-config" } diff --git a/proxies/kontoregister-person-proxy/settings.gradle b/proxies/kontoregister-person-proxy/settings.gradle index 308e11806f5..371a5277aa5 100644 --- a/proxies/kontoregister-person-proxy/settings.gradle +++ b/proxies/kontoregister-person-proxy/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-proxy' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/proxies/kontoregister-person-proxy/src/main/java/no/nav/testnav/proxies/kontoregisterperson/config/LocalVaultConfig.java b/proxies/kontoregister-person-proxy/src/main/java/no/nav/testnav/proxies/kontoregisterperson/config/LocalVaultConfig.java index 9b02b63e907..b456766d674 100644 --- a/proxies/kontoregister-person-proxy/src/main/java/no/nav/testnav/proxies/kontoregisterperson/config/LocalVaultConfig.java +++ b/proxies/kontoregister-person-proxy/src/main/java/no/nav/testnav/proxies/kontoregisterperson/config/LocalVaultConfig.java @@ -1,36 +1,12 @@ package no.nav.testnav.proxies.kontoregisterperson.config; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; @Configuration @Profile("dev") @VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) -public class LocalVaultConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { } diff --git a/proxies/krrstub-proxy/build.gradle b/proxies/krrstub-proxy/build.gradle index 1efccd36a7e..33757b2cc3c 100644 --- a/proxies/krrstub-proxy/build.gradle +++ b/proxies/krrstub-proxy/build.gradle @@ -12,6 +12,8 @@ sonarqube { dependencies { implementation "no.nav.testnav.libs:reactive-security" implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" + implementation "org.springframework.boot:spring-boot-starter-webflux" implementation "org.springframework.cloud:spring-cloud-starter-vault-config" } diff --git a/proxies/krrstub-proxy/settings.gradle b/proxies/krrstub-proxy/settings.gradle index c78c01fb986..5625c1721a9 100644 --- a/proxies/krrstub-proxy/settings.gradle +++ b/proxies/krrstub-proxy/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-proxy' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/proxies/krrstub-proxy/src/main/java/no/nav/testnav/proxies/krrstubproxy/config/LocalVaultConfig.java b/proxies/krrstub-proxy/src/main/java/no/nav/testnav/proxies/krrstubproxy/config/LocalVaultConfig.java index 1ae7b6d7ca6..5a880c9c35f 100644 --- a/proxies/krrstub-proxy/src/main/java/no/nav/testnav/proxies/krrstubproxy/config/LocalVaultConfig.java +++ b/proxies/krrstub-proxy/src/main/java/no/nav/testnav/proxies/krrstubproxy/config/LocalVaultConfig.java @@ -1,37 +1,13 @@ package no.nav.testnav.proxies.krrstubproxy.config; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; @Configuration @Profile("dev") @VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) @VaultPropertySource(value = "kv/preprod/fss/testnav-krrstub-proxy/dev", ignoreSecretNotFound = false) -public class LocalVaultConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { } \ No newline at end of file diff --git a/proxies/medl-proxy/build.gradle b/proxies/medl-proxy/build.gradle index 5ca42ccd62f..c2ae7901926 100644 --- a/proxies/medl-proxy/build.gradle +++ b/proxies/medl-proxy/build.gradle @@ -12,6 +12,8 @@ sonarqube { dependencies { implementation "no.nav.testnav.libs:reactive-security" implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" + implementation "org.springframework.boot:spring-boot-starter-webflux" implementation "org.springframework.cloud:spring-cloud-starter-vault-config" } diff --git a/proxies/medl-proxy/settings.gradle b/proxies/medl-proxy/settings.gradle index e59a1fa89e2..7a74e821866 100644 --- a/proxies/medl-proxy/settings.gradle +++ b/proxies/medl-proxy/settings.gradle @@ -10,6 +10,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-proxy' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/proxies/medl-proxy/src/main/java/no/nav/testnav/proxies/medlproxy/config/LocalVaultConfig.java b/proxies/medl-proxy/src/main/java/no/nav/testnav/proxies/medlproxy/config/LocalVaultConfig.java index 8c38a0a9479..56664cbbdee 100644 --- a/proxies/medl-proxy/src/main/java/no/nav/testnav/proxies/medlproxy/config/LocalVaultConfig.java +++ b/proxies/medl-proxy/src/main/java/no/nav/testnav/proxies/medlproxy/config/LocalVaultConfig.java @@ -1,36 +1,12 @@ package no.nav.testnav.proxies.medlproxy.config; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; @Configuration @Profile("dev") @VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) -public class LocalVaultConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { } \ No newline at end of file diff --git a/proxies/norg2-proxy/build.gradle b/proxies/norg2-proxy/build.gradle index 270390b7e8f..b7e51012270 100644 --- a/proxies/norg2-proxy/build.gradle +++ b/proxies/norg2-proxy/build.gradle @@ -10,7 +10,8 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config } diff --git a/proxies/norg2-proxy/settings.gradle b/proxies/norg2-proxy/settings.gradle index 5a5b5daafb2..c5316e6e5bc 100644 --- a/proxies/norg2-proxy/settings.gradle +++ b/proxies/norg2-proxy/settings.gradle @@ -2,13 +2,14 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'norg2-proxy' +rootProject.name = "norg2-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/data-transfer-objects' -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' +includeBuild "../../libs/data-transfer-objects" +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/norg2-proxy/src/main/java/no/nav/testnav/proxies/norg2proxy/LocalVaultConfig.java b/proxies/norg2-proxy/src/main/java/no/nav/testnav/proxies/norg2proxy/LocalVaultConfig.java new file mode 100644 index 00000000000..a5e41233db4 --- /dev/null +++ b/proxies/norg2-proxy/src/main/java/no/nav/testnav/proxies/norg2proxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.norg2proxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/norg2-proxy/src/main/java/no/nav/testnav/proxies/norg2proxy/Norg2ProxyApplicationStarter.java b/proxies/norg2-proxy/src/main/java/no/nav/testnav/proxies/norg2proxy/Norg2ProxyApplicationStarter.java index 1b614326c72..5599100596f 100644 --- a/proxies/norg2-proxy/src/main/java/no/nav/testnav/proxies/norg2proxy/Norg2ProxyApplicationStarter.java +++ b/proxies/norg2-proxy/src/main/java/no/nav/testnav/proxies/norg2proxy/Norg2ProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.norg2proxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -12,7 +11,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class }) @SpringBootApplication diff --git a/proxies/pdl-proxy/build.gradle b/proxies/pdl-proxy/build.gradle index 25af4e6c02a..8e425e34727 100644 --- a/proxies/pdl-proxy/build.gradle +++ b/proxies/pdl-proxy/build.gradle @@ -13,6 +13,8 @@ dependencies { implementation "no.nav.testnav.libs:data-transfer-objects" implementation "no.nav.testnav.libs:reactive-security" implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" + implementation "org.springframework.boot:spring-boot-starter-webflux" implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config. implementation "org.springframework.cloud:spring-cloud-starter-vault-config" diff --git a/proxies/pdl-proxy/settings.gradle b/proxies/pdl-proxy/settings.gradle index a1b491845af..56e4e14bc5a 100644 --- a/proxies/pdl-proxy/settings.gradle +++ b/proxies/pdl-proxy/settings.gradle @@ -2,15 +2,16 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'pdl-proxy' +rootProject.name = "pdl-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/data-transfer-objects' -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' -includeBuild '../../libs/reactive-security' -includeBuild '../../libs/security-core' +includeBuild "../../libs/data-transfer-objects" +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/reactive-security" +includeBuild "../../libs/security-core" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/PdlProxyApplicationStarter.java b/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/PdlProxyApplicationStarter.java index 6330dffc9a7..30ef0028151 100644 --- a/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/PdlProxyApplicationStarter.java +++ b/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/PdlProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.pdlproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import no.nav.testnav.libs.reactiveproxy.filter.AddAuthenticationRequestGatewayFilterFactory; import no.nav.testnav.libs.reactivesecurity.config.SecureOAuth2ServerToServerConfiguration; @@ -26,7 +25,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class, SecureOAuth2ServerToServerConfiguration.class }) diff --git a/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/DevVaultConfig.java b/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/DevVaultConfig.java deleted file mode 100644 index ad2f1fd3a12..00000000000 --- a/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/DevVaultConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.proxies.pdlproxy.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Profile("dev") -@Configuration -@VaultPropertySource(value = "kv/preprod/fss/testnav-pdl-proxy/dev", ignoreSecretNotFound = false) -public class DevVaultConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/LocalVaultConfig.java b/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/LocalVaultConfig.java new file mode 100644 index 00000000000..c8ff2443b61 --- /dev/null +++ b/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/LocalVaultConfig.java @@ -0,0 +1,13 @@ +package no.nav.testnav.proxies.pdlproxy.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Profile("dev") +@Configuration +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +@VaultPropertySource(value = "kv/preprod/fss/testnav-pdl-proxy/dev", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/proxies/pensjon-testdata-facade-proxy/build.gradle b/proxies/pensjon-testdata-facade-proxy/build.gradle index 2878fc888db..5ed37360f08 100644 --- a/proxies/pensjon-testdata-facade-proxy/build.gradle +++ b/proxies/pensjon-testdata-facade-proxy/build.gradle @@ -13,6 +13,8 @@ dependencies { implementation "no.nav.testnav.libs:data-transfer-objects" implementation "no.nav.testnav.libs:reactive-security" implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" + implementation "org.springframework.boot:spring-boot-starter-webflux" implementation "org.springframework.cloud:spring-cloud-starter-vault-config" } diff --git a/proxies/pensjon-testdata-facade-proxy/settings.gradle b/proxies/pensjon-testdata-facade-proxy/settings.gradle index 4f1d9f4f7fa..6936a160745 100644 --- a/proxies/pensjon-testdata-facade-proxy/settings.gradle +++ b/proxies/pensjon-testdata-facade-proxy/settings.gradle @@ -2,15 +2,16 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'pensjon-testdata-facade-proxy' +rootProject.name = "pensjon-testdata-facade-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/data-transfer-objects' -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' -includeBuild '../../libs/reactive-security' -includeBuild '../../libs/security-core' +includeBuild "../../libs/data-transfer-objects" +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/reactive-security" +includeBuild "../../libs/security-core" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/pensjon-testdata-facade-proxy/src/main/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/PensjonTestdataFacadeProxyApplicationStarter.java b/proxies/pensjon-testdata-facade-proxy/src/main/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/PensjonTestdataFacadeProxyApplicationStarter.java index 49072216df3..5fbc526b869 100644 --- a/proxies/pensjon-testdata-facade-proxy/src/main/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/PensjonTestdataFacadeProxyApplicationStarter.java +++ b/proxies/pensjon-testdata-facade-proxy/src/main/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/PensjonTestdataFacadeProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.pensjontestdatafacadeproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import no.nav.testnav.libs.reactiveproxy.filter.AddAuthenticationRequestGatewayFilterFactory; import no.nav.testnav.libs.reactivesecurity.config.SecureOAuth2ServerToServerConfiguration; @@ -22,7 +21,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class, SecureOAuth2ServerToServerConfiguration.class }) diff --git a/proxies/pensjon-testdata-facade-proxy/src/main/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/config/LocalVaultConfig.java b/proxies/pensjon-testdata-facade-proxy/src/main/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/config/LocalVaultConfig.java index 92ba1cb5d79..b914fcf66f1 100644 --- a/proxies/pensjon-testdata-facade-proxy/src/main/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/config/LocalVaultConfig.java +++ b/proxies/pensjon-testdata-facade-proxy/src/main/java/no/nav/testnav/proxies/pensjontestdatafacadeproxy/config/LocalVaultConfig.java @@ -1,26 +1,10 @@ package no.nav.testnav.proxies.pensjontestdatafacadeproxy.config; +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; -import org.springframework.lang.NonNull; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; @Configuration @Profile("dev") -public class LocalVaultConfig extends AbstractVaultConfiguration { - - @Override - @NonNull - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - @NonNull - public ClientAuthentication clientAuthentication() { - return new TokenAuthentication(System.getProperty("spring.cloud.vault.token")); - } +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { } diff --git a/proxies/saf-proxy/build.gradle b/proxies/saf-proxy/build.gradle index 21e34da52ab..a6e2b4b82a6 100644 --- a/proxies/saf-proxy/build.gradle +++ b/proxies/saf-proxy/build.gradle @@ -10,7 +10,8 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:reactive-security' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" } diff --git a/proxies/saf-proxy/settings.gradle b/proxies/saf-proxy/settings.gradle index c9a953f65f9..f6ae9850df9 100644 --- a/proxies/saf-proxy/settings.gradle +++ b/proxies/saf-proxy/settings.gradle @@ -2,15 +2,16 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'saf-proxy' +rootProject.name = "saf-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/data-transfer-objects' -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' -includeBuild '../../libs/reactive-security' -includeBuild '../../libs/security-core' +includeBuild "../../libs/data-transfer-objects" +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/reactive-security" +includeBuild "../../libs/security-core" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/saf-proxy/src/main/java/no/nav/testnav/proxies/safproxy/LocalVaultConfig.java b/proxies/saf-proxy/src/main/java/no/nav/testnav/proxies/safproxy/LocalVaultConfig.java new file mode 100644 index 00000000000..ca70a76d15b --- /dev/null +++ b/proxies/saf-proxy/src/main/java/no/nav/testnav/proxies/safproxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.safproxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/saf-proxy/src/main/java/no/nav/testnav/proxies/safproxy/SafProxyApplicationStarter.java b/proxies/saf-proxy/src/main/java/no/nav/testnav/proxies/safproxy/SafProxyApplicationStarter.java index e807b32d944..e76df06ada6 100644 --- a/proxies/saf-proxy/src/main/java/no/nav/testnav/proxies/safproxy/SafProxyApplicationStarter.java +++ b/proxies/saf-proxy/src/main/java/no/nav/testnav/proxies/safproxy/SafProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.safproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import no.nav.testnav.libs.reactiveproxy.filter.AddAuthenticationRequestGatewayFilterFactory; import no.nav.testnav.libs.reactivesecurity.exchange.azuread.TrygdeetatenAzureAdTokenService; @@ -23,7 +22,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class }) @SpringBootApplication diff --git a/proxies/sigrunstub-proxy/build.gradle b/proxies/sigrunstub-proxy/build.gradle index c04eb27cc23..2eeeaa62ff6 100644 --- a/proxies/sigrunstub-proxy/build.gradle +++ b/proxies/sigrunstub-proxy/build.gradle @@ -10,5 +10,6 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:vault" } diff --git a/proxies/sigrunstub-proxy/settings.gradle b/proxies/sigrunstub-proxy/settings.gradle index f932ff84792..b0883859278 100644 --- a/proxies/sigrunstub-proxy/settings.gradle +++ b/proxies/sigrunstub-proxy/settings.gradle @@ -2,13 +2,14 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'sigrunstub-proxy' +rootProject.name = "sigrunstub-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/data-transfer-objects' -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' +includeBuild "../../libs/data-transfer-objects" +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/sigrunstub-proxy/src/main/java/no/nav/testnav/proxies/sigrunstubproxy/LocalVaultConfig.java b/proxies/sigrunstub-proxy/src/main/java/no/nav/testnav/proxies/sigrunstubproxy/LocalVaultConfig.java new file mode 100644 index 00000000000..037351b909c --- /dev/null +++ b/proxies/sigrunstub-proxy/src/main/java/no/nav/testnav/proxies/sigrunstubproxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.sigrunstubproxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/sigrunstub-proxy/src/main/java/no/nav/testnav/proxies/sigrunstubproxy/SigrunstubProxyApplicationStarter.java b/proxies/sigrunstub-proxy/src/main/java/no/nav/testnav/proxies/sigrunstubproxy/SigrunstubProxyApplicationStarter.java index 09974df3c04..f04b4539673 100644 --- a/proxies/sigrunstub-proxy/src/main/java/no/nav/testnav/proxies/sigrunstubproxy/SigrunstubProxyApplicationStarter.java +++ b/proxies/sigrunstub-proxy/src/main/java/no/nav/testnav/proxies/sigrunstubproxy/SigrunstubProxyApplicationStarter.java @@ -1,7 +1,6 @@ package no.nav.testnav.proxies.sigrunstubproxy; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -12,7 +11,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class }) @SpringBootApplication diff --git a/proxies/synthdata-meldekort-proxy/build.gradle b/proxies/synthdata-meldekort-proxy/build.gradle index 2ae52b3d2af..ce19804eec5 100644 --- a/proxies/synthdata-meldekort-proxy/build.gradle +++ b/proxies/synthdata-meldekort-proxy/build.gradle @@ -19,6 +19,8 @@ dependencies { implementation "no.nav.testnav.libs:data-transfer-objects" implementation "no.nav.testnav.libs:reactive-security" implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:vault" + implementation "org.springframework.boot:spring-boot-starter-webflux" implementation "org.springframework.cloud:spring-cloud-starter-vault-config" } \ No newline at end of file diff --git a/proxies/synthdata-meldekort-proxy/settings.gradle b/proxies/synthdata-meldekort-proxy/settings.gradle index 51a14287d37..52df408b35e 100644 --- a/proxies/synthdata-meldekort-proxy/settings.gradle +++ b/proxies/synthdata-meldekort-proxy/settings.gradle @@ -11,6 +11,7 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-proxy' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' +includeBuild '../../libs/vault' develocity { buildScan { diff --git a/proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/SynthdataMeldekortProxyApplicationStarter.java b/proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/SynthdataMeldekortProxyApplicationStarter.java index d80cee2b33f..62e69799ba8 100644 --- a/proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/SynthdataMeldekortProxyApplicationStarter.java +++ b/proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/SynthdataMeldekortProxyApplicationStarter.java @@ -7,7 +7,7 @@ import no.nav.testnav.libs.reactivesecurity.exchange.azuread.NavAzureAdTokenService; import no.nav.testnav.libs.securitycore.domain.AccessToken; import no.nav.testnav.proxies.synthdatameldekortproxy.config.Consumers; -import no.nav.testnav.proxies.synthdatameldekortproxy.config.VaultConfig; +import no.nav.testnav.proxies.synthdatameldekortproxy.config.LocalVaultConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.gateway.route.RouteLocator; @@ -17,7 +17,7 @@ @Import({ CoreConfig.class, - VaultConfig.class, + LocalVaultConfig.class, SecurityConfig.class, SecureOAuth2ServerToServerConfiguration.class }) diff --git a/proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/config/LocalVaultConfig.java b/proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/config/LocalVaultConfig.java new file mode 100644 index 00000000000..9d20b9bf7ab --- /dev/null +++ b/proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/config/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.synthdatameldekortproxy.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} \ No newline at end of file diff --git a/proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/config/VaultConfig.java b/proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/config/VaultConfig.java deleted file mode 100644 index 1061aecdd8f..00000000000 --- a/proxies/synthdata-meldekort-proxy/src/main/java/no/nav/testnav/proxies/synthdatameldekortproxy/config/VaultConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package no.nav.testnav.proxies.synthdatameldekortproxy.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -import static io.micrometer.common.util.StringUtils.isBlank; - -@Configuration -@Profile("dev") -@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) -public class VaultConfig extends AbstractVaultConfiguration { - - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; - - @Override - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("Påkrevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/proxies/udistub-proxy/build.gradle b/proxies/udistub-proxy/build.gradle index 9fc11aa32fc..0dc2e8ae2c3 100644 --- a/proxies/udistub-proxy/build.gradle +++ b/proxies/udistub-proxy/build.gradle @@ -10,9 +10,10 @@ sonarqube { } dependencies { - implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:reactive-security' - implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:security-core" + implementation "no.nav.testnav.libs:reactive-security" + implementation "no.nav.testnav.libs:data-transfer-objects" + implementation "no.nav.testnav.libs:vault" - implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config + implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" // TODO remove legacy bootstrap config } diff --git a/proxies/udistub-proxy/settings.gradle b/proxies/udistub-proxy/settings.gradle index 0c5fe7eb36a..94a117cb7a1 100644 --- a/proxies/udistub-proxy/settings.gradle +++ b/proxies/udistub-proxy/settings.gradle @@ -2,15 +2,16 @@ plugins { id "com.gradle.develocity" version "3.17.4" } -rootProject.name = 'udistub-proxy' +rootProject.name = "udistub-proxy" includeBuild "../../plugins/java" -includeBuild '../../libs/data-transfer-objects' -includeBuild '../../libs/reactive-core' -includeBuild '../../libs/reactive-proxy' -includeBuild '../../libs/reactive-security' -includeBuild '../../libs/security-core' +includeBuild "../../libs/data-transfer-objects" +includeBuild "../../libs/reactive-core" +includeBuild "../../libs/reactive-proxy" +includeBuild "../../libs/reactive-security" +includeBuild "../../libs/security-core" +includeBuild "../../libs/vault" develocity { buildScan { diff --git a/proxies/udistub-proxy/src/main/java/no/nav/testnav/proxies/udistubproxy/LocalVaultConfig.java b/proxies/udistub-proxy/src/main/java/no/nav/testnav/proxies/udistubproxy/LocalVaultConfig.java new file mode 100644 index 00000000000..b1739871236 --- /dev/null +++ b/proxies/udistub-proxy/src/main/java/no/nav/testnav/proxies/udistubproxy/LocalVaultConfig.java @@ -0,0 +1,12 @@ +package no.nav.testnav.proxies.udistubproxy; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +public class LocalVaultConfig extends AbstractLocalVaultConfiguration { +} diff --git a/proxies/udistub-proxy/src/main/java/no/nav/testnav/proxies/udistubproxy/UdistubProxyApplicationStarter.java b/proxies/udistub-proxy/src/main/java/no/nav/testnav/proxies/udistubproxy/UdistubProxyApplicationStarter.java index 8f3fe516a11..d806397edda 100644 --- a/proxies/udistub-proxy/src/main/java/no/nav/testnav/proxies/udistubproxy/UdistubProxyApplicationStarter.java +++ b/proxies/udistub-proxy/src/main/java/no/nav/testnav/proxies/udistubproxy/UdistubProxyApplicationStarter.java @@ -2,7 +2,6 @@ import lombok.RequiredArgsConstructor; import no.nav.testnav.libs.reactivecore.config.CoreConfig; -import no.nav.testnav.libs.reactiveproxy.config.DevConfig; import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import no.nav.testnav.libs.reactiveproxy.filter.AddAuthenticationRequestGatewayFilterFactory; import no.nav.testnav.libs.reactivesecurity.config.SecureOAuth2ServerToServerConfiguration; @@ -19,7 +18,6 @@ @Import({ CoreConfig.class, - DevConfig.class, SecurityConfig.class, SecureOAuth2ServerToServerConfiguration.class })