Skip to content

fix: Add checks for registry and feature server handlers#6455

Merged
ntkathole merged 1 commit into
feast-dev:masterfrom
ntkathole:perms_check_all
May 30, 2026
Merged

fix: Add checks for registry and feature server handlers#6455
ntkathole merged 1 commit into
feast-dev:masterfrom
ntkathole:perms_check_all

Conversation

@ntkathole

@ntkathole ntkathole commented May 30, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

For consistency across all registry and feature server endpoints, added missing inline auth checks that their sibling handlers already enforce.

FeastObjectNotFoundException -> Yes → pass -> return empty list

FeastPermissionError -> No → propagates → 403

@ntkathole ntkathole self-assigned this May 30, 2026
@ntkathole ntkathole requested a review from a team as a code owner May 30, 2026 06:10
jyejare

This comment was marked as spam.

@jyejare jyejare left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This PR adds important security and authorization checks to registry and feature server handlers, improving access control for projects and operations. The changes properly implement permission assertions and handle edge cases like missing projects, though there are some areas that need attention around error handling and code duplication.

Comment on lines +264 to +266
except Exception as e:
logger.warning(f"Failed to persist recent visits: {e}")
return response

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[Critical] Unreachable code after return statement

There are three lines of unreachable code after the return statement. The response handling and call_next() execution will never be reached, which could break the middleware functionality.

Current code:

+                    return response
                 response = await call_next(request)
                 return response

Suggested:

Suggested change
except Exception as e:
logger.warning(f"Failed to persist recent visits: {e}")
return response
return response
# Remove the unreachable code below

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The suggestion to remove those lines would break the middleware for all non-GET requests.

Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
@ntkathole ntkathole merged commit 4203eb7 into feast-dev:master May 30, 2026
27 of 29 checks passed
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