Skip to content

Conversation

@tcnichol
Copy link
Contributor

@tcnichol tcnichol commented Mar 7, 2023

Add MetadataAuth dependency we can use if metadata_id is available in a route, and implements it on several metadata routes.

Also implemented for some dataset metadata routes.

Files will wait until this pull request merged:

#385

added for everything except file metadata
file metadata will wait until after adding auth to file endpoints pull request merged
@tcnichol tcnichol requested a review from max-zilla as a code owner March 7, 2023 19:52
@tcnichol tcnichol linked an issue Mar 7, 2023 that may be closed by this pull request
@tcnichol tcnichol added the backend Backend specific (Python) label Mar 7, 2023
user=Depends(get_current_user),
db: MongoClient = Depends(dependencies.get_db),
es: Elasticsearch = Depends(dependencies.get_elasticsearchclient),
allow: bool = Depends(DatasetAuthorization("editor")),
Copy link
Contributor

Choose a reason for hiding this comment

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

These should be MetadataAuthorization I think?

from app import dependencies
from app import keycloak_auth
from app.deps.authorization_deps import Authorization
from app.deps.authorization_deps import Authorization, DatasetAuthorization
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be removed (covered in other PR)

@max-zilla max-zilla self-requested a review March 15, 2023 12:57
@max-zilla max-zilla merged commit 97ad138 into main Mar 15, 2023
@max-zilla max-zilla deleted the 383-add-authorization-to-metadata-endpoints branch March 15, 2023 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend specific (Python)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add authorization to Metadata endpoints

3 participants