[
https://issues.apache.org/jira/browse/KNOX-2762?focusedWorklogId=784343&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-784343
]
ASF GitHub Bot logged work on KNOX-2762:
----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Jun/22 19:40
Start Date: 23/Jun/22 19:40
Worklog Time Spent: 10m
Work Description: zeroflag commented on code in PR #597:
URL: https://github.com/apache/knox/pull/597#discussion_r905386669
##########
gateway-provider-security-authz-composite/src/main/java/org/apache/knox/gateway/deploy/impl/CompositeAuthzDeploymentContributor.java:
##########
@@ -71,7 +71,7 @@ public void contributeFilter( DeploymentContext context,
Provider provider, Serv
}
List parseProviderNames(String providerNames) {
Review Comment:
What's the reason for not having a type parameter for the List? (E.g.
List<String>)
##########
gateway-provider-security-authz-composite/src/test/java/org/apache/knox/gateway/deploy/impl/CompositeAuthzProviderTest.java:
##########
@@ -83,13 +85,19 @@ public void testingNullandEmptyProviderNames() throws
Exception {
String testnames = "";
CompositeAuthzDeploymentContributor c = new
CompositeAuthzDeploymentContributor();
List providerNames = c.parseProviderNames(testnames);
- assertEquals(providerNames.size(), 1);
- assertEquals(providerNames.get(0), "");
+ assertSame(providerNames.size(),0);
Review Comment:
Here the order of parameters are reversed. The first is the expected and the
second is the actual.
This is not a correctness issue, but the error message will misleading if
the test fails.
For example if providerNames has a size of 3 it'll say: expected 3 got 0,
but it is the other way around.
More importantly what's the reason for using assertSame instead of
assertEquals? My understanding is that assertSame checks identity (`==`) not
equality (`.equals`).
Issue Time Tracking
-------------------
Worklog Id: (was: 784343)
Time Spent: 3h (was: 2h 50m)
> Whitespaces around delimiters in composite provider names gives
> NullPointerException
> ------------------------------------------------------------------------------------
>
> Key: KNOX-2762
> URL: https://issues.apache.org/jira/browse/KNOX-2762
> Project: Apache Knox
> Issue Type: Bug
> Components: Server
> Affects Versions: 1.6.0
> Reporter: Harshil Jhaveri
> Assignee: Harshil Jhaveri
> Priority: Minor
> Fix For: 2.0.0
>
> Attachments: NPE gateway log.png
>
> Time Spent: 3h
> Remaining Estimate: 0h
>
> When giving space before the delimiter for composite.provider.names in
> composite authorisation provider. The topology deployment is failing and
> returning a null pointer exception.
> The topology state:
> {code:java}
> <provider>
> <role>authorization</role>
> <name>CompositeAuthz</name>
> <enabled>true</enabled>
> <param>
> <name>composite.provider.names</name>
> <value>AclsAuthz ,XASecurePDPKnox</value>
> </param>
> <param>
> <name>AclsAuthz.ranger.acl</name>
> <value>*;;</value> </param></provider>
> </provider>{code}
> {color:#e8bf6a}CC:{color} [~pzampino] [~smore] [~smolnar]
--
This message was sent by Atlassian Jira
(v8.20.7#820007)