Repository navigation
fix: read PRIOMPT_TOKEN and re-sync the vendored proto - #11
Merged
Merged
Conversation
The client ignored PRIOMPT_TOKEN, which the CLI and docs treat as the client credential. The token is now, in order: the explicit token, PRIOMPT_TOKEN, then the token in the url / PRIOMPT_URL, matching the priompt CLI and the web UI. Re-sync proto/priompt/v1/prompt.proto from priompt/proto main (e7dce07); the only change is the go_package path. Adds an npm test suite (node:test) and runs it in CI. Fixes #7 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What was wrong
PromptClientignoredPRIOMPT_TOKEN. ThepriomptCLI,promptctland the web UI all send it as the client's bearer token, and the CLI and web UI prefer it over the token inPRIOMPT_URL. So a setup the docs describe (export PRIOMPT_TOKEN=…plus a host) failed withUNAUTHENTICATEDfrom Node.proto/priompt/v1/prompt.protostill had the oldgo_package = "priomptproto/gen/priompt/v1;priomptv1".Fix
token, thenPRIOMPT_TOKEN, then the token inurl/PRIOMPT_URL. This matchespriompt'sauthCtxand the web UI. README updated.npm run sync-protofrom priompt/protomain(e7dce07). The only difference isgo_package→github.com/priompt/proto/gen/priompt/v1;priomptv1. No message or RPC changes.npm test(node --test) withtest/token.test.js, and CI runs it.Test evidence
Before the fix (main):
After:
Real run against
priompt v0.7.2 serve -tokens-file(tokenadmintok),PRIOMPT_TOKEN=admintok,new PromptClient({ host: "127.0.0.1:48443" }).get("priompt://acme/onboarding/welcome"):The re-synced proto loads (
node -e "new (require('./client.js').PromptClient)({host:'localhost:1'})").Overlap with #9 / #10
Both add the same
npm testscript and CI line. A trial merge of this branch with #9 alone, or with #10 alone, is clean.Fixes #7
🤖 Generated with Claude Code