Skip to content

Implement PolicyCatalogHandler and Add Policy Privileges Stage 2: AttachPolicy + DetachPolicy #1416

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

Conversation

HonahX
Copy link
Contributor

@HonahX HonahX commented Apr 21, 2025

This is a follow-up of #1357. It adds privilege and auth methods for attachPolicy and detachPolicy.

The tests are in PolicyCatalogHandlerAuthzTest.java

cc: @flyrain

Comment on lines +34 to +36
public static PolarisResolvedPathWrapper getResolvedPathWrapper(
@Nonnull PolarisResolutionManifest resolutionManifest,
@Nonnull PolicyAttachmentTarget target) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I plan to extract all getResolvedPathWrappers in PolicyCatalog to this util class to make them shared between PolicyCatalogHandler and PolicyCatalog

initializeCatalog();
}

private PolarisAuthorizableOperation determinePolicyAttachmentOperation(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this confused me when I first saw it called because it's talking about "Attachment" operations when half the time it's used for a "Detachment" operation. Maybe just determineRequiredOperation or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! How about determinePolicyMappingOperation? This name should represent both attachment and detachment.

eric-maynard
eric-maynard previously approved these changes Apr 22, 2025
Copy link
Contributor

@eric-maynard eric-maynard left a comment

Choose a reason for hiding this comment

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

LGTM! Left one nit comment and a non-blocking question

@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Apr 22, 2025
@eric-maynard eric-maynard merged commit 7f31505 into apache:main Apr 22, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Apr 22, 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.

2 participants