Skip to content

feat: project/dataset view permissions#255

Open
v-rocheleau wants to merge 4 commits into
masterfrom
feat/authz-public
Open

feat: project/dataset view permissions#255
v-rocheleau wants to merge 4 commits into
masterfrom
feat/authz-public

Conversation

@v-rocheleau

Copy link
Copy Markdown

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

codecov Bot commented Apr 1, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (87ef185) to head (6f35ae6).
⚠️ Report is 232 commits behind head on master.

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

@davidlougheed davidlougheed left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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

Comment thread bento_lib/auth/permissions.py Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants