Repository navigation
Conversation
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
First contribution here — happy to adjust to whatever conventions the project
prefers, and thanks in advance for the review.
This adds an explicit
--insecureopt-in sojg authcan save a customJev-compatible endpoint that speaks plain
http://on a non-loopback host andrequires no API key (e.g. a self-hosted gateway on a private network). I ran into
this need when pointing
jgat a local LAN endpoint; the strict default is theright call for a tool that ships source content to a provider, so I kept this as
a deliberate, saved-record-only opt-in rather than any environment override.
Control flow of the new path:
Interactive auth accepts
jg auth --insecureas a preselect, or asks forconfirmation when a plain-http URL is entered. Records without
"insecure": truevalidate and behave exactly as before.
I tried to follow the existing contracts (stdout-only output, no key echoing,
strict defaults, no env overrides) — please correct me if I missed a convention.
Evidence
auth --provider custom --base-url http://192.168.0.135:8080/v1 --insecure --stdinexited 1 ("Base URL must use https:// …"); empty key stdin exited 1.
After: saves
{provider:"custom", baseURL, model, apiKey:"", insecure:true}with 0600/0700 modes, prints the warning, stderr empty, key never echoed;
doctorand search succeed against a fixture server with noAuthorizationheader sent.
bun test apps/cli/test packages/core/test test/evaluator.test.ts(docker-gatedsuites run against the built dist): 97 pass, 0 fail — includes a new pty test
for the interactive confirmation flow.
"installed insecure custom endpoint saves an empty key and searches without an
auth header" passes; existing preset journeys still pass.
check-types,lint,format:checkclean; parser suite 39/39.bun run verify) — my environment lackedbuildx initially; CI should be the authority here, and I'm glad to chase
anything it flags.
Merge Danger
Door: two-way. Reverting restores strict validation; already-saved insecure
records simply fail to load again with the generic credentials error. The
insecurefield is additive and ignored by old binaries, so nothing needsmigration in either direction.
Blast Radius: custom-endpoint auth and provider request headers. Preset
providers, cache identity, and search output are untouched; the header strip
only triggers when the saved key is
"", which only an insecure custom recordcan hold.