gabriel / muse public
refactor BREAKING mist dev
AI Agent gabriel · 105 days ago · May 26, 2026 · Diff

refactor(mist): replace urllib with HttpTransport for mkcert SSL support

mist.py was using bare urllib.request.urlopen with no SSL context, causing CERTIFICATE_VERIFY_FAILED when pushing to localhost:1337 (mkcert self-signed). Replaced _hub_api and run_raw to use HttpTransport.hub_json / hub_bytes, which load the mkcert root CA via _httpx_verify() — the same path as push/fetch.

Also adds hub_json and hub_bytes methods to HttpTransport with full TDD coverage (test_transport_hub_json.py: 23 tests), and applies American spelling to init.py plus associated test files, and fixes whoami to show full fingerprint.

sha256:2331ea415baf042c0c119fc219b503eb852e9973ac759feae4b903103074e0a9 sha
+39 ~14 −4 symbols
sha256:467f0cbebd15eb0f40a03c7cf045d8eb52a160312cb662642aed1a14a1ae9cdf snapshot
+39
symbols added
~14
symbols modified
−4
symbols removed
0
dead code introduced
Semantic Changes 57 symbols
~ tests/test_transport_hub_json.py .py 34 symbols added
+ TestHubBytes class class TestHubBytes L174–254
+ test_accept_star_header_sent method method test_accept_star_header_sent L191–198
+ test_http_404_raises_transport_error method method test_http_404_raises_transport_error L219–225
+ test_msign_header_sent_when_signing_provided method method test_msign_header_sent_when_signing_provided L200–208
+ test_network_error_raises_transport_error_with_code_0 method method test_network_error_raises_transport_error_with_code_0 L227–237
+ test_no_auth_header_when_signing_is_none method method test_no_auth_header_when_signing_is_none L210–217
+ test_returns_empty_bytes_on_empty_200_response method method test_returns_empty_bytes_on_empty_200_response L249–254
+ test_returns_raw_bytes method method test_returns_raw_bytes L175–181
+ test_sends_get_method method method test_sends_get_method L183–189
+ test_uses_httpx_client_not_urllib method method test_uses_httpx_client_not_urllib L239–247
+ TestHubJson class class TestHubJson L41–166
+ test_accept_json_header_sent method method test_accept_json_header_sent L71–78
+ test_get_with_no_body_sends_no_content method method test_get_with_no_body_sends_no_content L150–156
+ test_http_401_raises_transport_error method method test_http_401_raises_transport_error L122–128
+ test_http_404_raises_transport_error method method test_http_404_raises_transport_error L114–120
+ test_http_500_raises_transport_error method method test_http_500_raises_transport_error L130–136
+ test_invalid_json_raises_transport_error method method test_invalid_json_raises_transport_error L106–112
+ test_msign_auth_header_sent_when_signing_provided method method test_msign_auth_header_sent_when_signing_provided L80–88
+ test_network_error_raises_transport_error_with_code_0 method method test_network_error_raises_transport_error_with_code_0 L138–148
+ test_no_auth_header_when_signing_is_none method method test_no_auth_header_when_signing_is_none L90–97
+ test_non_dict_json_response_returns_empty_dict method method test_non_dict_json_response_returns_empty_dict L99–104
+ test_post_with_body_sends_json_bytes method method test_post_with_body_sends_json_bytes L50–58
+ test_post_with_body_sets_content_type_json method method test_post_with_body_sets_content_type_json L60–69
+ test_returns_parsed_dict method method test_returns_parsed_dict L42–48
+ test_uses_httpx_client_not_urllib method method test_uses_httpx_client_not_urllib L158–166
+ _make_signing function function _make_signing L18–20
+ _mock_httpx_client_resp function function _mock_httpx_client_resp L23–33
+ HttpTransport import import HttpTransport L10–10
+ SigningIdentity import import SigningIdentity L10–10
+ TransportError import import TransportError L10–10
+ annotations import import annotations L3–3
+ json import import json L5–5
+ pytest import import pytest L8–8
+ mock import import unittest.mock L6–6
~ muse/cli/commands/auth.py .py 1 symbol modified
~ muse/cli/commands/init.py .py 3 symbols modified
~ muse/cli/commands/mist.py .py 1 symbol removed, 2 symbols modified
request import import urllib.request L63–63
~ muse/core/transport.py .py 2 symbols added, 1 symbol modified
+ hub_bytes method method hub_bytes L623–641
+ hub_json method method hub_json L587–621
~ tests/test_cmd_init.py .py 3 symbols added, 3 symbols removed, 3 symbols modified
test_force_reinitialised_flag_in_json method method test_force_reinitialised_flag_in_json L1057–1060
test_json_reinitialised_false_on_fresh method method test_json_reinitialised_false_on_fresh L403–405
test_json_reinitialised_true_on_force method method test_json_reinitialised_true_on_force L407–410
+ test_force_reinitialized_flag_in_json method method test_force_reinitialized_flag_in_json L1057–1060
+ test_json_reinitialized_false_on_fresh method method test_json_reinitialized_false_on_fresh L403–405
+ test_json_reinitialized_true_on_force method method test_json_reinitialized_true_on_force L407–410
← 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:2331ea415baf042c0c119fc219b503eb852e9973ac759feae4b903103074e0a9 --body "your comment"