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

uml-3080 caching one login #2366

Merged
merged 5 commits into from
Oct 12, 2023
Merged

uml-3080 caching one login #2366

merged 5 commits into from
Oct 12, 2023

Conversation

Lbagg1
Copy link
Contributor

@Lbagg1 Lbagg1 commented Oct 11, 2023

Purpose

Implementation

We need to cache calls out to the openid-configuration url as they’ll naturally be slow.

Psuedocode

$cachedBuilder = new MetadataProviderBuilder();
$cachedBuilder->setCache(${INSTANCE_OF_\Psr\SimpleCache\CacheInterface}) // APCU via laminas-cache
->setTtl(60); //seconds? minutes? we probably want an hour

$issuer = (new IssuerBuilder())
->setMetadataProviderbuilder($cachedBuilder)
->build('http://mock-one-login/.well-known/openid-configuration'); // protocol+host from config

AC

PSR-16 cache to be used as with

Fixes UML-3080

Approach

Explain how your code addresses the purpose of the change

Learning

Any tips and tricks, blog posts or tools which helped you. Plus anything notable you've discovered about the Use a Lasting Power of Attorney service

Checklist

  • I have performed a self-review of my own code
  • [ ] I have added relevant logging with appropriate levels to my code
  • [ ] New event_codes have been documented on the [wiki page]~~(https://opgtransform.atlassian.net/wiki/spaces/LSML2/pages/3277881441/Understanding+the+event+logs)
  • [ ] I have updated documentation (Confluence/GitHub wiki/tech debt doc) where relevant
  • I have added tests to prove my work
  • [ ] I have added welsh translation tags and updated translation files
  • [ ] I have run an accessibility tool on any pages I have made changes to and fixed any issues found
  • [ ] I have notified the Interaction Designer of any content changes so that appropriate screenshots/flow diagram changes can be made
  • The product team have tested these changes

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Merging #2366 (48115ba) into main (b87582a) will increase coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2366      +/-   ##
============================================
+ Coverage     92.00%   92.01%   +0.01%     
- Complexity     1457     1459       +2     
============================================
  Files           275      276       +1     
  Lines          6629     6638       +9     
============================================
+ Hits           6099     6108       +9     
  Misses          513      513              
  Partials         17       17              
Flag Coverage Δ
use-an-lpa-admin 88.81% <ø> (ø)
use-an-lpa-api 96.82% <100.00%> (+0.05%) ⬆️
use-an-lpa-front 89.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...c/App/src/Service/Authentication/IssuerBuilder.php 100.00% <100.00%> (ø)
...entication/OneLoginAuthorisationRequestService.php 100.00% <100.00%> (ø)

@Lbagg1 Lbagg1 marked this pull request as ready for review October 12, 2023 13:48
@Lbagg1 Lbagg1 requested a review from a team as a code owner October 12, 2023 13:48
@Lbagg1 Lbagg1 merged commit b0a11f8 into main Oct 12, 2023
30 checks passed
@Lbagg1 Lbagg1 deleted the uml-3080-caching-onelogin branch October 12, 2023 13:55
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.

3 participants