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

Fix regression in jwt url parameter by awaiting async getAdditionalAuthHeader #1292

Merged
merged 7 commits into from
Jan 10, 2023

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jan 9, 2023

Description

A regression was introduced into JWT auth in the 2.4.0 release that prevented authentication with the JWT backend via the url param due to a signature change in the getAdditionalAuthHeader function. See this comment for details: #872 (comment)

This PR introduces a file called after_env.js which is needed to get beyond an issue ReferenceError: TextEncoder is not defined when trying to import SignJWT from jose.

The solution was suggested here: inrupt/solid-client-authn-js#1676 (comment)

I'm not sure if this is the best way to get beyond the problem and open to anyone's suggestions.

Category

[Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation]

Bug Fix

Issues Resolved

#872

Testing

Added new selenium tests directly in this PR.

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.

@cwperks cwperks requested a review from a team January 9, 2023 17:46
Signed-off-by: Craig Perkins <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2023

Codecov Report

Merging #1292 (0a7bde3) into main (180f694) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1292   +/-   ##
=======================================
  Coverage   71.78%   71.78%           
=======================================
  Files          88       88           
  Lines        2027     2027           
  Branches      274      274           
=======================================
  Hits         1455     1455           
  Misses        509      509           
  Partials       63       63           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

DarshitChanpura
DarshitChanpura previously approved these changes Jan 9, 2023
@RyanL1997 RyanL1997 added backport 2.x backport to 2.x branch backport 2.4 backport to 2.4 branch backport 2.5 backport to 2.5 branch labels Jan 10, 2023
Signed-off-by: Ryan Liang <[email protected]>
@RyanL1997 RyanL1997 merged commit 385377c into opensearch-project:main Jan 10, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 10, 2023
…thHeader (#1292)

* Fix issue with jwt as url param after getAdditionalAuthHeader switched to async

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Ryan Liang <[email protected]>
Co-authored-by: Ryan Liang <[email protected]>
(cherry picked from commit 385377c)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 10, 2023
…thHeader (#1292)

* Fix issue with jwt as url param after getAdditionalAuthHeader switched to async

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Ryan Liang <[email protected]>
Co-authored-by: Ryan Liang <[email protected]>
(cherry picked from commit 385377c)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 10, 2023
…thHeader (#1292)

* Fix issue with jwt as url param after getAdditionalAuthHeader switched to async

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Ryan Liang <[email protected]>
Co-authored-by: Ryan Liang <[email protected]>
(cherry picked from commit 385377c)
RyanL1997 pushed a commit that referenced this pull request Jan 11, 2023
…thHeader (#1292) (#1296)

* Fix issue with jwt as url param after getAdditionalAuthHeader switched to async

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Ryan Liang <[email protected]>
Co-authored-by: Ryan Liang <[email protected]>
(cherry picked from commit 385377c)
RyanL1997 pushed a commit that referenced this pull request Jan 18, 2023
…thHeader (#1292) (#1294)

* Fix issue with jwt as url param after getAdditionalAuthHeader switched to async

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Ryan Liang <[email protected]>
Co-authored-by: Ryan Liang <[email protected]>
(cherry picked from commit 385377c)
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 backport 2.4 backport to 2.4 branch backport 2.5 backport to 2.5 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants