Credential commands

Credential commands

The nova commands that exchange an API key for a token, manage API keys, mint tokens offline, and manage signing keys.

A cluster that checks tokens accepts two kinds of credential. An API key lives in the cluster's registry and can be revoked. A token is a short-lived JWT, and every request carries one. A developer usually holds an API key: with NOVA_API_KEY set, every nova command trades it for tokens on its own, and nova token exchange prints one for another program. An operator creates and revokes the keys.

CommandDoesNeeds
nova token exchangeTrades the API key for a short-lived tokenAn API key
nova credential createCreates an API keynova:admin
nova credential listPages through the API keysnova:admin
nova credential updateRenames a key or replaces its grantsnova:admin
nova credential revokeStops a key from getting new tokensnova:admin
nova credential generateCreates the root API key before the cluster startsNothing; offline
nova token mintSigns a token with the cluster's signing keyThe signing key; offline
nova auth keyCreates, rotates, and exports signing keysA node directory; offline

The examples ran on a cluster started with novad --auth jwt and a root API key in NOVA_API_KEY. The registry commands need a host:port address. Authentication explains keys, tokens, and grants, and Turn on token authentication sets up a cluster.

export NOVA_ADDR=localhost:7781

nova token exchange

Trades the API key in NOVA_API_KEY for a token narrowed to what you ask for, and prints the token alone on one line.

nova token exchange [options]

Get a token for one bucket

nova token exchange --bucket demo --ttl 10m
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ…

The token holds the key's grants on the bucket demo and nothing else.

Hand the token to another program

Give a job or a browser the token, never the key. Here the token runs nova itself. Unset the key first, because setting both is a usage error:

export NOVA_TOKEN=$(nova token exchange --bucket demo)
unset NOVA_API_KEY
printf 'order-1\n' | nova append nova://demo/orders
nova ls
appended 1 entries
nova: rpc error: code = PermissionDenied desc = dataplane: no grant covers list on buckets named ""*

A bucket token cannot list buckets, because that listing reaches past its bucket.

Narrow the token to one stream or to exact grants

nova token exchange --bucket demo --key orders
nova token exchange --scope 'nova:read:demo:*'

Name exactly one of --bucket and --scope. Naming neither, or asking for more than the key holds, fails with exit code 1:

nova: token exchange: rpc error: code = InvalidArgument desc = exchange: the ask names exactly one of bucket or scope
nova: token exchange: rpc error: code = PermissionDenied desc = exchange: the ask exceeds the credential's grants

A token lives 15 minutes unless --ttl says otherwise, and at most one hour. The cluster shortens a longer ask to one hour. Revoking the key stops new exchanges, but a token already printed keeps working until it expires. Without NOVA_API_KEY, the command fails with nova: token exchange: NOVA_API_KEY is required.

--bucketDefaultNone
Ask for the key's grants on this bucket
--keyDefaultNone
With --bucket, ask for the key's grants on this one stream
--scopeDefaultNone
Ask for exactly these grants, which the key's grants must cover
--ttlDefault0s, the cluster's 15m
The token's lifetime, at most 1h

The concept is The exchange. The same task is Authenticate with an SDK, which exchanges the key for you, and POST /v1/token/exchange over the API. See Authentication.

nova credential create

Creates an API key and prints it once.

nova credential create [options]

Create a key for one application

nova credential create --name orders-writer --scope 'nova:append:demo:* nova:read:demo:*'
api_key: nova_sk_d2f92c8cdb4120d0_VwIt… (shown once — only the secret's hash is stored)
key_id:  d2f92c8cdb4120d0
name:    orders-writer
scope:   nova:append:demo:* nova:read:demo:*

Copy the key now. The cluster stores only a hash of the secret, so no command prints it again. The key ID, the second part of the key, is what listings and logs show. The name says what the key is for, and two keys can share one.

The scope is a space-separated list of grants. See Scopes. Every grant must parse, or the command fails with exit code 1:

nova: client: entry too large: admin: malformed scope tokens: [nova:apend:demo]
--nameRequired
What the key is for: 1 to 64 bytes of UTF-8, with no control characters and no space at either end
--scopeRequired
The key's grants

The concept is API keys. With an SDK, the admin client makes the same call, CreateCredential / createCredential. It also has the update, list, and revoke calls that the next sections show. The HTTP API has no registry routes.

nova credential list

Prints one page of API keys. It never prints a key's secret.

nova credential list [options]

List the keys

nova credential list
d2f92c8cdb4120d0	orders-writer	active	2026-11-22T18:40:30Z	nova:append:demo:* nova:read:demo:*
fa4bb0c3c34da3c0	root	active	2026-11-22T18:34:18Z	nova:admin

Each line holds five fields separated by tabs, with no header: the key ID, the name, active or disabled, the creation time in UTC, and the grants. The lines are in key ID order. When more keys remain, the page ends with next: <key id>. Pass that ID to --cursor.

--limitDefault100
Keys a page
--cursorDefaultNone
Start after this key ID

nova credential update

Renames a key or replaces its grants.

nova credential update [options] <key-id>

Narrow a key's grants

nova credential update d2f92c8cdb4120d0 --scope 'nova:append:demo:orders nova:read:demo:*'
key_id:  d2f92c8cdb4120d0
name:    orders-writer
scope:   nova:append:demo:orders nova:read:demo:*

New grants apply from the key's next exchange. Tokens it already has keep their old grants until they expire. Naming neither flag fails with nova: credential update: set --name or --scope and exit code 2.

--nameDefaultUnchanged
The new name
--scopeDefaultUnchanged
The new grants, which replace the old ones

nova credential revoke

Disables a key: its exchanges fail from then on.

nova credential revoke [options] <key-id>

Revoke a key

nova credential revoke d2f92c8cdb4120d0
revoked d2f92c8cdb4120d0

The next exchange with the key fails with exchange: the credential is revoked, and credential list shows it as disabled. Tokens the key already has keep working until they expire, at most an hour, which is why exchanged tokens are short-lived. The command has no options of its own.

nova credential generate

Creates the root API key offline, with the seed novad reads at boot to register it.

nova credential generate [options]

Generate a seed for the environment

nova credential generate --env
api_key: nova_sk_a8f94d2131977126_gb0c…
key_id:  a8f94d2131977126
NOVAD_ROOT_CREDENTIAL='{"key_id":"a8f94d2131977126","scope":"nova:admin","secret_hash":"92589f33000079946e8a2b9b327ecb03557ce3b59ae580e85ca53228118cfe12"}'

Set the last line in every node's environment. The seed holds the hash of the secret, never the secret, so an environment variable is a safe place for it.

Generate a seed file

nova credential generate --seed-out ./root-seed.json
api_key: nova_sk_d079fe6dd9329ed9_Rv4D…
key_id:  d079fe6dd9329ed9
seed:    ./root-seed.json

Start each node with novad --root-credential-file ./root-seed.json. Keep the api_key line: it is the only copy of the key. The key is named root and holds nova:admin unless --scope says otherwise. Use it to create every other key, then keep it somewhere safe. Naming both or neither of --env and --seed-out fails with exit code 1.

--envDefaultOff
Print the seed as a NOVAD_ROOT_CREDENTIAL line
--seed-outDefaultNone
Write the seed to this file
--scopeDefaultnova:admin
The root key's grants

The steps around it are in The root credential.

nova token mint

Signs a token offline with the key the cluster verifies tokens with.

nova token mint [options]

Mint with the cluster's shared secret

export NOVAD_JWT_HMAC_SECRET=…   # the secret novad has
nova token mint --subject ci-job --scope 'nova:read:demo:*' --ttl 5m
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ…

Mint with a key directory

nova token mint --dir ./keydir --subject ci-job --scope 'nova:read:demo:*'
eyJhbGciOiJFZERTQSIsImtpZCI6ImsyIiwidHlw…

The token is signed with the directory's active key, here k2. A minted token needs no registry and no network, but no command can revoke it: it works until it expires. Prefer token exchange, and mint only where no cluster is reachable or no API key exists, such as in tests.

--subject names the caller in audit logs. Mint takes the same --jwt-* flags, NOVAD_* variables, and --config file as novad, so it signs with whatever key the nodes verify with. A mint without grants fails with nova: auth: mint requires valid, nonempty nova scopes, and one without a key with nova: auth: read keys directory: … no such file or directory.

--subjectRequired
The caller's name, the token's sub
--scopeDefaultNone
The grants, separated by spaces. Required unless --admin is set
--adminDefaultOff
Grant nova:admin. Refused together with --scope
--ttlDefault15m
The token's lifetime
--dirNOVAD_DIRDefault./.novad
The node directory that holds auth/keys
--configNOVAD_CONFIGDefaultNone
A novad YAML config file
--jwt-*DefaultAs on novad
The signing settings, such as --jwt-hmac-secret-file and --jwt-issuer; see novad auth flags

nova auth key

Creates, imports, selects, and exports the keys that sign and verify tokens, in a node's directory.

nova auth key [command [command options]]

Create keys

nova auth key create --dir ./keydir --id k1
nova auth key create --dir ./keydir --id k2
nova auth key list --dir ./keydir
Created key k1 in keydir/auth
Created key k2 in keydir/auth
k1	sign, verify
k2	verify

create makes an Ed25519 key pair. The first key signs; later keys only verify until you activate one.

Rotate the signing key

nova auth key activate --dir ./keydir k2
nova auth key list --dir ./keydir
k1	verify
k2	sign, verify

activate prints nothing. Nodes read the keys at start, so restart them to sign with the new key. Tokens signed by k1 still verify while its public key stays in the directory.

Publish the public keys

nova auth key export --dir ./keydir
{
  "keys": [
    {
      "kty": "OKP",
      "use": "sig",
      "alg": "EdDSA",
      "kid": "k1",
      "crv": "Ed25519",
      "x": "kLFpUeqljeZ8QhMxL_OJM04PyBMYTtlLfXimW74enfQ"
    },
    {
      "kty": "OKP",
      "use": "sig",
      "alg": "EdDSA",
      "kid": "k2",
      "crv": "Ed25519",
      "x": "AaTj6J_hSpLuaTQ1YcwAhZvywgkhjxIWqMcneSpwg18"
    }
  ]
}

Give this JWKS to every verifier that does not share the directory.

import --id k3 ./private.pem adds an unencrypted PKCS #8, RSA, or EC private key under a new ID and prints nothing. The files live in <dir>/auth/keys/<id>.private.pem and <id>.public.pem, and <dir>/auth/active-key names the signer. An ID that exists fails with nova: auth: key ID "k1" already exists or cannot be inspected. None of these commands turns token checking on; novad --auth jwt does.

--dirNOVAD_DIRDefault./.novad
The node directory that holds auth/keys
--idDefaultNone
The new key's ID, on create and import, where it is required

The steps around these commands are in Rotate signing keys.

On this page