Skip to main content
When the service runs with CYBORGDB_SERVICE_ROOT_KEY set, *EncryptedIndex can create, list, and revoke per-index users. These methods require a client created with the root key. They work on both KMS-backed indexes and indexes created with an IndexKey.
See Multi-Tenancy & RBAC for the operator-side playbook (modes, key kinds, SDK-supplied indexes).

CreateUser

Creates a user scoped to this index and returns their API key.

Parameters

Returns

*CreatedUser:
The service returns APIKey only in this response and never stores it. Give it to the user over a secure channel and don’t log it. If it’s lost, delete the user and create a new one.

Example


ListUsers

Lists the users created for this index.

Returns

A []UserInfo, each with UserID string and Permissions []string (a subset of {"read", "write"}).

Example

Deleting an index doesn’t delete its user records. If you create a new index with the same name, ListUsers on it still returns the old users. They can’t read the new index, because their keys don’t unwrap its data key; delete them with DeleteUser.

DeleteUser

Revokes a user. Their access keys for this index are erased, so their cdbk_ key stops working on the next request.

Parameters

Example


Errors

The client isn’t using the root key (HTTP 403), or its apiKey is invalid (HTTP 401).
permissions is empty or contains a value other than "read" or "write", or userID isn’t hex (HTTP 400).
The index doesn’t exist (HTTP 404).
The service returns 5xx or can’t be reached.
See Errors.