Commit Graph

11 Commits

Author SHA1 Message Date
pulse-triage[bot]
d6159f1af9 Initialize auth stores in standalone quick setup tests
The release API runner splits its test binary into fresh processes. Three successful quick setup fixtures used a bare router and relied on session and CSRF stores initialized by other tests. Give the fixtures their own temporary stores and shut them down before removing the directory. Keep credential persistence, session and one-time token assertions on the real handler.

Change-source: pulse-maintainer
2026-11-19 06:53:32 +00:00
pulse-triage[bot]
748707ca9e Keep consumer persistence-failure fixtures on the owned descriptor
Adapt the API and agent-token filesystem fixtures to exclusive temporary creation. Preserve their original write errors, blocking points, counts and all authority/rollback assertions.

Contract-Neutral: Registered test-fixture adapters only; no additional runtime or contract change.
Change-source: pulse-maintainer
2026-11-01 21:58:30 +00:00
rcourtman
9a4f75b5b7 Require instance-wide authority to rotate credentials by token
POST /api/security/quick-setup with force=true sets the administrator
username and password and replaces every API token with a full-access
one. With authentication already configured, a token holding only
settings:write could call it, so settings:write was enough to take the
instance over, although the endpoint is documented as needing a
bootstrap token or an authenticated session.

A token caller now needs an instance-wide full-access token (full access,
bound only to the default organization) once the request would change
credentials. The not-forced "already configured" answer is unchanged, and
browser sessions, the bootstrap token and recovery token paths are
untouched.

The two existing force tests that used a settings:write caller are about
persistence rollback and settings preservation, so they now use a
full-access caller. The new tests use a deliberately weak password so a
caller that passes the check is stopped by validation before any
credential or session is written, and they fail when the check is removed.

Contract-Neutral: Behavioural fix that gives credential rotation the authority check regenerate-token and token management already have; no new API surface or contract.
2026-10-11 18:10:20 +01:00
rcourtman
9718555e31 Stop token callers widening or bypassing their scopes
Two authorization gaps where a token could do more than its scopes allow.

POST /api/security/regenerate-token replaces the whole token inventory,
wildcard tokens included, and issues a full-access credential (nil scopes
normalise to "*"). A token holding only settings:write could therefore
wipe every other token and mint an unrestricted one, which the normal
create and update paths refuse because a caller can only grant scopes it
holds. A token caller now needs full-access scope and must not be bound
to a non-default organization; anything narrower gets 403 and is pointed at
POST /api/security/tokens/{id}/rotate, which replaces one token. Admin
sessions are unchanged.

/api/resources/ is one prefix route gated on monitoring:read, but it also
dispatches POST link, unlink and report-merge, which persist resource
identity changes. A read-only token could change them. Anything other
than GET or HEAD on that prefix now needs monitoring:write; the more
specific registrations (operator-state, maintenance) keep their own gates.

Tests pin both boundaries and each fails when its fix is reverted. Two
existing regenerate tests that used a settings:write caller now use a
full-access one, since their subject is owner inheritance and rollback.

Contract-Neutral: Behavioural fix that enforces the documented token scope model; no new API surface or contract.
2026-10-11 15:57:35 +01:00
pulse-triage[bot]
56fc9b8255 Keep token issuance atomic on persistence failure
Restore the complete live token inventory when durable writes fail during legacy regeneration, quick security setup, and container-runtime token preparation. Return an error instead of exposing or claiming an unpersisted credential.

Contract-Neutral: hardens internal failure handling without changing successful API payloads or extension contracts
2026-08-29 05:19:19 +01:00
rcourtman
3953554ae1 Bind owner identity across token minting 2026-05-04 00:50:14 +01:00
rcourtman
649516cab4 Fix API auth failure handling
Make direct CheckAuth failures return explicit auth-required responses while preserving route-specific auth errors through shared response capture.

Align API contract tests with uncapped self-hosted monitoring, route-local config import/export auth, and marketed entitlement upgrade reasons.
2026-04-26 17:26:16 +01:00
rcourtman
586473ee31 Bind recovery and bootstrap auth to direct loopback 2026-04-22 00:39:53 +01:00
rcourtman
778a2577b6 feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
rcourtman
b9eee668e5 test: expand security regression coverage 2026-02-04 10:28:41 +00:00
rcourtman
e60a11116b test(api): comprehensively improve test coverage to Security, Infra, and Features 2026-02-02 18:59:44 +00:00