Skip to content

[JSDK-57] Optional credentials caching + custom pluggable cache#94

Merged
tl-andrea-dilisio merged 5 commits intomainfrom
jsdk-57
Mar 18, 2022
Merged

[JSDK-57] Optional credentials caching + custom pluggable cache#94
tl-andrea-dilisio merged 5 commits intomainfrom
jsdk-57

Conversation

@tl-andrea-dilisio
Copy link
Contributor

@tl-andrea-dilisio tl-andrea-dilisio commented Mar 18, 2022

Description

One of the feedback from the Security team during their pre go-live review was to make the credentials caching optional. This PR onboards that change and pushes a bit further by making the cache implementation customizable.

To enable the default cache (in memory ) users will have to build a client like this

tlClient = TrueLayerClient.New()
                .clientCredentials(TestUtils.getClientCredentials())
                .signingOptions(TestUtils.getSigningOptions())
                .environment(testEnvironment)
                .withCredentialsCaching()
                .build();

Whereas, if a custom cache is needed, developers can provide an implementation of the ICredentialsCache interface

tlClient = TrueLayerClient.New()
                .clientCredentials(TestUtils.getClientCredentials())
                .signingOptions(TestUtils.getSigningOptions())
                .environment(testEnvironment)
                .withCredentialsCaching(new CustomCache())
                .build();

More on this Wiki page

Type of change

Please select multiple options if required.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the relevant documentation

@tl-andrea-dilisio tl-andrea-dilisio marked this pull request as ready for review March 18, 2022 14:48
@tl-andrea-dilisio tl-andrea-dilisio requested a review from a team March 18, 2022 14:48
@CptAlessio
Copy link

Thanks Andrea, looks good to me

@tl-andrea-dilisio tl-andrea-dilisio merged commit 3c5620d into main Mar 18, 2022
@tl-andrea-dilisio tl-andrea-dilisio deleted the jsdk-57 branch March 18, 2022 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants