Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup/AAD_ISSUER_URI-replacement #3734

Merged
merged 9 commits into from
Jan 29, 2025
Merged

Conversation

rfc3092
Copy link
Contributor

@rfc3092 rfc3092 commented Jan 28, 2025

  • Erstatter bruk av AAD_ISSUER_URI diverse steder i koden med AZURE_OPENID_CONFIG_TOKEN_ENDPOINT gjennom AzureClientCredential.
  • Legger til en ny application context initializer, som bruker Secret Manager for å konfigurere opp tilsvarende miljø som NAIS gir ved kjøring i local. Denne fyller også inn dummy-verdier som før måtte legges i config for test. Reduserer mye boilerplate.

Sistnevnte er foreløpig kun brukt på adresse-service, for utprøving før de andre ~100 evt. endres.

…ng token endpoint from AzureClientCredential, which is based on the NAIS provided AZURE_OPENID_CONFIG_TOKEN_ENDPOINT.
…S provided environment for local profile, and b) automatically populates with dummy values for test profile, reducing configuration boilerplate.
@rfc3092 rfc3092 marked this pull request as ready for review January 28, 2025 15:59
@rfc3092 rfc3092 requested a review from a team as a code owner January 28, 2025 15:59
Copy link
Contributor

@krharum krharum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


SpringApplication.run(AdresseServiceApplicationStarter.class, args);
new SpringApplicationBuilder(AdresseServiceApplicationStarter.class)
.initializers(new NaisEnvironmentApplicationContextInitializer())
Copy link
Contributor

@krharum krharum Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vi har allerede ApplicationConfig der denne initialisering kunne ha vært lagt til, alternativet er å lage en egen config for local og test som kaller NaisEnvironmentApplicationContextInitializer(). Da blir det eksplisitt og tydelig hva som skjer, og ApplicationStarter forblir så enkel som muilig.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Application context initializer må kalles før Spring context er ferdig opprettet, så jeg ser ikke hvordan det skal være teknisk mulig. 🤔 Bruker de eksisterende APIene i Spring for å gjøre dette (de nye APIene, siden DelegatingApplicationContextInitializer er fjernet f.o.m. Spring Boot 3.4.0) Vi setter config gjennom kode avhengig av hvilken Spring profile som er satt for initialisering.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skjønner, vel det var et forslag, hvis det ikke er mulig, så kjør på. 😄

@rfc3092 rfc3092 merged commit 77774e6 into master Jan 29, 2025
206 checks passed
@rfc3092 rfc3092 deleted the cleanup/AAD_ISSUER_URI-replacement branch January 29, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants