NuraMesh records who did what. A person signs in and acts under their own id. A program uses an API token and is recorded as that token. A token is never recorded as a person, and nothing in a request body or header can name the actor.
Prerequisites
Section titled “Prerequisites”- NuraMesh installed with the
localextra, which carries the API server (Install). - A team folder, for example the
my-teamfolder of the Quickstart. - A terminal on the machine that runs the server. The first owner is set up from there.
-
Start the server from a terminal on your own machine. Sign-in is on unless you turn it off.
Terminal window nuramesh serve my-team -
Open the one-time setup link the server prints, choose an email and a password, then sign in. That account is the first owner. Sign-in says what to do when no link is printed.
-
As the owner, invite the other people by email as
approverorviewer. Roles lists what each may do. -
For a program, make an API token instead of an account. It is shown once.
Terminal window nuramesh auth tokens create --name ci-nightly --scope read --days 7 --team my-team
Why the server stays on loopback until sign-in is on
Section titled “Why the server stays on loopback until sign-in is on”nuramesh serve starts with sign-in on. Only if you type --auth off does it answer loopback addresses only
(127.0.0.1, ::1, localhost), with open reads and every write (stop a run, decide an approval, lift a budget
block) refused with authentication_required, because nothing could say who is acting; it prints a banner in
capitals saying so. A network address is accepted only with sign-in on, --trusted-proxy and at least one
--allowed-host, behind a proxy that ends TLS. Without those, the server exits and says why.
Sign-in
Section titled “Sign-in”- The first owner. Started from a terminal on your own machine with no owner yet,
nuramesh serveprints one setup link (.../setup#token=..., valid 15 minutes, works once). Open it, choose an email and a password, then sign in. Anywhere else (a container, behind a proxy, no terminal) it prints no link: runnuramesh auth new-setup-token --team <team>in a terminal, which shows a one-time token once (valid 24 hours), and paste it on the app’s setup page (or usePOST /v1/auth/setup/redeem). If the link has expired, restartserveor make a new token. - More people. An owner invites people by email as
approverorviewer. An owner is never made through the API. - Sessions. The browser gets cookies that are
HttpOnlyandSameSite=Strict; every change made with a cookie sends a CSRF token. A refresh token used twice ends the whole session. - Failures are limited. Repeated failed sign-ins lock the account for a while, and the answer to a bad email or a bad password is the same.
A person has one role. The role decides which permissions they have when they act in a signed-in session.
| Role | Permissions | What that means |
|---|---|---|
viewer |
read |
look at runs, the ledger and reports |
approver |
read, run, decide, reveal |
also stop a run, answer approvals and lift budget blocks, and read the text behind a hash |
builder |
read, run, build |
also change the team: the graph, roles and policies |
admin |
everything except govern |
also manage people and API tokens |
owner |
everything | also the controls only an owner has |
Today a person can be made an owner (the first one, from a setup token), an approver or a viewer. The builder
and admin roles exist in the permission table, but nobody can be given them yet: assigning them is refused with
invalid_request, and role_not_assignable answers a request to make an owner.
API tokens
Section titled “API tokens”A token is for a program, such as a CI job that reads reports or stops a run.
- Scopes.
readandrun. There is no scope for approving: no token can decide an approval, lift a budget block, read a person’s reason, change the team or manage people. Those routes answerhuman_requiredto a token. - A token never has more than its issuer. On every request a token’s rights are its scopes limited to what its
issuer may do now. Demote the issuer and the token loses
runat once; erase the issuer and the token fails withtoken_invalid. - Shown once. A token starts with
nmt_, is shown once when it is made and is stored only as a hash. Send it in theAuthorization: Bearerheader, never in a URL. - Lifetime. 90 days by default through the API, 1 to 365 days. The command line makes short ones:
nuramesh auth tokens create --name ci-nightly --scope read --days 7 --team <team>(default 7, at most 30). - Names. A name is a label for the program, not a person. It is unique for ever, so a revoked token keeps its name
(
token_name_taken). - Revoke.
nuramesh auth tokens revoke <id or name> --team <team>or the app. It takes effect on the next request.
Actions only a person can take
Section titled “Actions only a person can take”These need a signed-in person with the right role and are refused (human_required) for an API token:
- answer an approval or a human gate, and lift a budget block
- read the text behind a content hash
- change the team, manage people and tokens, and the organization controls
- resume the organization after a halt (see Kill switch)
- issue or rotate an agent credential (see Agent credentials)
The command line can look and restrict (stop a run, revoke a token or a credential, halt the organization) but it
cannot approve or widen anything. A typed --human there is a claim, not a sign-in.
Where the details are
Section titled “Where the details are”The route-by-route rules, the cookie settings and the errors are in the API reference and Errors.
Check it worked
Section titled “Check it worked”List the tokens. The one you made is there by name, and no secret is printed.
nuramesh auth tokens list --team my-teamThen sign in to the app as an invited viewer: the runs and reports are readable, and stopping a run is refused.
Troubleshooting
Section titled “Troubleshooting”| You see | Do this |
|---|---|
| No setup link is printed | The server is not on a terminal of your own machine (a container, a proxy). Run nuramesh auth new-setup-token --team my-team and paste the token on the setup page |
| The setup link has expired | It is valid for 15 minutes and works once. Restart serve, or make a new token as above |
authentication_required on a write |
The server runs with --auth off. It then refuses every write. Start it with sign-in on |
human_required |
An API token tried something only a person may do, such as answering an approval. Sign in as a person with the right role |
token_name_taken |
A token name is unique for ever, also after it is revoked. Choose another name |
| The server exits on a network address | A network address needs sign-in on, --trusted-proxy and at least one --allowed-host, behind a proxy that ends TLS |
Next steps
Section titled “Next steps”- Turn on two-step sign-in for your own account.
- Give an agent credentials: the identity of an agent, which is not a person and not a token.
- Require a human approval: what an
approveris asked to decide. - Errors: every code named on this page.
Was this page helpful?