From a87b3e18553ff713faf651a32a3ca30fba9e285d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Skogstad?= Date: Fri, 22 Nov 2024 13:41:45 +0100 Subject: [PATCH] chore(app): Temp. disable authorized parties cache (#1512) ## Description ## Related Issue(s) - #1226 ## Verification - [ ] **Your** code builds clean without any errors or warnings - [ ] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) ## Summary by CodeRabbit - **Bug Fixes** - Resolved issues with the caching mechanism for retrieving authorized parties, now using direct requests to improve reliability. - **Improvements** - Enhanced clarity in the claims retrieval process for authorized resources. - Maintained robust error handling to ensure integrity in the authorization process. --- .../Altinn/Authorization/AltinnAuthorizationClient.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/AltinnAuthorizationClient.cs b/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/AltinnAuthorizationClient.cs index 1bc6d9280..71cc487b9 100644 --- a/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/AltinnAuthorizationClient.cs +++ b/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/AltinnAuthorizationClient.cs @@ -81,8 +81,12 @@ public async Task GetAuthorizedParties(IPartyIdentifier CancellationToken cancellationToken = default) { var authorizedPartiesRequest = new AuthorizedPartiesRequest(authenticatedParty); - var authorizedParties = await _partiesCache.GetOrSetAsync(authorizedPartiesRequest.GenerateCacheKey(), async token - => await PerformAuthorizedPartiesRequest(authorizedPartiesRequest, token), token: cancellationToken); + + // Disabled until this bug is fixed: https://github.com/digdir/dialogporten/issues/1226 + // var authorizedParties = await _partiesCache.GetOrSetAsync(authorizedPartiesRequest.GenerateCacheKey(), async token + // => await PerformAuthorizedPartiesRequest(authorizedPartiesRequest, token), token: cancellationToken); + + var authorizedParties = await PerformAuthorizedPartiesRequest(authorizedPartiesRequest, cancellationToken); return flatten ? GetFlattenedAuthorizedParties(authorizedParties) : authorizedParties; }