FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Reject unknown resource types and actions in the REST permission API by LuisFigueroaG · Pull Request #6951 · feast-dev/feast · GitHub

Repository navigation

fix: Reject unknown resource types and actions in the REST permission API - #6951

Merged
ntkathole merged 1 commit into
feast-dev:masterfrom
LuisFigueroaG:fix/rest-permission-unknown-types
Oct 7, 2026
Merged

ntkathole merged 1 commit into
feast-dev:masterfrom
LuisFigueroaG:fix/rest-permission-unknown-types

Conversation

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

POST /permissions silently dropped any type or action name it did not recognize:

types = [_TYPE_NAME_TO_ENUM[t] for t in body.types if t in _TYPE_NAME_TO_ENUM]

A typo or wrong casing in every type (e.g. "feature_view" instead of "FEATURE_VIEW") left the spec with an empty types list, which Permission treats as ALL_RESOURCE_TYPES. So a permission meant for one resource type was stored covering all 12 of them, with a 201. A partly invalid action list such as ["DESCRIBE", "READ"] was also narrowed to ["DESCRIBE"] without any notice.

The endpoint now returns a 400 that lists the invalid names and the valid options, consistent with the other 400s in the REST registry API. Valid requests behave as before.

Which issue(s) this PR fixes:

No existing issue.

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

Added REST tests in test_api_rest_registry.py for the valid apply/get/delete path and for rejecting unknown types and actions (lowercase type, a typo among valid types, lowercase action, partly invalid actions). Each rejection test also checks that nothing was stored. The rejection tests fail on master and pass with this change. ruff format --check, ruff check and mypy pass on the changed files, and pytest sdk/python/tests/unit/api passes (139 passed, 6 skipped).

LuisFigueroaG requested a review from a team as a code owner October 6, 2026 00:44

codecov-commenter commented Oct 6, 2026 •
edited
Loading

Copy link
Copy Markdown

⚠️ Please install the to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.14%. Comparing base (7087f1f) to head (e2e2c71).
⚠️ Report is 5 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

@@            Coverage Diff             @@
##           master    #6951      +/-   ##
==========================================
+ Coverage   49.08%   49.14%   +0.05%     
==========================================
  Files         433      433              
  Lines       54332    54338       +6     
  Branches     7917     7918       +1     
==========================================
+ Hits        26667    26702      +35     
+ Misses      25788    25761      -27     
+ Partials     1877     1875       -2     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 50.54% <100.00%> (+0.06%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/api/registry/rest/permissions.py 84.61% <100.00%> (+17.55%) ⬆️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7087f1f...e2e2c71. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ntkathole force-pushed the fix/rest-permission-unknown-types branch from 362415b to 19708b0 Compare October 7, 2026 04:43
… API

apply_permission silently dropped any type or action name that was not in
the name-to-enum maps. A typo or wrong casing in every type left the spec
with an empty types list, which Permission treats as ALL_RESOURCE_TYPES,
so a permission meant for one resource type ended up covering all of them.
Partially invalid action lists were also narrowed without notice.

Return a 400 listing the invalid names and the valid options instead.

Signed-off-by: LuisFigueroaG <luis.h.figueroa.g@gmail.com>
ntkathole force-pushed the fix/rest-permission-unknown-types branch from 19708b0 to e2e2c71 Compare October 7, 2026 05:48
ntkathole merged commit a5eaa36 into feast-dev:master Oct 7, 2026
12 of 16 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL