mainsequence 9.0.8.dev45__py3-none-any.whl → 9.0.9.dev46__py3-none-any.whl

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.
@@ -15,7 +15,7 @@ import threading
15
15
  import time
16
16
  import webbrowser
17
17
  from collections.abc import Callable
18
- from dataclasses import dataclass
18
+ from dataclasses import dataclass, field
19
19
  from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
20
20
  from urllib.parse import parse_qs, urlparse
21
21
 
@@ -37,7 +37,8 @@ class BrowserAuthError(RuntimeError):
37
37
  class BrowserAuthCallback:
38
38
  """Authorization callback payload captured from the local loopback receiver."""
39
39
 
40
- code: str | None = None
40
+ # The authorization code is a bearer credential: it stays out of repr() and str().
41
+ code: str | None = field(default=None, repr=False)
41
42
  state: str | None = None
42
43
  error: str | None = None
43
44
  error_description: str | None = None
@@ -353,7 +353,8 @@ class AgentRuntimePresence(BasePydanticModel):
353
353
 
354
354
 
355
355
  class AgentSessionRuntimeAccess(BasePydanticModel):
356
- model_config = ConfigDict(extra="allow")
356
+ # A validation error must not echo the input: it holds the bearer token.
357
+ model_config = ConfigDict(extra="allow", hide_input_in_errors=True)
357
358
 
358
359
  coding_agent_service_uid: str | None = Field(
359
360
  None,
@@ -373,6 +374,7 @@ class AgentSessionRuntimeAccess(BasePydanticModel):
373
374
  token: str | None = Field(
374
375
  None,
375
376
  description="Bearer token that authorizes calls to the coding-agent gateway.",
377
+ repr=False,
376
378
  )
377
379
  expires_at: str | None = Field(
378
380
  None,
@@ -7,7 +7,7 @@ from uuid import UUID
7
7
 
8
8
  import yaml
9
9
  from cachetools import TTLCache, cachedmethod
10
- from pydantic import Field, SecretStr
10
+ from pydantic import ConfigDict, Field, SecretStr
11
11
 
12
12
  from .base import (
13
13
  BaseObjectOrm,
@@ -891,6 +891,10 @@ class Secret(
891
891
  BasePydanticModel,
892
892
  BaseObjectOrm,
893
893
  ):
894
+ # `value` is a SecretStr once read, but a validation error would echo the
895
+ # plaintext it was given.
896
+ model_config = ConfigDict(hide_input_in_errors=True)
897
+
894
898
  HYDRATE_FILTER_GET_FROM_DETAIL: ClassVar[bool] = True
895
899
  FILTERSET_FIELDS: ClassVar[dict[str, list[str]]] = {
896
900
  "uid": ["in", "exact"],
@@ -6,7 +6,7 @@ from decimal import Decimal
6
6
  from typing import Any, ClassVar, Literal
7
7
  from uuid import UUID
8
8
 
9
- from pydantic import BaseModel, Field, PositiveInt
9
+ from pydantic import BaseModel, ConfigDict, Field, PositiveInt
10
10
 
11
11
  from .base import (
12
12
  BaseObjectOrm,
@@ -798,6 +798,10 @@ class ResourceReleaseRuntimePresence(BasePydanticModel):
798
798
 
799
799
 
800
800
  class ResourceReleaseRuntimeAccess(BasePydanticModel):
801
+ # `access` holds the runtime's bearer token, so neither repr() nor a
802
+ # validation error shows it.
803
+ model_config = ConfigDict(hide_input_in_errors=True)
804
+
801
805
  resource_release_uid: str
802
806
  # The canonical vocabulary ResourceRelease.release_kind reads (#119): this
803
807
  # payload names a release kind, so it names it the same way.
@@ -805,7 +809,7 @@ class ResourceReleaseRuntimeAccess(BasePydanticModel):
805
809
  routing: ResourceReleaseRuntimeRouting
806
810
  runtime_access: ResourceReleaseRuntimeAdmission
807
811
  runtime_presence: ResourceReleaseRuntimePresence
808
- access: dict[str, Any] | None = None
812
+ access: dict[str, Any] | None = Field(default=None, repr=False)
809
813
 
810
814
 
811
815
  class ResourceRelease(
@@ -278,8 +278,9 @@ class BaseAuthProvider:
278
278
 
279
279
  @dataclass
280
280
  class SessionJWTAuthProvider(BaseAuthProvider):
281
- access_token: str | None = None
282
- refresh_token: str | None = None
281
+ # Tokens stay out of repr() and str(), so logging the provider never shows them.
282
+ access_token: str | None = field(default=None, repr=False)
283
+ refresh_token: str | None = field(default=None, repr=False)
283
284
  header_keyword: str = "Bearer"
284
285
 
285
286
  def __post_init__(self):
@@ -324,12 +325,13 @@ class RuntimeCredentialAuthProvider(BaseAuthProvider):
324
325
  `MAINSEQUENCE_RUNTIME_IDENTITY_TOKEN_FILE` is set: the file is read for every
325
326
  exchange, and `MAINSEQUENCE_RUNTIME_CREDENTIAL_SECRET` is never read or sent.
326
327
  Otherwise the proof is that bootstrap secret. The token is never kept on the
327
- provider. Throttled (`429`) and temporarily unavailable (`503`) exchanges are
328
- retried within the timeout budget; a rejected one (`401`) fails at once.
328
+ provider, and the secret is left out of `repr()` and `str()`. Throttled
329
+ (`429`) and temporarily unavailable (`503`) exchanges are retried within the
330
+ timeout budget; a rejected one (`401`) fails at once.
329
331
  """
330
332
 
331
333
  credential_id: str | None = None
332
- credential_secret: str | None = None
334
+ credential_secret: str | None = field(default=None, repr=False)
333
335
  token_url: str | None = None
334
336
  token_type: str = "Bearer"
335
337
  refresh_skew_seconds: int = 30
@@ -481,8 +483,9 @@ class RuntimeCredentialAuthProvider(BaseAuthProvider):
481
483
 
482
484
  @dataclass
483
485
  class JWTAuthProvider(BaseAuthProvider):
484
- access_token: str | None = None
485
- refresh_token: str | None = None
486
+ # Tokens stay out of repr() and str(), so logging the provider never shows them.
487
+ access_token: str | None = field(default=None, repr=False)
488
+ refresh_token: str | None = field(default=None, repr=False)
486
489
  refresh_url: str | None = None
487
490
  obtain_url: str | None = None
488
491
  header_keyword: str = "Bearer"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mainsequence
3
- Version: 9.0.8.dev45
3
+ Version: 9.0.9.dev46
4
4
  Summary: Main Sequence SDK
5
5
  Author-email: Main Sequence GmbH <dev@main-sequence.io>
6
6
  License-Expression: MIT
@@ -22,7 +22,7 @@ mainsequence/runtime_flags.py,sha256=1eTM7VRRhnuZ_GXcmFhqAmdEKwyQYMyZcPsio88vJRQ
22
22
  mainsequence/scaffold_skills.py,sha256=k0V6eKC5AwbHr9wB9UGMJNF-8eJ0_1izF4-BU01KHrg,10606
23
23
  mainsequence/cli/__init__.py,sha256=sMWTnomCaISjnureLuXFRqOzkH2Y77uYEivsd-M6_8Y,28
24
24
  mainsequence/cli/api.py,sha256=emn5UsIpQ0qvGLnW7MpNPYenQZjR4NJ6SGDKmLo6gHk,127404
25
- mainsequence/cli/browser_auth.py,sha256=C-Sbpt0Pr9Pv3Z9dO80TMk7zPcaaZ-4zvW0tbRVMrTU,9863
25
+ mainsequence/cli/browser_auth.py,sha256=Vb5MBOnPC05HLZzVNUDODobJ_p5wEIzH_h8rIlpShlE,9984
26
26
  mainsequence/cli/cli.py,sha256=zo3ptVxluTYAIeIAluGQPwgFY-_vr0SO3BthCGuVK-0,268962
27
27
  mainsequence/cli/code_repository_status.py,sha256=SHEnU8YSWFowPG6dEdE4Yd8CS1tIcJSE1MXFLfvD3Os,5975
28
28
  mainsequence/cli/config.py,sha256=Q4aGhSLxSeSjX2HqGgPDGg9kNAvrLhIBzWUJ-pY4lPg,45567
@@ -36,27 +36,27 @@ mainsequence/cli/ssh_utils.py,sha256=m7HgFHZQ545sxY9igfQLpaNjWHm4SiN9VwCkAuGy2yw
36
36
  mainsequence/cli/ui.py,sha256=memd6pmjALfGj8zndGCx_z80ztQeqTcOvcofU0un34U,2277
37
37
  mainsequence/client/__init__.py,sha256=lsr9JWxeVqOG0KRoHErW5M40ACPSR7SAEE508dTN5XM,672
38
38
  mainsequence/client/_transport.py,sha256=l2xkbJ21SbrJhzgOf58Yikxg-uzOQPyo-H5hENdCBo8,5374
39
- mainsequence/client/agent_runtime_models.py,sha256=lay0DN3lN5p6-3ajVsaHvPgcmrURFwrNfTb6upoImm4,66642
39
+ mainsequence/client/agent_runtime_models.py,sha256=tsjs71If9B7CJOx7YoEYg9l9_NOxAW3EPLX1wSF3rCU,66766
40
40
  mainsequence/client/base.py,sha256=T3k3xptM09TreiVogrxAPWoIy8zM6Dtn3Cbwsnb33ag,42678
41
41
  mainsequence/client/client.py,sha256=Jaw9RYObdVDS5J2O0pln99-XpuW9e4vW-SsbJRNldfw,3866
42
42
  mainsequence/client/compute_validation.py,sha256=ByeX0CkIE7qq06ggZFfN92U3Qp2e9cvo2RTIGWa5_Vw,6662
43
43
  mainsequence/client/exceptions.py,sha256=xx2L4l3OMNsTybbYkiTKK398ahnutEascM0It35tGr0,3815
44
44
  mainsequence/client/github_issues.py,sha256=pSTUw3UPrmE6wqnpoJctartTaNSq6iu6PQRrd8hip6I,14568
45
45
  mainsequence/client/inference.py,sha256=g24H9LWumMRABIevho8FS7BBOuyYvf80pRwCmJZpLeY,7353
46
- mainsequence/client/models_foundry.py,sha256=iN1jJzDokfniEQF0Ac5eepAB7L5pVjJnKavaHLP7BHA,36310
47
- mainsequence/client/models_helpers.py,sha256=y7cgcsH8yO3dfIWPhRdcYam7ItWHw3Ps63-WYDe4YHE,46262
46
+ mainsequence/client/models_foundry.py,sha256=JwQdPLDSO4dZI-KC0SUdmN6izmNIKMb9IzZlYXy0Mig,36488
47
+ mainsequence/client/models_helpers.py,sha256=vwZdQhEQZBCxXojP9-DxhdRc-TlceWz4lTqQQnT05Ms,46465
48
48
  mainsequence/client/models_user.py,sha256=co9uhe-LKkt7Kw5u8-wDMWcp0yL_lS2LuUOyauW5KF0,38557
49
49
  mainsequence/client/observability.py,sha256=_WrDKCaNk_TXmKElKCXC1inork6Exxxe8FRY4m1GI9s,16008
50
- mainsequence/client/utils.py,sha256=wg0tSaAe9R4-LD75_A-G9pf5p43kXZWRqXo6sHL8Q0Y,32123
50
+ mainsequence/client/utils.py,sha256=d6lXJPAOe683gb-ph9x0GJcvK5c5Pg9gr90ihDgQGug,32484
51
51
  mainsequence/client/value_sets.py,sha256=7TA-mpuAd3hOduNgO1WTQQTuNOGaFgue-VqCsDWKaC8,6181
52
52
  mainsequence/instrumentation/__init__.py,sha256=J_9XmfjprElvz0u2t9rTyJT0kFdyKpxdbkdQiaw28_U,316
53
53
  mainsequence/instrumentation/utils.py,sha256=b-ihjSioAepeLfMpudM2SqCtvnxMqIXileHx3klBCQU,3377
54
54
  mainsequence/server/__init__.py,sha256=BHUAhtdWPDRdxX07NYO_6wrBv5mf0GsXflecO52PmUc,73
55
55
  mainsequence/server/caller_assertions.py,sha256=f9jHhVeoFK1ScDCmW8h3lEIU5V7zKw70SUSVV2P7wUI,10975
56
56
  mainsequence/server/fastapi.py,sha256=Y5QB51CRVbuUVRUcWh5GKQ5b5vMPjbs9scioTt684oQ,10712
57
- mainsequence-9.0.8.dev45.dist-info/licenses/LICENSE,sha256=b6Ecsk8wjsEby3lbSzdljR6hHiFGHBizt9iWV2p1c_I,1074
58
- mainsequence-9.0.8.dev45.dist-info/METADATA,sha256=z8ETo9B0eKLTBZxqULrm9ZNkbehM-ObnGFdieIR5WjA,7402
59
- mainsequence-9.0.8.dev45.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
60
- mainsequence-9.0.8.dev45.dist-info/entry_points.txt,sha256=XGAOq3-mF2lWWpeRJvoaWyMarRcK167mH1g124aGdUs,88
61
- mainsequence-9.0.8.dev45.dist-info/top_level.txt,sha256=BFeblM_Q9q0cUWBvTxnfWcWQEHtf5XZi9nOS-Gdfwus,28
62
- mainsequence-9.0.8.dev45.dist-info/RECORD,,
57
+ mainsequence-9.0.9.dev46.dist-info/licenses/LICENSE,sha256=b6Ecsk8wjsEby3lbSzdljR6hHiFGHBizt9iWV2p1c_I,1074
58
+ mainsequence-9.0.9.dev46.dist-info/METADATA,sha256=ZaHroaaeOwrBElz7C46oQ1o6m6iIgE3b-u1Lap3ozPg,7402
59
+ mainsequence-9.0.9.dev46.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
60
+ mainsequence-9.0.9.dev46.dist-info/entry_points.txt,sha256=XGAOq3-mF2lWWpeRJvoaWyMarRcK167mH1g124aGdUs,88
61
+ mainsequence-9.0.9.dev46.dist-info/top_level.txt,sha256=BFeblM_Q9q0cUWBvTxnfWcWQEHtf5XZi9nOS-Gdfwus,28
62
+ mainsequence-9.0.9.dev46.dist-info/RECORD,,