Skip to content

Commit 2e10a2a

Browse files
feat: Expire stuck IN_PROGRESS managed auth sessions via background worker
1 parent 75a4aab commit 2e10a2a

2 files changed

Lines changed: 18 additions & 4 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%2Fkernel-e14974fd90680e5745b35d8718a1ccce2181f6d17a6e0a1fd35fc5bca88795ae.yml
3-
openapi_spec_hash: 1b3aa75f0ab48b122d514047f9c82873
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-a674e3c4c0063942621d1b4e7f67b72f7e240c12dd88564fe16627618ba33dd6.yml
3+
openapi_spec_hash: 8b97c87f0dafe5fc5e5a7365f3687755
44
config_hash: 08d55086449943a8fec212b870061a3f

authconnection.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,10 @@ type ManagedAuth struct {
270270
// Instructions for external action (present when
271271
// flow_step=awaiting_external_action)
272272
ExternalActionMessage string `json:"external_action_message" api:"nullable"`
273-
// When the current flow expires (null when no flow in progress)
273+
// When the current flow expires (null when no flow in progress). A flow past this
274+
// timestamp is no longer valid and its `flow_status` will be `EXPIRED`. Clients
275+
// may start a new login to supersede a stale `IN_PROGRESS` flow past this
276+
// timestamp.
274277
FlowExpiresAt time.Time `json:"flow_expires_at" api:"nullable" format:"date-time"`
275278
// Current flow status (null when no flow in progress)
276279
//
@@ -293,8 +296,18 @@ type ManagedAuth struct {
293296
HealthCheckInterval int64 `json:"health_check_interval" api:"nullable"`
294297
// URL to redirect user to for hosted login (present when flow in progress)
295298
HostedURL string `json:"hosted_url" api:"nullable" format:"uri"`
296-
// When the profile was last successfully authenticated
299+
// Deprecated alias for `last_auth_check_at`. Despite the name, this is the last
300+
// health-check timestamp, not the last successful authentication. Use
301+
// `last_auth_check_at` instead.
302+
//
303+
// Deprecated: deprecated
297304
LastAuthAt time.Time `json:"last_auth_at" format:"date-time"`
305+
// When the most recent auth health check ran for this connection, regardless of
306+
// outcome. Updated on every health check and does not by itself indicate that the
307+
// profile is currently authenticated - use `status` for that. May be newer than
308+
// `flow_expires_at` when a flow is still in progress because health checks
309+
// continue to run in parallel.
310+
LastAuthCheckAt time.Time `json:"last_auth_check_at" format:"date-time"`
298311
// Browser live view URL for debugging (present when flow in progress)
299312
LiveViewURL string `json:"live_view_url" api:"nullable" format:"uri"`
300313
// Optional login page URL to skip discovery
@@ -339,6 +352,7 @@ type ManagedAuth struct {
339352
HealthCheckInterval respjson.Field
340353
HostedURL respjson.Field
341354
LastAuthAt respjson.Field
355+
LastAuthCheckAt respjson.Field
342356
LiveViewURL respjson.Field
343357
LoginURL respjson.Field
344358
MfaOptions respjson.Field

0 commit comments

Comments
 (0)