Skip to content

feat(client): Vercel protection-bypass header for preview deployments - #21

Merged
nictuku merged 1 commit into
mainfrom
feat/vercel-preview-bypass
Sep 7, 2026
Merged

nictuku merged 1 commit into
mainfrom
feat/vercel-preview-bypass

Conversation

@nictuku

@nictuku nictuku commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Why

Pipeboard's PR previews (https://v0-pipeboard-<hash>-nictukus-projects.vercel.app) are behind Vercel SSO. Any CLI request gets HTTP 401 {"error":{"message":"Protected deployment"}} from the edge, so PIPEBOARD_API_URL could target prod or localhost but never the exact commit under review. That is what kept pipeboard.co#3060 parked: a Microsoft Ads change can only be E2E'd where the production Entra app secrets live, and the only non-prod environment with them is the preview.

What

  • New internal/client/headers.go: setCommonHeaders() applies bearer auth, User-Agent and, when VERCEL_AUTOMATION_BYPASS_SECRET is set, x-vercel-protection-bypass.
  • All four request sites use it: MCP call, MCP notify, REST Post, and FetchToolsHash (the tools-hash endpoint needs no auth but still needs the bypass on a preview).
  • README + CLAUDE.md document the variable.

Behavior is unchanged when the variable is unset. Hosts without deployment protection ignore the header.

Tests

internal/client/headers_test.go: httptest server records headers; asserts the bypass header is present on all four request kinds when configured and absent when not, and that tools-hash stays unauthenticated.

go vet ./... && go test ./...
ok  github.com/pipeboard-co/pipeboard-cli/cmd
ok  github.com/pipeboard-co/pipeboard-cli/internal/client

Follow-ups (not in this PR)

  • Enable "Protection Bypass for Automation" on the v0-pipeboard Vercel project and distribute the secret (Doppler dev, agents VM .env). The project currently has none minted.
  • Tag a release so Homebrew / the agents VM (still on 0.4.0) pick it up.
  • pipeboard.co side (scripts/pr-preview-url.sh, agent prompts, skill docs) is a separate PR.

…TION_BYPASS_SECRET is set

Pipeboard PR previews sit behind Vercel SSO and answer HTTP 401 'Protected deployment' to the CLI, so PIPEBOARD_API_URL could never point at unmerged code. When VERCEL_AUTOMATION_BYPASS_SECRET is set, every request (MCP call/notify, REST, and the unauthenticated tools-hash fetch) now carries it as x-vercel-protection-bypass. Hosts without protection ignore the header. Covered by httptest-based tests for all four request kinds, present and absent.
@nictuku
nictuku merged commit 116a17b into main Sep 7, 2026
2 checks passed
@nictuku
nictuku deleted the feat/vercel-preview-bypass branch September 7, 2026 12:35
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