gabriel / muse public
fix patch dev
AI Agent gabriel · 145 days ago · Apr 26, 2026 · Diff

fix: _hub_api SSL context + unauthenticated GET for public resources

- Add _hub_api_ssl_context() to load local CA cert for localhost URLs, matching the SSL trust logic already in transport._httpx_verify - Allow GET/HEAD/OPTIONS requests to proceed without a signing identity; mutating methods (POST/PUT/DELETE/PATCH) still require auth - Add _get_hub_and_optional_identity() for read-only hub commands on public repos (hub issue read, hub issue list) - Use fake_id() from muse.core.types instead of raw 'sha256:' + 'a'*64 - Update _fake_urlopen/_fake signatures to accept **_kw for context kwarg - Update test_missing_token_exits to assert POST (not GET) exits without auth

sha256:5d4a894d54ce01e00d662db1d1b395ca8f95c2a79e3702b3023cd151983a3a2c sha
+61 ~50 symbols
sha256:f87939b9a33907dacb5b494a6757fdd112970443bb8827b1013bab797e76d459 snapshot
+61
symbols added
~50
symbols modified
0
dead code introduced
Semantic Changes 111 symbols
+ TestHubApiContract class class TestHubApiContract L230–294
+ test_authenticated_get_sends_msign_header method method test_authenticated_get_sends_msign_header L251–266
+ test_localhost_ssl_context_cafile_set method method test_localhost_ssl_context_cafile_set L268–294
+ test_public_get_sends_no_auth_header method method test_public_get_sends_no_auth_header L233–249
+ TestHubApiPublicGetUnit class class TestHubApiPublicGetUnit L153–223
+ test_delete_without_signing_exits method method test_delete_without_signing_exits L197–205
+ test_get_with_signing_includes_auth_header method method test_get_with_signing_includes_auth_header L207–223
+ test_get_without_signing_does_not_exit method method test_get_without_signing_does_not_exit L176–184
+ test_get_without_signing_proceeds method method test_get_without_signing_proceeds L156–174
+ test_post_without_signing_exits method method test_post_without_signing_exits L186–195
+ TestHubApiRegression class class TestHubApiRegression L416–487
+ test_R1_hub_issue_read_no_ssl_error_on_localhost method method test_R1_hub_issue_read_no_ssl_error_on_localhost L419–441
+ test_R2_public_issue_read_no_exit_without_identity method method test_R2_public_issue_read_no_exit_without_identity L443–451
+ test_R3_file_scheme_still_blocked method method test_R3_file_scheme_still_blocked L453–460
+ test_R4_response_size_cap_still_enforced method method test_R4_response_size_cap_still_enforced L462–471
+ test_R5_existing_auth_tests_unaffected method method test_R5_existing_auth_tests_unaffected L473–487
+ TestHubApiSecurity class class TestHubApiSecurity L494–563
+ test_ansi_in_http_error_body_still_sanitized method method test_ansi_in_http_error_body_still_sanitized L515–532
+ test_no_auth_header_leaked_on_unauthenticated_get method method test_no_auth_header_leaked_on_unauthenticated_get L497–513
+ test_ssl_context_does_not_disable_verification method method test_ssl_context_does_not_disable_verification L534–553
+ test_ssrf_scheme_blocking_unaffected_by_public_get_change method method test_ssrf_scheme_blocking_unaffected_by_public_get_change L555–563
+ TestHubApiSslContextProperty class class TestHubApiSslContextProperty L364–409
+ test_localhost_always_gets_custom_context method method test_localhost_always_gets_custom_context L375–396
+ test_mutating_methods_require_auth method method test_mutating_methods_require_auth L400–409
+ TestHubApiSslContextUnit class class TestHubApiSslContextUnit L87–150
+ test_127_0_0_1_https_gets_custom_ssl_context method method test_127_0_0_1_https_gets_custom_ssl_context L135–150
+ test_localhost_https_gets_custom_ssl_context method method test_localhost_https_gets_custom_ssl_context L90–112
+ test_remote_https_uses_system_ca method method test_remote_https_uses_system_ca L114–133
+ TestHubApiStress class class TestHubApiStress L570–633
+ test_concurrent_authenticated_gets_no_deadlock method method test_concurrent_authenticated_gets_no_deadlock L604–633
+ test_concurrent_unauthenticated_gets_no_deadlock method method test_concurrent_unauthenticated_gets_no_deadlock L573–602
+ TestHubIssueReadPublicIntegration class class TestHubIssueReadPublicIntegration L301–357
+ test_issue_list_public_no_auth_succeeds method method test_issue_list_public_no_auth_succeeds L335–357
+ test_issue_read_public_no_auth_succeeds method method test_issue_read_public_no_auth_succeeds L306–333
+ _HUB_LOCAL variable variable _HUB_LOCAL L62–62
+ _HUB_REMOTE variable variable _HUB_REMOTE L63–63
+ _IDENTITY variable variable _IDENTITY L61–61
+ _make_signing function function _make_signing L74–80
+ _mock_resp function function _mock_resp L66–71
+ CliRunner import import CliRunner L50–50
+ MagicMock import import MagicMock L43–43
+ TYPE_CHECKING import import TYPE_CHECKING L42–42
+ annotations import import annotations L34–34
+ call import import call L43–43
+ fake_id import import fake_id L49–49
+ given import import given L46–46
+ io import import io L36–36
+ json import import json L37–37
+ patch import import patch L43–43
+ pytest import import pytest L45–45
+ settings import import settings L46–46
+ ssl import import ssl L38–38
+ st import import st L47–47
+ threading import import threading L39–39
+ error import import urllib.error L40–40
+ request import import urllib.request L41–41
+ runner variable variable runner L55–55
~ muse/cli/commands/hub/_core.py .py 3 symbols added, 2 symbols modified
+ _READ_ONLY_METHODS method variable _READ_ONLY_METHODS L558–558
+ _get_hub_and_optional_identity function function _get_hub_and_optional_identity L968–1021
+ _hub_api_ssl_context function function _hub_api_ssl_context L523–551
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:5d4a894d54ce01e00d662db1d1b395ca8f95c2a79e3702b3023cd151983a3a2c --body "your comment"