Skip to content

Conversation

@v-rocheleau
Copy link
Contributor

Enables optional authorization checks for project and dataset models, mostly intended for the data catalog.

  • GET /projects
    • User must have a grant with the P_VIEW_PROJECTS permission
    • Feature flag: KATSU_PROJECTS_LIST_AUTHZ: bool
  • GET /datasets
    • User must have a grant with the P_VIEW_DATASETS permission
    • Feature flag: KATSU_DATASETS_LIST_AUTHZ: bool

@codecov
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

Attention: Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.

Project coverage is 92.83%. Comparing base (7009514) to head (7c6d209).

Files with missing lines Patch % Lines
chord_metadata_service/chord/api_views.py 69.23% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #573      +/-   ##
===========================================
- Coverage    92.91%   92.83%   -0.08%     
===========================================
  Files          124      124              
  Lines         4486     4496      +10     
  Branches       391      393       +2     
===========================================
+ Hits          4168     4174       +6     
- Misses         228      230       +2     
- Partials        90       92       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

return await sync_to_async(super().destroy)(request, *args, **kwargs)

@async_to_sync
async def list(self, request, *args, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

there are a few more endpoints for viewing project/dataset metadata (a bunch of public endpoints + maybe some old CHORD endpoints too), I think. Also, how will this interface with Beacon?

from chord_metadata_service.authz.middleware import authz_middleware as authz
from chord_metadata_service.authz.permissions import BentoAllowAnyReadOnly, BentoDeferToHandler
from chord_metadata_service.cleanup.run_all import run_all_cleanup
from chord_metadata_service.metadata.settings import KATSU_DATASETS_LIST_AUTHZ, KATSU_PROJECTS_LIST_AUTHZ
Copy link
Member

Choose a reason for hiding this comment

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

use from django.conf import settings and access all Django settings thru that interface

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.

3 participants