HenniOKF
Documentation

Concept

Roles and permissions

The roles, what each may do, accounts, passwords, passkeys and API keys.

What it is about

Whoever uses the application without signing in is a guest and reads. Whoever signs in has an account with exactly one role, and the role decides what the account may do. Only the admin creates accounts. There is no self-registration and no e-mail.

The application does not build signing in itself. It uses Better Auth with the plugins username, admin, @better-auth/passkey and @better-auth/api-key.

The roles

RoleIn GermanWhoWhat
guesta visitor who is not signed inreads the start page and the documentation
reviewer"Prüfer"a person who reviews contentreads; later also comments and rates
editor"Redakteur"a person who looks after the contentlike reviewer; later also sees all comments, assigns tags, creates jobs and accepts or rejects them
admin"Admin"who runs the instanceeverything; also accounts, settings and status
LLM"LLM"an agent with an API keyreads; later works on jobs over MCP. Only this role gets a key

The permissions in detail are under Permissions. Who may do what is decided in one place in the code, lib/permissions.ts. A new account gets the role reviewer unless another is chosen.

Accounts

The admin creates an account on /users with name, username, role and initial password. There he also sets the role, sets a password anew, bans, unbans and deletes accounts. A forgotten password he sets anew.

FieldRule
Nameat most 80 characters
Username3 to 30 characters: lowercase letters, digits, dot, underscore, a letter or a digit in front. No hyphen. Unique
Passwordat least 10 characters

A banned account cannot sign in. A running session and a key of that account stop working too.

The last admin stays. The last admin account that is not banned can be neither deleted nor banned nor demoted. The page then says: "The last admin account cannot be deleted, banned or demoted." So nobody locks themselves out. The admin can neither ban nor delete his own account on /users; the buttons are missing there.

Better Auth requires an e-mail address for every account. The application sets <username>@henniokf.invalid and shows it nowhere.

The own account

On /account every account sees its role, its name and its username. There you change your password, manage your passkeys and sign out. After a password change your other sessions are signed out.

Signing in

On /sign-in with username and password or with a passkey. Afterwards the page loads anew and leads back to where you wanted to go, but only to an address of the application itself.

MessageWhat it means
Username or password is wrong.one of the two is wrong; which one, the page deliberately does not say
This account is banned.the admin banned the account
Too many sign-in attempts. Please wait a minute.more attempts per minute than HENNIOKF_SIGN_IN_LIMIT allows

Passkeys

A passkey replaces the password with a fingerprint, a face or a device PIN. It works only under the main address of the instance, HENNIOKF_URL, with protocol and port. Without the variable that is http://localhost:3370. Under every other address the UI offers no passkey and names the address under which they work.

If the main address is https, the session cookie works only over encrypted connections and at localhost. If you open the page over http in the network, the sign-in page says that this does not work and points to the main address.

API keys

An agent, such as Claude Code, identifies itself with an API key. It sends it in every request as a header:

Authorization: Bearer hok_…
  1. On /users create an account with the role LLM.
  2. At that account, under "API keys", enter a label such as "Claude Code" and choose Create key.
  3. Copy the key at once. It is shown only this one time. Stored is only its hash.

Every key starts with hok_. An account with another role gets none; the application checks that on the server too. A key can be revoked at its account. A key in the header goes before a cookie.

The MCP server for agents comes with a later phase; it will accept only API keys.

Where the accounts lie

In users/users.sqlite in the root directory. Passwords and keys stand only as hashes in it. The file belongs in the backup, see Operation and backup.

Next: The first admin.