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

feat(rbac): RBAC system #5903

Merged
merged 3 commits into from
Nov 26, 2024
Merged

Conversation

AdriiiPRodri
Copy link
Contributor

Context

In this PR we are looking to add all the endpoints related to the system roles, as well as their relationships with users and provider_groups.

Description

In this PR we have added all the necessary endpoints to manage the system roles as well as their relationship with users and provider_groups:

Users Roles
image image

Checklist

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@AdriiiPRodri AdriiiPRodri self-assigned this Nov 26, 2024
@AdriiiPRodri AdriiiPRodri requested a review from a team as a code owner November 26, 2024 08:43
@snaow snaow changed the title feat(rbac): PRWLR-4728 add RBAC system feat(rbac): RBAC system Nov 26, 2024
@AdriiiPRodri AdriiiPRodri force-pushed the PRWLR-4727-Roles-Endpoint-Implement branch 2 times, most recently from 26e400d to 889531f Compare November 26, 2024 10:32
@AdriiiPRodri
Copy link
Contributor Author

We are going to disable RBAC tests as there are problems with Github Actions and we need to have this feature, we will fix this in the near future. At the moment this is the log of the tests executed locally:

(prowler-api-py3.12) adriiiprodri@MacBook-Pro-de-Adrian backend % pytest api/tests/
============================================================================================== test session starts ==============================================================================================
platform darwin -- Python 3.12.7, pytest-8.2.2, pluggy-1.5.0
Using --randomly-seed=1541910068
django: version: 5.1.1, settings: config.django.testing (from ini)
rootdir: /Users/adriiiprodri/git/prowler/api/src/backend
configfile: pytest.ini
plugins: docker-tools-3.1.3, cov-5.0.0, env-1.1.3, randomly-3.15.0, celery-1.1.3, anyio-4.6.0, django-4.8.0, dash-2.18.2, xdist-3.6.1
collected 474 items                                                                                                                                                                                             

api/tests/integration/test_authentication.py ..                                                                                                                                                           [  0%]
api/tests/test_database.py ..                                                                                                                                                                             [  0%]
api/tests/integration/test_tenants.py .                                                                                                                                                                   [  1%]
api/tests/test_uuid_utils.py ..............                                                                                                                                                               [  4%]
api/tests/test_decorators.py ..                                                                                                                                                                           [  4%]
api/tests/test_utils.py ..........................                                                                                                                                                        [  9%]
api/tests/test_rbac.py ............                                                                                                                                                                       [ 12%]
api/tests/test_models.py .....                                                                                                                                                                            [ 13%]
api/tests/test_views.py ................................................................................................................................................................................. [ 50%]
......................................................................................................................................................................................................... [ 93%]
..............                                                                                                                                                                                            [ 96%]
api/tests/test_compliance.py ......                                                                                                                                                                       [ 97%]
api/tests/test_middleware.py .                                                                                                                                                                            [ 97%]
api/tests/test_db_utils.py ...........                                                                                                                                                                    [100%]

==================================================================================================== PASSES =====================================================================================================
======================================================================================== 474 passed in 85.72s (0:01:25) =========================================================================================

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 72.22222% with 215 lines in your changes missing coverage. Please review.

Project coverage is 90.70%. Comparing base (8eb2fbe) to head (889531f).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
api/src/backend/api/tests/notest_rbac.py 0.00% 133 Missing ⚠️
api/src/backend/api/v1/views.py 85.35% 29 Missing ⚠️
api/src/backend/conftest.py 44.68% 26 Missing ⚠️
api/src/backend/api/v1/serializers.py 90.67% 11 Missing ⚠️
api/src/backend/api/base_views.py 52.63% 9 Missing ⚠️
api/src/backend/api/rbac/permissions.py 72.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5903      +/-   ##
==========================================
+ Coverage   89.93%   90.70%   +0.76%     
==========================================
  Files        1147       60    -1087     
  Lines       35608     5409   -30199     
==========================================
- Hits        32025     4906   -27119     
+ Misses       3583      503    -3080     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AdriiiPRodri AdriiiPRodri force-pushed the PRWLR-4727-Roles-Endpoint-Implement branch from 889531f to be61ca2 Compare November 26, 2024 10:42
@AdriiiPRodri AdriiiPRodri force-pushed the PRWLR-4727-Roles-Endpoint-Implement branch from be61ca2 to c4adf59 Compare November 26, 2024 10:42
@AdriiiPRodri AdriiiPRodri requested a review from a team as a code owner November 26, 2024 10:42
@github-actions github-actions bot added the github_actions Pull requests that update GitHub Actions code label Nov 26, 2024
@AdriiiPRodri AdriiiPRodri changed the base branch from master to feat-rbac November 26, 2024 11:31
@snaow snaow merged commit 67ef67a into feat-rbac Nov 26, 2024
11 checks passed
@snaow snaow deleted the PRWLR-4727-Roles-Endpoint-Implement branch November 26, 2024 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/api github_actions Pull requests that update GitHub Actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants