···001import { StrictMode } from "react";
2import { createRoot } from "react-dom/client";
3-import "./index.css";
4import App from "./App.tsx";
56createRoot(document.getElementById("root")!).render(
···1+import "./index.css";
2+3import { StrictMode } from "react";
4import { createRoot } from "react-dom/client";
5+6import App from "./App.tsx";
78createRoot(document.getElementById("root")!).render(
+2-1
src/common/crypto-enc.ts
···01import { nanoid } from "@sitnik/nanoid";
02import { encrAlgo } from "./crypto-algos.ts";
3-import { base64url } from "@panva/jose";
45export interface Cipher {
6 encrypt(input: string): Promise<string>;
···1+import { base64url } from "@panva/jose";
2import { nanoid } from "@sitnik/nanoid";
3+4import { encrAlgo } from "./crypto-algos.ts";
056export interface Cipher {
7 encrypt(input: string): Promise<string>;
+2-2
src/common/crypto-sig.ts
···1import { decodeJwt, importJWK, JWTPayload, jwtVerify, JWTVerifyResult } from "@panva/jose";
2-import { generateKeyPair } from "@panva/jose/key/generate/keypair";
3import { calculateJwkThumbprint } from "@panva/jose/jwk/thumbprint";
4import { exportJWK } from "@panva/jose/key/export";
5-import { z, ZodError } from "zod/v4";
6import { signAlgo } from "@repo/common/crypto-algos.ts";
078const CLOCK_TOLERANCE_S = 30;
9
···1import { decodeJwt, importJWK, JWTPayload, jwtVerify, JWTVerifyResult } from "@panva/jose";
02import { calculateJwkThumbprint } from "@panva/jose/jwk/thumbprint";
3import { exportJWK } from "@panva/jose/key/export";
4+import { generateKeyPair } from "@panva/jose/key/generate/keypair";
5import { signAlgo } from "@repo/common/crypto-algos.ts";
6+import { z, ZodError } from "zod/v4";
78const CLOCK_TOLERANCE_S = 30;
9
+1-1
src/common/socket.ts
···1import { BlockingAtom } from "./blocking-atom.ts";
2import { BlockingQueue } from "./blocking-queue.ts";
3-import { makeGate } from "./gate.ts";
4import { CancellationError } from "./errors.ts";
056const STREAM_CONFIG_DEFAULT = {
7 signal: undefined as AbortSignal | undefined,
···1import { BlockingAtom } from "./blocking-atom.ts";
2import { BlockingQueue } from "./blocking-queue.ts";
03import { CancellationError } from "./errors.ts";
4+import { makeGate } from "./gate.ts";
56const STREAM_CONFIG_DEFAULT = {
7 signal: undefined as AbortSignal | undefined,
+2-1
src/schema/proto.ts
···01import { z } from "zod/v4";
2-import { jwkSchema } from "@repo/common/crypto-sig.ts";
3import { identIdSchema, realmIdSchema } from "./state.ts";
45export const preauthAuthnMessageSchema = z.object({
···1+import { jwkSchema } from "@repo/common/crypto-sig.ts";
2import { z } from "zod/v4";
3+4import { identIdSchema, realmIdSchema } from "./state.ts";
56export const preauthAuthnMessageSchema = z.object({
+1-1
src/server/main.ts
···1-import { parseArgs } from "jsr:@std/cli/parse-args";
2import { Application } from "@oak/oak/application";
034import { apiMiddleware } from "./routes-api/middleware.ts";
5import { notFound } from "./routes-error.ts";
···01import { Application } from "@oak/oak/application";
2+import { parseArgs } from "jsr:@std/cli/parse-args";
34import { apiMiddleware } from "./routes-api/middleware.ts";
5import { notFound } from "./routes-error.ts";
+1-1
src/server/routes-socket/handler-error.ts
···1-import { z } from "zod/v4";
2import { BaseError, ValidationError } from "@repo/common/errors.ts";
034export function errorHandler(ws: WebSocket, e: unknown) {
5 if (e instanceof BaseError) {
···01import { BaseError, ValidationError } from "@repo/common/errors.ts";
2+import { z } from "zod/v4";
34export function errorHandler(ws: WebSocket, e: unknown) {
5 if (e instanceof BaseError) {
+1-2
src/server/routes-socket/handler-preauth.ts
···1import { jwtVerify } from "@panva/jose";
2-3import { combineSignals, timeoutSignal } from "@repo/common/aborts.ts";
04import { AuthError, normalizeError } from "@repo/common/errors.ts";
5import { takeSocket } from "@repo/common/socket.ts";
6import { StrictMap } from "@repo/common/strict-map.ts";
7-import { jwtDecodedSchema } from "@repo/common/crypto-sig.ts";
8import { preauthAuthnMessageSchema } from "@repo/schema/proto.ts";
9import { parseIdentId, parseRealmId } from "@repo/schema/state.ts";
10
···1import { jwtVerify } from "@panva/jose";
02import { combineSignals, timeoutSignal } from "@repo/common/aborts.ts";
3+import { jwtDecodedSchema } from "@repo/common/crypto-sig.ts";
4import { AuthError, normalizeError } from "@repo/common/errors.ts";
5import { takeSocket } from "@repo/common/socket.ts";
6import { StrictMap } from "@repo/common/strict-map.ts";
07import { preauthAuthnMessageSchema } from "@repo/schema/proto.ts";
8import { parseIdentId, parseRealmId } from "@repo/schema/state.ts";
9
+1-1
src/server/routes-socket/handler-realm.ts
···1-import { Realm, Session } from "./state.ts";
2import { streamSocket } from "../../common/socket.ts";
034export async function realmHandler(ws: WebSocket, realm: Realm, auth: Session, signal: AbortSignal) {
5 ws.send(`welcome ${auth.identid} to ${auth.realmid} - ${realm.identities.keys()} `);
···01import { streamSocket } from "../../common/socket.ts";
2+import { Realm, Session } from "./state.ts";
34export async function realmHandler(ws: WebSocket, realm: Realm, auth: Session, signal: AbortSignal) {
5 ws.send(`welcome ${auth.identid} to ${auth.realmid} - ${realm.identities.keys()} `);
+1-1
src/server/routes-socket/handler.ts
···23import { errorHandler } from "./handler-error.ts";
4import { preauthHandler } from "./handler-preauth.ts";
5-import { attachSocket, detachSocket } from "./state.ts";
6import { realmHandler } from "./handler-realm.ts";
078export async function socketHandler(this: WebSocket) {
9 const controller = new AbortController();
···23import { errorHandler } from "./handler-error.ts";
4import { preauthHandler } from "./handler-preauth.ts";
05import { realmHandler } from "./handler-realm.ts";
6+import { attachSocket, detachSocket } from "./state.ts";
78export async function socketHandler(this: WebSocket) {
9 const controller = new AbortController();
···1-import { escape } from "jsr:@std/regexp/escape";
2import { nanoid } from "@sitnik/nanoid";
03import { z } from "zod/v4";
45/** result from a branded id maker invocation */
···01import { nanoid } from "@sitnik/nanoid";
2+import { escape } from "jsr:@std/regexp/escape";
3import { z } from "zod/v4";
45/** result from a branded id maker invocation */
+2-2
vite.config.ts
···1-import { defineConfig } from "vite";
2-import react from "@vitejs/plugin-react";
3import deno from "@deno/vite-plugin";
0045export default defineConfig({
6 root: "./src/client",
···001import deno from "@deno/vite-plugin";
2+import react from "@vitejs/plugin-react";
3+import { defineConfig } from "vite";
45export default defineConfig({
6 root: "./src/client",