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

Fixes issue with expiryTime of OIDC cookie that causes refreshToken workflow to be skipped #1990

Merged

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jun 10, 2024

Description

I branched off of the PR submitted by @Alankarsharma and added a unit test that verifies the OIDC refresh token flow.

This also updates one more area where the expiryTime is computed after a token refresh where it gets the new expiry time of the credentials (access token) from the refreshToken response's idToken.

Category

Bug fix

Issues Resolved

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Craig Perkins <[email protected]>
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.61%. Comparing base (489ae54) to head (cb7aea8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1990   +/-   ##
=======================================
  Coverage   70.61%   70.61%           
=======================================
  Files          97       97           
  Lines        2600     2600           
  Branches      380      380           
=======================================
  Hits         1836     1836           
  Misses        668      668           
  Partials       96       96           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@derek-ho derek-ho added the backport 2.x backport to 2.x branch label Jun 10, 2024
@stephen-crawford stephen-crawford merged commit 70f2a9c into opensearch-project:main Jun 11, 2024
19 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 11, 2024
…orkflow to be skipped (#1990)

* Bug fix

Signed-off-by: Alankarsharma <[email protected]>

* Update cookie expiry as well

Signed-off-by: Alankarsharma <[email protected]>

* Lint issue fix

Signed-off-by: Alankarsharma <[email protected]>

* fixed test case

Signed-off-by: Alankarsharma <[email protected]>

* Add test for refresh token workflow in OIDC

Signed-off-by: Craig Perkins <[email protected]>

* Fix assertion

Signed-off-by: Craig Perkins <[email protected]>

* Update getKeepAliveExpiry logic for OIDC

Signed-off-by: Craig Perkins <[email protected]>

* Add check to ensure mockClient.post is called

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Alankarsharma <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Co-authored-by: Alankarsharma <[email protected]>
Co-authored-by: Darshit Chanpura <[email protected]>
(cherry picked from commit 70f2a9c)
cwperks added a commit that referenced this pull request Jun 11, 2024
…orkflow to be skipped (#1990) (#1995)

* Bug fix

Signed-off-by: Alankarsharma <[email protected]>

* Update cookie expiry as well

Signed-off-by: Alankarsharma <[email protected]>

* Lint issue fix

Signed-off-by: Alankarsharma <[email protected]>

* fixed test case

Signed-off-by: Alankarsharma <[email protected]>

* Add test for refresh token workflow in OIDC

Signed-off-by: Craig Perkins <[email protected]>

* Fix assertion

Signed-off-by: Craig Perkins <[email protected]>

* Update getKeepAliveExpiry logic for OIDC

Signed-off-by: Craig Perkins <[email protected]>

* Add check to ensure mockClient.post is called

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Alankarsharma <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Co-authored-by: Alankarsharma <[email protected]>
Co-authored-by: Darshit Chanpura <[email protected]>
(cherry picked from commit 70f2a9c)

Co-authored-by: Craig Perkins <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants