This is an automated email from the ASF dual-hosted git repository. mehul pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ranger.git
The following commit(s) were added to refs/heads/master by this push: new 084c599 RANGER-2559 :- Set RangerAccessRequestImpl with forwardedAddresses and Remote IP from proxy request in Atlas authorizer. 084c599 is described below commit 084c5993d469faade6d67d0e202e9a212fbcf2ff Author: nixonrodrigues <ni...@apache.org> AuthorDate: Fri Sep 6 15:49:46 2019 +0530 RANGER-2559 :- Set RangerAccessRequestImpl with forwardedAddresses and Remote IP from proxy request in Atlas authorizer. Signed-off-by: Mehul Parikh <me...@apache.org> --- .../atlas/authorizer/RangerAtlasAuthorizer.java | 13 +++++++++++-- pom.xml | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/plugin-atlas/src/main/java/org/apache/ranger/authorization/atlas/authorizer/RangerAtlasAuthorizer.java b/plugin-atlas/src/main/java/org/apache/ranger/authorization/atlas/authorizer/RangerAtlasAuthorizer.java index c6008ba..1c56589 100644 --- a/plugin-atlas/src/main/java/org/apache/ranger/authorization/atlas/authorizer/RangerAtlasAuthorizer.java +++ b/plugin-atlas/src/main/java/org/apache/ranger/authorization/atlas/authorizer/RangerAtlasAuthorizer.java @@ -111,6 +111,9 @@ public class RangerAtlasAuthorizer implements AtlasAuthorizer { rangerRequest.setClientIPAddress(request.getClientIPAddress()); rangerRequest.setAccessTime(request.getAccessTime()); rangerRequest.setAction(action); + rangerRequest.setForwardedAddresses(request.getForwardedAddresses()); + rangerRequest.setRemoteIPAddress(request.getRemoteIPAddress()); + ret = checkAccess(rangerRequest); } finally { @@ -183,7 +186,8 @@ public class RangerAtlasAuthorizer implements AtlasAuthorizer { rangerRequest.setClientIPAddress(request.getClientIPAddress()); rangerRequest.setAccessTime(request.getAccessTime()); rangerRequest.setAction(action); - + rangerRequest.setForwardedAddresses(request.getForwardedAddresses()); + rangerRequest.setRemoteIPAddress(request.getRemoteIPAddress()); ret = checkAccess(rangerRequest); } finally { @@ -228,7 +232,8 @@ public class RangerAtlasAuthorizer implements AtlasAuthorizer { rangerRequest.setClientIPAddress(request.getClientIPAddress()); rangerRequest.setAccessTime(request.getAccessTime()); rangerRequest.setAction(action); - + rangerRequest.setForwardedAddresses(request.getForwardedAddresses()); + rangerRequest.setRemoteIPAddress(request.getRemoteIPAddress()); rangerResource.setValue(RESOURCE_RELATIONSHIP_TYPE, relationShipType); @@ -343,6 +348,8 @@ public class RangerAtlasAuthorizer implements AtlasAuthorizer { rangerRequest.setClientIPAddress(request.getClientIPAddress()); rangerRequest.setAccessTime(request.getAccessTime()); rangerRequest.setResource(rangerResource); + rangerRequest.setForwardedAddresses(request.getForwardedAddresses()); + rangerRequest.setRemoteIPAddress(request.getRemoteIPAddress()); if (StringUtils.isNotEmpty(classification)) { rangerResource.setValue(RESOURCE_ENTITY_CLASSIFICATION, request.getClassificationTypeAndAllSuperTypes(classification)); @@ -417,6 +424,8 @@ public class RangerAtlasAuthorizer implements AtlasAuthorizer { final AtlasEntityAccessRequest entityAccessRequest = new AtlasEntityAccessRequest(request.getTypeRegistry(), AtlasPrivilege.ENTITY_READ, entity, request.getUser(), request.getUserGroups()); entityAccessRequest.setClientIPAddress(request.getClientIPAddress()); + entityAccessRequest.setForwardedAddresses(request.getForwardedAddresses()); + entityAccessRequest.setRemoteIPAddress(request.getRemoteIPAddress()); if (!isAccessAllowed(entityAccessRequest, null)) { scrubEntityHeader(entity); diff --git a/pom.xml b/pom.xml index 13d5a5b..abc5d59 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ <apacheds.version>2.0.0-M22</apacheds.version> <asm.all.version>3.2</asm.all.version> <aspectj.version>1.8.2</aspectj.version> - <atlas.version>2.0.0</atlas.version> + <atlas.version>3.0.0-SNAPSHOT</atlas.version> <atlas.gson.version>2.5</atlas.gson.version> <atlas.jackson.version>2.9.9</atlas.jackson.version> <atlas.jettison.version>1.3.7</atlas.jettison.version>