feat(pulse): Bearer PAT auth for pulse-emit hook#27
Merged
masonwyatt23 merged 2 commits intomainfrom Apr 29, 2026
Merged
Conversation
The OTel emitter currently sends only the `x-ashlr-user` header, which the Pulse server (ashlrai/ashlr-pulse) accepts only when NODE_ENV !== Assisted-By: ashlr-plugin <https://plugin.ashlr.ai>"production". Production Pulse servers reject it — so the plugin can't talk to a hosted Pulse instance today. Adds opt-in Bearer auth via a new `ASHLR_PULSE_PAT` env var. PATs are minted on the Pulse server with `bun run src/cli/mint-pat.ts`. When set, the hook sends `Authorization: Bearer <pat>` and OMITS `x-ashlr-user` so the server's auth path stays unambiguous. When unset, behavior is identical to today. Tests - 2 new cases in __tests__/pulse-emit.test.ts: - PAT set → Bearer header present, x-ashlr-user absent - PAT unset → x-ashlr-user falls back as before - All 7 pulse-emit tests pass; typecheck clean. Docs - env list in the file header now documents ASHLR_PULSE_PAT and notes that production Pulse servers require it. No behavior change for users who don't set the PAT. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
ASHLR_PULSE_PATenv var sohooks/pulse-emit.tscan authenticate against production Pulse servers (today the hook only sendsx-ashlr-user, which production rejects viaNODE_ENVgate)Authorization: Bearer <pat>and dropsx-ashlr-userso the server's auth path stays unambiguousx-ashlr-userfallback preservedWhy
The Pulse server (ashlrai/ashlr-pulse) gates
x-ashlr-userto non-production environments. Without Bearer support here, the plugin can only talk to a local dev Pulse, not a hosted instance — which blocks the v0.4 cloud rollout the Pulse roadmap commits to.Test plan
__tests__/pulse-emit.test.ts:Authorization: Bearer …header present,x-ashlr-userabsentx-ashlr-userfallback works as beforebun test __tests__/pulse-emit.test.ts→ 7 pass / 0 failbun run typecheckclean🤖 Generated with Claude Code