Permissions and access control
セッション・トークンや API キーを作成する際に、特定のネームスペース、キャッシュ・キー、キャッ シュ・キー接頭辞、およびトピックに対する権限を制限することができます。これは、permissions を使用することで可能になります。トークンを作成する際に、Scope オブジェクトでパーミッションのセットを定義します。トークンを作成すると、トークンはパーミッションスコープで指定されたキャッシュキーとトピックにのみアクセスできるようになり、特定の操作(読み取り、書き込み、公開、購読など)を実行できるようになります。ユーザーがパーミッションスコープの範囲外のアクションを実行しようとすると、403 Unauthorized
というステータスコードが返されます。
Scope
APIキーとトークンは、リソースへのアクセスを制限するために、特定のパーミッション・セットにスコープすることができます。スコープオブジェクトにはキャッシュパーミッションとトピックパーミッションの両方が含まれます。
Attributes
A set of cache and/or topic permissions used to scope the token.
{
"permissions": [
{
"role": "readonly",
"cache": "data",
"item": {
"key": "foo"
}
},
{
"role": "subscribeonly",
"cache": "data",
"topic": "bar"
}
]
}
Cache permission
個々のキャッシュ・キー、キャッシュ・キーのプレフィックス、またはキャッシュ全体に対してパーミッションを作成できます。キャッシュ権限を作成するとき、ユーザはシステム定義の3つの役割のいずれかを選択します:
- readwrite - キャッシュデータへのフルアクセスを提供
- writeonly - 書き込み操作(
set
、sortedSetIncrementScore
、listPopFront
など)へのアクセスを提供する。 - readonly - 読み取り操作のみへのアクセスを提供する (
get
、dictionaryFetch
、setFetch
など)。
Attributes
The system-defined permission set for cache operations
Allowed values: readwrite, writeonly, readonlyThe namespace to scope permissions to
Configuration to limit cache operations to specific keys.
{
"role": "readonly",
"cache": "myCache",
"item": {
"keyPrefix": "id-45-",
"key": "string"
}
}
Topic permission
与えられたネームスペース内の個別またはすべてのトピックに対してパーミッションを作成できます。トピック接頭辞はサポートされていません。トピック権限を作成する際、ユーザは 3 つのシステム定義の役割から 1 つを選択します:
- publishsubscribe - トピックデータへのフルアクセスを提供
- publishonly - 書き込み操作(
publish
)のみへのアクセスを提供する。 - subscribeonly - 読み取り操作のみへのアクセスを提供する (
subscribe
)
Attributes
The system-defined permission set for topic operations
Allowed values: subscribeonly, publishonly, publishsubscribeThe namespace to scope permissions to
The name of the specific topic to scope permissions to.
{
"role": "subscribeonly",
"cache": "myCache",
"topic": "test-topic"
}