Skip to content

Support all Trino Security Access Control modes in Delta lake Connector#11782

Merged
kokosing merged 1 commit intotrinodb:masterfrom
mdesmet:feature/access_controls
Sep 6, 2022
Merged

Support all Trino Security Access Control modes in Delta lake Connector#11782
kokosing merged 1 commit intotrinodb:masterfrom
mdesmet:feature/access_controls

Conversation

@mdesmet
Copy link
Copy Markdown
Contributor

@mdesmet mdesmet commented Apr 4, 2022

Description

Support Read-only, file and allow all access control modes in delta connector.

Is this change a fix, improvement, new feature, refactoring, or other?

Improvement

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

Change to the Delta Lake Connector

How would you describe this change to a non-technical end user or system administrator?

Related issues, pull requests, and links

Documentation

( ) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

( ) No release notes entries required.
( ) Release notes entries required with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Apr 4, 2022
@mdesmet mdesmet force-pushed the feature/access_controls branch from 4439683 to 9b6b0cc Compare April 4, 2022 22:04
@mdesmet mdesmet force-pushed the feature/access_controls branch from 9b6b0cc to bf45197 Compare April 5, 2022 07:23
@mdesmet
Copy link
Copy Markdown
Contributor Author

mdesmet commented Apr 8, 2022

This PR is preparation to support Trino views within the Delta Lake connector. We would need to support Access control modes as otherwise the default SYSTEM access control would fail on every view access.

See following comment

@mdesmet mdesmet requested a review from findepi May 17, 2022 21:27
@findepi findepi requested a review from dain May 18, 2022 13:44
@findepi
Copy link
Copy Markdown
Member

findepi commented May 18, 2022

@kokosing @lukasz-walkiewicz did you have time to look into this?

@mdesmet mdesmet force-pushed the feature/access_controls branch from bf45197 to 1b2d90f Compare May 18, 2022 20:41
@mdesmet
Copy link
Copy Markdown
Contributor Author

mdesmet commented May 18, 2022

I've also added docs based on the existing Iceberg docs.

@github-actions github-actions bot added the docs label May 18, 2022
@findepi findepi requested review from alexjo2144 and findinpath May 19, 2022 14:04
@alexjo2144
Copy link
Copy Markdown
Member

Are the other SecurityModules used by the Hive connector applicable? legacy and sql-standard?

@findepi
Copy link
Copy Markdown
Member

findepi commented May 19, 2022

@alexjo2144 good question

legacy is Hive's default because changing the default is hard.
i don't think we want it for Delta, do we?

cc @kokosing @electrum

@kokosing
Copy link
Copy Markdown
Member

We don't want legacy.

@mdesmet
Copy link
Copy Markdown
Contributor Author

mdesmet commented May 28, 2022

Is this good to be merged? This would unblock #11763

@findinpath
Copy link
Copy Markdown
Contributor

@lukasz-walkiewicz CPTAL ?

Copy link
Copy Markdown
Member

@lukasz-walkiewicz lukasz-walkiewicz left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: static import

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: description

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gentle reminder

@alexjo2144
Copy link
Copy Markdown
Member

@mdesmet can you resolve the conflicts?

@mdesmet mdesmet force-pushed the feature/access_controls branch from 1b2d90f to cb83597 Compare July 27, 2022 13:43
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would prefer SYSTEM as default

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I based myself on the Iceberg security default:

private IcebergSecurity securitySystem = IcebergSecurity.ALLOW_ALL;

Wouldn't we want to keep this consistent with Iceberg?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would change the Iceberg too. From user perspective ALLOW_ALL and and SYSTEM do not differ match, other than ALLOW_ALL pretends that it manages roles (while actaully it has no roles) so it limits system roles use cases.

I think we could even consider removal of ALLOW_ALL.

Hence I would prefer to use SYSTEM here, and then update Iceberg too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add a note which option is used by default.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gentle reminder

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

test-iceberg-plugin-access-control -> test-delta-lake-plugin-access-control

@findinpath
Copy link
Copy Markdown
Contributor

@kokosing CPTAL over this PR ? It has been dormant for a while now.

@mdesmet mdesmet force-pushed the feature/access_controls branch from cb83597 to 0419680 Compare August 25, 2022 12:53
@kokosing
Copy link
Copy Markdown
Member

Either I need to base #13862 on this, on this has to be rebased on top of #13862.

@kokosing
Copy link
Copy Markdown
Member

Thanks to #13862 I realized I was wrong. I think you should allow-all as default.

@kokosing
Copy link
Copy Markdown
Member

I am very sorry I have mislead you in the first place.

@mdesmet mdesmet force-pushed the feature/access_controls branch from 0419680 to 4b2b708 Compare August 31, 2022 20:17
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unused parameter. Please remove.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can safely add a static import here. I think it will not be misleading.

@mdesmet mdesmet force-pushed the feature/access_controls branch from 4b2b708 to 7964760 Compare September 1, 2022 06:58
@mdesmet
Copy link
Copy Markdown
Contributor Author

mdesmet commented Sep 6, 2022

@kokosing: Can you have another look?

@kokosing kokosing merged commit 95849b0 into trinodb:master Sep 6, 2022
@kokosing
Copy link
Copy Markdown
Member

kokosing commented Sep 6, 2022

Thanks. I am sorry for the delay.

@github-actions github-actions bot added this to the 395 milestone Sep 6, 2022
install(new ConnectorAccessControlModule());
bindSecurityModule(ALLOW_ALL, new AllowAllSecurityModule());
bindSecurityModule(READ_ONLY, new ReadOnlySecurityModule());
bindSecurityModule(FILE, new FileBasedAccessControlModule());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mdesmet @findepi On qn: can Hive's sql-standard be one of the options here in addition the existing access models?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Delta connector doesn't support all Trino Access Control modes

7 participants