A Redis-backed key-value store for the reckless and the careful alike.
SLKVS stores values under compound keys of the form kvs_{realm}__{key}. Every operation requires a realm and a key. Optional secure marking protects keys from unauthorised writes.
Retrieves the value for a given realm and key. Returns the raw value on success, or a 404 JSON error if the key does not exist.
curl https://host/api?method=get&realm=production&key=db_url
postgres://user:pass@primary:5432/slkvs
{ "error": "Key not found" }
Stores a value. If the key has been marked secure, a matching secret must be provided; otherwise the request is rejected with 403.
curl https://host/api \
-X POST \
-H "Content-Type: application/json" \
-d '{ "method": "set", "realm": "staging", "key": "api_key", "value": "sk-abc123" }'
{ "success": true }
Deletes a key and its associated security metadata. Like set, this requires the secret if the key is marked secure.
curl https://host/api \
-X POST \
-H "Content-Type: application/json" \
-d '{ "method": "remove", "realm": "staging", "key": "api_key" }'
{ "success": true }
Marks a key or list as secure. Once marked, every set / remove (or listset / listremove) call must include the correct secret. The secret is hashed with bcrypt before storage — SLKVS never stores plaintext secrets. Getting a value or listing members never requires a secret.
curl https://host/api \
-X POST \
-H "Content-Type: application/json" \
-d '{ "method": "setsecure", "realm": "production", "key": "db_url", "secret": "hunter2" }'
curl https://host/api \
-X POST \
-H "Content-Type: application/json" \
-d '{ "method": "setsecure", "list": "club1|OWNER_UUID", "secret": "hunter2" }'
{ "success": true }
Adds or updates a member in a named list. The list parameter identifies the group, key is the member identifier (OBJECT_UUID), and value is its URL. If the list has been secured with setsecure, a matching secret is required. Lists are stored as Redis hashes — created on first use, no setup required.
curl https://host/api \
-X POST \
-H "Content-Type: application/json" \
-d '{ "method": "listset", "list": "club1|OWNER_UUID", "key": "OBJECT_UUID", "value": "https://example.com/webhook" }'
{ "success": true, "member": "OBJECT_UUID" }
Removes a member from a list. Idempotent — succeeds even if the member does not exist. If the list is secured, the secret must be provided.
curl https://host/api \
-X POST \
-H "Content-Type: application/json" \
-d '{ "method": "listremove", "list": "club1|OWNER_UUID", "key": "OBJECT_UUID" }'
{ "success": true, "member": "OBJECT_UUID" }
Returns all members of a list as a JSON object mapping OBJECT_UUID to URL. Returns {} for an empty or non-existent list.
curl https://host/api?method=listget&list=club1|OWNER_UUID
{ "OBJECT_UUID": "https://example.com/webhook" }
| Name | Required | Description |
|---|---|---|
method | always | One of get, set, remove, setsecure, listset, listremove, listget |
realm | singles | Namespace / partition for scalar keys |
key | singles / listset & listremove | Scalar key name, or member identifier inside a list |
list | lists | List name (e.g. scope|owner_uuid) |
value | set / listset | Value to store (string / URL) |
secret | setsecure / secure ops | Secret for marking or accessing a secure key or list |
setsecure with a new secret rotates the secret.kvs_{realm}__{key}; for lists it is kvs_list:{name} (a Redis hash).listset — no schema or setup needed.