Reject userinfo in public base URLs#77
Conversation
Ckeplinger199
left a comment
There was a problem hiding this comment.
No blockers found on PR #77.
Checked:
app/config.pytests/test_deploy_readiness.py
The deploy-readiness validator now rejects URL userinfo in MERGEWORK_PUBLIC_BASE_URL before that value can be used as the public origin for links/OAuth callback construction. I verified the branch rejects username-only, password-only, and username+password URL shapes while preserving a normal public HTTPS origin.
Validation:
uv run --extra dev python -m pytest tests/test_deploy_readiness.py::test_deploy_readiness_rejects_public_base_url_userinfo tests/test_deploy_readiness.py::test_deploy_readiness_accepts_strong_configuration -q-> 2 passeduv run --extra dev python -m pytest tests/test_deploy_readiness.py -q-> 5 passeduv run --extra dev python -m pytest -q-> 80 passeduv run --extra dev ruff format --check app/config.py tests/test_deploy_readiness.py-> passeduv run --extra dev ruff check app/config.py tests/test_deploy_readiness.py-> passeduv run --extra dev mypy app-> passedgit diff --check origin/main...HEAD -- app/config.py tests/test_deploy_readiness.py-> passed
GitHub reports PR #77 as CLEAN and the CI check Quality, readiness, docs, and image checks SUCCESS. No secrets, deployment changes, wallet signing, spending, or price claims included.
4122d4d to
fce4847
Compare
|
Rebased this branch onto current Validation after the rebase:
The GitHub check is green again and the PR is mergeable now. |
dobbobalina2
left a comment
There was a problem hiding this comment.
No blockers from my pass.
I inspected the narrow deploy-readiness change in app/config.py and the regression coverage in tests/test_deploy_readiness.py. The validator already rejects non-HTTPS public origins, missing hosts, path/params, query, and fragment; this PR adds the missing userinfo guard so values like https://operator:secret@mrwk.example.test are rejected before they can become a public origin for links or OAuth callback configuration. The new test covers that shape directly, and the check is scoped to the existing deployment validation path.
Local validation from PR head fce4847:
uv run --extra dev pytest tests/test_deploy_readiness.py -q->7 passeduv run --extra dev pytest -q->99 passed, 2 warningsuv run --extra dev ruff format --check app/config.py tests/test_deploy_readiness.py->2 files already formatteduv run --extra dev ruff check app/config.py tests/test_deploy_readiness.py->All checks passed!uv run --extra dev mypy app->Success: no issues found in 11 source filesgit diff --check origin/main...HEAD -- app/config.py tests/test_deploy_readiness.py-> clean
I also checked that GitHub CI Quality, readiness, docs, and image checks is passing. Prepared with AI assistance.
Refs #55
Summary
Reject deploy configurations where
MERGEWORK_PUBLIC_BASE_URLincludes URL userinfo, for examplehttps://operator:secret@mrwk.example.test.Observed problem
The deploy-readiness gate already requires HTTPS and a host, but it still accepted a public base URL with embedded userinfo. That is not a clean public origin for externally visible links or GitHub OAuth callback construction, and it can let credential-shaped values slip into deploy configuration.
Changed behavior
usernameorpasswordcomponents after parsingMERGEWORK_PUBLIC_BASE_URL.Validation
uv run --extra dev python -m pytest tests/test_deploy_readiness.py::test_deploy_readiness_rejects_public_base_url_userinfo -qfailed because the error list was empty.uv run --extra dev python -m pytest tests/test_deploy_readiness.py::test_deploy_readiness_rejects_public_base_url_userinfo -q-> 1 passeduv run --extra dev python -m pytest tests/test_deploy_readiness.py -q-> 5 passeduv run --extra dev python -m pytest -q-> 80 passeduv run --extra dev ruff format --check app/config.py tests/test_deploy_readiness.py-> 2 files already formatteduv run --extra dev ruff check app/config.py tests/test_deploy_readiness.py-> All checks passeduv run --extra dev mypy app-> Successuv run --extra dev python scripts/check_deploy_ready.py-> Deploy readiness check passeduv run --extra dev python scripts/check_deploy_ready.py-> failed withMERGEWORK_PUBLIC_BASE_URL must not include userinfouv run --extra dev python scripts/docs_smoke.py-> docs smoke okgit diff --check -- app/config.py tests/test_deploy_readiness.py-> passed