-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More readable 403s #396
More readable 403s #396
Conversation
polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizer.java
Outdated
Show resolved
Hide resolved
throw new ForbiddenException( | ||
"Principal '%s' with activated PrincipalRoles '%s' and activated ids '%s' is not authorized for op %s", | ||
"Principal '%s' with activated PrincipalRoles '%s' and activated grants via '%s' is not authorized for op %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Not sure if this is clearer? grants via
-> grant on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what this message is trying to say is that you have grants through / via these roles. So you may have a grant on table X through your principal role A and catalog role B but you fail when you try to read table Y. This message will say ...and activated grants via [A, B]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you also have grants on A and B but they are not privilege grants, they are role grants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. I thought they're table/namespace entities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah no they are roles. But I am still not sure if this verbiage is totally correct, maybe you are right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The via
makes sense to me if they are roles.
Description
Currently, when a request is rejected users see an error like this:
org.apache.iceberg.exceptions.ForbiddenException: Forbidden: Principal 'quickstart_user' with activated PrincipalRoles '[]' and activated ids '[6, 7]' is not authorized for op CREATE_NAMESPACE
With this change, users will see something more like the following:
org.apache.iceberg.exceptions.ForbiddenException: Forbidden: Principal 'quickstart_user' with activated PrincipalRoles '[]' and activated grants via '[quickstart_catalog_role, quickstart_user_role]' is not authorized for op CREATE_NAMESPACE