ソースを参照

HPCC-15181 EspBindings should include feature security

        - SecurityManagersPlugin bindings should include feature
          flags

Signed-off-by: Gleb Aronsky <gleb.aronsky@lexisnexis.com>
Gleb Aronsky 9 年 前
コミット
665e5a8322

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

@@ -197,6 +197,24 @@ xmlns:seisint="http://seisint.com"  xmlns:set="http://exslt.org/sets" exclude-re
                     </xsl:for-each>
                 </Authenticate>
             </xsl:when>
+            <xsl:when test="$authMethod='secmgrPlugin'">
+                <Authenticate>
+                    <xsl:attribute name="method">
+                      <xsl:value-of select="$bindingNode/@type"/>
+                    </xsl:attribute>
+                    <xsl:copy-of select="$bindingNode/@resourcesBasedn"/>
+                    <xsl:copy-of select="$bindingNode/@workunitsBasedn"/>
+                    <xsl:copy-of select="$bindingNode/@serverType"/>
+                    <xsl:for-each select="$bindingNode/Authenticate[@path='/']">
+                        <Location path="/" resource="{@resource}" required="{@access}" description="{@description}"/>
+                    </xsl:for-each>
+                    <xsl:for-each select="$bindingNode/AuthenticateFeature[@authenticate='Yes']">
+                        <xsl:if test="@service=$service">
+                            <Feature name="{@name}" path="{@path}" resource="{@resource}" required="{@access}" description="{@description}"/>
+                        </xsl:if>
+                    </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>

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

@@ -677,6 +677,35 @@ This is required by its binding with ESP service '<xsl:value-of select="$espServ
             </xsl:if>         
          </Authenticate>
       </xsl:when>
+      <xsl:when test="$authMethod='secmgrPlugin'">
+         <Authenticate>
+            <xsl:attribute name="method">
+               <xsl:value-of select="$bindingNode/@type"/>
+            </xsl:attribute>
+            <xsl:copy-of select="$bindingNode/@resourcesBasedn"/>
+            <xsl:copy-of select="$bindingNode/@workunitsBasedn"/>
+
+            <xsl:for-each select="$bindingNode/Authenticate[@path='/']">
+              <Location path="/" resource="{@resource}" required="{@access}" description="{@description}"/>
+            </xsl:for-each>
+
+            <xsl:for-each select="$bindingNode/AuthenticateFeature[@authenticate='Yes']">
+               <xsl:if test="$service='ws_smc' or @service=$service">
+                  <Feature name="{@name}" path="{@path}" resource="{@resource}" required="{@access}" description="{@description}"/>
+               </xsl:if>
+            </xsl:for-each>
+
+            <xsl:if test="$service = 'ws_topology'">
+               <xsl:for-each select="$bindingNode/AuthenticateFeature[@authenticate='Yes']">
+                  <xsl:if test="starts-with(@path, 'MachineInfoAccess')">
+                     <Feature path="{@path}" resource="{@resource}" required="{@access}" description="{@description}">
+                        <xsl:copy-of select="*"/>
+                     </Feature>
+                  </xsl:if>
+               </xsl:for-each>
+            </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>

+ 16 - 0
initfiles/componentfiles/configxml/@temp/esp_service_ecldirect.xsl

@@ -112,6 +112,22 @@
             </xsl:for-each>
             </Authenticate>
          </xsl:when>
+         <xsl:when test="$authMethod='secmgrPlugin'">
+            <Authenticate>
+            <xsl:attribute name="method">
+               <xsl:value-of select="$bindingNode/@type"/>
+            </xsl:attribute>
+            <xsl:copy-of select="$bindingNode/@resourcesBasedn"/>
+
+            <xsl:for-each select="$bindingNode/Authenticate">
+               <Location path="{@path}" resource="{@resource}" access="{@access}"/>
+            </xsl:for-each>
+
+            <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>

+ 18 - 1
initfiles/componentfiles/configxml/@temp/esp_service_wsecl.xsl

@@ -204,7 +204,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[string(@path) != '']">
                   <Location path="{@path}" resource="{@resource}" access="{@access}" description="{@description}"/>
                </xsl:for-each>
@@ -214,6 +214,23 @@
                </xsl:for-each>                              
             </Authenticate>
          </xsl:when>
+         <xsl:when test="$authMethod='secmgrPlugin'">
+            <Authenticate>
+               <xsl:attribute name="method">
+                 <xsl:value-of select="$bindingNode/@type"/>
+               </xsl:attribute>
+               <xsl:copy-of select="$bindingNode/@resourcesBasedn"/>
+               <xsl:for-each select="$bindingNode/Authenticate[string(@path) != '']">
+
+                  <Location path="{@path}" resource="{@resource}" access="{@access}" description="{@description}"/>
+               </xsl:for-each>
+
+               <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>

+ 16 - 0
initfiles/componentfiles/configxml/@temp/esp_service_wslogging.xsl

@@ -140,6 +140,22 @@ xmlns:seisint="http://seisint.com"  xmlns:set="http://exslt.org/sets" exclude-re
             </xsl:for-each>
             </Authenticate>
          </xsl:when>
+         <xsl:when test="$authMethod='secmgrPlugin'">
+            <Authenticate>
+            <xsl:attribute name="method">
+              <xsl:value-of select="$bindingNode/@type"/>
+            </xsl:attribute>
+            <xsl:copy-of select="$bindingNode/@resourcesBasedn"/>
+
+            <xsl:for-each select="$bindingNode/Authenticate">
+               <Location path="{@path}" resource="{@resource}" access="{@access}"/>
+            </xsl:for-each>
+
+            <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>

+ 0 - 26
initfiles/componentfiles/configxml/esp.xsl

@@ -102,12 +102,6 @@
                 </xsl:if>
             </xsl:for-each>
 
-             <xsl:if test="@type='secmgrPlugin'">
-                <xsl:call-template name="dosecmgrPlugin">
-                    <xsl:with-param name="method" select="@method"/>
-                </xsl:call-template>
-            </xsl:if>
-
             <xsl:if test="./Authentication/@method='secmgrPlugin'">
             <SecurityManagers>
                 <xsl:for-each select="./EspBinding[@type != '']">
@@ -406,14 +400,6 @@
         </xsl:element>
     </xsl:template>
 
-    <xsl:template name="dosecmgrPlugin">
-        <xsl:param name="method"/>
-        <xsl:copy-of select="/Environment/Software/*[@name=$instanceName and @type='SecurityManager']"/>
-        <xsl:element name="Authenticate">
-            <xsl:attribute name="method"> <xsl:value-of select="$method"/> </xsl:attribute>
-        </xsl:element>
-    </xsl:template>
-    
     <xsl:template name="doAccurintSecurity">
         <xsl:param name="method"/>
         <xsl:param name="accurintSecurity"/>
@@ -533,18 +519,6 @@
                   </xsl:choose>
                </xsl:variable>
 
-               <xsl:if test="$espProcess/Authentication/@method = 'secmgrPlugin'">
-                    <xsl:for-each select="$espProcess/EspBinding[@name = $origBindName]/Authenticate">
-                        <xsl:copy>
-                            <xsl:apply-templates select="@*" />
-                                <xsl:attribute name="method">
-                                    <xsl:value-of select="$envBindNode/@type"/>
-                                </xsl:attribute>
-                            <xsl:apply-templates select="node()"/>
-                        </xsl:copy>
-                    </xsl:for-each>
-               </xsl:if>
-
                <xsl:for-each select="$bindNode/Authenticate">
                   <xsl:copy>
                      <xsl:apply-templates select="@*[string(.) != '']" mode="processImportedServiceDefinitions"/>