Skip to content

Conversation

@v-rocheleau
Copy link

Intended for data catalog, for situations where listing the metadata of projects/datasets must be authorized.

Accompanying Katsu/Bento PRs will:

  • Add configuration flags for catalog authz in Bento/Katsu
    • BENTO_KATSU_PUBLIC_PROJECTS_AUTHZ
    • BENTO_KATSU_PUBLIC_DATASETS_AUTHZ
  • Make Katsu's /projects and /datasets endpoints authz protected based on the feature flags

@codecov
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (87ef185) to head (6f35ae6).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #255   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           56        56           
  Lines         1731      1733    +2     
  Branches       177       177           
=========================================
+ Hits          1731      1733    +2     
Files with missing lines Coverage Δ
bento_lib/auth/permissions.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@davidlougheed davidlougheed self-requested a review April 1, 2025 18:13
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.

first pass

)
P_QUERY_DATASET_LEVEL_COUNTS = Permission(QUERY_VERB, DATASET_LEVEL_COUNTS, gives=(P_QUERY_DATASET_LEVEL_BOOLEAN,))

# Data catalog: permissions to view project/dataset metadata
Copy link
Member

Choose a reason for hiding this comment

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

i'd move these above the query permissions so those can all be grouped together

P_QUERY_DATASET_LEVEL_COUNTS = Permission(QUERY_VERB, DATASET_LEVEL_COUNTS, gives=(P_QUERY_DATASET_LEVEL_BOOLEAN,))

# Data catalog: permissions to view project/dataset metadata
P_VIEW_DATASETS = Permission(VIEW_VERB, DATASET, min_level_required=LEVEL_INSTANCE)
Copy link
Member

Choose a reason for hiding this comment

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

this should give view:projects imo, since a dataset without a project isn't very useful. unless there's a reason not to?


# Data catalog: permissions to view project/dataset metadata
P_VIEW_DATASETS = Permission(VIEW_VERB, DATASET)
P_VIEW_PROJECTS = Permission(VIEW_VERB, PROJECT, min_level_required=LEVEL_PROJECT)
Copy link
Member

Choose a reason for hiding this comment

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

add supports_data_type_narrowing=False to these

Copy link
Member

Choose a reason for hiding this comment

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

(although I should rethink how this logic works, should be false by default I think)

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