Files
orca/cloud/packages/push-contract/src/host-auth-messages.ts
Jinwoo Hong eb2f2d52ae feat(cloud): native push gateway and dedicated infrastructure (1/3) (#19912)
* refactor(cloud): share PostgreSQL schema startup between services

* feat(cloud): add durable native push notification gateway

* infra(push): define dedicated gateway resources and operational checks

* fix(push): bound cross-host admission and simplify gateway configuration

* fix(push): validate deploy configuration and preserve topic-error registrations
2026-09-10 17:59:46 -04:00

42 lines
1.3 KiB
TypeScript

import { z } from 'zod'
import {
Base6432ByteSchema,
Base64Raw24ByteSchema,
Base64Url32ByteSchema,
BoundedCiphertextSchema,
EpochMsSchema,
OpaqueIdSchema,
PushHostFingerprintSchema
} from './wire-scalars.js'
export const PushHostChallengeRequestSchema = z
.object({ v: z.literal(1), hostPublicKeyB64: Base6432ByteSchema })
.strict()
export const PushHostChallengeResponseSchema = z
.object({
challengeId: OpaqueIdSchema,
gatewayEphemeralPublicKeyB64: Base6432ByteSchema,
nonceB64: Base64Raw24ByteSchema,
ciphertextB64: BoundedCiphertextSchema,
expiresAt: EpochMsSchema
})
.strict()
export const PushHostSessionRequestSchema = z
.object({ v: z.literal(1), challengeId: OpaqueIdSchema, proofB64: Base6432ByteSchema })
.strict()
export const PushHostSessionResponseSchema = z
.object({
sessionToken: Base64Url32ByteSchema,
expiresAt: EpochMsSchema,
hostFingerprint: PushHostFingerprintSchema
})
.strict()
export type PushHostChallengeRequest = z.infer<typeof PushHostChallengeRequestSchema>
export type PushHostChallengeResponse = z.infer<typeof PushHostChallengeResponseSchema>
export type PushHostSessionRequest = z.infer<typeof PushHostSessionRequestSchema>
export type PushHostSessionResponse = z.infer<typeof PushHostSessionResponseSchema>