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

Features/new auth #60

Merged
merged 17 commits into from
Oct 18, 2023
Merged

Features/new auth #60

merged 17 commits into from
Oct 18, 2023

Conversation

gsfk
Copy link
Member

@gsfk gsfk commented Oct 17, 2023

First pass at adding authz to beacon: response to main /individuals endpoint varies with user permissions:

  • users with valid token and PERMISSION_QUERY_DATA get full response to queries
  • additionally, if they have PERMISSION_DOWNLOAD_DATA they can get valid download links for DRS.

Users without permissions will get the default response only, whether they have a token or not (response currently hardcoded to counts, configurable response coming soon)

The /individuals/<id> endpoint requires a token with valid permissions, all other users receive 401 / 403.

bento_beacon/utils/handover_utils.py Outdated Show resolved Hide resolved
bento_beacon/authz/middleware.py Outdated Show resolved Hide resolved
from .utils.beacon_response import build_response_meta
from ..config_files.config import Config
from ..utils.beacon_response import build_response_meta
from .headers import auth_header_getter
Copy link
Member

Choose a reason for hiding this comment

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

this import now goes unused

@@ -0,0 +1,10 @@
from flask import request, Request
Copy link
Member

Choose a reason for hiding this comment

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

this file is just unused stuff, but we could leave it if you intend to do some non-bearer-token stuff in the future

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, it's going to be in the katsu / gohan stuff

Copy link
Member

@davidlougheed davidlougheed left a comment

Choose a reason for hiding this comment

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

lgtm

@gsfk gsfk merged commit f8d97c2 into master Oct 18, 2023
1 check passed
@gsfk gsfk deleted the features/new-auth branch April 15, 2024 19:03
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