Users
A user is a name with a token. It is one JSON file in a domain's datahoster-users folder, and the file name is the username. Wherever an endpoint permission lists users, a request proves it is one of them by presenting that user's token.
<datahoster-config-contentRoot>/
api.example.com/
datahoster-users/
you.json the "you" user
team.json the "team" user
Contents
Inside a domain's datahoster-users folder, every user is one JSON file, named for the user. This page describes that file.
| Name | Type | Description |
|---|---|---|
you.json | file | A user: one token, held under a fixed key. The username is the file name. |
team.json | file | Another user, the same shape as you.json. |
you.json
One JSON object holding the user's token. The username is the file name, not a key: 1 to 32 characters and URL-safe, since it is stored in every record's by field. A name outside that range fails the sync with a clear error. A name may not start with datahoster either: that prefix is reserved for the engine's own built-in users, such as datahoster-import, which writes imported records.
{
"datahoster-user-token": "k7Qw2f9xJ4mB6pR8tZ1nD3sV5hL0aYc"
}
you user, whose token authenticates every request made as them.| Name | Type | Description |
|---|---|---|
datahoster-user-token | text | The user's secret token, at least 16 characters. A request presents it to act as this user. Required. |
The token is a shared secret: anything that presents it acts as this user. Generate a long random string and keep it out of client-side code. It travels in the request as a bearer token; see Endpoints.