Repository: incubator-ranger Updated Branches: refs/heads/master 048f6a89d -> 1115ca8e9
RANGER-1171 - Invert authorization logic in RangerKafkaAuthorizer Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/1115ca8e Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/1115ca8e Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/1115ca8e Branch: refs/heads/master Commit: 1115ca8e9bb339b8f8e23909945eb314624e8d4c Parents: 048f6a8 Author: Colm O hEigeartaigh <cohei...@apache.org> Authored: Thu Sep 8 11:50:21 2016 +0100 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Fri Sep 9 09:48:22 2016 +0100 ---------------------------------------------------------------------- .../authorization/kafka/authorizer/RangerKafkaAuthorizer.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/1115ca8e/plugin-kafka/src/main/java/org/apache/ranger/authorization/kafka/authorizer/RangerKafkaAuthorizer.java ---------------------------------------------------------------------- diff --git a/plugin-kafka/src/main/java/org/apache/ranger/authorization/kafka/authorizer/RangerKafkaAuthorizer.java b/plugin-kafka/src/main/java/org/apache/ranger/authorization/kafka/authorizer/RangerKafkaAuthorizer.java index 8ce8233..4c5280a 100644 --- a/plugin-kafka/src/main/java/org/apache/ranger/authorization/kafka/authorizer/RangerKafkaAuthorizer.java +++ b/plugin-kafka/src/main/java/org/apache/ranger/authorization/kafka/authorizer/RangerKafkaAuthorizer.java @@ -62,8 +62,6 @@ public class RangerKafkaAuthorizer implements Authorizer { public static final String ACCESS_TYPE_KAFKA_ADMIN = "kafka_admin"; private static volatile RangerBasePlugin rangerPlugin = null; - long lastLogTime = 0; - int errorLogFreq = 30000; // Log after every 30 seconds public RangerKafkaAuthorizer() { } @@ -187,11 +185,10 @@ public class RangerKafkaAuthorizer implements Authorizer { validationFailed = true; } - boolean returnValue = true; + boolean returnValue = false; if (validationFailed) { MiscUtil.logErrorMessageByInterval(logger, validationStr + ", request=" + rangerRequest); - returnValue = false; } else { try { @@ -199,7 +196,6 @@ public class RangerKafkaAuthorizer implements Authorizer { .isAccessAllowed(rangerRequest); if (result == null) { logger.error("Ranger Plugin returned null. Returning false"); - returnValue = false; } else { returnValue = result.getIsAllowed(); }