Commit Graph

6 Commits

Author SHA1 Message Date
Jordan Ritter 8714ab569b chore(showcase): apply oxfmt formatting across showcase scripts and shells
oxfmt --write normalized formatting on showcase scripts, the four shells, and the
new oxlint rule; required for the repo-root oxfmt --check CI gate.
2026-05-29 11:45:16 -07:00
Jordan Ritter 690ab1d675 fix(showcase): trim RAILWAY_TOKEN env lane to honor no-whitespace-in-header invariant
A RAILWAY_TOKEN secret with trailing whitespace/newline (common from op
read, heredoc, shell export) was returned verbatim and produced invalid
Authorization: Bearer headers and silent Railway 401s. Trim the env-var
lane and treat whitespace-only as UNSET so the config-file fallback runs.
Also adds a missing should-have-thrown guard in the NO_HOME test and
removes a stale gateIgnore clause from findUntrackedServices docstring.
2026-05-29 11:45:13 -07:00
Jordan Ritter db84d82d42 fix(showcase): unify railway token resolver + sanitize GraphQL error bodies + null-check project 2026-05-29 11:45:12 -07:00
Jordan Ritter 781bc92e90 fix(showcase): return trimmed railway token to avoid invalid Authorization header
A token read from ~/.railway/config.json with surrounding whitespace or a
trailing newline passed nonEmpty() but was returned verbatim, so an
'Authorization: Bearer <token>' header could carry CR/LF or stray spaces
(Node HTTP rejects invalid header chars; Railway 401s otherwise). Trim
each return path so the canonical token is always emitted; whitespace-only
values still fall through. Also clarify the JSDoc that this resolver does
not consult process.env.RAILWAY_TOKEN.
2026-05-29 11:45:12 -07:00
Jordan Ritter 5795f3e3e5 fix(showcase): harden railway-token resolver (whitespace/non-object guards, type-safe narrowing)
Treat whitespace-only token strings as empty so the resolver falls through
to the next candidate instead of returning a bearer that fails at Railway
with a confusing 401.

Guard against non-object JSON input (null/undefined/string/number/array)
defensively before property access — the config originates from
JSON.parse of ~/.railway/config.json (untrusted).

Replace non-null assertions on re-accessed expressions with
locally-captured values so the nonEmpty narrowing actually applies; no
behavior change for the happy path.

Comment cleanups: replace stale line-number reference with a symbolic
one, reword the Ruby-parity note to acknowledge the per-project token
fallback that is intentionally not honored, drop the rotting
"(43+ chars)" parenthetical, and soften the deprecation timeline to
"a future release."
2026-05-29 11:45:11 -07:00
Jordan Ritter 7b513c8f57 feat(showcase): add shared Railway token resolver with accessToken preference 2026-05-29 11:45:02 -07:00