2.3. プロパティーレルム
プロパティーレルムはプロパティーファイルを使用して、ユーザーおよびグループを定義します。
-
users.propertiesには Data Grid ユーザーの認証情報が含まれます。パスワードは、DIGEST-MD5およびDIGEST認証メカニズムを使用して事前署名できます。 -
groups.propertiesは、ユーザーをロールおよびパーミッションに関連付けます。
注記
Data Grid CLI を使用して、ファイルに正しいセキュリティーレルム名を入力することで、プロパティーファイルに関連する認証の問題を回避することができます。infinispan.xml ファイルを開き、<security-realm name> プロパティーに移動すると、Data Grid Server の正しいセキュリティーレルム名を見つけることができます。Data Grid Server から別の Data Grid Server へプロパティーファイルをコピーする場合、セキュリティーレルム名がターゲットエンドポイントの正しい認証メカニズムに対応していることを確認してください。
users.properties
myuser=a_password
user2=another_password
groups.properties
myuser=supervisor,reader,writer
user2=supervisor
プロパティーレルム設定
XML
<server xmlns="urn:infinispan:server:14.0">
<security>
<security-realms>
<security-realm name="default">
<!-- groups-attribute configures the "groups.properties" file to contain security authorization roles. -->
<properties-realm groups-attribute="Roles">
<user-properties path="users.properties"
relative-to="infinispan.server.config.path"
plain-text="true"/>
<group-properties path="groups.properties"
relative-to="infinispan.server.config.path"/>
</properties-realm>
</security-realm>
</security-realms>
</security>
</server>
JSON
{
"server": {
"security": {
"security-realms": [{
"name": "default",
"properties-realm": {
"groups-attribute": "Roles",
"user-properties": {
"digest-realm-name": "default",
"path": "users.properties",
"relative-to": "infinispan.server.config.path",
"plain-text": true
},
"group-properties": {
"path": "groups.properties",
"relative-to": "infinispan.server.config.path"
}
}
}]
}
}
}
YAML
server:
security:
securityRealms:
- name: "default"
propertiesRealm:
# groupsAttribute configures the "groups.properties" file
# to contain security authorization roles.
groupsAttribute: "Roles"
userProperties:
digestRealmName: "default"
path: "users.properties"
relative-to: 'infinispan.server.config.path'
plainText: "true"
groupProperties:
path: "groups.properties"
relative-to: 'infinispan.server.config.path'