MCPcopy Index your code
hub / github.com/github/spec-kit / _load_config

Function _load_config

src/specify_cli/authentication/http.py:28–51  ·  view source on GitHub ↗

Load auth config, using override if set (for testing). The result is cached per-process so ``auth.json`` is read at most once, and any warning about a malformed file fires only once.

()

Source from the content-addressed store, hash-verified

26
27
28def _load_config() -> list[AuthConfigEntry]:
29 """Load auth config, using override if set (for testing).
30
31 The result is cached per-process so ``auth.json`` is read at most once,
32 and any warning about a malformed file fires only once.
33 """
34 global _config_cache
35 if _config_override is not None:
36 return _config_override
37 if _config_cache is not None:
38 return _config_cache
39 try:
40 _config_cache = load_auth_config()
41 except (ValueError, OSError) as exc:
42 import warnings
43 config_path = _default_config_path()
44 warnings.warn(
45 f"Failed to load {config_path}: {exc}. "
46 "All requests will be unauthenticated.",
47 UserWarning,
48 stacklevel=2,
49 )
50 _config_cache = []
51 return _config_cache
52
53
54def _hostname_in_hosts(hostname: str, hosts: tuple[str, ...]) -> bool:

Callers 3

build_requestFunction · 0.85
github_provider_hostsFunction · 0.85
open_urlFunction · 0.85

Calls 2

load_auth_configFunction · 0.85
_default_config_pathFunction · 0.85

Tested by

no test coverage detected