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: Add fine-grained permission system using scopes #2087

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MoritzWeber0
Copy link
Member

@MoritzWeber0 MoritzWeber0 commented Dec 12, 2024

Instead of the inflexible roles and project roles, introduce a fine-grained permission system.

For OpenID / frontend authentication, the role concept is still in place and will be expended with customizable roles in the future.

During creation of personal access tokens, the user can select the permissions that the token should have. This replaces the full-access of personal access tokens. Existing access tokens will receive all permissions that the user has access to during migration.

The permission system will be matched the current role and the behaviour will not change; it's not a breaking change.

This is also the basis for mapping of OAuth scopes.

Open tasks:

  • Write tests to cover the PermissionValidation
  • Ensure that revoked access is also reflected in PAT
  • Update all routes to use PermissionValidation instead of RoleVerification
  • Add support for ProjectPermissionValidation
  • Add descriptions to all routes
  • Add scope selection in frontend
  • Reflect changes in frontend (maybe in another PR?)

Copy link

The generated OpenAPI client is not up to date with the latest changes in the OpenAPI specification.
Please run make openapi locally and commit the changes.

Copy link

github-actions bot commented Dec 12, 2024

API Changelog 4.15.1.dev19+g824f0463

GET /api/v1/permissions

  • endpoint added

POST /api/v1/users/current/tokens

  • ⚠️ added the new required request property 'scopes'

This comment has been minimized.

@MoritzWeber0 MoritzWeber0 force-pushed the fine-grained-permissions branch 2 times, most recently from d57e373 to 4c2c2e9 Compare December 13, 2024 10:08
@MoritzWeber0 MoritzWeber0 force-pushed the get-username branch 3 times, most recently from 0ee0e03 to 4be8ae3 Compare December 13, 2024 12:03
Base automatically changed from get-username to main December 13, 2024 12:08
Instead of the unflexible roles and project roles, introduce a
fine-grained permission system.

For OpenID / frontend authentication, the role concept is
still in place and will be expended with customizable roles in the future.

During creation of personal access tokens, the user can select
the permissions that the token should have. This replaces the full-access
of personal access tokens. Existing access tokens will receive all
permissions that the user has access to during migration.

The permission system will be matched the current role and the behaviour
will not change; it's not a breaking change.

This is also the basis for mapping of OAuth scopes.
@MoritzWeber0 MoritzWeber0 force-pushed the fine-grained-permissions branch from 4c2c2e9 to 9ce3867 Compare December 13, 2024 16:27
Copy link

sonarcloud bot commented Dec 13, 2024

Copy link

A Storybook preview is available for commit 824f046.
➡️ View Storybook
➡️ View Chromatic build

Copy link

This report was generated by comparing 824f046 with ebe2c33.
If you would like to check difference, please check here.

success

ArtifactName: reg

✨✨ That's perfect, there is no visual difference! ✨✨

item count
pass 432
change 0
new 0
delete 0

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.

1 participant