1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use ;
use HashSet;
/// API permission levels for access control.
///
/// The `Admin` tier is intentionally read-only despite the name: it grants
/// `RpcRead` AND lifts the per-policy ownership requirement on the two
/// read-with-ownership endpoints (`newt_simulatePolicy`,
/// `newt_simulatePolicyDataWithClient`). It does NOT grant `RpcWrite`.
/// Holders cannot create tasks, store secrets, register webhooks, or call
/// any other state-changing endpoint.
///
/// Why a distinct tier rather than just `RpcRead` + a per-request bypass
/// flag: the bypass increments `gateway_owner_check_bypassed_total{chain_id,
/// endpoint}` and is the only observable signal of privileged read activity.
/// Tying the bypass to a `permissions` row in `api_keys` makes every bypass
/// attributable to a specific key with `permissions @> ARRAY['admin']`. A
/// per-request flag would remove the issuance ceremony (the operator's
/// `--i-understand-admin-bypasses-getowner` acknowledgement) and lose the
/// audit trail. See `crates/gateway/src/rpc/api/common.rs::verify_policy_client_ownership`.
///
/// First-party callers (Newton Dashboard health checks, CI canaries,
/// internal e2e test runners, demo dashboards) are the use case: they
/// legitimately read across policy clients they don't own on-chain.
/// External callers issued an Admin key would gain no write rights from
/// the tier alone.