Browse Source

Merge pull request #3886 from garonsky/issue-8630_htpasswd_config_40

HPCC-8630 Configmr -  Add htpasswd Option to ESP Authentication

Reviewed-By: Russ Whitehead <william.whitehead@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 years ago
parent
commit
dfe699c34c

+ 5 - 0
initfiles/componentfiles/configxml/@temp/esp_service.xsl

@@ -236,6 +236,11 @@ xmlns:seisint="http://seisint.com"  xmlns:set="http://exslt.org/sets" exclude-re
                     </xsl:for-each>
                 </Authenticate>
             </xsl:when>
+            <xsl:when test="$authMethod='htpasswd'">
+              <Authenticate method="htpasswd">
+                <xsl:attribute name="htpasswdFile"> <xsl:value-of select="$bindingNode/../Authentication/@htpasswdFile"/> </xsl:attribute>
+              </Authenticate>
+            </xsl:when>
         </xsl:choose>
     </xsl:template>
 

+ 5 - 0
initfiles/componentfiles/configxml/@temp/esp_service_WsSMC.xsl

@@ -658,6 +658,11 @@ This is required by its binding with ESP service '<xsl:value-of select="$espServ
             </xsl:if>         
          </Authenticate>
       </xsl:when>
+      <xsl:when test="$authMethod='htpasswd'">
+        <Authenticate method="htpasswd">
+          <xsl:attribute name="htpasswdFile"> <xsl:value-of select="$bindingNode/../Authentication/@htpasswdFile"/> </xsl:attribute>
+        </Authenticate>
+      </xsl:when>
         </xsl:choose>
     </xsl:template>
 

+ 6 - 2
initfiles/componentfiles/configxml/@temp/esp_service_ecldirect.xsl

@@ -102,7 +102,7 @@
          <xsl:when test="$authMethod='ldap' or $authMethod='ldaps'">
             <Authenticate method="LdapSecurity" config="ldapserver">
             <xsl:copy-of select="$bindingNode/@resourcesBasedn"/> <!--if binding has an ldap resourcebasedn specified then copy it out -->
-            
+
             <xsl:for-each select="$bindingNode/Authenticate">
                <Location path="{@path}" resource="{@resource}" access="{@access}"/>
             </xsl:for-each>
@@ -110,9 +110,13 @@
             <xsl:for-each select="$bindingNode/AuthenticateFeature[@authenticate='Yes']">
                <Feature name="{@name}" path="{@path}" resource="{@resource}" required="{@access}" description="{@description}"/>
             </xsl:for-each>
-            
             </Authenticate>
          </xsl:when>
+        <xsl:when test="$authMethod='htpasswd'">
+          <Authenticate method="htpasswd">
+            <xsl:attribute name="htpasswdFile"> <xsl:value-of select="$bindingNode/../Authentication/@htpasswdFile"/> </xsl:attribute>
+          </Authenticate>
+        </xsl:when>
       </xsl:choose>
     </xsl:template>
 

+ 5 - 0
initfiles/componentfiles/configxml/@temp/esp_service_wsecl.xsl

@@ -214,6 +214,11 @@
                </xsl:for-each>                              
             </Authenticate>
          </xsl:when>
+         <xsl:when test="$authMethod='htpasswd'">
+           <Authenticate method="htpasswd">
+             <xsl:attribute name="htpasswdFile"> <xsl:value-of select="$bindingNode/../Authentication/@htpasswdFile"/> </xsl:attribute>
+           </Authenticate>
+         </xsl:when>
       </xsl:choose>
    </xsl:template>
    

+ 8 - 0
initfiles/componentfiles/configxml/esp.xsd.in

@@ -240,9 +240,17 @@
                                     <xs:enumeration value="ldap"/>
                                     <xs:enumeration value="ldaps"/>
                                     <xs:enumeration value="remotens"/>
+                                    <xs:enumeration value="htpasswd"/>
                                 </xs:restriction>
                             </xs:simpleType>
                         </xs:attribute>
+                        <xs:attribute name="htpasswdFile" type="xs:string" use="optional" default="/etc/HPCCSystems/.htpasswd">
+                            <xs:annotation>
+                                <xs:appinfo>
+                                    <tooltip>The location of the file to use for htpasswd authentication.</tooltip>
+                                </xs:appinfo>
+                            </xs:annotation>
+                        </xs:attribute>
                         <xs:attribute name="ldapServer" type="ldapServerType" use="optional">
                             <xs:annotation>
                                 <xs:appinfo>

+ 14 - 1
initfiles/componentfiles/configxml/esp.xsl

@@ -104,8 +104,13 @@
                         <xsl:with-param name="accurintSecurity" select="@AccurintSecurity"/>
                         <xsl:with-param name="localDomain" select="/Environment/Hardware/Computer[@name=$computerName]/@domain"/>
                     </xsl:call-template>
+                 </xsl:if>
+                 <xsl:if test="@method='htpasswd'">
+                    <xsl:call-template name="dohtpasswdSecurity">
+                        <xsl:with-param name="method" select="@method"/>
+                        <xsl:with-param name="htpasswdFile" select="@htpasswdFile"/>
+                    </xsl:call-template>
                 </xsl:if>
-
             </xsl:for-each>
             
             <xsl:variable name="maxRequestEntityLength">
@@ -368,6 +373,14 @@
         </xsl:for-each>
     </xsl:template>
     
+    <xsl:template name="dohtpasswdSecurity">
+        <xsl:param name="method"/>
+        <xsl:param name="htpasswdFile"/>
+        <xsl:element name="htpasswdSecurity">
+            <xsl:attribute name="method"> <xsl:value-of select="$method"/> </xsl:attribute>
+            <xsl:attribute name="htpasswdFile"> <xsl:value-of select="$htpasswdFile"/> </xsl:attribute>
+        </xsl:element>
+    </xsl:template>
     
     <xsl:template name="doAccurintSecurity">
         <xsl:param name="method"/>

+ 2 - 1
initfiles/etc/DIR_NAME/environment.xml.in

@@ -423,7 +423,8 @@
               name="myesp"
               perfReportDelay="60"
               portalurl="${PORTALURL}">
-   <Authentication ldapAuthMethod="kerberos"
+   <Authentication htpasswd="/etc/HPCCSystems/.htpasswd"
+                   ldapAuthMethod="kerberos"
                    ldapConnections="10"
                    ldapServer=""
                    method="none"/>