Skip to content

Commit 68707d7

Browse files
authored
Merge pull request #149 from kernel/stainless/release
Release SDK updates
2 parents 265ac16 + db4cb24 commit 68707d7

25 files changed

Lines changed: 825 additions & 135 deletions

api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ Types:
8181
```python
8282
from kernel.types import (
8383
BrowserPoolRef,
84+
BrowserProxy,
85+
BrowserProxyConfig,
86+
BrowserProxyMode,
8487
BrowserUsage,
8588
Profile,
8689
Tags,
@@ -314,6 +317,7 @@ Types:
314317
from kernel.types.auth import (
315318
LoginResponse,
316319
ManagedAuth,
320+
ManagedAuthBrowserConfig,
317321
ManagedAuthCreateRequest,
318322
ManagedAuthTimelineEvent,
319323
ManagedAuthUpdateRequest,

src/kernel/resources/auth/connections.py

Lines changed: 57 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from ...types.auth.submit_fields_response import SubmitFieldsResponse
3434
from ...types.auth.connection_follow_response import ConnectionFollowResponse
3535
from ...types.auth.managed_auth_timeline_event import ManagedAuthTimelineEvent
36+
from ...types.auth.managed_auth_browser_config_param import ManagedAuthBrowserConfigParam
3637

3738
__all__ = ["ConnectionsResource", "AsyncConnectionsResource"]
3839

@@ -66,6 +67,7 @@ def create(
6667
profile_name: str,
6768
allowed_domains: SequenceNotStr[str] | Omit = omit,
6869
auto_reauth: bool | Omit = omit,
70+
browser: ManagedAuthBrowserConfigParam | Omit = omit,
6971
browser_telemetry: Optional[connection_create_params.BrowserTelemetry] | Omit = omit,
7072
credential: connection_create_params.Credential | Omit = omit,
7173
health_check_interval: int | Omit = omit,
@@ -120,9 +122,11 @@ def create(
120122
false, expired sessions are marked as `NEEDS_AUTH` instead of attempting
121123
re-auth. Defaults to true.
122124
123-
browser_telemetry: Browser telemetry configuration used by this connection's browser sessions by
124-
default. Uses the exact create-browser configuration. Can be overridden
125-
per-login.
125+
browser: Default browser configuration for login, reauthentication, and health-check
126+
sessions.
127+
128+
browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
129+
clients.
126130
127131
credential:
128132
Reference to credentials for the auth connection. Use one of:
@@ -133,9 +137,10 @@ def create(
133137
134138
health_check_interval: Interval in seconds between automatic health checks. When set, the system
135139
periodically verifies the authentication status and triggers re-authentication
136-
if needed. Maximum is 86400 (24 hours). Default is 3600 (1 hour). The minimum
137-
depends on your plan: Enterprise: 300 (5 minutes), Startup: 1200 (20 minutes),
138-
Hobbyist: 3600 (1 hour).
140+
if needed. Maximum is 86400 (24 hours). Default is 3600 (1 hour) or your plan
141+
minimum, whichever is larger. The minimum depends on your plan: Enterprise: 300
142+
(5 minutes), Startup: 1200 (20 minutes), Hobbyist: 3600 (1 hour), Free: 21600 (6
143+
hours).
139144
140145
health_checks: Whether to enable periodic health checks. When false, the system will not
141146
automatically verify authentication status, and `auto_reauth` has no effect on
@@ -144,10 +149,7 @@ def create(
144149
145150
login_url: Optional login page URL to skip discovery
146151
147-
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
148-
project as the resource referencing it. When selecting by name, the name must
149-
match exactly one active proxy in the project. Ambiguous names return a 400; use
150-
id for stable references.
152+
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.
151153
152154
record_session: Whether to record browser sessions for this connection by default. Useful for
153155
debugging. Can be overridden per-login. Defaults to false.
@@ -171,6 +173,7 @@ def create(
171173
"profile_name": profile_name,
172174
"allowed_domains": allowed_domains,
173175
"auto_reauth": auto_reauth,
176+
"browser": browser,
174177
"browser_telemetry": browser_telemetry,
175178
"credential": credential,
176179
"health_check_interval": health_check_interval,
@@ -229,6 +232,7 @@ def update(
229232
*,
230233
allowed_domains: SequenceNotStr[str] | Omit = omit,
231234
auto_reauth: bool | Omit = omit,
235+
browser: ManagedAuthBrowserConfigParam | Omit = omit,
232236
browser_telemetry: Optional[connection_update_params.BrowserTelemetry] | Omit = omit,
233237
credential: connection_update_params.Credential | Omit = omit,
234238
health_check_interval: int | Omit = omit,
@@ -260,9 +264,11 @@ def update(
260264
when `health_checks` is false. When false, expired sessions detected by a health
261265
check are marked as `NEEDS_AUTH` instead of attempting re-auth.
262266
263-
browser_telemetry: Browser telemetry configuration used by future browser sessions for this
264-
connection. Uses the exact create-browser configuration. Set enabled to false to
265-
disable telemetry.
267+
browser: Browser configuration updates for future login, reauthentication, and
268+
health-check sessions. Omitted properties remain unchanged.
269+
270+
browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
271+
clients.
266272
267273
credential:
268274
Reference to credentials for the auth connection. Use one of:
@@ -280,10 +286,7 @@ def update(
280286
281287
login_url: Login page URL. Set to empty string to clear.
282288
283-
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
284-
project as the resource referencing it. When selecting by name, the name must
285-
match exactly one active proxy in the project. Ambiguous names return a 400; use
286-
id for stable references.
289+
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.
287290
288291
record_session: Whether to record browser sessions for this connection by default
289292
@@ -305,6 +308,7 @@ def update(
305308
{
306309
"allowed_domains": allowed_domains,
307310
"auto_reauth": auto_reauth,
311+
"browser": browser,
308312
"browser_telemetry": browser_telemetry,
309313
"credential": credential,
310314
"health_check_interval": health_check_interval,
@@ -464,6 +468,7 @@ def login(
464468
self,
465469
id: str,
466470
*,
471+
browser: ManagedAuthBrowserConfigParam | Omit = omit,
467472
browser_telemetry: Optional[connection_login_params.BrowserTelemetry] | Omit = omit,
468473
proxy: connection_login_params.Proxy | Omit = omit,
469474
record_session: bool | Omit = omit,
@@ -481,14 +486,13 @@ def login(
481486
credentials are stored.
482487
483488
Args:
484-
browser_telemetry: Override the connection's default browser telemetry configuration for this
485-
login. When omitted, the connection's browser_telemetry default is used. Uses
486-
the exact create-browser configuration.
489+
browser: Browser configuration override for this login. Omitted properties inherit the
490+
connection defaults.
491+
492+
browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
493+
clients.
487494
488-
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
489-
project as the resource referencing it. When selecting by name, the name must
490-
match exactly one active proxy in the project. Ambiguous names return a 400; use
491-
id for stable references.
495+
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.
492496
493497
record_session: Override the connection's default for recording this login's browser session.
494498
When omitted, the connection's record_session default is used.
@@ -507,6 +511,7 @@ def login(
507511
path_template("/auth/connections/{id}/login", id=id),
508512
body=maybe_transform(
509513
{
514+
"browser": browser,
510515
"browser_telemetry": browser_telemetry,
511516
"proxy": proxy,
512517
"record_session": record_session,
@@ -675,6 +680,7 @@ async def create(
675680
profile_name: str,
676681
allowed_domains: SequenceNotStr[str] | Omit = omit,
677682
auto_reauth: bool | Omit = omit,
683+
browser: ManagedAuthBrowserConfigParam | Omit = omit,
678684
browser_telemetry: Optional[connection_create_params.BrowserTelemetry] | Omit = omit,
679685
credential: connection_create_params.Credential | Omit = omit,
680686
health_check_interval: int | Omit = omit,
@@ -729,9 +735,11 @@ async def create(
729735
false, expired sessions are marked as `NEEDS_AUTH` instead of attempting
730736
re-auth. Defaults to true.
731737
732-
browser_telemetry: Browser telemetry configuration used by this connection's browser sessions by
733-
default. Uses the exact create-browser configuration. Can be overridden
734-
per-login.
738+
browser: Default browser configuration for login, reauthentication, and health-check
739+
sessions.
740+
741+
browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
742+
clients.
735743
736744
credential:
737745
Reference to credentials for the auth connection. Use one of:
@@ -742,9 +750,10 @@ async def create(
742750
743751
health_check_interval: Interval in seconds between automatic health checks. When set, the system
744752
periodically verifies the authentication status and triggers re-authentication
745-
if needed. Maximum is 86400 (24 hours). Default is 3600 (1 hour). The minimum
746-
depends on your plan: Enterprise: 300 (5 minutes), Startup: 1200 (20 minutes),
747-
Hobbyist: 3600 (1 hour).
753+
if needed. Maximum is 86400 (24 hours). Default is 3600 (1 hour) or your plan
754+
minimum, whichever is larger. The minimum depends on your plan: Enterprise: 300
755+
(5 minutes), Startup: 1200 (20 minutes), Hobbyist: 3600 (1 hour), Free: 21600 (6
756+
hours).
748757
749758
health_checks: Whether to enable periodic health checks. When false, the system will not
750759
automatically verify authentication status, and `auto_reauth` has no effect on
@@ -753,10 +762,7 @@ async def create(
753762
754763
login_url: Optional login page URL to skip discovery
755764
756-
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
757-
project as the resource referencing it. When selecting by name, the name must
758-
match exactly one active proxy in the project. Ambiguous names return a 400; use
759-
id for stable references.
765+
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.
760766
761767
record_session: Whether to record browser sessions for this connection by default. Useful for
762768
debugging. Can be overridden per-login. Defaults to false.
@@ -780,6 +786,7 @@ async def create(
780786
"profile_name": profile_name,
781787
"allowed_domains": allowed_domains,
782788
"auto_reauth": auto_reauth,
789+
"browser": browser,
783790
"browser_telemetry": browser_telemetry,
784791
"credential": credential,
785792
"health_check_interval": health_check_interval,
@@ -838,6 +845,7 @@ async def update(
838845
*,
839846
allowed_domains: SequenceNotStr[str] | Omit = omit,
840847
auto_reauth: bool | Omit = omit,
848+
browser: ManagedAuthBrowserConfigParam | Omit = omit,
841849
browser_telemetry: Optional[connection_update_params.BrowserTelemetry] | Omit = omit,
842850
credential: connection_update_params.Credential | Omit = omit,
843851
health_check_interval: int | Omit = omit,
@@ -869,9 +877,11 @@ async def update(
869877
when `health_checks` is false. When false, expired sessions detected by a health
870878
check are marked as `NEEDS_AUTH` instead of attempting re-auth.
871879
872-
browser_telemetry: Browser telemetry configuration used by future browser sessions for this
873-
connection. Uses the exact create-browser configuration. Set enabled to false to
874-
disable telemetry.
880+
browser: Browser configuration updates for future login, reauthentication, and
881+
health-check sessions. Omitted properties remain unchanged.
882+
883+
browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
884+
clients.
875885
876886
credential:
877887
Reference to credentials for the auth connection. Use one of:
@@ -889,10 +899,7 @@ async def update(
889899
890900
login_url: Login page URL. Set to empty string to clear.
891901
892-
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
893-
project as the resource referencing it. When selecting by name, the name must
894-
match exactly one active proxy in the project. Ambiguous names return a 400; use
895-
id for stable references.
902+
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.
896903
897904
record_session: Whether to record browser sessions for this connection by default
898905
@@ -914,6 +921,7 @@ async def update(
914921
{
915922
"allowed_domains": allowed_domains,
916923
"auto_reauth": auto_reauth,
924+
"browser": browser,
917925
"browser_telemetry": browser_telemetry,
918926
"credential": credential,
919927
"health_check_interval": health_check_interval,
@@ -1073,6 +1081,7 @@ async def login(
10731081
self,
10741082
id: str,
10751083
*,
1084+
browser: ManagedAuthBrowserConfigParam | Omit = omit,
10761085
browser_telemetry: Optional[connection_login_params.BrowserTelemetry] | Omit = omit,
10771086
proxy: connection_login_params.Proxy | Omit = omit,
10781087
record_session: bool | Omit = omit,
@@ -1090,14 +1099,13 @@ async def login(
10901099
credentials are stored.
10911100
10921101
Args:
1093-
browser_telemetry: Override the connection's default browser telemetry configuration for this
1094-
login. When omitted, the connection's browser_telemetry default is used. Uses
1095-
the exact create-browser configuration.
1102+
browser: Browser configuration override for this login. Omitted properties inherit the
1103+
connection defaults.
1104+
1105+
browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
1106+
clients.
10961107
1097-
proxy: Proxy selection. Provide either id or name. The proxy must be in the same
1098-
project as the resource referencing it. When selecting by name, the name must
1099-
match exactly one active proxy in the project. Ambiguous names return a 400; use
1100-
id for stable references.
1108+
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.
11011109
11021110
record_session: Override the connection's default for recording this login's browser session.
11031111
When omitted, the connection's record_session default is used.
@@ -1116,6 +1124,7 @@ async def login(
11161124
path_template("/auth/connections/{id}/login", id=id),
11171125
body=await async_maybe_transform(
11181126
{
1127+
"browser": browser,
11191128
"browser_telemetry": browser_telemetry,
11201129
"proxy": proxy,
11211130
"record_session": record_session,

0 commit comments

Comments
 (0)