JiriOndrusek commented on code in PR #1660:
URL: https://github.com/apache/cxf/pull/1660#discussion_r1488072808
##########
rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/custom/DefaultAlgorithmSuiteLoader.java:
##########
@@ -140,9 +164,116 @@ protected void parseCustomAssertion(Assertion assertion) {
} else if ("Basic256GCM".equals(assertionName)) {
setAlgorithmSuiteType(ALGORITHM_SUITE_TYPES.get("Basic256GCM"));
getAlgorithmSuiteType().setNamespace(assertionNamespace);
+ } else if ("CustomizedAlgorithmSuite".equals(assertionName)) {
+
setAlgorithmSuiteType(ALGORITHM_SUITE_TYPES.get("CustomizedAlgorithmSuite"));
+ getAlgorithmSuiteType().setNamespace(assertionNamespace);
}
}
}
+ public static AlgorithmSuite.AlgorithmSuiteType
customize(AlgorithmSuite.AlgorithmSuiteType suiteType,
+ Message message)
{
+
+ Map<String, Object> values = message.getContextualPropertyKeys()
+ .stream()
+ .filter(k ->
k.startsWith(SecurityConstants.CUSTOM_ALG_SUITE_PREFIX))
+ .collect(Collectors.toMap(Function.identity(), k ->
message.getContextualProperty(k)));
+
+ return customize(suiteType, values);
+
+ }
+
+ public static AlgorithmSuite.AlgorithmSuiteType
customize(AlgorithmSuite.AlgorithmSuiteType suiteType,
+ Map<String,
Object> values) {
+
+ //customization happens only for CustomizedAlgorithmSuite
+ if (suiteType != null &&
!"CustomizedAlgorithmSuite".equals(suiteType.getName())) {
+ return suiteType;
+ }
+
+
+ AlgorithmSuite.AlgorithmSuiteType retVal = suiteType != null ?
suiteType
+ : new AlgorithmSuite.AlgorithmSuiteType(null, null, null, null,
+ null, null, null,
Review Comment:
fixed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]