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-7372] New Auth mechanism #2729

Merged
merged 17 commits into from
Oct 16, 2024
Merged

Conversation

MarkLark86
Copy link
Contributor

@MarkLark86 MarkLark86 commented Oct 10, 2024

Purpose

Implement a new Authentication and Authorization mechanism, for use with async resources and endpoints

What has changed

  • Move common superdesk.core types into superdesk.core.types, to reduce chance of cyclic imports
  • Implement base Authentication mechanism
  • Implement base Authorization rules
  • Implement Superdesk specific Authentication mechanism (may require further work)
  • Expose sync mongo interfaces from async resources, for scenario's where it would be easier to use sync resource
  • Support custom error strings in field validators

Resolves: SDESK-7372

@MarkLark86 MarkLark86 added this to the 3.0 milestone Oct 10, 2024
@MarkLark86
Copy link
Contributor Author

MarkLark86 commented Oct 10, 2024

This PR is missing the docs and tests. The tests are covered by the Newshub PR that I will create, as it uses this new auth mechanism throughout it's tests.

I will add docs and tests for this core feature in a separate PR, just wanting to get this one in and reviewed.

Copy link

@eos87 eos87 left a comment

Choose a reason for hiding this comment

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

Looks good to me, I just left a couple of minor comments.

superdesk/core/auth/rules.py Outdated Show resolved Hide resolved
Comment on lines 77 to 78
async def return_404() -> Response:
return Response("", 404)
Copy link

Choose a reason for hiding this comment

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

do we need async here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added support for non-async endpoint functions now.

superdesk/core/web/endpoints.py Show resolved Hide resolved
@MarkLark86 MarkLark86 requested a review from eos87 October 14, 2024 00:30
@MarkLark86 MarkLark86 merged commit 904fe88 into superdesk:async Oct 16, 2024
8 of 12 checks passed
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