You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
auth: the backend spells one admin gate three ways (two require_admin copies beside auth_rbac.require_role) — consolidate #16333
Measurement: which internal callers reach which admin gate
Method: static analysis of current main. Each client call that sends the internal service key is resolved to its backend route and that route's gate. No host logs were read, so this is what the code can call, not what was observed calling. Anything gated outside dependency injection or the handler body would read as none or get_current_user-only. The none rows and a sample of the rest were spot-read.
Callers:
The SLM frontend, through the SLM's backend proxy. The proxy checks for an SLM admin session, adds the key, and also forwards the user's own token.
The SLM backend's own proxies.
The SLM node agent.
Deployment roles.
An enterprise-enable script.
Backend self-calls.
193 calls by gate:
Gate
Calls
Admits the key alone?
check_admin_permission
108
yes
get_current_user only (auth_middleware)
30
yes (returns a synthetic admin)
no gate found
14
n/a
service principal (/api/v2/secrets/system)
8
yes, as a scoped service principal (separate mechanism)
11 have no backend route; 5 target the SLM, not the backend
What this means for the ruling:
156 of the 193 calls come from the SLM frontend through the proxy. Those carry the human admin's own token as well, so under option (b) a human admin keeps access through the role check.
The 4 require_role routes (orphan storage, the orphan list and repair, the shared-links admin list) already work only through that human token, never through the key.
Under (b) the change is the 108 + 30 routes that accept the key with no human token at all.
The key-only callers found are:
the system-vault secrets routes, which use the service-principal mechanism and are unaffected;
the enterprise-enable script's /api/enterprise/* calls, which would need the explicit service opt-in.
The SLM backend's personality and voice proxies forward any path. Only the paths the SLM frontend uses were enumerated.
Owed follow-up, so it isn't lost: the SLM require_admin docstring in autobot-slm-backend/services/auth.py still says "legacy binary check … retained for backward compatibility". It should match the decision recorded above: it is the SLM's own admin check, separate by #20628 and ruling (b), and no route uses it. services/auth.py is in the open #20648, so this one-line change follows once #20648 lands. It does not go into #20648.
Activity
github-actions commentedon Oct 31, 2026
needs-structurecleared: goal milestone, matching phase label and native parent (or sub-issues) are all present (#19522).mrveiss commentedon Nov 3, 2026
Measurement: which internal callers reach which admin gate
Method: static analysis of current
main. Each client call that sends the internal service key is resolved to its backend route and that route's gate. No host logs were read, so this is what the code can call, not what was observed calling. Anything gated outside dependency injection or the handler body would read asnoneorget_current_user-only. Thenonerows and a sample of the rest were spot-read.Callers:
193 calls by gate:
check_admin_permissionget_current_useronly (auth_middleware)/api/v2/secrets/system)require_role("admin","superadmin")require_settings_admin(wrapscheck_admin_permission)check_file_permissionsWhat this means for the ruling:
require_roleroutes (orphan storage, the orphan list and repair, the shared-links admin list) already work only through that human token, never through the key./api/enterprise/*calls, which would need the explicit service opt-in.13 remaining items
mrveiss commentedon Nov 4, 2026
Owed follow-up, so it isn't lost: the SLM
require_admindocstring inautobot-slm-backend/services/auth.pystill says "legacy binary check … retained for backward compatibility". It should match the decision recorded above: it is the SLM's own admin check, separate by #20628 and ruling (b), and no route uses it.services/auth.pyis in the open #20648, so this one-line change follows once #20648 lands. It does not go into #20648.fix(auth): recorded admin functions keyed by qualified name with the …
fix(auth): the service key is not an admin; one gate, a named and aud…
docs(threat-model): re-anchor check_admin_permission (mrveiss#16333)
fix(auth): the local admin checks use the one gate and predicate; the…
fix(auth): repeated role denials group into one audit row per user an…
fix(auth): denial grouping keys an unmatched route as one constant an…
chore(guard): prune the redis_mcp hardcoded-values entry the predicat…
fix(train): reach floors return to mid-window on the merged tree (mrv…
github-actions commentedon Nov 4, 2026
Landed via the merge train (#20797, merge
92572eba98)fix(auth): the one-admin-gate guard refuses a new function named like…
fix(auth): the admin-function detector reads ensure/assert/verify/has…
fix(train): #20478 follows the one admin gate, keeps 409 transition r…