Skip to content

Conversation

@jyejare
Copy link
Contributor

@jyejare jyejare commented Oct 14, 2025

What this PR does / why we need it:

We observed Inconsistent permission response behavior across Feature Store API routes.

  • Fixing the behaviour by changes in filter_only and named_patterns

Which issue(s) this PR fixes:

Inconsistent permission response behavior across Feature Store API routes. RHOAIENG-35929

Misc

Signed-off-by: jyejare <[email protected]>

filter only for named patterns
No matching permissions are handled
@jyejare jyejare requested a review from a team as a code owner October 14, 2025 13:54
@jyejare jyejare changed the title Denial by default to all resources when no permissions set fix: Denial by default to all resources when no permissions set Oct 14, 2025
Comment on lines +74 to 88
if not grant:
if not filter_only:
logger.error(f"Permission denied: {','.join(explanations)}")
raise FeastPermissionError(",".join(explanations))
elif filter_only and not p.name_patterns:
logger.error(f"Permission denied: {','.join(explanations)}")
raise FeastPermissionError(",".join(explanations))
else:
continue
if grant:
logger.debug(
f"Permission granted for {type(resource).__name__}:{resource.name}"
)
_permitted_resources.append(resource)
break

Choose a reason for hiding this comment

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

@jyejare, what do you think about following suggestion?

Suggested change
if not grant:
if not filter_only:
logger.error(f"Permission denied: {','.join(explanations)}")
raise FeastPermissionError(",".join(explanations))
elif filter_only and not p.name_patterns:
logger.error(f"Permission denied: {','.join(explanations)}")
raise FeastPermissionError(",".join(explanations))
else:
continue
if grant:
logger.debug(
f"Permission granted for {type(resource).__name__}:{resource.name}"
)
_permitted_resources.append(resource)
break
if not grant:
if filter_only or p.name_patterns:
continue
logger.error(f"Permission denied: {','.join(explanations)}")
raise FeastPermissionError(",".join(explanations))
logger.debug(
f"Permission granted for {type(resource).__name__}:{resource.name}"
)
_permitted_resources.append(resource)
break

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