Repository navigation
@odatano/nightgate 0.25.3
@odatano/nightgate 0.25.3
Agent tokens may read through the bound functions. No schema change, no
migration, no config change.
The indexer entities carry bound read functions, Blocks/latest(),
Blocks/range(...), Transactions/byHash(...), ContractActions/history(...)
and the others, eleven in all. An agent token could read the same rows
through the entity sets (READ is always allowed), but a bound function
arrives at the grant hook as its own event, latest, range, byHash, and
those names were neither in the always-allowed set nor grantable: an operator
could not put them into allowedActions either (createAgentGrant refuses
non-grantable entries with a 400, which is right, they are not actions an
operator hands out). So a token got 403 on every one of them. ODATANO ACCESS
found it: its reference lists the functions for gateway keys, and a key got
action 'latest' is not allowed for this agent grant.
The eleven functions now sit in AGENT_ALWAYS_ALLOWED_EVENTS
(srv/sessions/agent-grants.ts), next to READ, the verify functions,
getJobStatus and deriveTokenType. They cost no budget, need no allowlist
entry, and existing grants get them without an update. Everything else is as
before: the allowlist still decides the sponsor and attestation actions, the
operator-only actions stay closed.
| entity | functions |
|---|---|
| Blocks | latest, byHeight, range |
| Transactions | byHash, byType |
| ContractActions | byAddress, history |
| UnshieldedUtxos | byOwner, unspent |
| NightBalances | getBalance, getTopHolders |
Review notes
- One file changed in
srv/, one set extended, no logic change elsewhere.
docs/actions.mdlists the functions under "always allowed". - Booted proof in
test/unit/agent-token-documents-read.test.ts: a token
gets 200 onBlocks/latest()andNightBalances/getTopHolders(limit=5)
over real HTTP (403 against the previous build). Typecheck, lint and the
grant suites green.
Full Changelog: v0.25.2...v0.25.3