Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ Types:
```python
from kernel.types import (
BrowserPoolRef,
BrowserProxy,
BrowserProxyConfig,
BrowserProxyMode,
BrowserUsage,
Profile,
Tags,
Expand Down Expand Up @@ -314,6 +317,7 @@ Types:
from kernel.types.auth import (
LoginResponse,
ManagedAuth,
ManagedAuthBrowserConfig,
ManagedAuthCreateRequest,
ManagedAuthTimelineEvent,
ManagedAuthUpdateRequest,
Expand Down
105 changes: 57 additions & 48 deletions src/kernel/resources/auth/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from ...types.auth.submit_fields_response import SubmitFieldsResponse
from ...types.auth.connection_follow_response import ConnectionFollowResponse
from ...types.auth.managed_auth_timeline_event import ManagedAuthTimelineEvent
from ...types.auth.managed_auth_browser_config_param import ManagedAuthBrowserConfigParam

__all__ = ["ConnectionsResource", "AsyncConnectionsResource"]

Expand Down Expand Up @@ -66,6 +67,7 @@ def create(
profile_name: str,
allowed_domains: SequenceNotStr[str] | Omit = omit,
auto_reauth: bool | Omit = omit,
browser: ManagedAuthBrowserConfigParam | Omit = omit,
browser_telemetry: Optional[connection_create_params.BrowserTelemetry] | Omit = omit,
credential: connection_create_params.Credential | Omit = omit,
health_check_interval: int | Omit = omit,
Expand Down Expand Up @@ -120,9 +122,11 @@ def create(
false, expired sessions are marked as `NEEDS_AUTH` instead of attempting
re-auth. Defaults to true.

browser_telemetry: Browser telemetry configuration used by this connection's browser sessions by
default. Uses the exact create-browser configuration. Can be overridden
per-login.
browser: Default browser configuration for login, reauthentication, and health-check
sessions.

browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
clients.

credential:
Reference to credentials for the auth connection. Use one of:
Expand All @@ -133,9 +137,10 @@ def create(

health_check_interval: Interval in seconds between automatic health checks. When set, the system
periodically verifies the authentication status and triggers re-authentication
if needed. Maximum is 86400 (24 hours). Default is 3600 (1 hour). The minimum
depends on your plan: Enterprise: 300 (5 minutes), Startup: 1200 (20 minutes),
Hobbyist: 3600 (1 hour).
if needed. Maximum is 86400 (24 hours). Default is 3600 (1 hour) or your plan
minimum, whichever is larger. The minimum depends on your plan: Enterprise: 300
(5 minutes), Startup: 1200 (20 minutes), Hobbyist: 3600 (1 hour), Free: 21600 (6
hours).

health_checks: Whether to enable periodic health checks. When false, the system will not
automatically verify authentication status, and `auto_reauth` has no effect on
Expand All @@ -144,10 +149,7 @@ def create(

login_url: Optional login page URL to skip discovery

proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it. When selecting by name, the name must
match exactly one active proxy in the project. Ambiguous names return a 400; use
id for stable references.
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.

record_session: Whether to record browser sessions for this connection by default. Useful for
debugging. Can be overridden per-login. Defaults to false.
Expand All @@ -171,6 +173,7 @@ def create(
"profile_name": profile_name,
"allowed_domains": allowed_domains,
"auto_reauth": auto_reauth,
"browser": browser,
"browser_telemetry": browser_telemetry,
"credential": credential,
"health_check_interval": health_check_interval,
Expand Down Expand Up @@ -229,6 +232,7 @@ def update(
*,
allowed_domains: SequenceNotStr[str] | Omit = omit,
auto_reauth: bool | Omit = omit,
browser: ManagedAuthBrowserConfigParam | Omit = omit,
browser_telemetry: Optional[connection_update_params.BrowserTelemetry] | Omit = omit,
credential: connection_update_params.Credential | Omit = omit,
health_check_interval: int | Omit = omit,
Expand Down Expand Up @@ -260,9 +264,11 @@ def update(
when `health_checks` is false. When false, expired sessions detected by a health
check are marked as `NEEDS_AUTH` instead of attempting re-auth.

browser_telemetry: Browser telemetry configuration used by future browser sessions for this
connection. Uses the exact create-browser configuration. Set enabled to false to
disable telemetry.
browser: Browser configuration updates for future login, reauthentication, and
health-check sessions. Omitted properties remain unchanged.

browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
clients.

credential:
Reference to credentials for the auth connection. Use one of:
Expand All @@ -280,10 +286,7 @@ def update(

login_url: Login page URL. Set to empty string to clear.

proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it. When selecting by name, the name must
match exactly one active proxy in the project. Ambiguous names return a 400; use
id for stable references.
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.

record_session: Whether to record browser sessions for this connection by default

Expand All @@ -305,6 +308,7 @@ def update(
{
"allowed_domains": allowed_domains,
"auto_reauth": auto_reauth,
"browser": browser,
"browser_telemetry": browser_telemetry,
"credential": credential,
"health_check_interval": health_check_interval,
Expand Down Expand Up @@ -464,6 +468,7 @@ def login(
self,
id: str,
*,
browser: ManagedAuthBrowserConfigParam | Omit = omit,
browser_telemetry: Optional[connection_login_params.BrowserTelemetry] | Omit = omit,
proxy: connection_login_params.Proxy | Omit = omit,
record_session: bool | Omit = omit,
Expand All @@ -481,14 +486,13 @@ def login(
credentials are stored.

Args:
browser_telemetry: Override the connection's default browser telemetry configuration for this
login. When omitted, the connection's browser_telemetry default is used. Uses
the exact create-browser configuration.
browser: Browser configuration override for this login. Omitted properties inherit the
connection defaults.

browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
clients.

proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it. When selecting by name, the name must
match exactly one active proxy in the project. Ambiguous names return a 400; use
id for stable references.
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.

record_session: Override the connection's default for recording this login's browser session.
When omitted, the connection's record_session default is used.
Expand All @@ -507,6 +511,7 @@ def login(
path_template("/auth/connections/{id}/login", id=id),
body=maybe_transform(
{
"browser": browser,
"browser_telemetry": browser_telemetry,
"proxy": proxy,
"record_session": record_session,
Expand Down Expand Up @@ -675,6 +680,7 @@ async def create(
profile_name: str,
allowed_domains: SequenceNotStr[str] | Omit = omit,
auto_reauth: bool | Omit = omit,
browser: ManagedAuthBrowserConfigParam | Omit = omit,
browser_telemetry: Optional[connection_create_params.BrowserTelemetry] | Omit = omit,
credential: connection_create_params.Credential | Omit = omit,
health_check_interval: int | Omit = omit,
Expand Down Expand Up @@ -729,9 +735,11 @@ async def create(
false, expired sessions are marked as `NEEDS_AUTH` instead of attempting
re-auth. Defaults to true.

browser_telemetry: Browser telemetry configuration used by this connection's browser sessions by
default. Uses the exact create-browser configuration. Can be overridden
per-login.
browser: Default browser configuration for login, reauthentication, and health-check
sessions.

browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
clients.

credential:
Reference to credentials for the auth connection. Use one of:
Expand All @@ -742,9 +750,10 @@ async def create(

health_check_interval: Interval in seconds between automatic health checks. When set, the system
periodically verifies the authentication status and triggers re-authentication
if needed. Maximum is 86400 (24 hours). Default is 3600 (1 hour). The minimum
depends on your plan: Enterprise: 300 (5 minutes), Startup: 1200 (20 minutes),
Hobbyist: 3600 (1 hour).
if needed. Maximum is 86400 (24 hours). Default is 3600 (1 hour) or your plan
minimum, whichever is larger. The minimum depends on your plan: Enterprise: 300
(5 minutes), Startup: 1200 (20 minutes), Hobbyist: 3600 (1 hour), Free: 21600 (6
hours).

health_checks: Whether to enable periodic health checks. When false, the system will not
automatically verify authentication status, and `auto_reauth` has no effect on
Expand All @@ -753,10 +762,7 @@ async def create(

login_url: Optional login page URL to skip discovery

proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it. When selecting by name, the name must
match exactly one active proxy in the project. Ambiguous names return a 400; use
id for stable references.
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.

record_session: Whether to record browser sessions for this connection by default. Useful for
debugging. Can be overridden per-login. Defaults to false.
Expand All @@ -780,6 +786,7 @@ async def create(
"profile_name": profile_name,
"allowed_domains": allowed_domains,
"auto_reauth": auto_reauth,
"browser": browser,
"browser_telemetry": browser_telemetry,
"credential": credential,
"health_check_interval": health_check_interval,
Expand Down Expand Up @@ -838,6 +845,7 @@ async def update(
*,
allowed_domains: SequenceNotStr[str] | Omit = omit,
auto_reauth: bool | Omit = omit,
browser: ManagedAuthBrowserConfigParam | Omit = omit,
browser_telemetry: Optional[connection_update_params.BrowserTelemetry] | Omit = omit,
credential: connection_update_params.Credential | Omit = omit,
health_check_interval: int | Omit = omit,
Expand Down Expand Up @@ -869,9 +877,11 @@ async def update(
when `health_checks` is false. When false, expired sessions detected by a health
check are marked as `NEEDS_AUTH` instead of attempting re-auth.

browser_telemetry: Browser telemetry configuration used by future browser sessions for this
connection. Uses the exact create-browser configuration. Set enabled to false to
disable telemetry.
browser: Browser configuration updates for future login, reauthentication, and
health-check sessions. Omitted properties remain unchanged.

browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
clients.

credential:
Reference to credentials for the auth connection. Use one of:
Expand All @@ -889,10 +899,7 @@ async def update(

login_url: Login page URL. Set to empty string to clear.

proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it. When selecting by name, the name must
match exactly one active proxy in the project. Ambiguous names return a 400; use
id for stable references.
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.

record_session: Whether to record browser sessions for this connection by default

Expand All @@ -914,6 +921,7 @@ async def update(
{
"allowed_domains": allowed_domains,
"auto_reauth": auto_reauth,
"browser": browser,
"browser_telemetry": browser_telemetry,
"credential": credential,
"health_check_interval": health_check_interval,
Expand Down Expand Up @@ -1073,6 +1081,7 @@ async def login(
self,
id: str,
*,
browser: ManagedAuthBrowserConfigParam | Omit = omit,
browser_telemetry: Optional[connection_login_params.BrowserTelemetry] | Omit = omit,
proxy: connection_login_params.Proxy | Omit = omit,
record_session: bool | Omit = omit,
Expand All @@ -1090,14 +1099,13 @@ async def login(
credentials are stored.

Args:
browser_telemetry: Override the connection's default browser telemetry configuration for this
login. When omitted, the connection's browser_telemetry default is used. Uses
the exact create-browser configuration.
browser: Browser configuration override for this login. Omitted properties inherit the
connection defaults.

browser_telemetry: Deprecated. Use browser.telemetry. Retained during migration for existing
clients.

proxy: Proxy selection. Provide either id or name. The proxy must be in the same
project as the resource referencing it. When selecting by name, the name must
match exactly one active proxy in the project. Ambiguous names return a 400; use
id for stable references.
proxy: Deprecated. Use browser.proxy. Retained during migration for existing clients.

record_session: Override the connection's default for recording this login's browser session.
When omitted, the connection's record_session default is used.
Expand All @@ -1116,6 +1124,7 @@ async def login(
path_template("/auth/connections/{id}/login", id=id),
body=await async_maybe_transform(
{
"browser": browser,
"browser_telemetry": browser_telemetry,
"proxy": proxy,
"record_session": record_session,
Expand Down
Loading
Loading