Skip to content

Commit 5976b83

Browse files
feat: Prepare native OAuth for MCP: path resource, exchange targets, static exchange client, retention, Clerk OAuth cutoff
Stainless-Generated-From: 12fe170984ea55c209e28a34cebb74700e9754f7
1 parent abc1820 commit 5976b83

7 files changed

Lines changed: 64 additions & 0 deletions

File tree

‎api.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ from kernel.types.auth import (
436436
LoginResponse,
437437
ManagedAuth,
438438
ManagedAuthBrowserConfig,
439+
ManagedAuthBrowserLocation,
439440
ManagedAuthCreateRequest,
440441
ManagedAuthTimelineEvent,
441442
ManagedAuthUpdateRequest,

‎src/kernel/types/auth/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
from .connection_timeline_params import ConnectionTimelineParams as ConnectionTimelineParams
1616
from .managed_auth_browser_config import ManagedAuthBrowserConfig as ManagedAuthBrowserConfig
1717
from .managed_auth_timeline_event import ManagedAuthTimelineEvent as ManagedAuthTimelineEvent
18+
from .managed_auth_browser_location import ManagedAuthBrowserLocation as ManagedAuthBrowserLocation
1819
from .managed_auth_browser_config_param import ManagedAuthBrowserConfigParam as ManagedAuthBrowserConfigParam
20+
from .managed_auth_browser_location_param import ManagedAuthBrowserLocationParam as ManagedAuthBrowserLocationParam

‎src/kernel/types/auth/managed_auth_browser_config.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from ..._models import BaseModel
77
from ..browser_proxy_config import BrowserProxyConfig
8+
from .managed_auth_browser_location import ManagedAuthBrowserLocation
89
from ..browsers.browser_telemetry_categories_config import BrowserTelemetryCategoriesConfig
910

1011
__all__ = [
@@ -117,6 +118,12 @@ class ManagedAuthBrowserConfig(BaseModel):
117118
Browser configuration applied to browser sessions created for a managed auth connection. Managed auth controls the profile, headless mode, timeout, start URL, kiosk mode, and viewport.
118119
"""
119120

121+
location: Optional[ManagedAuthBrowserLocation] = None
122+
"""
123+
Browser locale for the connection's login, reauthentication, and health-check
124+
sessions. Set on create or update; not supported on login.
125+
"""
126+
120127
proxy: Optional[BrowserProxyConfig] = None
121128
"""Proxy configuration for managed auth browser sessions.
122129

‎src/kernel/types/auth/managed_auth_browser_config_param.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing_extensions import Literal, TypedDict
77

88
from ..browser_proxy_config_param import BrowserProxyConfigParam
9+
from .managed_auth_browser_location_param import ManagedAuthBrowserLocationParam
910
from ..browsers.browser_telemetry_categories_config_param import BrowserTelemetryCategoriesConfigParam
1011

1112
__all__ = [
@@ -118,6 +119,12 @@ class ManagedAuthBrowserConfigParam(TypedDict, total=False):
118119
Browser configuration applied to browser sessions created for a managed auth connection. Managed auth controls the profile, headless mode, timeout, start URL, kiosk mode, and viewport.
119120
"""
120121

122+
location: ManagedAuthBrowserLocationParam
123+
"""
124+
Browser locale for the connection's login, reauthentication, and health-check
125+
sessions. Set on create or update; not supported on login.
126+
"""
127+
121128
proxy: BrowserProxyConfigParam
122129
"""Proxy configuration for managed auth browser sessions.
123130
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
5+
from ..._models import BaseModel
6+
7+
__all__ = ["ManagedAuthBrowserLocation"]
8+
9+
10+
class ManagedAuthBrowserLocation(BaseModel):
11+
"""
12+
Browser locale applied to browser sessions created for a managed auth connection.
13+
"""
14+
15+
locale: Optional[str] = None
16+
"""
17+
Supported canonical BCP 47 locale for the browser's language and Accept-Language
18+
header. Omit to use the default for the browser's region, or omit on update to
19+
keep the current locale. Null clears it on update.
20+
"""
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Optional
6+
from typing_extensions import TypedDict
7+
8+
__all__ = ["ManagedAuthBrowserLocationParam"]
9+
10+
11+
class ManagedAuthBrowserLocationParam(TypedDict, total=False):
12+
"""
13+
Browser locale applied to browser sessions created for a managed auth connection.
14+
"""
15+
16+
locale: Optional[str]
17+
"""
18+
Supported canonical BCP 47 locale for the browser's language and Accept-Language
19+
header. Omit to use the default for the browser's region, or omit on update to
20+
keep the current locale. Null clears it on update.
21+
"""

‎tests/api_resources/auth/test_connections.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def test_method_create_with_all_params(self, client: Kernel) -> None:
4141
allowed_domains=["login.netflix.com", "auth.netflix.com"],
4242
auto_reauth=True,
4343
browser={
44+
"location": {"locale": "sv-SE"},
4445
"proxy": {
4546
"id": "x",
4647
"mode": "direct",
@@ -210,6 +211,7 @@ def test_method_update_with_all_params(self, client: Kernel) -> None:
210211
allowed_domains=["login.netflix.com", "auth.netflix.com"],
211212
auto_reauth=True,
212213
browser={
214+
"location": {"locale": "sv-SE"},
213215
"proxy": {
214216
"id": "x",
215217
"mode": "direct",
@@ -464,6 +466,7 @@ def test_method_login_with_all_params(self, client: Kernel) -> None:
464466
connection = client.auth.connections.login(
465467
id="id",
466468
browser={
469+
"location": {"locale": "sv-SE"},
467470
"proxy": {
468471
"id": "x",
469472
"mode": "direct",
@@ -712,6 +715,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncKernel) ->
712715
allowed_domains=["login.netflix.com", "auth.netflix.com"],
713716
auto_reauth=True,
714717
browser={
718+
"location": {"locale": "sv-SE"},
715719
"proxy": {
716720
"id": "x",
717721
"mode": "direct",
@@ -881,6 +885,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncKernel) ->
881885
allowed_domains=["login.netflix.com", "auth.netflix.com"],
882886
auto_reauth=True,
883887
browser={
888+
"location": {"locale": "sv-SE"},
884889
"proxy": {
885890
"id": "x",
886891
"mode": "direct",
@@ -1135,6 +1140,7 @@ async def test_method_login_with_all_params(self, async_client: AsyncKernel) ->
11351140
connection = await async_client.auth.connections.login(
11361141
id="id",
11371142
browser={
1143+
"location": {"locale": "sv-SE"},
11381144
"proxy": {
11391145
"id": "x",
11401146
"mode": "direct",

0 commit comments

Comments
 (0)