mainsequence 9.0.10.dev47__py3-none-any.whl → 9.0.10.dev48__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.
@@ -138,11 +138,14 @@ remain projections of the same identity, not a separate resolver. Outside an
138
138
  authenticated request, including public routes, `User.get_logged_user()` raises
139
139
  `RequestIdentityError`.
140
140
 
141
- On a protected route, this identity is the human making the current HTTP
142
- request. It is not the release creator, deployment owner, runtime workload
143
- principal, or the process account returned by `User.get_authenticated_user_details()`.
144
- Caller authentication is not resource authorization; apply the endpoint's
145
- application policy using the verified user UID.
141
+ On a protected route, this identity is the caller of the current HTTP request:
142
+ a person, or the workload identity a deployed Job, FastAPI release or Agent runs
143
+ as. It is not the release creator, deployment owner, the application's own
144
+ runtime workload principal, or the process account returned by
145
+ `User.get_authenticated_user_details()`. To tell a workload caller from a
146
+ person, read `User.get_by_uid(uid)`: a workload identity has `identity_type`
147
+ `"workload"`. Caller authentication is not resource authorization; apply the
148
+ endpoint's application policy using the verified user UID.
146
149
 
147
150
  WebSockets retain the platform's gateway ticket/header contract rather than
148
151
  the HTTP Bearer/assertion flow; the getter is available while the authenticated
@@ -23,14 +23,21 @@ from .value_sets import OpenValueSet
23
23
 
24
24
 
25
25
  class RequestUserIdentity(BaseModel):
26
- """Minimal identity of the human making the current runtime request."""
26
+ """Minimal identity of the caller of the current runtime request.
27
+
28
+ The caller is a person or a workload identity; ``User.get_by_uid(uid)``
29
+ reads its User.
30
+ """
27
31
 
28
32
  model_config = ConfigDict(extra="forbid", frozen=True)
29
33
 
30
34
  uid: str = Field(
31
35
  ...,
32
36
  title="User UID",
33
- description="Canonical public UUID of the human making the current request.",
37
+ description=(
38
+ "Canonical public UUID of the User making the current request, a person or a "
39
+ "workload identity."
40
+ ),
34
41
  )
35
42
  username: str | None = Field(
36
43
  None,
@@ -954,6 +961,17 @@ class ShareableAccessState(BasePydanticModel):
954
961
 
955
962
 
956
963
  class User(UserApiBaseObjectOrm, BasePydanticModel):
964
+ """A platform User: a person, or the workload identity a deployed Job,
965
+ FastAPI release or Agent runs as.
966
+
967
+ A workload identity is read with ``User.get_by_uid(uid)`` or listed with
968
+ ``User.filter(identity_type="workload")``. Its row carries ``uid``,
969
+ ``identity_type`` (``"workload"``), ``is_active`` and the UID of its
970
+ workload in ``job_uid``, ``resource_release_uid`` or ``agent_uid``, without
971
+ a username, email, join date or name. Fields the row does not carry are
972
+ ``None``, or empty for lists.
973
+ """
974
+
957
975
  # Platform facts, not application authorization policy. None means the
958
976
  # connected platform has not supplied the versioned additive contract.
959
977
  is_organization_admin: StrictBool | None = None
@@ -963,6 +981,7 @@ class User(UserApiBaseObjectOrm, BasePydanticModel):
963
981
  FILTERSET_FIELDS: ClassVar[dict[str, list[str]] | None] = {
964
982
  "uid": ["exact", "in"],
965
983
  "email": ["exact", "contains", "in"],
984
+ "identity_type": ["exact"],
966
985
  }
967
986
  FILTER_VALUE_NORMALIZERS: ClassVar[dict[str, str]] = {
968
987
  "uid": "uid",
@@ -970,6 +989,7 @@ class User(UserApiBaseObjectOrm, BasePydanticModel):
970
989
  "email": "str",
971
990
  "email__contains": "str",
972
991
  "email__in": "str",
992
+ "identity_type": "str",
973
993
  }
974
994
 
975
995
  id: int | None = Field(
@@ -985,6 +1005,35 @@ class User(UserApiBaseObjectOrm, BasePydanticModel):
985
1005
  description="Stable public unique identifier of the user.",
986
1006
  examples=["8f5d6b54-2f5e-4a8b-bb10-0b17f3f4c123"],
987
1007
  )
1008
+ identity_type: (
1009
+ OpenValueSet[Literal["human", "service_account", "deleted_user", "workload"]] | None
1010
+ ) = Field(
1011
+ None,
1012
+ title="Identity Type",
1013
+ description=(
1014
+ "Kind of identity: `workload` for the identity a deployed Job, FastAPI release "
1015
+ "or Agent runs as. None when the response does not carry it."
1016
+ ),
1017
+ examples=["workload"],
1018
+ )
1019
+ job_uid: str | None = Field(
1020
+ None,
1021
+ title="Job UID",
1022
+ description="UID of the Job a workload identity belongs to; None otherwise.",
1023
+ examples=["88888888-8888-4888-8888-888888888888"],
1024
+ )
1025
+ resource_release_uid: str | None = Field(
1026
+ None,
1027
+ title="Resource Release UID",
1028
+ description="UID of the release a workload identity belongs to; None otherwise.",
1029
+ examples=[None],
1030
+ )
1031
+ agent_uid: str | None = Field(
1032
+ None,
1033
+ title="Agent UID",
1034
+ description="UID of the Agent a workload identity belongs to; None otherwise.",
1035
+ examples=[None],
1036
+ )
988
1037
  profile_picture: str | None = Field(
989
1038
  None,
990
1039
  title="Profile Picture URL",
@@ -1022,10 +1071,13 @@ class User(UserApiBaseObjectOrm, BasePydanticModel):
1022
1071
  examples=["enterprise"],
1023
1072
  )
1024
1073
 
1025
- date_joined: datetime.datetime = Field(
1026
- ...,
1074
+ date_joined: datetime.datetime | None = Field(
1075
+ None,
1027
1076
  title="Date Joined",
1028
- description="Timestamp when the user account was created.",
1077
+ description=(
1078
+ "Timestamp when the user account was created. None when the response does not "
1079
+ "carry it, as for a workload identity."
1080
+ ),
1029
1081
  examples=["2025-01-10T08:15:00Z"],
1030
1082
  )
1031
1083
  is_active: bool = Field(
@@ -1034,16 +1086,22 @@ class User(UserApiBaseObjectOrm, BasePydanticModel):
1034
1086
  description="Whether the user account is active.",
1035
1087
  examples=[True],
1036
1088
  )
1037
- username: str = Field(
1038
- ...,
1089
+ username: str | None = Field(
1090
+ None,
1039
1091
  title="Username",
1040
- description="Unique username used by the platform.",
1092
+ description=(
1093
+ "Unique username used by the platform. None when the response does not carry it, "
1094
+ "as for a workload identity."
1095
+ ),
1041
1096
  examples=["jose@main-sequence.io"],
1042
1097
  )
1043
- email: str = Field(
1044
- ...,
1098
+ email: str | None = Field(
1099
+ None,
1045
1100
  title="Email",
1046
- description="Primary email address of the user.",
1101
+ description=(
1102
+ "Primary email address of the user. None when the response does not carry it, "
1103
+ "as for a workload identity."
1104
+ ),
1047
1105
  examples=["jose@main-sequence.io"],
1048
1106
  )
1049
1107
  first_name: str | None = Field(
@@ -1064,16 +1122,22 @@ class User(UserApiBaseObjectOrm, BasePydanticModel):
1064
1122
  description="Timestamp of the last successful login.",
1065
1123
  examples=["2026-03-15T11:20:00Z"],
1066
1124
  )
1067
- api_request_limit: int = Field(
1068
- ...,
1125
+ api_request_limit: int | None = Field(
1126
+ None,
1069
1127
  title="API Request Limit",
1070
- description="Maximum number of API requests available to the user in the current limit window.",
1128
+ description=(
1129
+ "Maximum number of API requests available to the user in the current limit "
1130
+ "window. None when the response does not carry it, as for a workload identity."
1131
+ ),
1071
1132
  examples=[10000],
1072
1133
  )
1073
- mfa_enabled: bool = Field(
1074
- ...,
1134
+ mfa_enabled: bool | None = Field(
1135
+ None,
1075
1136
  title="MFA Enabled",
1076
- description="Whether multi-factor authentication is enabled for the user.",
1137
+ description=(
1138
+ "Whether multi-factor authentication is enabled for the user. None when the "
1139
+ "response does not carry it, as for a workload identity."
1140
+ ),
1077
1141
  examples=[True],
1078
1142
  )
1079
1143
  organization: Organization | None = Field(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mainsequence
3
- Version: 9.0.10.dev47
3
+ Version: 9.0.10.dev48
4
4
  Summary: Main Sequence SDK
5
5
  Author-email: Main Sequence GmbH <dev@main-sequence.io>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  agent_scaffold/AGENTS.md,sha256=W91rpnyQuoQIa-3dsebIYyuwnbGLvkmuq_8X5k2hTAw,6399
2
2
  agent_scaffold/skills/a2a_sdk_execution/SKILL.md,sha256=NKtcXibE8TxZzKzz1KzJ2cVZ_EeuJJkb660U6wLvZ3s,11809
3
- agent_scaffold/skills/application_surfaces/api_surfaces/SKILL.md,sha256=GdbPjIf4xMs5Pz6VrjAwBBePkc7rC3P57s70PNjYZWU,15997
3
+ agent_scaffold/skills/application_surfaces/api_surfaces/SKILL.md,sha256=BUaqO3MkZ-d5sdh2xNPNQ904aO3RIJZfQW54FhDRxkc,16225
4
4
  agent_scaffold/skills/mainsequence-inference/SKILL.md,sha256=yv8aAHLQ2FBBSWPIFadY7pGNTwtR-yiR_-UzaGRN9-g,12502
5
5
  agent_scaffold/skills/maintenance/bug_auditor/SKILL.md,sha256=CCKs7edyZ9RK-WtAgXJXucokJFXZxk8sRUe0_imFtu8,8610
6
6
  agent_scaffold/skills/maintenance/code_repository_maintenance/SKILL.md,sha256=pPsZaERlfokSJ6b6vLjpA5U0KuKxbOFzzcxOVW_ikiI,17935
@@ -45,7 +45,7 @@ mainsequence/client/github_issues.py,sha256=pSTUw3UPrmE6wqnpoJctartTaNSq6iu6PQRr
45
45
  mainsequence/client/inference.py,sha256=tYKHRxLR6mA5iLmgd3qURwweWc2OPQuw0__tD3LQgSI,7748
46
46
  mainsequence/client/models_foundry.py,sha256=JwQdPLDSO4dZI-KC0SUdmN6izmNIKMb9IzZlYXy0Mig,36488
47
47
  mainsequence/client/models_helpers.py,sha256=vwZdQhEQZBCxXojP9-DxhdRc-TlceWz4lTqQQnT05Ms,46465
48
- mainsequence/client/models_user.py,sha256=co9uhe-LKkt7Kw5u8-wDMWcp0yL_lS2LuUOyauW5KF0,38557
48
+ mainsequence/client/models_user.py,sha256=fD0PZ0raeaTz-E08mVCMeM0RmKGAgI8TxOYwU5CMMoY,40963
49
49
  mainsequence/client/observability.py,sha256=_WrDKCaNk_TXmKElKCXC1inork6Exxxe8FRY4m1GI9s,16008
50
50
  mainsequence/client/utils.py,sha256=d6lXJPAOe683gb-ph9x0GJcvK5c5Pg9gr90ihDgQGug,32484
51
51
  mainsequence/client/value_sets.py,sha256=7TA-mpuAd3hOduNgO1WTQQTuNOGaFgue-VqCsDWKaC8,6181
@@ -54,9 +54,9 @@ mainsequence/instrumentation/utils.py,sha256=b-ihjSioAepeLfMpudM2SqCtvnxMqIXileH
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.10.dev47.dist-info/licenses/LICENSE,sha256=b6Ecsk8wjsEby3lbSzdljR6hHiFGHBizt9iWV2p1c_I,1074
58
- mainsequence-9.0.10.dev47.dist-info/METADATA,sha256=t0hclwLjy2rK78xGkVSr9-JGEpOpE77iTfe0s-ZP-tQ,7403
59
- mainsequence-9.0.10.dev47.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
60
- mainsequence-9.0.10.dev47.dist-info/entry_points.txt,sha256=XGAOq3-mF2lWWpeRJvoaWyMarRcK167mH1g124aGdUs,88
61
- mainsequence-9.0.10.dev47.dist-info/top_level.txt,sha256=BFeblM_Q9q0cUWBvTxnfWcWQEHtf5XZi9nOS-Gdfwus,28
62
- mainsequence-9.0.10.dev47.dist-info/RECORD,,
57
+ mainsequence-9.0.10.dev48.dist-info/licenses/LICENSE,sha256=b6Ecsk8wjsEby3lbSzdljR6hHiFGHBizt9iWV2p1c_I,1074
58
+ mainsequence-9.0.10.dev48.dist-info/METADATA,sha256=ozfGPFF2jw8BHsmJMoRdGXanBzDnthptLoTBs6t0Bss,7403
59
+ mainsequence-9.0.10.dev48.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
60
+ mainsequence-9.0.10.dev48.dist-info/entry_points.txt,sha256=XGAOq3-mF2lWWpeRJvoaWyMarRcK167mH1g124aGdUs,88
61
+ mainsequence-9.0.10.dev48.dist-info/top_level.txt,sha256=BFeblM_Q9q0cUWBvTxnfWcWQEHtf5XZi9nOS-Gdfwus,28
62
+ mainsequence-9.0.10.dev48.dist-info/RECORD,,