Skip to content

BE: RBAC: Implement RBAC tests #767

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 16 commits into from
Apr 27, 2025
Merged

BE: RBAC: Implement RBAC tests #767

merged 16 commits into from
Apr 27, 2025

Conversation

zambrinf
Copy link
Contributor

@zambrinf zambrinf commented Jan 12, 2025

  • Breaking change? (if so, please describe the impact and migration path for existing application instances)

What changes did you make? (Give an overview)
Added tests to cober AccessControlService
Closes #729

Is there anything you'd like reviewers to focus on?

How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)

  • No need to
  • Manually (please, describe, if necessary)
  • Unit checks
  • Integration checks
  • Covered by existing automation

Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • My changes generate no new warnings (e.g. Sonar is happy)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Check out Contributing and Code of Conduct

A picture of a cute animal (not mandatory but encouraged)

@kapybro kapybro bot added status/triage Issues pending maintainers triage status/triage/manual Manual triage in progress area/rbac Related to Role Based Access Control feature status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Jan 12, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hi zambrinf! 👋

Welcome, and thank you for opening your first PR in the repo!

Please wait for triaging by our maintainers.

Please take a look at our contributing guide.

@zambrinf zambrinf marked this pull request as ready for review January 12, 2025 14:39
@zambrinf zambrinf requested a review from a team as a code owner January 12, 2025 14:39
@Haarolean Haarolean added scope/backend Related to backend changes type/chore Boring stuff, could be refactoring or tech debt and removed status/triage/manual Manual triage in progress labels Jan 12, 2025
@Haarolean Haarolean changed the title Issues/729: Implement RBAC tests BE: RBAC: Implement RBAC tests Jan 12, 2025
@Haarolean
Copy link
Member

@zambrinf could we please add some tests to cover these cases?

If the tests fail due to faulty business logic, we can disable them until the issues are resolved.

@zambrinf
Copy link
Contributor Author

zambrinf commented Jan 14, 2025

@Haarolean Done. I added a test class RbacEditTopicTest specific to #260 but I couldn't reproduce a RBAC error. And the test for #461 is disabled because it's failing.

@Haarolean Haarolean self-requested a review January 14, 2025 07:29
@zambrinf zambrinf requested a review from yeikel January 15, 2025 21:52
@Haarolean Haarolean self-assigned this Feb 11, 2025
@zambrinf
Copy link
Contributor Author

@Haarolean Are you planning on merging this PR?

@Haarolean
Copy link
Member

@Haarolean Are you planning on merging this PR?

absolutely! Sorry for the delay, I'll be taking a look at this soon - it just takes more cognitive load than other issues/PRs :))

Copy link
Member

@Haarolean Haarolean left a comment

Choose a reason for hiding this comment

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

Thank you very much for your efforts and sorry for the delay. Left a few inline comments, PTAL.

@Haarolean Haarolean self-requested a review April 27, 2025 16:16
@Haarolean Haarolean added this to the 1.3 milestone Apr 27, 2025
@Haarolean Haarolean enabled auto-merge (squash) April 27, 2025 16:17
@Haarolean Haarolean merged commit 1603d58 into kafbat:main Apr 27, 2025
9 of 11 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Release 1.3 Apr 27, 2025
@Haarolean
Copy link
Member

@zambrinf thank you very much for your contribution! This is a quite important enhancement for us despite being "just tests", as we had a decent amount of issues with RBAC due to lack of the tests. Much appreciated!

@Haarolean
Copy link
Member

@zambrinf
any idea how (and did it even) build for you?

/home/runner/work/kafka-ui/kafka-ui/api/src/test/java/io/kafbat/ui/service/rbac/RbacEditTopicTest.java:115: error: incompatible types: String cannot be converted to Provider
    sub.setProvider("ldap");

@zambrinf
Copy link
Contributor Author

@Haarolean apparently my branch wasn't fully up to date with the main branch, there was a commit 3074abcdc9f760eb22e5f9056a4f634905ee2441 on March 20th that changed the setter method of the Subject class, saw that you already fixed it

@Haarolean
Copy link
Member

@zambrinf ah I see, I've recently disabled 'branch should be up to date' merge check for some quick merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rbac Related to Role Based Access Control feature scope/backend Related to backend changes status/triage/completed Automatic triage completed type/chore Boring stuff, could be refactoring or tech debt
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

BE: RBAC: Implement RBAC tests
3 participants