协议网桥凭证文件格式

Managed File Transfer Agent 配置目录中的 ProtocolBridgeCredentials.xml 文件定义了协议网桥代理用于向协议服务器授权自身的用户名和凭证信息。

ProtocolBridgeCredentials.xml 文件必须符合 ProtocolBridgeCredentials.xsd 模式。 ProtocolBridgeCredentials.xsd 模式文档位于 MQMFT 安装的 MQ_INSTALLATION_PATH/mqft/samples/schema 目录中。 用户负责手动创建 ProtocolBridgeCredentials.xml 文件,该文件不再由 fteCreateBridgeAgent 命令创建。 MQMFT 安装的 MQ_INSTALLATION_PATH/mqft/samples 目录中提供了样本文件。

V7.5 引入了新的 <agent> 元素,其中包含指定代理的 <server> 或 <serverHost> 元素。

ProtocolBridgeCredentials.xml 文件由代理定期重新装入,并且对该文件所做的任何有效更改都将影响代理的行为。 缺省重新装入时间间隔为 30 秒。 此时间间隔可通过在 agent.properties 文件中指定代理程序属性 xmlConfigReloadInterval 进行更改。

模式 - V7.5 或更高版本

以下模式描述了 V8 的 ProtocolBridgeCredentials.xml 文件中有效的元素。

<schema targetNamespace="http://wmqfte.ibm.com/ProtocolBridgeCredentials" elementFormDefault="qualified" 
                xmlns="https://www.w3.org/2001/XMLSchema" xmlns:tns="http://wmqfte.ibm.com/ProtocolBridgeCredentials">

	<!--  
	    <?xml version="1.0" encoding="UTF-8"?>
        <tns:credentials xmlns:tns="http://wmqfte.ibm.com/ProtocolBridgeCredentials" 
      xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://wmqfte.ibm.com/ProtocolBridgeCredentials 
      ProtocolBridgeCredentials.xsd ">
          <tns:agent name="agent1">                                        
            <tns:serverHost name="myserver">
              <tns:user name="fred" serverPassword="pwd" serverUserId="bill"/>
              <tns:user name="jane" serverUserId="june" hostKey="1F:2e:f3">
                <tns:privateKey associationName="test" keyPassword="pwd2">
                 .... private key ...
                </tns:privateKey>
              </tns:user>
            </tns:serverHost>
          </tns:agent>
             
          <tns:agent name="agent2">                                        
            <tns:server name="server*" pattern="wildcard">
              <tns:user name="fred" serverPassword="pwd" serverUserId="bill"/>
              <tns:user name="jane" serverUserId="june" hostKey="1F:2e:f3">
                <tns:privateKey associationName="test" keyPassword="pwd2">
                 .... private key ...
                </tns:privateKey>
              </tns:user>
            </tns:server>
          </tns:agent>
          
          <tns:agent name="agent3">                                        
            <tns:serverHost name="ftpsServer" 
                            keyStorePassword="keypass" 
                            trustStorePassword="trustpass">
              <tns:user name="fred" serverPassword="pwd" serverUserId="bill"/>
            </tns:serverHost>
          </tns:agent>          
             
        </tns:credentials>
	-->
	
    <element name="credentials" type="tns:credentialsType"/>

    <complexType name="credentialsType">
    	<sequence>
    		<element name="agent" type="tns:agentType" minOccurs="0" maxOccurs="unbounded"/>
    	</sequence>	
    </complexType>	

    <complexType name="agentType">
    	<choice minOccurs="0" maxOccurs="1">
			<element name="serverHost" type="tns:serverHostType" minOccurs="0" maxOccurs="unbounded"/>
			<element name="server" type="tns:serverType" minOccurs="0" maxOccurs="unbounded"/>
		</choice>
		<attribute name="name" type="string" use="required"/>
    </complexType>

    <complexType name="serverHostType">
    	<sequence>
    		<element ref="tns:user" minOccurs="0" maxOccurs="unbounded"/>
    	</sequence>
    	<attribute name="name" type="string" use="required"/>
    	<attribute name="keyStorePassword" type="string" use="optional"/>
    	<attribute name="keyStorePasswordCipher" type="string" use="optional"/>
    	<attribute name="trustStorePassword" type="string" use="optional"/>
    	<attribute name="trustStorePasswordCipher" type="string" use="optional"/>
    </complexType>
    
    <complexType name="serverType">
    	<sequence>
    		<element ref="tns:user" minOccurs="0" maxOccurs="unbounded"/>
    	</sequence>
    	<attribute name="name" type="string" use="required"/>
    	<attribute name="pattern" type="tns:patternType" use="optional" />
    	<attribute name="keyStorePassword" type="string" use="optional"/>
    	<attribute name="keyStorePasswordCipher" type="string" use="optional"/>
    	<attribute name="trustStorePassword" type="string" use="optional"/>
    	<attribute name="trustStorePasswordCipher" type="string" use="optional"/>
    </complexType>
    
    <element name="user" type="tns:userType"/>

    <complexType name="userType">
    	<sequence>
    		<element ref="tns:privateKey" minOccurs="0" maxOccurs="unbounded"/>
    	</sequence>
    	<attribute name="name" type="string" use="required"/>
    	<attribute name="serverUserId" type="string" use="optional"/>
    	<attribute name="serverUserIdCipher" type="string" use="optional"/>
    	<attribute name="serverPassword" type="string" use="optional"/>
    	<attribute name="serverPasswordCipher" type="string" use="optional"/>
    	<attribute name="hostKey" use="optional">
    	    <simpleType>
    			<restriction base="string">
    				<pattern
    					value="([a-fA-F0-9]){2}(:([a-fA-F0-9]){2})*">
    				</pattern>
    			</restriction>
    		</simpleType>
    	</attribute>
    </complexType>

    <element name="privateKey" type="tns:privateKeyType"/>

    <complexType name="privateKeyType">    
    	<simpleContent>      
        	<extension base="string">
    			<attribute name="keyPassword" type="string" use="optional"/>
    			<attribute name="keyPasswordCipher" type="string" use="optional"/>
    			<attribute name="associationName" type="string" use="required"/>  
    		</extension>
    	</simpleContent>
    </complexType>
    
    <!--
		Determines the type of pattern matching to use.
	-->
	<simpleType name="patternType">
		<restriction base="string">
			<enumeration value="regex" />
			<enumeration value="wildcard" />
		</restriction>
	</simpleType>
</schema>

了解 ProtocolBridgeCredentials.xml 文件

下表中描述了在 ProtocolBridgeCredentials.xml 文件中使用的元素和属性。
<credentials>
组元素,其中包含描述由协议网桥代理用于连接协议服务器的凭证的元素。
<agent>
包含指定代理程序的 <server> 或 <serverHost> 定义的元素。
<server>
协议网桥连接到的协议服务器。

V7.0.4 或更早版本不支持 <server> 元素。

属性 描述
名称 协议服务器的名称。
pattern 如果您已使用通配符或正则表达式来指定协议服务器名称的模式,那么请使用 wildcardregex
trustStorePassword 或 trustStorePasswordCipher <server> 元素引用 FTPS 服务器时必需。

用于访问信任库的密码。 如果已使用 fteObfuscate 命令,那么必须使用该属性的加密版本。

keyStorePassword 或 keyStorePasswordCipher 可选。 用于访问密钥库的密码。 如果已使用 fteObfuscate 命令,那么必须使用该属性的加密版本。
<serverHost>
协议网桥连接的协议服务器的主机名称。

ProtocolBridgeCredentials.xml 文件可以包含 <serverHost>或<server>元素,但不能混合使用这两种不同类型的元素。 当您使用 <serverHost> 时,名称与协议服务器的主机名匹配。 使用 <server> 时,名称将与协议服务器名称(如 ProtocolBridgeProperties.xml 文件中所定义)相匹配。

属性 描述
名称 协议服务器的主机名或 IP 地址。
trustStorePassword 或 trustStorePasswordCipher <serverHost>指向FTPS服务器时需要。 用于访问信任库的密码。 如果已使用 fteObfuscate 命令,那么必须使用该属性的加密版本。
keyStorePassword 或 keyStorePasswordCipher 可选。 用于访问密钥库的密码。 此属性是可选的,除非您设置了 keyStore 属性,在这种情况下为必需。 如果已使用 fteObfuscate 命令,那么必须使用该属性的加密版本。
<user>
Managed File Transfer 用户名到协议服务器用户名的用户映射。
属性 描述
名称 Java 正则表达式,用于匹配与受管传输请求关联的 MQMD 用户标识。
serverUserId 或 serverUserIdCipher 在协议服务器上使用的用户名。 如果已使用 fteObfuscate 命令,那么必须使用该属性的加密版本。
serverPassword 或 serverPasswordCipher 在协议服务器上使用的用户名的密码。 如果已使用 fteObfuscate 命令,那么必须使用该属性的加密版本。
hostKey 服务器主机 SSH 指纹。
<privateKey>
用户的专用密钥。
属性 描述
keyPassword 或 keyStorePasswordCipher 专用密钥的密码。 如果已使用 fteObfuscate 命令,那么必须使用该属性的加密版本。
associationName 用于跟踪和记录的名称。