Skip to content
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

feat(Ranger): add a default database policy name for legacy table #1507

Conversation

WHBANG
Copy link
Contributor

@WHBANG WHBANG commented Jun 2, 2023

What problem does this PR solve?

#1054

What is changed and how does it work?

  • This patch adds a new conf item legacy_table_database_mapping_policy_name,
    the legacy table (the tables which are created before Ranger ACL enabled) will be
    matched to the database named legacy_table_database_mapping_policy_name
    for ACL.
  • "*" can match any table, including legacy tables and tables named by new rules.

A new configuration is added:

[ranger]
+ legacy_table_database_mapping_policy_name = __default__

@github-actions github-actions bot added the cpp label Jun 2, 2023
src/runtime/ranger/ranger_resource_policy_manager.cpp Outdated Show resolved Hide resolved
src/runtime/ranger/ranger_resource_policy_manager.cpp Outdated Show resolved Hide resolved
src/runtime/ranger/ranger_resource_policy_manager.cpp Outdated Show resolved Hide resolved
src/runtime/ranger/ranger_resource_policy_manager.cpp Outdated Show resolved Hide resolved
dsn::replication::update_app_env_rpc rpc(std::move(req), LPC_USE_RANGER_ACCESS_CONTROL);
_meta_svc->get_server_state()->set_app_envs(rpc);
LOG_AND_RETURN_NOT_OK(ERROR, rpc.response().err, "set_app_envs failed.");
break;
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible that a table match multiple policies?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, next patch will solve this problem: i will add a new data structure to record all matching policies

wh002 added 2 commits June 2, 2023 19:21
acelyc111
acelyc111 previously approved these changes Jun 6, 2023
src/runtime/ranger/ranger_resource_policy_manager.cpp Outdated Show resolved Hide resolved
acelyc111
acelyc111 previously approved these changes Jun 7, 2023
@empiredan empiredan merged commit f3d1388 into apache:master Jun 8, 2023
@empiredan empiredan mentioned this pull request Aug 21, 2023
@empiredan empiredan added the type/config-change Added or modified configuration that should be noted on release note of new version. label Dec 1, 2023
GehaFearless pushed a commit to GehaFearless/incubator-pegasus that referenced this pull request Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpp type/config-change Added or modified configuration that should be noted on release note of new version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants