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

[Enhancement] Support column access privilege for Ranger #47702

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

HangyuanLiu
Copy link
Contributor

@HangyuanLiu HangyuanLiu commented Jul 1, 2024

Why I'm doing:

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@HangyuanLiu HangyuanLiu requested review from a team as code owners July 1, 2024 11:21
@HangyuanLiu HangyuanLiu force-pushed the 0701-col-pri branch 6 times, most recently from aab12dd to 8603f5d Compare July 2, 2024 07:12
Signed-off-by: HangyuanLiu <460660596@qq.com>
Copy link

sonarqubecloud bot commented Jul 2, 2024

Copy link

github-actions bot commented Jul 2, 2024

[FE Incremental Coverage Report]

fail : 73 / 142 (51.41%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/privilege/ranger/hive/RangerHiveAccessController.java 0 6 00.00% [82, 83, 84, 85, 86, 88]
🔵 com/starrocks/privilege/ranger/starrocks/RangerStarRocksAccessController.java 0 7 00.00% [153, 154, 155, 156, 157, 158, 160]
🔵 com/starrocks/privilege/ColumnPrivilege.java 53 109 48.62% [54, 65, 78, 80, 82, 83, 85, 86, 87, 88, 89, 90, 91, 93, 98, 99, 101, 103, 104, 105, 106, 107, 108, 109, 110, 160, 161, 162, 163, 167, 168, 169, 170, 175, 176, 177, 179, 180, 183, 184, 185, 186, 187, 188, 208, 209, 210, 211, 216, 217, 218, 219, 224, 225, 226, 227]
🔵 com/starrocks/sql/analyzer/AuthorizerStmtVisitor.java 19 19 100.00% []
🔵 com/starrocks/sql/StatementPlanner.java 1 1 100.00% []

Copy link

github-actions bot commented Jul 2, 2024

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link
Contributor

@Seaven Seaven left a comment

Choose a reason for hiding this comment

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

LGTM,but I don't think run the whole optimization process is a good design

@@ -141,7 +141,6 @@
"label": "StarRocks View",
"description": "StarRocks View",
"accessTypeRestrictions": [
"select",
Copy link
Contributor

Choose a reason for hiding this comment

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

table needs to delete select

@@ -147,6 +147,18 @@ public void checkAnyActionOnAnyTable(UserIdentity currentUser, Set<Long> roleIds
throw new AccessDeniedException();
}

@Override
public void checkColumnsAction(UserIdentity currentUser, Set<Long> roleIds, TableName tableName,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public void checkColumnsAction(UserIdentity currentUser, Set<Long> roleIds, TableName tableName,
public void checkColumnAction(UserIdentity currentUser, Set<Long> roleIds, TableName tableName,

@wanpengfei-git wanpengfei-git merged commit ba567ce into StarRocks:main Jul 3, 2024
54 of 56 checks passed
Copy link

github-actions bot commented Jul 3, 2024

@Mergifyio backport branch-3.3

@github-actions github-actions bot removed the 3.3 label Jul 3, 2024
Copy link

github-actions bot commented Jul 3, 2024

@Mergifyio backport branch-3.2

@github-actions github-actions bot removed the 3.2 label Jul 3, 2024
Copy link
Contributor

mergify bot commented Jul 3, 2024

backport branch-3.3

✅ Backports have been created

Copy link
Contributor

mergify bot commented Jul 3, 2024

backport branch-3.2

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jul 3, 2024
Signed-off-by: HangyuanLiu <460660596@qq.com>
(cherry picked from commit ba567ce)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AuthorizerStmtVisitor.java
mergify bot pushed a commit that referenced this pull request Jul 3, 2024
Signed-off-by: HangyuanLiu <460660596@qq.com>
(cherry picked from commit ba567ce)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/privilege/AccessController.java
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/Authorizer.java
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AuthorizerStmtVisitor.java
#	fe/fe-core/src/test/java/com/starrocks/sql/analyzer/PrivilegeCheckerTest.java
HangyuanLiu added a commit that referenced this pull request Jul 3, 2024
Signed-off-by: HangyuanLiu <460660596@qq.com>
(cherry picked from commit ba567ce)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AuthorizerStmtVisitor.java
HangyuanLiu added a commit that referenced this pull request Jul 3, 2024
Signed-off-by: HangyuanLiu <460660596@qq.com>
(cherry picked from commit ba567ce)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/privilege/AccessController.java
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/Authorizer.java
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AuthorizerStmtVisitor.java
#	fe/fe-core/src/test/java/com/starrocks/sql/analyzer/PrivilegeCheckerTest.java
HangyuanLiu added a commit that referenced this pull request Jul 3, 2024
Signed-off-by: HangyuanLiu <460660596@qq.com>
(cherry picked from commit ba567ce)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/privilege/AccessController.java
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/Authorizer.java
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AuthorizerStmtVisitor.java
#	fe/fe-core/src/test/java/com/starrocks/sql/analyzer/PrivilegeCheckerTest.java
HangyuanLiu added a commit that referenced this pull request Jul 3, 2024
Signed-off-by: HangyuanLiu <460660596@qq.com>
(cherry picked from commit ba567ce)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/privilege/AccessController.java
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/Authorizer.java
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AuthorizerStmtVisitor.java
#	fe/fe-core/src/test/java/com/starrocks/sql/analyzer/PrivilegeCheckerTest.java
HangyuanLiu added a commit that referenced this pull request Jul 3, 2024
Signed-off-by: HangyuanLiu <460660596@qq.com>
(cherry picked from commit ba567ce)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AuthorizerStmtVisitor.java
wanpengfei-git pushed a commit that referenced this pull request Jul 3, 2024
wanpengfei-git pushed a commit that referenced this pull request Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants