Skip to content

RANGER-5529: RangerAuthorizer update to be REST friendly#890

Open
mneethiraj wants to merge 2 commits intoapache:masterfrom
mneethiraj:RANGER-5529
Open

RANGER-5529: RangerAuthorizer update to be REST friendly#890
mneethiraj wants to merge 2 commits intoapache:masterfrom
mneethiraj:RANGER-5529

Conversation

@mneethiraj
Copy link
Contributor

What changes were proposed in this pull request?

  • updated RangerAuthorizer.getResourcePermissions() to replace multiple parameters with a single parameter, to make it HTTP POST friendly
  • restricted the visibility of class RangerAuthzPlugin to package level, since this is not meant for use outside this package

Though this is a breaking change since the previous release (2.8.0, release earlier this month), updating to the new method signature is trivial (enough to avoid having to carry the previous API version in all releases going forward).

How was this patch tested?

  • verified all unit tests pass sucessfully

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Ranger authz API to make getResourcePermissions() REST/HTTP-POST friendly by wrapping inputs into a single request object, and adjusts embedded implementation/tests accordingly.

Changes:

  • Replace getResourcePermissions(resource, context) with getResourcePermissions(RangerResourcePermissionsRequest) in the RangerAuthorizer API.
  • Introduce RangerResourcePermissionsRequest model for REST-friendly request payloads.
  • Update embedded authorizer/plugin and unit tests to use the new request wrapper; adjust RangerAuthzPlugin constructor visibility.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
authz-embedded/src/test/java/org/apache/ranger/authz/embedded/TestEmbeddedAuthorizer.java Updates test to call getResourcePermissions() with the new request wrapper.
authz-embedded/src/main/java/org/apache/ranger/authz/embedded/RangerEmbeddedAuthorizer.java Implements the new getResourcePermissions(request) API and routes to the embedded plugin.
authz-embedded/src/main/java/org/apache/ranger/authz/embedded/RangerAuthzPlugin.java Updates plugin-side resource-permissions method to accept the new request object; constructor visibility adjusted.
authz-api/src/test/java/org/apache/ranger/authz/DummyAuthorizer.java Adapts test stub authorizer to the new method signature.
authz-api/src/main/java/org/apache/ranger/authz/model/RangerResourcePermissionsRequest.java Adds new request model used by the REST-friendly API.
authz-api/src/main/java/org/apache/ranger/authz/api/RangerAuthorizer.java Updates abstract API signature for resource-permissions retrieval.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants