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

Generic OIDC group scope is not sent in the request formed by the UI #13514

Merged
merged 13 commits into from
Feb 26, 2025

Conversation

cnotv
Copy link
Member

@cnotv cnotv commented Feb 26, 2025

Summary

Fixes #12477

Occurred changes and/or fixed issues

Included scopes in the Keycloack pop-up as indicated in the issue.

Technical notes summary

  • Replaced addObjects() with new joinStringList(), including unit tests
  • Added tests to the redirectTo action to generate redirect URL to auth provider pop up with all the involved cases
  • Added tests to the test action to pass all the required options to compose the redirect URL
  • Added tests to the auth-config mixin used in the view to submit the auth configuration
  • Added tests to the utility function concatStrings()

Side notes as report:
It seems like scope was not added to the whole logic after passing the list from the UI. The function where it gets added has not been changed for 5 years and was not working, so nothing about this feature has been used before.
The scopes seem to be in a format ['a b c'] with a single item in the array, but a refactor has been pushed to a separate issue (#13457) since this is way out of scope.
In the store logic it's also misspelled to the plural as scopes, which may leads to confusion while reviewing.

Areas or cases that should be tested

As by reported issue.

Areas which could experience regressions

  • Auth with other non-SAML providers (Azure has E2E)

Screenshot/Video

Video for this PR is not possible due to internal information, however a new page with the correct scope (as per test) is generated:

Screenshot 2025-02-26 at 10 28 56

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@cnotv cnotv requested a review from torchiaf February 26, 2025 09:13
@rancher-ui-project-bot rancher-ui-project-bot bot added this to the v2.11.0 milestone Feb 26, 2025
Copy link
Member

@torchiaf torchiaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cnotv cnotv merged commit b3babd5 into rancher:master Feb 26, 2025
34 checks passed
cnotv added a commit to cnotv/dashboard that referenced this pull request Mar 11, 2025
…ancher#13514)

* Add basic store auth tests for redirect

* Define mixin tests

* Correct tests to cover all the cases correctly and ensure that this function works as expected

* Add scopes to the redirectTo request when testing the model

* Add unit tests for action test

* Add comment to save auth config method

* Correct unit tests

* Correct test to avoid the same term to be used for different parts

* Correct key value from scope to scopes to match existing implementation

* Update tests to use scopesJoinChar

* Add further tests for merging default scopes and UI scopes

* Add joinStringList function

* Correct scopes merging issues
cnotv added a commit to cnotv/dashboard that referenced this pull request Mar 11, 2025
…ancher#13514)

* Add basic store auth tests for redirect

* Define mixin tests

* Correct tests to cover all the cases correctly and ensure that this function works as expected

* Add scopes to the redirectTo request when testing the model

* Add unit tests for action test

* Add comment to save auth config method

* Correct unit tests

* Correct test to avoid the same term to be used for different parts

* Correct key value from scope to scopes to match existing implementation

* Update tests to use scopesJoinChar

* Add further tests for merging default scopes and UI scopes

* Add joinStringList function

* Correct scopes merging issues
cnotv added a commit to cnotv/dashboard that referenced this pull request Mar 11, 2025
…ancher#13514)

* Add basic store auth tests for redirect

* Define mixin tests

* Correct tests to cover all the cases correctly and ensure that this function works as expected

* Add scopes to the redirectTo request when testing the model

* Add unit tests for action test

* Add comment to save auth config method

* Correct unit tests

* Correct test to avoid the same term to be used for different parts

* Correct key value from scope to scopes to match existing implementation

* Update tests to use scopesJoinChar

* Add further tests for merging default scopes and UI scopes

* Add joinStringList function

* Correct scopes merging issues
cnotv added a commit that referenced this pull request Mar 11, 2025
…13514) (#13679)

* Add basic store auth tests for redirect

* Define mixin tests

* Correct tests to cover all the cases correctly and ensure that this function works as expected

* Add scopes to the redirectTo request when testing the model

* Add unit tests for action test

* Add comment to save auth config method

* Correct unit tests

* Correct test to avoid the same term to be used for different parts

* Correct key value from scope to scopes to match existing implementation

* Update tests to use scopesJoinChar

* Add further tests for merging default scopes and UI scopes

* Add joinStringList function

* Correct scopes merging issues
cnotv added a commit that referenced this pull request Mar 11, 2025
… formed by the UI (#13681)

* Generic OIDC group scope is not sent in the request formed by the UI (#13514)

* Add basic store auth tests for redirect

* Define mixin tests

* Correct tests to cover all the cases correctly and ensure that this function works as expected

* Add scopes to the redirectTo request when testing the model

* Add unit tests for action test

* Add comment to save auth config method

* Correct unit tests

* Correct test to avoid the same term to be used for different parts

* Correct key value from scope to scopes to match existing implementation

* Update tests to use scopesJoinChar

* Add further tests for merging default scopes and UI scopes

* Add joinStringList function

* Correct scopes merging issues

* Remove unit tests incompatible with this backported version
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.

Generic OIDC group scope is not sent in the request formed by the UI
2 participants