7.2.2. 将安全性属性迁移到 Elytron
本节的示例假定 group.name 和 安全属性在传统 encoding. algorithm安全子系统中定义为 所示:
安全 属性,如下方
示例:安全子系统中定义的 安全 属性
<subsystem xmlns="urn:jboss:domain:security:2.0">
...
<security-properties>
<property name="group.name" value="engineering-group" />
<property name="encoding.algorithm" value="BASE64" />
</security-properties>
</subsystem>
若要在 elytron 子系统中定义相同的安全属性,可使用以下命令设置 elytron 子系统的 security-properties 属性:
/subsystem=elytron:write-attribute(name=security-properties, value={ group.name = "engineering-group", encoding.algorithm = "BASE64" })
这会在服务器配置文件中的 :
elytron 子系统中配置以下安全漏洞
<subsystem xmlns="urn:wildfly:elytron:4.0" final-providers="combined-providers" disallowed-providers="OracleUcrypto">
<security-properties>
<security-property name="group.name" value="engineering-group"/>
<security-property name="encoding.algorithm" value="BASE64"/>
</security-properties>
...
</subsystem>
上一命令中使用的 write-attribute 操作将覆盖现有的属性。若要在不影响其他安全属性的情况下添加或更改安全属性,请在管理 CLI 命令中使用 map 操作:
/subsystem=elytron:map-put(name=security-properties, key=group.name, value=technical-support)
类似地,您可以使用 map-remove 操作移除特定的安全属性。
/subsystem=elytron:map-remove(name=security-properties, key=group.name)