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

Escape commas in usernames to fix rbac permissions #19365

Closed

Conversation

Xaseron
Copy link

@Xaseron Xaseron commented Sep 14, 2023

Comprehensive Summary of your change

This change escape , in username which breaks rbac validation.
Which leads to that every user with , in his name wasn't able to access an repository via portal or API.

Issue being fixed

Fixes #19356

Please indicate you've done the following:

  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.

@Xaseron Xaseron requested a review from a team as a code owner September 14, 2023 15:33
@Xaseron Xaseron changed the title Fix commas in rbac permissions Escape commas in usernames to fix rbac permissions Sep 14, 2023
Changed the Name entry under projDeveloper in the api_test.go file for testing rbac corner cases.
Adjusted the GetUserName method in rbacUser.go to replace commas with underscores. This fixes a bug with commas in usernames.
@Xaseron
Copy link
Author

Xaseron commented Sep 14, 2023

How can i recheck the DCO?

@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Merging #19365 (5c93b38) into release-2.7.0 (252a0b7) will decrease coverage by 22.40%.
The diff coverage is n/a.

Impacted file tree graph

@@                Coverage Diff                 @@
##           release-2.7.0   #19365       +/-   ##
==================================================
- Coverage          66.41%   44.02%   -22.40%     
==================================================
  Files               1012      245      -767     
  Lines             108713    13398    -95315     
  Branches            2678     2678               
==================================================
- Hits               72207     5898    -66309     
+ Misses             32542     7215    -25327     
+ Partials            3964      285     -3679     
Flag Coverage Δ
unittests 44.02% <ø> (-22.40%) ⬇️

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

see 771 files with indirect coverage changes

@stonezdj
Copy link
Contributor

How can i recheck the DCO?

git commit --amend --signoff

@Xaseron
Copy link
Author

Xaseron commented Sep 15, 2023

I signed it yesterday and force pushed

@stonezdj
Copy link
Contributor

Because the OIDC onboard function checked the comma in the username, we need to investigate how the comma comes to the username in the database.

@Xaseron
Copy link
Author

Xaseron commented Sep 18, 2023

You can also create usernames with comma and authdb

@Vad1mo Vad1mo added the release-note/update Update or Fix label Oct 4, 2023
@Vad1mo Vad1mo enabled auto-merge (squash) October 4, 2023 12:50
@Vad1mo
Copy link
Member

Vad1mo commented Oct 4, 2023

@stonezdj, how can we move here further forward?

Copy link

github-actions bot commented Dec 4, 2023

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

@github-actions github-actions bot added the Stale label Dec 4, 2023
Copy link

github-actions bot commented Jan 4, 2024

This PR was closed because it has been stalled for 30 days with no activity. If this PR is still relevant, please re-open a new PR against main.

@github-actions github-actions bot closed this Jan 4, 2024
auto-merge was automatically disabled January 4, 2024 09:03

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants