Repository navigation
feat(client): Vercel protection-bypass header for preview deployments - #21
Merged
Merged
Conversation
…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.
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.
Why
Pipeboard's PR previews (
https://v0-pipeboard-<hash>-nictukus-projects.vercel.app) are behind Vercel SSO. Any CLI request getsHTTP 401 {"error":{"message":"Protected deployment"}}from the edge, soPIPEBOARD_API_URLcould 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
internal/client/headers.go:setCommonHeaders()applies bearer auth, User-Agent and, whenVERCEL_AUTOMATION_BYPASS_SECRETis set,x-vercel-protection-bypass.call, MCPnotify, RESTPost, andFetchToolsHash(the tools-hash endpoint needs no auth but still needs the bypass on a preview).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.Follow-ups (not in this PR)
v0-pipeboardVercel project and distribute the secret (Dopplerdev, agents VM.env). The project currently has none minted.scripts/pr-preview-url.sh, agent prompts, skill docs) is a separate PR.