[ACL-263] Caching improvements#337
Merged
Merged
Conversation
dili91
commented
Jan 14, 2025
| */ | ||
| public TrueLayerClientBuilder withCredentialsCaching() { | ||
| this.credentialsCache = new SimpleCredentialsCache(Clock.systemUTC()); | ||
| this.credentialsCache = new InMemoryCredentialsCache(Clock.systemUTC()); |
Contributor
Author
There was a problem hiding this comment.
As we anyway need a breaking change for the new cache interface (that aligns to what PHP and .NET libs do), I took the chance to rename this to be more explicit
dili91
commented
Jan 14, 2025
| return MessageFormat.format("{0}:{1}:{2}", CACHE_KEY_PREFIX, clientId, bytesToHex(md5InBytes)); | ||
| } | ||
|
|
||
| private static byte[] digest(byte[] input) { |
Contributor
Author
There was a problem hiding this comment.
Instead of using a numeric hashcode I'm using MD5. We don't really need this to be bullet-proof, so I think it's fine.
dili91
commented
Jan 14, 2025
Comment on lines
-14
to
+8
| Optional<AccessToken> getToken(RequestScopes scopes); | ||
| Optional<AccessToken> getToken(String key); |
Contributor
Author
There was a problem hiding this comment.
This is the main change: users of a custom cache won't have to bother computing hash keys. They will receive what the client builds, and they have the option to customise/override those if needed
dili91
marked this pull request as ready for review
January 21, 2025 18:00
tl-luca-baggi
approved these changes
Jan 22, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR includes 2 necessary breaking changes:
Type of change
Please select multiple options if required.
Checklist:
gradle.propertiesfile with the new versionCHANGELOG.mdfile with the details of the new version