-
Notifications
You must be signed in to change notification settings - Fork 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
[core] Introduce privilege system for catalog based on FileSystem #2789
Conversation
Please finish documentation in this PR. |
import java.util.List; | ||
|
||
/** {@link FileStore} with privilege checks. */ | ||
public class PrivilegedFileStore<T> implements FileStore<T> { |
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.
We should not wrap FileStore, all things should be finished in Table interface.
@@ -54,32 +61,43 @@ | |||
import static org.apache.paimon.utils.Preconditions.checkArgument; | |||
|
|||
/** Common implementation of {@link Catalog}. */ | |||
public abstract class AbstractCatalog implements Catalog { | |||
public abstract class AbstractCatalog implements Catalog, PrivilegedCatalog { |
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.
Maybe we should wrap a catalog just like PrevilegedFileStoreTable
.
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.
Some catalogs may not use FileSystem based Previlege system.
For example, RestCatalog will register users in server not filesystem.
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.
Can you describe storage format for privilege system in the PR description?
hi, @tsreaper , will there be plan to integrate with apache ranger in the future? like this: https://doris.apache.org/docs/dev/admin-manual/privilege-ldap/ranger/ |
fcd60bc
to
85ee0ec
Compare
## Enable Privileges | ||
|
||
Paimon currently only supports file-based privilege system. | ||
Only catalogs with `'metastore' = 'filesystem'` (the default value) support such privilege system. |
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.
Can we support filesystem privilege for hive catalog too?
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.
+1
Purpose
This PR introduces an identity-based privilege system for catalogs. Catalogs can now be updated into a privileged catalogs, where privileged users can be created and granted privileges to tables, databases or the whole catalog.
Tests
PrivilegeManagerTest
PrivilegeProcedureITCase
API and Format
Yes. This PR introduces two new system tables: user and privilege.
User table is the table which stores all user information. The schema of user table is:
Privilege table is the table storing what privileges each user have. Its schema is:
PrivilegeType
Documentation
Yes. Document is also added.