You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2020/06/17 09:31:10 UTC

[GitHub] [cxf-fediz] coheigea commented on a change in pull request #57: Add support for RSA_SHA256 signature with SAMLProtocol

coheigea commented on a change in pull request #57:
URL: https://github.com/apache/cxf-fediz/pull/57#discussion_r441412085



##########
File path: plugins/core/src/main/java/org/apache/cxf/fediz/core/config/SignAlgorithm.java
##########
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.fediz.core.config;
+
+import org.apache.cxf.fediz.core.config.jaxb.SignAlgorithmType;
+
+public enum SignAlgorithm {

Review comment:
       As per below, I think rename this to SignatureDigestAlgorithm.

##########
File path: plugins/core/src/main/java/org/apache/cxf/fediz/core/config/SAMLProtocol.java
##########
@@ -53,11 +53,23 @@ protected void setSAMLProtocol(SamlProtocolType samlProtocol) {
     }
 
     public boolean isSignRequest() {
-        return getSAMLProtocol().isSignRequest();
+        if (getSAMLProtocol().getSignRequest() != null) {
+            return getSAMLProtocol().getSignRequest().isValue();
+        } else {
+            return false;
+        }
+    }
+    
+    public SignAlgorithm getSignRequestAlgorithm() {

Review comment:
       Rename to getSignatureDigestAlgorithm

##########
File path: plugins/core/src/main/resources/schemas/FedizConfig.xsd
##########
@@ -205,6 +205,21 @@
             <xs:element ref="reply" />
         </xs:sequence>
     </xs:complexType>
+    
+     <xs:complexType name="SignRequestType">
+        <xs:simpleContent>
+            <xs:extension base="xs:boolean">
+                <xs:attribute name="algorithm" type="signAlgorithmType" />
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+    
+    <xs:simpleType name="signAlgorithmType">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="SHA1" />
+            <xs:enumeration value="SHA256" />
+        </xs:restriction>
+    </xs:simpleType>

Review comment:
       The algorithms here are actually digest algorithms. I think it would be more accurate to rename "signAlgorithmType" as "signatureDigestAlgorithmType", and change "algorithm" to "signatureDigestAlgorithm".




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org