Skip to content

[#6695] fix(authz): Fix the error privileges #6821

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

Merged
merged 9 commits into from
Apr 9, 2025
Merged

Conversation

jerqi
Copy link
Contributor

@jerqi jerqi commented Apr 2, 2025

What changes were proposed in this pull request?

Fix the error privileges.

Why are the changes needed?

Fix: #6695

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Add UT.

@jerqi jerqi marked this pull request as draft April 2, 2025 11:55
@jerqi jerqi marked this pull request as ready for review April 3, 2025 07:39
@jerqi jerqi requested a review from xunliu April 7, 2025 06:33
Copy link
Member

Choose a reason for hiding this comment

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

Don‘t forget to delete these defines.

public class PathBasedMetadataObject implements AuthorizationMetadataObject {

  public static final PathType METALAKE_PATH = new PathType(MetadataObject.Type.METALAKE);
  public static final PathType CATALOG_PATH = new PathType(MetadataObject.Type.CATALOG);
  public static final PathType SCHEMA_PATH = new PathType(MetadataObject.Type.SCHEMA);
  public static final PathType TABLE_PATH = new PathType(MetadataObject.Type.TABLE);
  public static final PathType FILESET_PATH = new PathType(MetadataObject.Type.FILESET);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @yuqi1129 This follows yu's suggestion.

Copy link
Contributor

@yuqi1129 yuqi1129 left a comment

Choose a reason for hiding this comment

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

some minor issues, others LGTM

@@ -740,4 +776,39 @@ protected Map<String, String> getServiceConfigs(Map<String, String> config) {
RangerAuthorizationProperties.FS_DEFAULT_VALUE))
.build();
}

private interface PathExtractor {
String getPath(Entity.EntityType type, String location);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add some comments regarding the method and its corresponding parameters.

return location;
} else {
throw new AuthorizationPluginException(
"Don't support %s to get table or fileset location", type);
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not allowed/supported to extract table or fileset path from entity %s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -92,15 +92,26 @@ public String toString() {
private final String name;
private final String parent;
private final String path;
private final boolean isRecursive;
Copy link
Contributor

Choose a reason for hiding this comment

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

I do like the name isRecursive, you may use recursive instead as there exists a method name isRecursive()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@jerqi jerqi merged commit be8e151 into apache:main Apr 9, 2025
25 checks passed
Abyss-lord pushed a commit to Abyss-lord/gravitino that referenced this pull request Apr 9, 2025
### What changes were proposed in this pull request?

Fix the error privileges.

### Why are the changes needed?

Fix: apache#6695

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Add UT.
Abyss-lord pushed a commit to Abyss-lord/gravitino that referenced this pull request Apr 15, 2025
### What changes were proposed in this pull request?

Fix the error privileges.

### Why are the changes needed?

Fix: apache#6695

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Add UT.
Abyss-lord pushed a commit to Abyss-lord/gravitino that referenced this pull request Apr 27, 2025
### What changes were proposed in this pull request?

Fix the error privileges.

### Why are the changes needed?

Fix: apache#6695

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Add UT.
Abyss-lord pushed a commit to Abyss-lord/gravitino that referenced this pull request Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Some privileges aren't accurate
3 participants