fix(remote): resolve remembered explicit-port endpoints
- Resolve bare remote hosts through the remote registry when one explicit port is stored. - Preserve bare host behavior when no unique explicit-port registry match exists. - Route requested remote targets through the new registry resolver. - Add registry tests for unique and ambiguous explicit-port matches. - Bump package and extension versions to 0.16.6.
This commit is contained in:
@@ -23,6 +23,23 @@ def test_save_remote_with_key_and_remove(monkeypatch, tmp_path):
|
||||
assert remote_registry.remove_remote("browser-host.example:443") is True
|
||||
assert remote_registry.load_remotes() == {}
|
||||
|
||||
def test_resolve_remote_endpoint_prefers_remembered_explicit_port(monkeypatch, tmp_path):
|
||||
path = tmp_path / "remotes.json"
|
||||
monkeypatch.setattr(remote_registry, "REMOTE_REGISTRY_PATH", path)
|
||||
path.write_text(json.dumps({"browser-host.example": {}, "browser-host.example:8765": {}}), encoding="utf-8")
|
||||
|
||||
assert remote_registry.resolve_remote_endpoint("browser-host.example") == "browser-host.example:8765"
|
||||
|
||||
def test_resolve_remote_endpoint_keeps_bare_domain_without_unique_port_match(monkeypatch, tmp_path):
|
||||
path = tmp_path / "remotes.json"
|
||||
monkeypatch.setattr(remote_registry, "REMOTE_REGISTRY_PATH", path)
|
||||
path.write_text(
|
||||
json.dumps({"browser-host.example:8765": {}, "browser-host.example:9000": {}}),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
assert remote_registry.resolve_remote_endpoint("browser-host.example") == "browser-host.example"
|
||||
|
||||
def test_remote_add_list_remove_cli(monkeypatch, tmp_path):
|
||||
path = tmp_path / "remotes.json"
|
||||
monkeypatch.setattr(remote_registry, "REMOTE_REGISTRY_PATH", path)
|
||||
|
||||
Reference in New Issue
Block a user