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

[SDESK-7460] Create async auth rules for user privileges #2824

Open
wants to merge 4 commits into
base: async
Choose a base branch
from

Conversation

eos87
Copy link

@eos87 eos87 commented Jan 27, 2025

Purpose

To implement privilege-based authentication rules for async rest endpoints.

What has changed

  • Added new privilege rules and configurations to ensure that only users with the right permissions can access certain resources.
  • Updated the test files to include scenarios for checking access to privileged resources.
  • Introduced new utility functions to help with privilege and role management. Also another one to flat nested lists.
  • Fixed json serialisation issue when saving session (SecureCookieSessionInterface not being able to handle ObjectId values).
  • Made some small tweaks to the error handling and configuration files to support the new privilege system.
  • Added tests to make sure the new rules work as expected.

Pending

- I will push some changes to fix all (unrelated) mypy issues tomorrow. Done!

Resolves: SDESK-7460

Thanks for checking!

@eos87 eos87 added the async label Jan 27, 2025
@eos87 eos87 added this to the 3.0 milestone Jan 27, 2025
pyproject.toml Outdated Show resolved Hide resolved
superdesk/core/auth/privilege_rules.py Show resolved Hide resolved
superdesk/core/auth/privilege_rules.py Outdated Show resolved Hide resolved
superdesk/core/auth/privilege_rules.py Show resolved Hide resolved
superdesk/tests/__init__.py Outdated Show resolved Hide resolved
tests/core/privilege_rules_test.py Outdated Show resolved Hide resolved
tests/core/resource_endpoints_test.py Outdated Show resolved Hide resolved
@eos87 eos87 requested review from MarkLark86 and removed request for BrianMwangi21 January 29, 2025 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants