Skip to content

Treat an empty control-plane bearer as none - #632

Merged
QR-Madness merged 1 commit into
masterfrom
relay-empty-bearer
Dec 1, 2026
Merged

QR-Madness merged 1 commit into
masterfrom
relay-empty-bearer

Conversation

@QR-Madness

Copy link
Copy Markdown
Collaborator

What

RELAY_REVOCATION_BEARER set but empty (RELAY_REVOCATION_BEARER=) became Some(""). That matched a request carrying no Authorization header at all, because the presented bearer defaults to "". So the internal workspace hooks (purge-member, retain-members) and the revocation push accepted anyone.

set_revocation_push_bearer, the one way a bearer reaches the server, now drops a blank one:

  • the hooks answer 503 (off);
  • /metrics stays open, as on a relay without a control plane.

The README row says so.

Found while reviewing #629. It isn't live: both deployed relays have a bearer, and an unauthenticated hook call gets 401 there.

Verification

  • Test red first: an_empty_bearer_is_no_bearer in tests/metrics_gate.rs failed before the fix. A headerless retain-members call got past the gate and failed only later, on its body (400).
  • After the fix: the hook answers 503 and /metrics is open.
  • Suites: the relay suite passes 1,135 tests (2 ignored). The OSS leak grep is clean.

Assisted-by: Opus 5.5

RELAY_REVOCATION_BEARER set but empty became Some(""), which matched a
request carrying no bearer at all: the internal workspace hooks and the
revocation push accepted anyone. The setter now drops a blank bearer, so
the hooks answer 503 (off) and /metrics stays open, as with no bearer.
No environment runs with an empty bearer today; both deployed relays
refuse an unauthenticated hook call with 401.

Assisted-by: Opus 5.5
@QR-Madness
QR-Madness merged commit 00b3110 into master Dec 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant