Improve key management/isolation #631

Merged
parabit merged 3 commits from parabit/better-key-management into master 2026-09-08 20:43:51 +00:00
Owner
No description provided.
improve key management
All checks were successful
CI / ckpool (pull_request) Successful in 39s
CI / lint (pull_request) Successful in 3m42s
CI / test-linux (pull_request) Successful in 11m10s
9c60765bc2
paratoxic requested changes 2026-09-08 19:52:36 +00:00
Dismissed
paratoxic left a comment

I don't know if you're gonna do this in a follow up but this seems relevant:

Behavior regression: aggregator with admin-token only. aggregator.rs no longer sends the admin token when fetching /status; it relies on the default Authorization: Bearer <api_token> header set in Aggregator::init. But ServerConfig allows --admin-token without --api-token (the assertion at server.rs:235 only requires admin if api is set). An aggregator deployed with only an admin token will now get 401s from auth-enabled peers' /status and silently report blockheight: 0 (fetch errors are filtered out in blockheight). Previously this worked. Either send config.api_token().or(config.admin_token()) in Aggregator::init, or document that aggregators now require an api token. The updated tests (aggregator_blockheight_returns_minimum) only cover the both-tokens case, so this regression wouldn't be caught.

I don't know if you're gonna do this in a follow up but this seems relevant: Behavior regression: aggregator with admin-token only. aggregator.rs no longer sends the admin token when fetching /status; it relies on the default Authorization: Bearer <api_token> header set in Aggregator::init. But ServerConfig allows --admin-token without --api-token (the assertion at server.rs:235 only requires admin if api is set). An aggregator deployed with only an admin token will now get 401s from auth-enabled peers' /status and silently report blockheight: 0 (fetch errors are filtered out in blockheight). Previously this worked. Either send config.api_token().or(config.admin_token()) in Aggregator::init, or document that aggregators now require an api token. The updated tests (aggregator_blockheight_returns_minimum) only cover the both-tokens case, so this regression wouldn't be caught.
@ -0,0 +26,4 @@
}
let admin = parts.extensions.get::<BearerAuth>().is_none_or(|auth| {
!auth.enabled()
Owner

maybe auth.enabled() check should happen before database lookup?

maybe auth.enabled() check should happen before database lookup?
fallback to admin if no api configured
All checks were successful
CI / ckpool (pull_request) Successful in 31s
CI / lint (pull_request) Successful in 3m28s
CI / test-linux (pull_request) Successful in 11m6s
5192e45f99
paratoxic approved these changes 2026-09-08 20:09:32 +00:00
paratoxic left a comment

LGTM

LGTM
Merge branch 'master' into parabit/better-key-management
All checks were successful
CI / lint (pull_request) Successful in 2m40s
CI / ckpool (pull_request) Successful in 24s
CI / test-linux (pull_request) Successful in 9m1s
0c023db257
parabit merged commit ba972cdd96 into master 2026-09-08 20:43:51 +00:00
parabit deleted branch parabit/better-key-management 2026-09-08 20:43:52 +00:00
Sign in to join this conversation.
No description provided.