Commit fafcf455 authored by cdanger's avatar cdanger

- Upgraded parent project: 7.6.0

- Upgraded dependencies:
  - authzforce-ce-xacml-json-model: 2.3.0
  - authzforce-ce-core-pdp-api: 16.3.0
  - jongo: 1.4.1
parent 6f777cb1
......@@ -21,7 +21,7 @@
<dependency>
<groupId>org.ow2.authzforce</groupId>
<artifactId>authzforce-ce-xacml-json-model</artifactId>
<version>2.2.0</version>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.ow2.authzforce</groupId>
......
......@@ -32,16 +32,10 @@
<!-- Version must match the one defined in Jongo's pom.xml -->
<version>3.5.0</version>
</dependency>
<dependency>
<!-- Fix CVE-2018-1000873 on Jongo dependency -->
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10.3</version>
</dependency>
<dependency>
<groupId>org.jongo</groupId>
<artifactId>jongo</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
......@@ -95,6 +89,7 @@
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wso2.balana</groupId>
......@@ -117,6 +112,7 @@
<artifactId>pax-logging-api</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<!-- <dependency> -->
<!-- Do not use WSO2 version of xercesImpl. See https://github.com/wso2/balana/issues/82 . This org.wso2.balana.utils runtime dependency overlaps with att xacml-pdp's dependency xml-apis -->
......@@ -128,6 +124,7 @@
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.0</version>
<scope>test</scope>
</dependency>
<!-- /Test dependencies -->
</dependencies>
......
......@@ -18,7 +18,6 @@
*/
package org.apache.coheigea.cxf.sts.xacml.common;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
......@@ -32,39 +31,48 @@ import org.apache.cxf.sts.claims.ProcessedClaimCollection;
/**
* A ClaimsHandler implementation that works with Roles.
*/
public class RolesClaimsHandler implements ClaimsHandler {
public class RolesClaimsHandler implements ClaimsHandler
{
public static final URI ROLE =
URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role");
public ProcessedClaimCollection retrieveClaimValues(
ClaimCollection claims, ClaimsParameters parameters) {
if (claims != null && claims.size() > 0) {
ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
for (Claim requestClaim : claims) {
ProcessedClaim claim = new ProcessedClaim();
claim.setClaimType(requestClaim.getClaimType());
if (ROLE.equals(requestClaim.getClaimType())) {
claim.setIssuer("STS");
if ("alice".equals(parameters.getPrincipal().getName())) {
claim.addValue("boss");
claim.addValue("employee");
} else if ("bob".equals(parameters.getPrincipal().getName())) {
claim.addValue("employee");
}
}
claimCollection.add(claim);
}
return claimCollection;
}
return null;
}
public static final String ROLE = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role";
public List<URI> getSupportedClaimTypes() {
List<URI> list = new ArrayList<URI>();
list.add(ROLE);
return list;
}
@Override
public ProcessedClaimCollection retrieveClaimValues(final ClaimCollection claims, final ClaimsParameters parameters)
{
if (claims != null && claims.size() > 0)
{
final ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
for (final Claim requestClaim : claims)
{
final ProcessedClaim claim = new ProcessedClaim();
claim.setClaimType(requestClaim.getClaimType());
if (ROLE.equals(requestClaim.getClaimType()))
{
claim.setIssuer("STS");
if ("alice".equals(parameters.getPrincipal().getName()))
{
claim.addValue("boss");
claim.addValue("employee");
}
else if ("bob".equals(parameters.getPrincipal().getName()))
{
claim.addValue("employee");
}
}
claimCollection.add(claim);
}
return claimCollection;
}
return null;
}
@Override
public List<String> getSupportedClaimTypes()
{
final List<String> list = new ArrayList<>();
list.add(ROLE);
return list;
}
}
......@@ -17,6 +17,10 @@
*/
package org.ow2.authzforce.core.pdp.testutil.test.pep.cxf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.net.URL;
import javax.xml.namespace.QName;
......@@ -78,13 +82,13 @@ public class EmbeddedPdpBasedAuthzInterceptorTest extends AbstractBusClientServe
public static void startServers() throws Exception
{
assertTrue("Server failed to launch",
// run the server for the target service (DoubleIt) in the same process
// set this to false to fork
launchServer(Server.class, true));
// run the server for the target service (DoubleIt) in the same process
// set this to false to fork
launchServer(Server.class, true));
assertTrue("Server failed to launch",
// run the server in the same process
// set this to false to fork
launchServer(STSServer.class, true));
// run the server in the same process
// set this to false to fork
launchServer(STSServer.class, true));
}
@org.junit.Test
......
......@@ -3,7 +3,7 @@
<parent>
<groupId>org.ow2.authzforce</groupId>
<artifactId>authzforce-ce-parent</artifactId>
<version>7.5.1</version>
<version>7.6.0</version>
</parent>
<artifactId>authzforce-ce-core</artifactId>
<version>15.1.1-SNAPSHOT</version>
......@@ -33,7 +33,7 @@
<dependency>
<groupId>org.ow2.authzforce</groupId>
<artifactId>authzforce-ce-core-pdp-api</artifactId>
<version>16.2.0</version>
<version>16.3.0</version>
</dependency>
<!-- /AuthzForce dependencies -->
<!-- Test dependencies -->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment