Skip to content
Open
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
20 changes: 10 additions & 10 deletions packages/contracts/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,30 +109,30 @@ 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;

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;

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;

Expand All @@ -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;

Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -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;
Loading