浏览代码

HPCC-20114 Don't allow service binding to https with no certificate

Add requiredIf to HTTPS relevant attributes marking them required if
https is the selected binding protocol for an ESP service.
Mark HTTPS deprecated certificate attributes.
Fix omitted merge changes.

Signed-off-by: Ken Rowland <kenneth.rowland@lexisnexisrisk.com>
Ken Rowland 6 年之前
父节点
当前提交
143998aa51

+ 0 - 1
configuration/config2/XSDValueSetParser.hpp

@@ -36,7 +36,6 @@ class XSDValueSetParser : public XSDSchemaParser
             XSDSchemaParser(pValueSet)  { }
         virtual ~XSDValueSetParser() { }
         virtual void parseXSD(const pt::ptree &valueSetTree);
-        void parseAttributeGroup(const pt::ptree &attributeTree);
         void setGroupByName(const std::string &name) { m_groupByName = name; }
 
 

+ 15 - 2
initfiles/componentfiles/configschema/xsd/esp.xsd

@@ -142,12 +142,25 @@
                         <xs:element name="HTTPS" minOccurs="0" hpcc:class="valueSet" hpcc:requiredIf="">
                             <xs:complexType>
                                 <xs:attribute name="acceptSelfSigned" type="xs:boolean" use="optional" default="true" hpcc:displayName="Accept Self Signed" hpcc:tooltip="whether to accept self-signed certificates"/>
-                                <xs:attribute name="CA_Certificates_Path" type="xs:string" use="optional" default="ca.pem" hpcc:displayName="Certificates Path" hpcc:tooltip="path to the file that contains CA certificates"/>
+                                <xs:attribute name="CA_Certificates_Path" type="xs:string" use="optional" default="ca.pem" hpcc:displayName="Certificates Path" hpcc:requiredIf="../EspBinding[@protocol='https']"
+                                              hpcc:tooltip="path to the file that contains CA certificates"/>
                                 <xs:attribute name="certificateFileName" type="xs:string" use="optional" default="certificate.cer" hpcc:displayName="Certificate Filename" hpcc:tooltip="Name of destination file in which the certificate will be written"/>
                                 <xs:attribute name="cipherList" type="xs:string" use="optional" default="ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5"
                                               hpcc:displayName="Cipher List" hpcc:tooltip="Sets the ordered list of available ciphers for use by openssl.  See openssl documentation on ciphers for information on use and formatting."/>
                                 <xs:attribute name="passphrase" type="xs:string" use="optional" hpcc:modifiers="mask,verify,ignoreNoChange,encrypt" hpcc:displayName="Passphrase" hpcc:tooltip="The passphrase used to generate the private key" />
-                                <xs:attribute name="privateKeyFileName" type="xs:string" use="optional" default="privatekey.cer" hpcc:displayName="Private Key Filename" hpcc:tooltip="Name of destination file in which the private key will be written" />
+                                <xs:attribute name="privateKeyFileName" type="xs:string" use="optional" default="privatekey.cer" hpcc:displayName="Private Key Filename" hpcc:requiredIf="../EspBinding[@protocol='https']"
+                                              hpcc:tooltip="Name of destination file in which the private key will be written" />
+                                <!-- The following are deprecated and marked hidden so that they don't appear to the user -->
+                                <xs:attribute name="city" hpcc:deprecated="true" hpcc:hidden="true" type="xs:string" use="optional"/>
+                                <xs:attribute name="country" hpcc:deprecated="true" hpcc:hidden="true" type="xs:string" use="optional"/>
+                                <xs:attribute name="daysValid" hpcc:deprecated="true" hpcc:hidden="true" type="xs:string" use="optional"/>
+                                <xs:attribute name="enableVerification" hpcc:deprecated="true" hpcc:hidden="true" type="xs:boolean" use="optional"/>
+                                <xs:attribute name="organization" hpcc:deprecated="true" hpcc:hidden="true" type="xs:string" use="optional"/>
+                                <xs:attribute name="organizationalUnit" hpcc:deprecated="true" hpcc:hidden="true" type="xs:string" use="optional"/>
+                                <xs:attribute name="regenerateCredentials" hpcc:deprecated="true" hpcc:hidden="true" type="xs:boolean" use="optional"/>
+                                <xs:attribute name="requireAddressMatch" hpcc:deprecated="true" hpcc:hidden="true" type="xs:boolean" use="optional"/>
+                                <xs:attribute name="state" hpcc:deprecated="true" hpcc:hidden="true" type="xs:string" use="optional"/>
+                                <xs:attribute name="trustedPeers" hpcc:deprecated="true" hpcc:hidden="true" type="xs:string" use="optional"/>
                             </xs:complexType>
                         </xs:element>
 

+ 1 - 1
initfiles/componentfiles/configschema/xsd/hardware.xsd

@@ -10,7 +10,7 @@
                     <xs:sequence>
                         <xs:element name="ComputerType" maxOccurs="unbounded" hpcc:displayName="Defined computer types" hpcc:class="elementSet">
                             <xs:complexType>
-                                <xs:attribute name="name" type="xs:string" use="required"/>
+                                <xs:attribute name="name" type="xs:string" use="required" hpcc:uniqueKey="computertype_name"/>
                                 <xs:attribute name="nicSpeed" type="xs:nonNegativeInteger"/>
                                 <xs:attribute name="manufacturer" type="xs:string"/>
                                 <xs:attribute name="memory" type="xs:nonNegativeInteger"/>