Skip to content

chore: refactor user -> rbac.subject into a function #13624

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

Merged
merged 5 commits into from
Jun 21, 2024

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Jun 21, 2024

db.GetAuthorizationUserRoles was being called in multiple places. Moved the logic to httpmw.UserRBACSubject for now. This logic handles custom roles.

Added unit tests for logging in with custom roles, and roles that no longer exist. Since the db schema does not assert the []text in postgres actually exist in the custom_roles table.

What this does

There was a bug with password login and custom roles because the duplicated logic did not handle custom-roles.

@Emyrk Emyrk changed the title test: implement test to assert deleted custom roles are omitted chore: refactor user -> rbac.subject into a function Jun 21, 2024
@Emyrk Emyrk marked this pull request as ready for review June 21, 2024 15:01
@Emyrk Emyrk requested a review from f0ssel June 21, 2024 15:02
Copy link
Contributor

@f0ssel f0ssel left a comment

Choose a reason for hiding this comment

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

Yeah this this will help encapsulate this while all these changes are being made

@Emyrk Emyrk merged commit 0e933f0 into main Jun 21, 2024
36 checks passed
@Emyrk Emyrk deleted the stevenmasley/assert_not_exists_role branch June 21, 2024 16:30
@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants