You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/11/01 10:16:41 UTC
[GitHub] [qpid-broker-j] mklaca opened a new pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
mklaca opened a new pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113
CONNECTION_LIMIT and CONNECTION_FREQUENCY_LIMIT properties are deprecated and they are not supported. Actual implementation silently parse and add a new predicate. This is the worst scenario because:
1. "CONNECTION_LIMIT" and "CONNECTION_FREQUENCY_LIMIT" are silently parsed but the code does not perform expected check.
2. The rule itself becomes unmatchable because any object never has the property "CONNECTION_LIMIT" or "CONNECTION_FREQUENCY_LIMIT". Hence, any object can not match with the rule.
The main aim of this changes is performance. Hence, I would like to keep the chain of rule predicates as short as possible.
The RulePredicate.Any does not perform any check and so it can be omitted in the chain.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] [qpid-broker-j] mklaca commented on pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
Posted by GitBox <gi...@apache.org>.
mklaca commented on pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113#issuecomment-961997263
Hi Alex, regarding the RulePredicate.Any performance optimization,
I have measured the impact of the chain of rule predicates optimization on the performance. The time of ACL rules check decreases by 2-3%, it depends on the structure of ACL rules of course. But the optimization has always a positive impact.
The whole ACL plugin performance optimization is based on the set of many small improvements that together will improve the performance significantly.
I disagree that
> The code readability has improved significantly without additional "any" check
From my point of view, it is a small change and it allows "null check free code". The RulePredicate.Any can be used as the default value instead of null and so it could be added to the predicate chain multiple times and any null check is not needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] [qpid-broker-j] mklaca commented on a change in pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
Posted by GitBox <gi...@apache.org>.
mklaca commented on a change in pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113#discussion_r743745075
##########
File path: broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclRulePredicatesBuilder.java
##########
@@ -123,6 +123,16 @@ else if (property == Property.ATTRIBUTES)
{
_attributeNames.addAll(splitToSet(value));
}
+ else if (property == Property.CONNECTION_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_limit' has been deprecated");
Review comment:
I changed the message to be precise.
##########
File path: broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclRulePredicatesBuilder.java
##########
@@ -123,6 +123,16 @@ else if (property == Property.ATTRIBUTES)
{
_attributeNames.addAll(splitToSet(value));
}
+ else if (property == Property.CONNECTION_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_limit' has been deprecated");
+ return false;
+ }
+ else if (property == Property.CONNECTION_FREQUENCY_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_frequency_limit' has been deprecated");
Review comment:
I changed the message to be precise.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] [qpid-broker-j] mklaca commented on pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
Posted by GitBox <gi...@apache.org>.
mklaca commented on pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113#issuecomment-960816319
Hi Alex, regarding the CONNECTION_LIMIT and CONNECTION_FREQUENCY_LIMIT
CONNECTION_LIMIT and CONNECTION_FREQUENCY_LIMIT syntax was kept on because of the compatibility of the connection limit plugin with existing acl files and so the acl plugin and connection limit plugin can use the same configuration file. It simplifies the transition.
If you do not like the warning message then it can be fixed.
If you want to drop CONNECTION_LIMIT and CONNECTION_FREQUENCY_LIMIT syntax from acl files then it should be removed completely from Property and AclRulePredicatesBuilder class, including support of the acl files from connection limit plugin.
This is refactoring task and it should not have any impact on the functionality. Any functional changes should be done in separate task.
But the most important is that the actual code has a bug.
Let have an acl file with following line:
`ACL ALLOW all ACCESS VIRTUALHOST connection_limit=10 connection_frequency_limit=12`
It silently passes the parsing with neither warning nor exception and it looks like that everything is fine. But acl rule is dysfunctional. The rule never matches because any object never has CONNECTION_LIMIT and CONNECTION_FREQUENCY_LIMIT property and so the rule is always skipped.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] [qpid-broker-j] asfgit closed pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] [qpid-broker-j] alex-rufous commented on a change in pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
Posted by GitBox <gi...@apache.org>.
alex-rufous commented on a change in pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113#discussion_r740213872
##########
File path: broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RulePredicate.java
##########
@@ -62,5 +71,16 @@ public boolean matches(LegacyOperation operation, ObjectProperties objectPropert
return true;
}
+ @Override
+ public RulePredicate and(RulePredicate other)
Review comment:
IMHO, this breaks a semantic of logical and,
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] [qpid-broker-j] mklaca commented on a change in pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
Posted by GitBox <gi...@apache.org>.
mklaca commented on a change in pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113#discussion_r743745075
##########
File path: broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclRulePredicatesBuilder.java
##########
@@ -123,6 +123,16 @@ else if (property == Property.ATTRIBUTES)
{
_attributeNames.addAll(splitToSet(value));
}
+ else if (property == Property.CONNECTION_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_limit' has been deprecated");
Review comment:
I changed the message to be precise.
##########
File path: broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclRulePredicatesBuilder.java
##########
@@ -123,6 +123,16 @@ else if (property == Property.ATTRIBUTES)
{
_attributeNames.addAll(splitToSet(value));
}
+ else if (property == Property.CONNECTION_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_limit' has been deprecated");
+ return false;
+ }
+ else if (property == Property.CONNECTION_FREQUENCY_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_frequency_limit' has been deprecated");
Review comment:
I changed the message to be precise.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] [qpid-broker-j] mklaca commented on pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
Posted by GitBox <gi...@apache.org>.
mklaca commented on pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113#issuecomment-961997263
Hi Alex, regarding the RulePredicate.Any performance optimization,
I have measured the impact of the chain of rule predicates optimization on the performance. The time of ACL rules check decreases by 2-3%, it depends on the structure of ACL rules of course. But the optimization has always a positive impact.
The whole ACL plugin performance optimization is based on the set of many small improvements that together will improve the performance significantly.
I disagree that
> The code readability has improved significantly without additional "any" check
From my point of view, it is a small change and it allows "null check free code". The RulePredicate.Any can be used as the default value instead of null and so it could be added to the predicate chain multiple times and any null check is not needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] [qpid-broker-j] alex-rufous commented on pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
Posted by GitBox <gi...@apache.org>.
alex-rufous commented on pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113#issuecomment-956234276
> CONNECTION_LIMIT and CONNECTION_FREQUENCY_LIMIT properties are deprecated and they are not supported.
That is not a precise statement. The support for CONNECTION_LIMIT and CONNECTION_FREQUENCY_LIMIT had been dropped a while ago. I deleted it completely as the warning was misleading. It was stating that the feature was deprecated whilst in fact it was completely removed. The deprecated feature should work as expected.
> Actual implementation silently parses and adds a new predicate. This is the worst scenario because:
>
> 1. "CONNECTION_LIMIT" and "CONNECTION_FREQUENCY_LIMIT" are silently parsed but the code does not perform expected check.
>
> 2. The rule itself becomes unmatchable because any object never has the property "CONNECTION_LIMIT" or "CONNECTION_FREQUENCY_LIMIT". Hence, any object can not match with the rule.
IMHO, handling CONNECTION_LIMIT and CONNECTION_FREQUENCY_LIMIT without implementation did not look right to me.
Marec, are you planning to restore the behaviour behind CONNECTION_LIMIT and CONNECTION_FREQUENCY_LIMIT ?
>
> The main aim of this changes is performance. Hence, I would like to keep the chain of rule predicates as short as possible. The RulePredicate.Any does not perform any check and so it can be omitted in the chain.
IMHO, check for "any" looked like a premature optimisation to me. Have you tested a performance impact? I anticipate that performance impact from having an extra predicate in chain should be neglectable. The code readability has improved significantly without additional "any" check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] [qpid-broker-j] mklaca commented on pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
Posted by GitBox <gi...@apache.org>.
mklaca commented on pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113#issuecomment-961997263
Hi Alex, regarding the RulePredicate.Any performance optimization,
I have measured the impact of the chain of rule predicates optimization on the performance. The time of ACL rules check decreases by 2-3%, it depends on the structure of ACL rules of course. But the optimization has always a positive impact.
The whole ACL plugin performance optimization is based on the set of many small improvements that together will improve the performance significantly.
I disagree that
> The code readability has improved significantly without additional "any" check
From my point of view, it is a small change and it allows "null check free code". The RulePredicate.Any can be used as the default value instead of null and so it could be added to the predicate chain multiple times and any null check is not needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] [qpid-broker-j] mklaca commented on a change in pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
Posted by GitBox <gi...@apache.org>.
mklaca commented on a change in pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113#discussion_r743745075
##########
File path: broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclRulePredicatesBuilder.java
##########
@@ -123,6 +123,16 @@ else if (property == Property.ATTRIBUTES)
{
_attributeNames.addAll(splitToSet(value));
}
+ else if (property == Property.CONNECTION_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_limit' has been deprecated");
Review comment:
I changed the message to be precise.
##########
File path: broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclRulePredicatesBuilder.java
##########
@@ -123,6 +123,16 @@ else if (property == Property.ATTRIBUTES)
{
_attributeNames.addAll(splitToSet(value));
}
+ else if (property == Property.CONNECTION_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_limit' has been deprecated");
+ return false;
+ }
+ else if (property == Property.CONNECTION_FREQUENCY_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_frequency_limit' has been deprecated");
Review comment:
I changed the message to be precise.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
[GitHub] [qpid-broker-j] alex-rufous commented on a change in pull request #113: QPID-8565: [Broker-J] Enhancement of ACL rule predicates evaluation
Posted by GitBox <gi...@apache.org>.
alex-rufous commented on a change in pull request #113:
URL: https://github.com/apache/qpid-broker-j/pull/113#discussion_r740212386
##########
File path: broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclRulePredicatesBuilder.java
##########
@@ -123,6 +123,16 @@ else if (property == Property.ATTRIBUTES)
{
_attributeNames.addAll(splitToSet(value));
}
+ else if (property == Property.CONNECTION_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_limit' has been deprecated");
Review comment:
The log message is misleading. The feature was completely removed. Only syntax support was left behind
##########
File path: broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclRulePredicatesBuilder.java
##########
@@ -123,6 +123,16 @@ else if (property == Property.ATTRIBUTES)
{
_attributeNames.addAll(splitToSet(value));
}
+ else if (property == Property.CONNECTION_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_limit' has been deprecated");
+ return false;
+ }
+ else if (property == Property.CONNECTION_FREQUENCY_LIMIT)
+ {
+ LOGGER.warn("The ACL Rule property 'connection_frequency_limit' has been deprecated");
Review comment:
The log message is misleading. The feature was completely removed. Only syntax support was left behind
##########
File path: broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RulePredicate.java
##########
@@ -62,5 +71,16 @@ public boolean matches(LegacyOperation operation, ObjectProperties objectPropert
return true;
}
+ @Override
+ public RulePredicate and(RulePredicate other)
Review comment:
IMHO, this breaks a semantic of logical and,
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org