feat(portal): allow probe headers, literal or from the environment - #3
Merged
Conversation
Replaces the Cloudflare Access support I should not have put here. prelude is a
general-purpose devshell library; it has no business knowing what Cloudflare is
or going looking for credentials in a shell.
Two options on an environment instead:
headers = { "X-Api-Version" = "2026-01-01"; };
headersFromEnv = { "Authorization" = "MY_PROBE_TOKEN"; };
The portal forwards exactly what the project declared, only to the environment
that declared it. Secrets go in headersFromEnv because the catalogue is
generated into the store from a file in a git repo, so a value in `headers` is
a value in the repo. An unset variable is skipped rather than sent empty, so an
unconfigured shell probes anonymously instead of sending a malformed request.
This is what makes a gated environment reportable as actually healthy, without
prelude carrying anyone's auth scheme.
`nix flake check` fails on main for everyone:
error: Path 'nix/preflight-hook-pty-test.py' does not exist in Git
repository
`checks.nix` calls four python scripts; two of them are not in the tree.
Both were committed on 2026-08-16 and later lost while the references stayed,
so every check behind them is blocked — which is why the airline check has been
the visible failure: nothing after it ever ran.
Restored from history rather than deleting the checks. They cover MOTD
activation without exported coordination state, and the final prompt render —
the kind of thing that regresses silently.
Audited all four references; the other two were already present.
Unrelated to this PR's headers work; it just blocks everything behind it.
cooper (czxtm)
force-pushed
the
feat/portal-headers
branch
from
August 18, 2026 06:00
416c4db to
47e02ed
Compare
`docs-media-fresh` fingerprints the documented option set, and this PR adds two options — so the recordings and options.md went stale. Regenerated with `nix run .#docs-record`.
treefmt reflows the markdown tables that docs-record emits; the two disagree about column padding.
Member
Author
|
Merging with the airline check red. It is pre-existing (main has had 2 green Test runs in its last 30) and unrelated: the failure is Two things this PR does fix that were masking it: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the Cloudflare Access support that was briefly on
mainand has beenforce-pushed out. prelude is a general-purpose devshell/MOTD library — it has no
business knowing what Cloudflare is, and it certainly should not scan a shell
for credentials.
Two options on an environment instead:
The portal forwards exactly what the project declared, only to the environment
that declared it. It knows nothing about any auth provider.
Why two options rather than one
The catalogue is generated into the Nix store from a file in a git repo, so a
value in
headersis a value in the repo. Secrets belong inheadersFromEnv,which carries the variable name and is read at probe time.
An unset variable is skipped, not sent empty — an unconfigured shell probes
anonymously rather than sending a malformed request that looks like a broken
credential.
Verified
Against a real gated host, with the same catalogue, differing only in whether
the environment supplied the variables:
Tests cover the literal header, the env-sourced header, that an unset variable
produces no header, and that headers do not carry over between environments
sharing a prober.
🤖 Generated with Claude Code