Omaha #3509 Fixed XACML processing to work properly with DPA

Change-Id: I6b66cfe4217c8a9bc2dec1d7e97b7f5203b518fe

Former-commit-id: e230d38e13 [formerly defe9d1c42] [formerly 201962c6fc] [formerly e230d38e13 [formerly defe9d1c42] [formerly 201962c6fc] [formerly 02719e9f90 [formerly 201962c6fc [formerly 4661d8ec3ed187b2ccf270a2acbcd55cc5ef359c]]]]
Former-commit-id: 02719e9f90
Former-commit-id: dbd6d18200 [formerly 3e1b3f180c] [formerly 25a7792436d9cc0eddebd8721e813a557e22d7f6 [formerly f8ee1ce801]]
Former-commit-id: 6fcbb461641f247db2f49252dfbad358b72261a3 [formerly b8c4bb918e]
Former-commit-id: b56bf7055a
This commit is contained in:
Benjamin Phillippe 2014-08-19 15:01:00 -05:00
parent 3659b37555
commit 80bb517683
3 changed files with 36 additions and 7 deletions

View file

@ -3,6 +3,14 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<bean id="xacmlInterceptor" class="com.raytheon.uf.edex.registry.acp.xacml.interceptor.XACMLInterceptor">
<constructor-arg value="pre-invoke"/>
<constructor-arg ref="XACMLPolicyAdministrator"/>
<constructor-arg ref="XACMLPolicyDecisionPoint"/>
<constructor-arg ref="registryObjectDao"/>
</bean>
<bean id="xacmlQueryInterceptor" class="com.raytheon.uf.edex.registry.acp.xacml.interceptor.XACMLInterceptor">
<constructor-arg value="post-invoke"/>
<constructor-arg ref="XACMLPolicyAdministrator"/>
<constructor-arg ref="XACMLPolicyDecisionPoint"/>
<constructor-arg ref="registryObjectDao"/>

View file

@ -133,7 +133,26 @@ public class XACMLInterceptor extends AbstractPhaseInterceptor<Message> {
*/
public XACMLInterceptor(XACMLPolicyAdministrator xacmlPolicyAdmin,
XACMLPolicyDecisionPoint pdp, RegistryObjectDao registryObjectDao) {
super(Phase.PRE_INVOKE);
this(Phase.PRE_INVOKE, xacmlPolicyAdmin, pdp, registryObjectDao);
}
/**
* Constructs a new XACMLInterceptor
*
* @param phase
* The phase in the CXF Interceptor chain that this interceptor
* gets executed
* @param xacmlPolicyAdmin
* The policy admin
* @param pdp
* The policy decision point
* @param registryObjectDao
* The registry object data access object
*/
public XACMLInterceptor(String phase,
XACMLPolicyAdministrator xacmlPolicyAdmin,
XACMLPolicyDecisionPoint pdp, RegistryObjectDao registryObjectDao) {
super(phase);
OpenSAMLUtil.initSamlEngine();
this.xacmlPolicyAdmin = xacmlPolicyAdmin;
this.pdp = pdp;
@ -283,11 +302,13 @@ public class XACMLInterceptor extends AbstractPhaseInterceptor<Message> {
} else if (request instanceof FilterObjectsRequest) {
objList = ((FilterObjectsRequest) request).getOriginalObjects();
} else if (request instanceof QueryRequest) {
QueryResponse queryResponse = (QueryResponse) ((SoapMessage) message
.getExchange().getOutMessage()).getContent(List.class)
.get(0);
refList = queryResponse.getObjectRefList();
objList = queryResponse.getRegistryObjectList();
if (message.getExchange().getOutMessage() != null) {
QueryResponse queryResponse = (QueryResponse) ((SoapMessage) message
.getExchange().getOutMessage()).getContent(
List.class).get(0);
refList = queryResponse.getObjectRefList();
objList = queryResponse.getRegistryObjectList();
}
} else if (request instanceof RemoveObjectsRequest) {
refList = ((RemoveObjectsRequest) request).getObjectRefList();
} else if (request instanceof SubmitObjectsRequest) {

View file

@ -66,7 +66,7 @@
<jaxws:inInterceptors>
<ref bean="webServiceInInterceptor" />
<ref bean="authenticationInterceptor" />
<ref bean="xacmlInterceptor" />
<ref bean="xacmlQueryInterceptor" />
</jaxws:inInterceptors>
<jaxws:serviceBean>
<ref bean="QueryServiceWrapper" />