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

change/clientcredential_factory #3695

Merged
merged 32 commits into from
Dec 19, 2024
Merged

Conversation

rfc3092
Copy link
Contributor

@rfc3092 rfc3092 commented Dec 12, 2024

Fullfører ny TODO i #3693.

Samler extends ClientCredential i security-core, og skriver om til factory ClientCredentialAutoConfiguration, med meta-dok. Ønsker å unngå @Import. Fail fast og defaults for test profile.

Har også gått gjennom extends TokenService (unntatt TokenXService) og laget factory TokenServiceAutoConfiguration for disse. Defaults for test profile, for å unngå boilerplate i test config.

Har testa pdl-proxy med opprettelse/import etter arbeidstid.

Fjerner samtidig et par ubrukte klasser i reactive-security.

Merk at det er noe off i hvordan AzureTokenService settes opp. Den bruker en property AAD_ISSUER_URI som vi setter opp, men burde refaktoreres til å bruke AZURE_OPENID_CONFIG_TOKEN_ENDPOINT (som AzureNavTokenService og AzureTrygdeetatenTokenService). Det tas evt. i annen PR.

- Added factory for autoconfiguration of ClientCredential beans.
- Added default beans for "test" profile.
@rfc3092 rfc3092 mentioned this pull request Dec 12, 2024
@rfc3092 rfc3092 marked this pull request as ready for review December 13, 2024 09:41
@rfc3092 rfc3092 requested a review from a team as a code owner December 13, 2024 09:41
Copy link
Contributor

@stigus stigus left a comment

Choose a reason for hiding this comment

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

Ser flott ut 😎

# Conflicts:
#	libs/reactive-security/src/main/java/no/nav/testnav/libs/reactivesecurity/domain/AzureNavProxyClientCredential.java
#	libs/reactive-security/src/main/java/no/nav/testnav/libs/reactivesecurity/domain/AzureTrygdeetatenClientCredential.java
#	libs/security-core/src/main/java/no/nav/testnav/libs/securitycore/domain/azuread/AzureNavClientCredential.java
#	libs/security-core/src/main/java/no/nav/testnav/libs/securitycore/domain/azuread/ClientCredential.java
#	libs/security-core/src/main/resources/META-INF/additional-spring-configuration-metadata.json
# Conflicts:
#	libs/reactive-security/src/main/java/no/nav/testnav/libs/reactivesecurity/domain/AzureNavProxyClientCredential.java
#	libs/reactive-security/src/main/java/no/nav/testnav/libs/reactivesecurity/domain/AzureTrygdeetatenClientCredential.java
#	libs/security-core/src/main/java/no/nav/testnav/libs/securitycore/domain/azuread/AzureNavClientCredential.java
#	libs/security-core/src/main/java/no/nav/testnav/libs/securitycore/domain/azuread/ClientCredential.java
#	libs/security-core/src/main/resources/META-INF/additional-spring-configuration-metadata.json
… (which is actually used), not AZURE_OPENID_CONFIG_TOKEN_ENDPOINT (which should be used).

- All subclasses of ClientCredential now takes tokenEndpoint. AzureClientCredential just doesn't use it (yet). Simpler code.
- Cleaned up for readability in ClientCredentialConfig.
…ureAdTokenService and NavAzureAdTokenService.
…nts TokenService, similar to AzureAdTokenService.
…TrygdeetatenAzureAdTokenService to be available as a bean (similar to AzureAdTokenService).
…n and TokenServiceAutoConfiguration having different conditionals.
…r related beans to actually work.

- Added test beans to TokenServiceAutoConfiguration to avoid placeholders in config.
@rfc3092 rfc3092 requested a review from stigus December 18, 2024 12:32
Copy link
Contributor

@stigus stigus left a comment

Choose a reason for hiding this comment

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

Nice 👍

@rfc3092 rfc3092 merged commit 879a1b8 into master Dec 19, 2024
21 checks passed
@rfc3092 rfc3092 deleted the change/clientcredential_factory branch December 19, 2024 10:44
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