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

add accessControl, only allow to read data from own organization #68

Merged
merged 3 commits into from
Oct 20, 2024

Conversation

swerder
Copy link
Contributor

@swerder swerder commented Feb 16, 2024

This changes forces that only allowed values can be accessed on all api endpoints.
Some logic before was only "frontend" security/filtering.
The existing backend security from policies are merged to the new middleware, the one in controllers are leave inplace.

added global middleware "globalSecurity":

  • to remove filters and population query param
  • to verify/force route bases Middleware "accessControl" is executed on all api endpoints

added middleware "accessControl":

  • is added to all routes
  • define api type and context where run (as config)
  • check context aware the rights for shared accessToken or normal login (only access data of allowed Operation/Organization)
  • verify not modify/create element to belong to other Operation/Organization

filters/population not longer allowed:

  • they would allow to bypass the new "accessControl" managed security filters
  • add new endpoint forLogin on Organization
  • add "state" and "operationId" query param to add specific filter (inside "accessControl")

existing policies are removed:

  • the logic are now central handled in "accessControl"

organization on logged-in user object:

  • the organization is always loaded / accessible for logged-in user in ctx.state.user.organization

websocket:

  • don't leak encrypted password of logged-in / shared user

For this change also changes on the frontent/client part are required:
zskarte/zskarte-client#393

remove population from query, add specific endpoint instead
@swerder swerder force-pushed the feat/accessControl branch 2 times, most recently from 82e55ec to f3b4fde Compare February 18, 2024 14:46
@thegnuu thegnuu merged commit 1a415b8 into zskarte:dev Oct 20, 2024
1 check passed
@swerder swerder deleted the feat/accessControl branch October 21, 2024 06:52
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.

2 participants