Skip to content

Commit 0fd9a82

Browse files
feat: Add opt-in record_session flag to managed auth
1 parent 4d3eacd commit 0fd9a82

3 files changed

Lines changed: 41 additions & 3 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 112
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-38c6ce8b0ce54e6c62517b9635acaf65369c26cdb1b55eb66290c13a8ab2b33d.yml
3-
openapi_spec_hash: e6f6ed157b1e318d1a1db72fd1d27091
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-64dac369ae935b0318cd611e1735d45359a663eb55cf43fbb8b09e9dd814d7a2.yml
3+
openapi_spec_hash: cc0c6a4e716977df4b9eab5f4658d41b
44
config_hash: 08d55086449943a8fec212b870061a3f

src/resources/auth/connections.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ export interface ManagedAuth {
212212
*/
213213
profile_name: string;
214214

215+
/**
216+
* Whether browser sessions for this connection are recorded by default for
217+
* debugging. Can be overridden per-login.
218+
*/
219+
record_session: boolean;
220+
215221
/**
216222
* Whether credentials are saved after every successful login. One-time codes
217223
* (TOTP, SMS, etc.) are not saved.
@@ -614,6 +620,12 @@ export interface ManagedAuthCreateRequest {
614620
*/
615621
proxy?: ManagedAuthCreateRequest.Proxy;
616622

623+
/**
624+
* Whether to record browser sessions for this connection by default. Useful for
625+
* debugging. Can be overridden per-login. Defaults to false.
626+
*/
627+
record_session?: boolean;
628+
617629
/**
618630
* Whether to save credentials after every successful login. Defaults to true.
619631
* One-time codes (TOTP, SMS, etc.) are not saved.
@@ -702,6 +714,11 @@ export interface ManagedAuthUpdateRequest {
702714
*/
703715
proxy?: ManagedAuthUpdateRequest.Proxy;
704716

717+
/**
718+
* Whether to record browser sessions for this connection by default
719+
*/
720+
record_session?: boolean;
721+
705722
/**
706723
* Whether to save credentials after every successful login
707724
*/
@@ -1080,6 +1097,12 @@ export interface ConnectionCreateParams {
10801097
*/
10811098
proxy?: ConnectionCreateParams.Proxy;
10821099

1100+
/**
1101+
* Whether to record browser sessions for this connection by default. Useful for
1102+
* debugging. Can be overridden per-login. Defaults to false.
1103+
*/
1104+
record_session?: boolean;
1105+
10831106
/**
10841107
* Whether to save credentials after every successful login. Defaults to true.
10851108
* One-time codes (TOTP, SMS, etc.) are not saved.
@@ -1165,6 +1188,11 @@ export interface ConnectionUpdateParams {
11651188
*/
11661189
proxy?: ConnectionUpdateParams.Proxy;
11671190

1191+
/**
1192+
* Whether to record browser sessions for this connection by default
1193+
*/
1194+
record_session?: boolean;
1195+
11681196
/**
11691197
* Whether to save credentials after every successful login
11701198
*/
@@ -1236,6 +1264,12 @@ export interface ConnectionLoginParams {
12361264
* caller's org.
12371265
*/
12381266
proxy?: ConnectionLoginParams.Proxy;
1267+
1268+
/**
1269+
* Override the connection's default for recording this login's browser session.
1270+
* When omitted, the connection's record_session default is used.
1271+
*/
1272+
record_session?: boolean;
12391273
}
12401274

12411275
export namespace ConnectionLoginParams {

tests/api-resources/auth/connections.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ describe('resource connections', () => {
3838
health_check_interval: 3600,
3939
login_url: 'https://netflix.com/login',
4040
proxy: { id: 'id', name: 'name' },
41+
record_session: false,
4142
save_credentials: true,
4243
});
4344
});
@@ -136,7 +137,10 @@ describe('resource connections', () => {
136137
await expect(
137138
client.auth.connections.login(
138139
'id',
139-
{ proxy: { id: 'id', name: 'name' } },
140+
{
141+
proxy: { id: 'id', name: 'name' },
142+
record_session: true,
143+
},
140144
{ path: '/_stainless_unknown_path' },
141145
),
142146
).rejects.toThrow(Kernel.NotFoundError);

0 commit comments

Comments
 (0)