-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Authorize table parameters in CTAS and remove deprecated check methods #10939
Authorize table parameters in CTAS and remove deprecated check methods #10939
Conversation
Access controls interfaces allow implementor to inspect new table's properties. This is done for CREATE TABLE`, but was not done for `CREATE TABLE AS`. Instead, a deprecated access control method was called.
Remove `ConnectorAccessControl` and `SystemAccessControl`'s `checkCanCreateTable` and `checkCanCreateMaterializedView` checks that do not take properties that were deprecated some time ago. Remove associated fallback configuration toggle. Among other things, this forces plugin implementors to implement the correct method. This is important, because the old method did not delegate to the new, nor vice versa.
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.
Great find!
I suggest we leave the deprecated methods in connector and system access control, and have the new methods pass through to them. This way we don't break someone who did not realize we changed the signature.
* @deprecated use {@link #checkCanCreateTable(ConnectorSecurityContext context, SchemaTableName tableName, Map properties)} instead | ||
*/ | ||
@Deprecated | ||
default void checkCanCreateTable(ConnectorSecurityContext context, SchemaTableName tableName) |
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 suggest we leave the deprecated methods in connector and system access control, and have the new methods pass through to them. This way we don't break someone who did not realize we changed the signature.
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 agree this is how this should be implemented in the first place, in 364 when the new methods were added.
But now, it's not worthwhile to fix it, and we want to remove the deprecated methods at some point in time anyway. IMO the time is now.
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.
Wow, didn't realize it was that long ago. I guess we have what we have
* @deprecated use {@link #checkCanCreateTable(ConnectorSecurityContext context, SchemaTableName tableName, Map properties)} instead | ||
*/ | ||
@Deprecated | ||
default void checkCanCreateTable(ConnectorSecurityContext context, SchemaTableName tableName) |
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.
Wow, didn't realize it was that long ago. I guess we have what we have
Access controls interfaces allow implementor to inspect new table's
properties. This is done for
CREATE TABLE
, but was not done forCREATE TABLE AS
.Instead, a deprecated access control method was called.
Follows #9401