From c7d54effa422ee98844b9fdb9d56f558e7bb95b4 Mon Sep 17 00:00:00 2001 From: ardenworks <284684426+ardenworks@users.noreply.github.com> Date: Thu, 14 May 2026 10:27:43 -0400 Subject: [PATCH] fix(ssh): decode auth timestamps from JSON strings --- packages/contracts/src/auth.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/contracts/src/auth.ts b/packages/contracts/src/auth.ts index 8439d12b069..f764f79f2b0 100644 --- a/packages/contracts/src/auth.ts +++ b/packages/contracts/src/auth.ts @@ -109,7 +109,7 @@ export const AuthBootstrapResult = Schema.Struct({ authenticated: Schema.Literal(true), role: AuthSessionRole, sessionMethod: ServerAuthSessionMethod, - expiresAt: Schema.DateTimeUtc, + expiresAt: Schema.DateTimeUtcFromString, }); export type AuthBootstrapResult = typeof AuthBootstrapResult.Type; @@ -117,14 +117,14 @@ export const AuthBearerBootstrapResult = Schema.Struct({ authenticated: Schema.Literal(true), role: AuthSessionRole, sessionMethod: Schema.Literal("bearer-session-token"), - expiresAt: Schema.DateTimeUtc, + expiresAt: Schema.DateTimeUtcFromString, sessionToken: TrimmedNonEmptyString, }); export type AuthBearerBootstrapResult = typeof AuthBearerBootstrapResult.Type; export const AuthWebSocketTokenResult = Schema.Struct({ token: TrimmedNonEmptyString, - expiresAt: Schema.DateTimeUtc, + expiresAt: Schema.DateTimeUtcFromString, }); export type AuthWebSocketTokenResult = typeof AuthWebSocketTokenResult.Type; @@ -132,7 +132,7 @@ export const AuthPairingCredentialResult = Schema.Struct({ id: TrimmedNonEmptyString, credential: TrimmedNonEmptyString, label: Schema.optionalKey(TrimmedNonEmptyString), - expiresAt: Schema.DateTimeUtc, + expiresAt: Schema.DateTimeUtcFromString, }); export type AuthPairingCredentialResult = typeof AuthPairingCredentialResult.Type; @@ -142,8 +142,8 @@ export const AuthPairingLink = Schema.Struct({ role: AuthSessionRole, subject: TrimmedNonEmptyString, label: Schema.optionalKey(TrimmedNonEmptyString), - createdAt: Schema.DateTimeUtc, - expiresAt: Schema.DateTimeUtc, + createdAt: Schema.DateTimeUtcFromString, + expiresAt: Schema.DateTimeUtcFromString, }); export type AuthPairingLink = typeof AuthPairingLink.Type; @@ -172,9 +172,9 @@ export const AuthClientSession = Schema.Struct({ role: AuthSessionRole, method: ServerAuthSessionMethod, client: AuthClientMetadata, - issuedAt: Schema.DateTimeUtc, - expiresAt: Schema.DateTimeUtc, - lastConnectedAt: Schema.NullOr(Schema.DateTimeUtc), + issuedAt: Schema.DateTimeUtcFromString, + expiresAt: Schema.DateTimeUtcFromString, + lastConnectedAt: Schema.NullOr(Schema.DateTimeUtcFromString), connected: Schema.Boolean, current: Schema.Boolean, }); @@ -261,6 +261,6 @@ export const AuthSessionState = Schema.Struct({ auth: ServerAuthDescriptor, role: Schema.optionalKey(AuthSessionRole), sessionMethod: Schema.optionalKey(ServerAuthSessionMethod), - expiresAt: Schema.optionalKey(Schema.DateTimeUtc), + expiresAt: Schema.optionalKey(Schema.DateTimeUtcFromString), }); export type AuthSessionState = typeof AuthSessionState.Type;