Add LC_API_URL and LC_JWT_URL to target a non-public deployment - #397
Conversation
The SDK and CLI always talked to the public API and token-exchange roots, so neither could be pointed at a local development stack. LC_API_URL and LC_JWT_URL override them; unset keeps the public roots, and a value that is not an absolute http(s) URL is refused rather than silently ignored. `limacharlie api --target jwt` follows LC_JWT_URL too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
LimaCharlie Cloud Security — code scanNo new code findings were introduced by this pull request. This check reports and never fails: no Scanned This comment is updated in place on every push to this pull request. |
|
Self-review (pristine |
Why
The SDK and CLI always use
https://api.limacharlie.ioandhttps://jwt.limacharlie.io. There was no way to point them at another deployment, such as a local development stack, short of patching the module.What
LC_API_URLoverrides the API root (ROOT_URL),LC_JWT_URLthe token-exchange endpoint (JWT_URL). Both are read once at import.http://orhttps://URL raises instead of silently falling back to the public API (which would send the caller's key somewhere they did not intend)./is stripped.limacharlie api --target jwtfollowsLC_JWT_URL(theapitarget already usedROOT_URL).doc/authentication.md.Tests
tests/unit/test_client_root_override.py: unset, empty, override + normalization, three malformed values, and a real-HTTP-server check that a client built under the overrides exchanges its key atLC_JWT_URLand callsLC_API_URL/v1/.... The full unit + microbenchmark suite passes (4572 passed).🤖 Generated with Claude Code