miso-client 5.2.3__tar.gz → 5.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. {miso_client-5.2.3 → miso_client-5.2.4}/CHANGELOG.md +11 -0
  2. {miso_client-5.2.3/miso_client.egg-info → miso_client-5.2.4}/PKG-INFO +1 -1
  3. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/__init__.py +1 -1
  4. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/models/bootstrap.py +29 -4
  5. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/bootstrap_transport.py +26 -7
  6. {miso_client-5.2.3 → miso_client-5.2.4/miso_client.egg-info}/PKG-INFO +1 -1
  7. {miso_client-5.2.3 → miso_client-5.2.4}/pyproject.toml +1 -1
  8. {miso_client-5.2.3 → miso_client-5.2.4}/setup.py +1 -1
  9. {miso_client-5.2.3 → miso_client-5.2.4}/LICENSE +0 -0
  10. {miso_client-5.2.3 → miso_client-5.2.4}/MANIFEST.in +0 -0
  11. {miso_client-5.2.3 → miso_client-5.2.4}/README.md +0 -0
  12. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/__init__.py +0 -0
  13. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/applications_api.py +0 -0
  14. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/auth_api.py +0 -0
  15. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/logs_api.py +0 -0
  16. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/logs_stats_api.py +0 -0
  17. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/logs_stats_delegation_mixin.py +0 -0
  18. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/permissions_api.py +0 -0
  19. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/response_utils.py +0 -0
  20. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/roles_api.py +0 -0
  21. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/types/__init__.py +0 -0
  22. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/types/applications_types.py +0 -0
  23. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/types/auth_types.py +0 -0
  24. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/types/logs_types.py +0 -0
  25. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/types/permissions_types.py +0 -0
  26. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/api/types/roles_types.py +0 -0
  27. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/client.py +0 -0
  28. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/errors.py +0 -0
  29. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/models/__init__.py +0 -0
  30. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/models/config.py +0 -0
  31. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/models/encryption.py +0 -0
  32. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/models/error_response.py +0 -0
  33. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/models/filter.py +0 -0
  34. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/models/filter_schema.py +0 -0
  35. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/models/pagination.py +0 -0
  36. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/models/session_cookie.py +0 -0
  37. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/models/sort.py +0 -0
  38. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/py.typed +0 -0
  39. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/__init__.py +0 -0
  40. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/application_context.py +0 -0
  41. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/auth.py +0 -0
  42. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/auth_flow_helpers.py +0 -0
  43. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/auth_token_cache.py +0 -0
  44. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/auth_user_cache.py +0 -0
  45. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/authorization_mixin.py +0 -0
  46. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/browser_session_refresh.py +0 -0
  47. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/cache.py +0 -0
  48. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/encryption.py +0 -0
  49. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/logger.py +0 -0
  50. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/logger_chain.py +0 -0
  51. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/permission.py +0 -0
  52. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/redis.py +0 -0
  53. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/role.py +0 -0
  54. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/services/unified_logger.py +0 -0
  55. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/__init__.py +0 -0
  56. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/application_url_resolver.py +0 -0
  57. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/audit_log_queue.py +0 -0
  58. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/auth_cache_helpers.py +0 -0
  59. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/auth_strategy.py +0 -0
  60. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/auth_utils.py +0 -0
  61. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/bootstrap.py +0 -0
  62. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/bootstrap_auth.py +0 -0
  63. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/bootstrap_credentials.py +0 -0
  64. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/bootstrap_request_policy.py +0 -0
  65. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/bootstrap_runtime.py +0 -0
  66. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/bootstrap_snapshot.py +0 -0
  67. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/circuit_breaker.py +0 -0
  68. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/client_token_manager.py +0 -0
  69. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/config_loader.py +0 -0
  70. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/controller_url_resolver.py +0 -0
  71. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/data_masker.py +0 -0
  72. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/environment_token.py +0 -0
  73. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/error_utils.py +0 -0
  74. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/fastapi_endpoints.py +0 -0
  75. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/fastapi_logger_middleware.py +0 -0
  76. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/filter.py +0 -0
  77. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/filter_applier.py +0 -0
  78. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/filter_coercion.py +0 -0
  79. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/filter_parser.py +0 -0
  80. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/filter_schema.py +0 -0
  81. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/flask_endpoints.py +0 -0
  82. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/flask_logger_middleware.py +0 -0
  83. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/http_client.py +0 -0
  84. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/http_client_auth_helpers.py +0 -0
  85. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/http_client_logging.py +0 -0
  86. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/http_client_logging_helpers.py +0 -0
  87. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/http_client_query_helpers.py +0 -0
  88. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/http_client_runtime_helpers.py +0 -0
  89. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/http_error_handler.py +0 -0
  90. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/http_error_sanitizer.py +0 -0
  91. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/http_log_formatter.py +0 -0
  92. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/http_log_masker.py +0 -0
  93. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/internal_http_auth_strategy.py +0 -0
  94. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/internal_http_client.py +0 -0
  95. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/jwt_tools.py +0 -0
  96. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/log_request_transformer.py +0 -0
  97. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/logger_context_storage.py +0 -0
  98. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/logger_helpers.py +0 -0
  99. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/logger_request_helpers.py +0 -0
  100. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/logging_helpers.py +0 -0
  101. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/origin_validator.py +0 -0
  102. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/pagination.py +0 -0
  103. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/request_context.py +0 -0
  104. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/request_target.py +0 -0
  105. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/sensitive_fields_config.json +0 -0
  106. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/sensitive_fields_loader.py +0 -0
  107. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/shared_task.py +0 -0
  108. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/sort.py +0 -0
  109. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/token_utils.py +0 -0
  110. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/unified_logger_factory.py +0 -0
  111. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/url_validator.py +0 -0
  112. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client/utils/user_token_refresh.py +0 -0
  113. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client.egg-info/SOURCES.txt +0 -0
  114. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client.egg-info/dependency_links.txt +0 -0
  115. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client.egg-info/not-zip-safe +0 -0
  116. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client.egg-info/requires.txt +0 -0
  117. {miso_client-5.2.3 → miso_client-5.2.4}/miso_client.egg-info/top_level.txt +0 -0
  118. {miso_client-5.2.3 → miso_client-5.2.4}/requirements-test.txt +0 -0
  119. {miso_client-5.2.3 → miso_client-5.2.4}/requirements.txt +0 -0
  120. {miso_client-5.2.3 → miso_client-5.2.4}/setup.cfg +0 -0
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [5.2.4] - 2026-12-02
11
+
12
+ ### Added
13
+
14
+ - `BootstrapError.try_outcomes` names each transport try of a failed bootstrap fetch, in
15
+ order (past six, the last six): `http-<status>` or the exception class as
16
+ `<root module>.<ClassName>` (for example `httpx.ConnectError`, `builtins.TimeoutError`). An application can now tell a
17
+ refused connection from a timeout, a TLS failure or an HTTP answer. Only entries matching that
18
+ fixed pattern are kept, so the field never holds a message, a URL or a value; it is `()` for
19
+ errors that made no try.
20
+
10
21
  ## [5.2.3] - 2026-11-12
11
22
 
12
23
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: miso-client
3
- Version: 5.2.3
3
+ Version: 5.2.4
4
4
  Summary: Python client SDK for AI Fabrix authentication, authorization, and logging
5
5
  Home-page: https://github.com/aifabrix/miso-client-python
6
6
  Author: AI Fabrix Team
@@ -165,7 +165,7 @@ from .utils.user_token_refresh import (
165
165
  normalize_expires_at,
166
166
  )
167
167
 
168
- __version__ = "5.2.3"
168
+ __version__ = "5.2.4"
169
169
  __author__ = "AI Fabrix Team"
170
170
  __license__ = "MIT"
171
171
 
@@ -2,8 +2,9 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import re
5
6
  from abc import ABC, abstractmethod
6
- from typing import Callable, Literal, Optional, Tuple
7
+ from typing import Callable, Iterable, Literal, Optional, Tuple
7
8
 
8
9
  from pydantic import BaseModel, ConfigDict, Field
9
10
 
@@ -37,13 +38,37 @@ SAFE_ERROR_CODES = frozenset(
37
38
  )
38
39
 
39
40
 
40
- class BootstrapError(MisoClientError):
41
- """Safe bootstrap failure with a fixed category and no transport payload."""
41
+ # One transport try: an HTTP status or an exception class as `<root module>.<ClassName>`.
42
+ TRY_OUTCOME_PATTERN = re.compile(
43
+ r"^(http-[1-5][0-9]{2}|[A-Za-z_][A-Za-z0-9_]*\.[A-Za-z_][A-Za-z0-9_]*)$"
44
+ )
45
+ # A fetch is at most two exchanges (mint, snapshot) of three tries each; the budget running out
46
+ # can name a seventh, so the last six are kept.
47
+ MAX_TRY_OUTCOMES = 6
42
48
 
43
- def __init__(self, code: str, status_code: Optional[int] = None):
49
+
50
+ class BootstrapError(MisoClientError):
51
+ """Safe bootstrap failure with a fixed category and no transport payload.
52
+
53
+ `try_outcomes` names each transport try of the failed fetch, in order: `http-<status>` or the
54
+ exception class. Past six tries the last six are kept, so the final cause stays. Only entries
55
+ matching the token pattern are kept, so it never holds a message, a URL or a value.
56
+ """
57
+
58
+ def __init__(
59
+ self,
60
+ code: str,
61
+ status_code: Optional[int] = None,
62
+ try_outcomes: Iterable[object] = (),
63
+ ):
44
64
  code = code if code in SAFE_ERROR_CODES else "operation-failed"
45
65
  super().__init__("Secret runtime operation failed: " + code, status_code=status_code)
46
66
  self.code = code
67
+ self.try_outcomes: Tuple[str, ...] = tuple(
68
+ entry
69
+ for entry in try_outcomes
70
+ if isinstance(entry, str) and TRY_OUTCOME_PATTERN.match(entry)
71
+ )[-MAX_TRY_OUTCOMES:]
47
72
 
48
73
 
49
74
  class ApplicationTokenProvider(ABC):
@@ -12,11 +12,21 @@ from typing import Optional
12
12
  import httpx
13
13
  from pydantic import SecretStr
14
14
 
15
- from ..models.bootstrap import BootstrapError
15
+ from ..models.bootstrap import TRY_OUTCOME_PATTERN, BootstrapError
16
16
  from .bootstrap_credentials import parse_minted_token, validate_credentials, validate_http_client
17
17
  from .bootstrap_snapshot import MAX_BODY, SnapshotClock
18
18
 
19
19
  RETRY_STATUS = {429, 502, 503, 504}
20
+ TRY_SECONDS = 5
21
+ FETCH_BUDGET_SECONDS = 30
22
+ _OTHER_TOKEN = "other.Exception"
23
+
24
+
25
+ def try_outcome_token(error: BaseException) -> str:
26
+ """Name a failed try by its exception class only: `<root module>.<ClassName>`."""
27
+ kind = type(error)
28
+ token = f"{kind.__module__.split('.')[0]}.{kind.__name__}"
29
+ return token if TRY_OUTCOME_PATTERN.match(token) else _OTHER_TOKEN
20
30
 
21
31
 
22
32
  def _tls_failure(error: BaseException) -> bool:
@@ -73,6 +83,7 @@ class BrokerTransport:
73
83
  self._mint_deadline = 0.0
74
84
  self._snapshot_clock: Optional[SnapshotClock] = None
75
85
  self._closed = False
86
+ self._outcomes: list[str] = []
76
87
  self._owned = http_client is None
77
88
  self.client = http_client or httpx.AsyncClient(
78
89
  timeout=5, follow_redirects=False, trust_env=False
@@ -96,12 +107,17 @@ class BrokerTransport:
96
107
  async def fetch(self) -> bytes:
97
108
  """Fetch within a total budget, sanitizing every transport error."""
98
109
  failure: Optional[BootstrapError] = None
110
+ self._outcomes = []
99
111
  try:
100
- return await asyncio.wait_for(self._fetch(), timeout=30)
112
+ return await asyncio.wait_for(self._fetch(), timeout=FETCH_BUDGET_SECONDS)
101
113
  except BootstrapError as error:
102
- failure = BootstrapError(error.code, error.status_code)
103
- except Exception:
104
- failure = BootstrapError("temporarily-unavailable")
114
+ failure = BootstrapError(error.code, error.status_code, self._outcomes)
115
+ except Exception as error:
116
+ # The budget running out, or an error no try caught: named once, by class only.
117
+ token = try_outcome_token(error)
118
+ if not self._outcomes or self._outcomes[-1] != token:
119
+ self._outcomes.append(token)
120
+ failure = BootstrapError("temporarily-unavailable", None, self._outcomes)
105
121
  raise failure
106
122
 
107
123
  async def _fetch(self) -> bytes:
@@ -126,10 +142,12 @@ class BrokerTransport:
126
142
  async def _attempt(self, mint: bool, attempt: int) -> tuple[Optional[bytes], float]:
127
143
  retry = False
128
144
  try:
129
- return await asyncio.wait_for(self._request(mint, attempt), timeout=5)
145
+ return await asyncio.wait_for(self._request(mint, attempt), timeout=TRY_SECONDS)
130
146
  except httpx.NetworkError as error:
147
+ self._outcomes.append(try_outcome_token(error))
131
148
  retry = not _tls_failure(error)
132
- except (httpx.TimeoutException, asyncio.TimeoutError):
149
+ except (httpx.TimeoutException, asyncio.TimeoutError) as error:
150
+ self._outcomes.append(try_outcome_token(error))
133
151
  retry = True
134
152
  if not retry:
135
153
  raise BootstrapError("transport-error")
@@ -181,6 +199,7 @@ class BrokerTransport:
181
199
  async def _read_response(
182
200
  self, response: httpx.Response, expected: int, attempt: int
183
201
  ) -> tuple[Optional[bytes], float]:
202
+ self._outcomes.append(f"http-{response.status_code}")
184
203
  if response.status_code in (401, 403):
185
204
  raise BootstrapError("authorization-denied", response.status_code)
186
205
  if response.status_code in RETRY_STATUS:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: miso-client
3
- Version: 5.2.3
3
+ Version: 5.2.4
4
4
  Summary: Python client SDK for AI Fabrix authentication, authorization, and logging
5
5
  Home-page: https://github.com/aifabrix/miso-client-python
6
6
  Author: AI Fabrix Team
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "miso-client"
7
- version = "5.2.3"
7
+ version = "5.2.4"
8
8
  description = "Python client SDK for AI Fabrix authentication, authorization, and logging"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -8,7 +8,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
8
8
 
9
9
  setup(
10
10
  name="miso-client",
11
- version="5.2.3",
11
+ version="5.2.4",
12
12
  author="AI Fabrix Team",
13
13
  author_email="team@aifabrix.ai",
14
14
  description="Python client SDK for AI Fabrix authentication, authorization, and logging",
File without changes
File without changes
File without changes
File without changes