Repository navigation
Default base_url from PROOFLINE_BASE_URL - #61
Open
usaamahahmed101 wants to merge 1 commit into
Open
usaamahahmed101 wants to merge 1 commit into
usaamahahmed101 wants to merge 1 commit into
Conversation
ProoflineClient and AsyncProoflineClient now take base_url=None. When it is left out they read a non-empty PROOFLINE_BASE_URL, and otherwise use https://proofline.sh, matching the CLI, the MCP bridge and the TypeScript SDK. An explicit base_url wins; an empty variable counts as unset; a bad value is refused by name without echoing it. check.py drops the variable from the test environment like PROOFLINE_TOKEN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 changes
base_urlis now optional onProoflineClientandAsyncProoflineClient. When it is left out, the clients readPROOFLINE_BASE_URL, and when that is not set they usehttps://proofline.sh.The order is: the
base_urlargument, then a non-emptyPROOFLINE_BASE_URL, then the hosted origin.Who it helps
Anyone who points a script or CI job at something other than the hosted origin, such as a staging or dedicated deployment. The CLI (
--base-url, envPROOFLINE_BASE_URL), the MCP bridge and, since prooflinedev/sdk-typescript#50, the TypeScript SDK all read this variable. The Python SDK already readsPROOFLINE_TOKENfrom the environment but hard-coded the origin. So a team that sets the variable once for the CLI in CI still had to thread the same value through its Python code, and a script that forgot to do so silently talked to production.Decisions
base_urlwins over the variable. A program that names its origin should not change behaviour because of the shell it runs in.PROOFLINE_BASE_URLcounts as unset. A CI template that expands a missing variable to an empty string gets the hosted origin, not a startup error.ValueErrorstarting withPROOFLINE_BASE_URL must be, so it is clear which setting to fix. The message never repeats the value, becausehttps://user:secret@hostwould otherwise end up in logs. A badbase_urlargument keeps its existing message._transport.configured_base_url, used by both clients, so sync and async cannot drift.scripts/check.pyremovesPROOFLINE_BASE_URLfrom the test environment, as it already does forPROOFLINE_TOKEN. A developer who has the variable exported locally still gets hermetic runs.There is no change to the generated code, the OpenAPI contract, retries, timeouts or the package version.
Verification
test_base_url_defaults_to_the_environment_then_the_hosted_origin(sync and async) using the existing loopbackServerfixture. It covers: a client withoutbase_urlsends the request and token toPROOFLINE_BASE_URL; an explicitbase_urlwins; unset and empty both fall back tohttps://proofline.sh; and bad values (including one with credentials) are refused by name without echoing the secret.mainfirst: both cases fail ('https://proofline.sh' == 'http://127.0.0.1:…'). With this change they pass.ruff check,ruff format --check,mypy proofline scripts, andpytest: 218 passed.🤖 Generated with Claude Code