Skip to content
Permalink
Browse files
RAMPART-174 Rampart should only return true for WS-Security Policy an…
…d Rampart config assertions
  • Loading branch information
Nandana Mihindukulasooriya committed Dec 22, 2010
1 parent 4adac3a commit 3774a373733e92e5188e8451c88e0540530561ff
Showing 1 changed file with 16 additions and 3 deletions.
@@ -23,6 +23,9 @@
import org.apache.axis2.modules.Module;
import org.apache.neethi.Assertion;
import org.apache.neethi.Policy;
import org.apache.rampart.policy.model.RampartConfig;
import org.apache.ws.secpolicy.SP11Constants;
import org.apache.ws.secpolicy.SP12Constants;

public class Rampart implements Module /* , ModulePolicyExtension */ {

@@ -48,8 +51,18 @@ public void applyPolicy(Policy policy, AxisDescription axisDescription) throws A
}

public boolean canSupportAssertion(Assertion assertion) {
//TODO doesn't we need to check whether policy is security policy or
// RampartConfig assertion
return true;
if(assertion == null) {
return false;
}

String ns = assertion.getName().getNamespaceURI();

// Rampart module can handle WS-SecurityPolicy 1.1 & 1.2 and RampartConfig assertions
if (SP11Constants.SP_NS.equals(ns) || SP12Constants.SP_NS.equals(ns) || RampartConfig.NS.equals(ns)) {
return true;
} else {
return false;
}

}
}

0 comments on commit 3774a37

Please sign in to comment.