-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Distinguish SystemAccessControl methods not exposing query id #18973
Distinguish SystemAccessControl methods not exposing query id #18973
Conversation
24fd23b
to
f309164
Compare
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.
% comment
@@ -229,6 +229,60 @@ | |||
</item> | |||
<!-- Backwards incompatible changes since the previous release --> | |||
<!-- Any exclusions below can be deleted after each release --> | |||
<item> |
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 we should go with deprecation step and avoid backward incompatible change here.
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.
How would you envision getQueryId method in the security context class? would it return optional or not?
i think it would require spreading out changes over multiple versions with plugins updating more than once. I think this is the case where lack of compat is justified.
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.
Let it be.
b642c6e
to
0ef33d8
Compare
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 generally like this change. I think this is one of those cases where an argument that can be Optional.empty()
buys us nothing, and obscures the intent.
I don't have an opinion on the backwards-compatibliity question.
Almost all were imported statically. Import all.
Before the change, `SystemSecurityContext` was provided to every method in `SystemAccessControl`. This was problematic for implementations which need to be query-aware (e.g. for audit or caching purposes), because there was no type system support helping to determine whether ID is present or not. This commit makes `SystemSecurityContext.queryId` non-optional. For methods where query ID is not passed, simple `Identity` is now passed, since this is the only other field in the `SystemSecurityContext`. This is a breaking change because doing it in backwards compatible way would be quite laborious.
0ef33d8
to
2905c18
Compare
Hi, @findepi I tried to use trino version 427, I found that this breaking changes makes unexpected result when using with Apache Ranger. Apache Ranger override Do you have any idea to handle this issue? |
Hello,@wannte , I used<trino. version>427</trino. version>to compile ranger, but still reported the same error. May I ask if there is anything wrong? |
i wish i could help. i don't know where the ranger integration is maintained and by whom |
hi @2416210017 , As you check RangerSystemAccessControl, it implements trino's |
Hello,@wannte |
Incorporates following changes: Add query start to SystemSecurityContext trinodb/trino#19141 trinodb/trino@925f7e4 Distinguish SystemAccessControl methods not exposing query id trinodb/trino#18973 trinodb/trino@1f46063 Signed-off-by: Utkarsh Saxena <[email protected]>
Incorporates following changes: Add query start to SystemSecurityContext trinodb/trino#19141 trinodb/trino@925f7e4 Distinguish SystemAccessControl methods not exposing query id trinodb/trino#18973 trinodb/trino@1f46063 Signed-off-by: Utkarsh Saxena <[email protected]>
Description
Before the change,
SystemSecurityContext
was provided to every method inSystemAccessControl
. This was problematic for implementations which need to be query-aware (e.g. for audit or caching purposes), because there was no type system support helping to determine whether ID is present or not. This commit makesSystemSecurityContext.queryId
non-optional. For methods where query ID is not passed, simpleIdentity
is now passed, since this is the only other field in theSystemSecurityContext
. This is a breaking change because doing it in backwards compatible way would be quite laborious.