-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add separate settings for parties cache, don't cache invalid res…
…ponse from Altinn 2 (#1194) ## Description Currently, if the user is missing a profile in Altinn 2, the reportee list returned from all auth/am APIs are empty. This is an error condition, so we treat it as such and don't cache the empty response. Also, this introduces a separate cache setting for parties, as this does not have the cardinality issues as the PDP cache, allowing us to utilize memory cache for this. ## Related Issue(s) - N/A ## Verification - [x] **Your** code builds clean without any errors or warnings - [x] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced caching mechanism for authorized parties, improving performance and response times. - Introduced a new exception handling mechanism for upstream service errors. - **Bug Fixes** - Improved error handling in the `UpstreamServiceException` class to allow custom messages. - **Documentation** - Updated configuration parameters for caching authorized parties to ensure clarity on retention and timeout settings. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
3 changed files
with
35 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
src/Digdir.Domain.Dialogporten.Infrastructure/Common/Exceptions/UpstreamServiceException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
namespace Digdir.Domain.Dialogporten.Infrastructure.Common.Exceptions; | ||
|
||
public interface IUpstreamServiceError; | ||
internal sealed class UpstreamServiceException(Exception innerException) | ||
: Exception(innerException.Message, innerException), IUpstreamServiceError; | ||
internal sealed class UpstreamServiceException : Exception, IUpstreamServiceError | ||
{ | ||
public UpstreamServiceException(Exception innerException) : base(innerException.Message, innerException) { } | ||
public UpstreamServiceException(string message) : base(message) { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters