PEP-65: eGov QR login through the KazEDS relay (sign.aitu.uz)
Login page and Settings → eGov: relay session with a server-side challenge/nonce, QR + eGov Mobile deep link, polling, one-shot completion; IIN from the signer's certificate (own DER reader), users.egov_iin. The relay is trusted (PM decision): no own XMLDSig check. CLI peppa user egov, mock-kazeds-relay, tests. Dev mode: /_next/static is no-store (Cloudflare cached stale chunks). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4179690277
commit
ed49767c31
@ -26,6 +26,7 @@
|
||||
- **Доступ (PEP-16)**: войти могут логины из `platform.allowed_logins` (`peppa platform allowlist/allow/deny`), приглашённые и участники проектов, локальные `mock-…`; проверка в `/auth/callback`, `currentUser` (каждый запрос) и `/mcp`
|
||||
- **Шеринг (PEP-12)**: `project_members` + `project_invites` (по логину Gitea, принимаются при первом входе); доступ везде через `projectForUser` / `userProjectIds` (владелец или участник); `shareProject` / `unshareProject` в runner добавляют/убирают соавтора репо (клиент владельца, затем peppa-bot). Участник может всё, кроме управления участниками; сессии идут на подписке Claude владельца. MCP: list_members, add_member, remove_member
|
||||
- **Ошибки из прода (PEP-58)**: Bugsink 2.6 в docker `peppa-bugsink` (`infra/bugsink/`, `scripts/bugsink-up.sh`, база `bugsink` в Postgres (контейнер `peppa-postgres` остался только ради неё, перевод — PEP-63), `bugsink.telecom.quest`, API на 127.0.0.1:3180, env `BUGSINK_*` в `.env`). Адаптер `packages/bugsink` (API + JSON custom-вебхука). Проект подключается в вебе («Подключить отслеживание ошибок» → два проекта Bugsink `<KEY>-web`/`<KEY>-api`, цель «Стабильность», `incident_settings`, `error_sources`). Входы: `POST /api/hooks/bugsink/<hook_secret>` (`receiveBugsinkWebhook` → `processIncidents` в `after()`) и опрос раз в 2 мин в `tick` вачдога (`pollBugsink`); оба → `ingestIssue` (идемпотентно по issue). Политика проекта (runner/incidents.ts): `notify` / `backlog` (по умолчанию) / `start` / `ask` (кнопки `i:<id>:backlog|start|ignore` в боте) / `triage` (runner/triage.ts: `$PEPPA_TRIAGE_BIN -p --output-format json --model haiku` с токеном владельца, не уверен → `ask`); окружения, игнор-регэксп, предел задач в сутки. «Исправлено» вручную (`resolveIncident`) до PEP-57, `REGRESSED` → задача обратно в бэклог. Моки: `mock-bugsink`, `mock-triage`
|
||||
- **Вход через eGov QR (PEP-65)**: relay KazEDS `sign.aitu.uz` (`KAZEDS_RELAY_BASE`, уже доверенный в eGov), `EGOV_ORGANISATION_NAME`/`EGOV_ORGANISATION_BIN` (БИН сгенерирован). `core/egov.ts`: `startEgovFlow` (документ `<auth><challenge/><nonce/></auth>`, поток в `settings` `egov.flow:<hash>`, 5 мин) → `egovFlowStatus` → `completeEgovFlow` (сверка challenge+nonce, ИИН из сертификата — свой разбор DER, `users.egov_iin`). **Подпись XMLDSig не проверяется — доверяем relay (решение PM)**. Веб: `/auth/egov/{start,status,complete}`, handle только в httpOnly cookie `peppa_egov`; `EgovSign` на странице входа и в «Настройках → eGov» (привязать/отвязать). Войти может только пользователь с привязанным ИИН и доступом (PEP-16). CLI `peppa user egov <login> <ИИН|->`. Мок `mock-kazeds-relay` (testkit; подписывает на 3-м опросе поддельным сертификатом). Пример интеграции от PM — `docs/egov-reference/`
|
||||
- **Подключить Claude (PEP-13)**: «Настройки → Claude» запускает `claude setup-token` в tmux `peppa-auth-u<id>` (runner/claude-auth.ts), пользователь входит по ссылке на своём устройстве и вставляет код в форму; токен шифруется в `users.claude_token_enc` и идёт в сессии проектов владельца как `CLAUDE_CODE_OAUTH_TOKEN`; без токена — вход машины
|
||||
- **Мониторинг (PEP-20)**: веб (`instrumentation.ts`, раз в минуту), бот и вачдог (каждые 30 с) пишут heartbeat в `settings` (`heartbeat:<service>`); вачдог проверяет бота и веб, бот — вачдог и веб (`checkServices` в core/monitor.ts). Молчит дольше `PEPPA_MONITOR_STALE_MIN` (5) мин → алерт админам платформы в Telegram через outbox (`platform.admins`, по умолчанию `platform.allowed_logins`; без привязки — в лог), потом «снова на связи»; напоминание раз в час, кулдаун 15 мин, дедуп ключом `mon:<service>:…`. Упал бот — вачдог шлёт алерт прямо в Bot API. `GET /api/health` (БД, версия, сервисы; 503 без БД), `peppa status`, `peppa platform admins [логины|-]`
|
||||
- **CI проектов (PEP-57)**: Gitea Actions + `act_runner` в docker (`infra/act-runner`, контейнер `peppa-act-runner`, метка `peppa-trusted`, docker.sock хоста). Раннер регистрируется только на репо проектов: один раз на репо peppa-bot (`scripts/ci-runner-register.sh`), на репо чужого пространства — `setupCi` (runner/ci.ts) при создании проекта или `peppa ci connect <KEY>` (ещё PR с workflow из шаблона). Контракт: `.gitea/workflows/ci.yml` + `.gitea/peppa-check.sh` из шаблона, команды — `checks` в `.peppa/project.json`; шаг пишет статус `peppa/<проверка>` и шлёт отчёт в Пеппу, подписанный `PEPPA_CI_SECRET` (секрет Actions = `projectHookSecret(project.id)`). Логи job через API Gitea 1.22 недоступны — хвост лога присылает сам шаг. В тестах регистрация — `mock-ci-register` (`PEPPA_CI_REGISTER_BIN`)
|
||||
@ -34,7 +35,7 @@
|
||||
- **CD проектов (PEP-57)**: шаблон — `.gitea/workflows/deploy.yml` + `.gitea/peppa-deploy.sh` + `deploy/compose.yml` (метки Traefik, сеть `traefik_default`) + `deploy/Dockerfile.*`; настройки — `deploy` в `.peppa/project.json`. Образ `peppa/<slug>:<sha>` на docker хоста, `docker compose -p <slug>-<env>`, хосты `<slug>-pr<N>` / `<slug>-staging` / `<slug>-prod` `.telecom.quest` (один уровень: сертификат Cloudflare). Health до 2 мин изнутри сети Traefik, провал → откат на образ, работавший до этого. Шаг шлёт `X-Peppa-Event: deploy` → `recordRelease` (runner/deploy.ts, таблица `releases`, задачи — из сообщений коммитов). Staging здоров → PM вопрос с кнопкой «🚀 Выкатить в прод»; откат/провал → сообщение с причиной и логом. Прод: `deployProd` (веб «Релизы» на странице проекта, Telegram-кнопка через `answerAndDeliver` → `onReleaseAnswer`, MCP `deploy`, CLI `peppa deploy prod`) ставит тег `deploy-prod-<время>` на здоровый staging-коммит (в Gitea 1.22 нет API workflow_dispatch). В тестах docker — `mock-docker` первым в PATH
|
||||
- `template/` — содержимое репо `peppa-bot/template` в Gitea (`scripts/push-template.sh`). `RULES.md` — общие правила агентов: не копируется в проекты, раннер берёт свежую версию из Gitea при каждом запуске (`--append-system-prompt-file`), кэш `~/.peppa/rules.md`; MCP `get_rules` для ручных сессий. `AGENTS.md` — заготовка под специфику проекта
|
||||
- Gitea: бот `peppa-bot` (токен в `.env`), репо `peppa-bot/peppa` (эта платформа), `peppa-bot/template`; git-доступ через per-repo `credential.helper peppa` (`git-credential-peppa`), глобальный git config не трогаем
|
||||
- **До официального запуска (сейчас)**: всё в деве. `peppa.telecom.quest` — `next dev` (HMR) из рабочей копии `/Users/telecom/Dev/Peppa`: правки этой сессии сразу видны вживую, без сборки и релиза; бот, вачдог и `~/.local/bin` — тоже из рабочей копии; агента `release` нет. Установка: `PEPPA_WEB_MODE=dev scripts/install-launchd.sh watchdog web bot && scripts/install-bins.sh`. Что выкачено = что лежит в рабочей копии (ветка, незакоммиченное), поэтому после работы возвращаться на `main`. Официальный прод будет отдельно на другом домене — по схеме PEP-18 ниже
|
||||
- **До официального запуска (сейчас)**: всё в деве. `peppa.telecom.quest` — `next dev` (HMR) из рабочей копии `/Users/telecom/Dev/Peppa`: правки этой сессии сразу видны вживую, без сборки и релиза; бот, вачдог и `~/.local/bin` — тоже из рабочей копии; агента `release` нет. Установка: `PEPPA_WEB_MODE=dev scripts/install-launchd.sh watchdog web bot && scripts/install-bins.sh`. Cloudflare превращает `no-cache` в 4-часовой кэш браузера, а dev-чанки не меняют имён — поэтому `next.config.ts` в dev отдаёт `/_next/static` с `private, no-store`. Новые колонки в схеме = сразу `peppa db backup && peppa db migrate` (живой веб читает схему из рабочей копии). Что выкачено = что лежит в рабочей копии (ветка, незакоммиченное), поэтому после работы возвращаться на `main`. Официальный прод будет отдельно на другом домене — по схеме PEP-18 ниже
|
||||
- **Прод Пеппы (PEP-18, для будущего официального прода)**: сервисы и `~/.local/bin` работают из `~/peppa/current` — симлинк на `~/peppa/releases/<sha>` (git worktree от bare-клона `~/peppa/repo.git`, `.env` → `~/peppa/shared/.env`), не из рабочей копии `/Users/telecom/Dev/Peppa`. Релиз — `scripts/peppa-release.sh <sha>`: install → `next build` → `peppa db backup` (VACUUM INTO + `quick_check`, `~/.peppa/backups/release-*`) → `peppa db migrate` → `current` → `launchctl kickstart -k` web/bot/watchdog → health (`/api/health` с коммитом релиза, свежие heartbeat) → иначе откат `current` и kickstart; журнал `~/peppa/logs`, отчёты `peppa release report` в `releases` (проект PEP, env prod). Кнопка PM: после зелёного main — вопрос «🚀 Выкатить в прод»; `deployProd` для `PEPPA_PLATFORM_KEY` (PEP) → `deployPlatform` (runner/platform-release.ts) кладёт запрос в `~/.peppa/release-queue`, launchd `quest.telecom.peppa.release` (QueueDirectories) запускает `peppa-release.sh --queue`. `peppa-release.sh --check` — здоровье текущего. bin-обёртки берут логический корень (хуки и `credential.helper` → `~/peppa/current`), агенты launchd получают `PEPPA_ROOT`
|
||||
- `scripts/` — push-template.sh, install-bins.sh (симлинки `packages/*/bin/*` в ~/.local/bin), install-launchd.sh (watchdog/web/bot/release; ждёт выгрузки после `bootout`), peppa-release.sh
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import {
|
||||
linkEgovIin,
|
||||
createTask,
|
||||
getQuestion,
|
||||
getSession,
|
||||
@ -185,6 +186,13 @@ export async function disconnectClaude(f: FormData) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function unlinkEgov(f: FormData) {
|
||||
const user = await requireUser();
|
||||
await attempt(f, async () => {
|
||||
await linkEgovIin(db, user.id, null);
|
||||
});
|
||||
}
|
||||
|
||||
export async function addProjectMember(f: FormData) {
|
||||
const user = await requireUser();
|
||||
await attempt(f, async () => {
|
||||
|
||||
@ -1,15 +1,16 @@
|
||||
import { ExternalLink } from "lucide-react";
|
||||
import { connectedApps } from "@peppa/core";
|
||||
import { connectedApps, maskIin } from "@peppa/core";
|
||||
import { pendingClaudeSetup } from "@peppa/runner";
|
||||
import { Hidden } from "@/components/cards";
|
||||
import { ago, Empty, Flash, Notice, PageHeader, Section } from "@/components/common";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { EgovSign } from "@/components/EgovSign";
|
||||
import { Workspace } from "@/components/Workspace";
|
||||
import { publicOrigin, requireUser } from "@/lib/auth";
|
||||
import { db } from "@/lib/db";
|
||||
import { cancelClaude, connectClaude, disconnectClaude, pairTelegram, revokeConnectedApp, submitClaudeCode, unpairTelegramAction } from "../actions";
|
||||
import { cancelClaude, connectClaude, disconnectClaude, pairTelegram, revokeConnectedApp, submitClaudeCode, unlinkEgov, unpairTelegramAction } from "../actions";
|
||||
|
||||
const back = { back: "/settings" };
|
||||
|
||||
@ -26,9 +27,9 @@ function Row({ title, children, actions }: { title: React.ReactNode; children?:
|
||||
);
|
||||
}
|
||||
|
||||
export default async function Settings({ searchParams }: { searchParams: Promise<{ error?: string; claude?: string }> }) {
|
||||
export default async function Settings({ searchParams }: { searchParams: Promise<{ error?: string; claude?: string; egov?: string }> }) {
|
||||
const user = await requireUser();
|
||||
const { error, claude } = await searchParams;
|
||||
const { error, claude, egov } = await searchParams;
|
||||
const setup = await pendingClaudeSetup(db, user.id);
|
||||
const apps = await connectedApps(db, user.id);
|
||||
const origin = await publicOrigin();
|
||||
@ -91,6 +92,28 @@ export default async function Settings({ searchParams }: { searchParams: Promise
|
||||
</Row>
|
||||
)}
|
||||
</Section>
|
||||
<Section title="eGov">
|
||||
{egov === "linked" && <Notice>eGov привязан — теперь можно входить по QR</Notice>}
|
||||
{user.egovIin ? (
|
||||
<Card>
|
||||
<p className="m-0 text-sm">
|
||||
Привязан ИИН <span className="font-mono">{maskIin(user.egovIin)}</span> — на странице входа можно войти через eGov QR.
|
||||
</p>
|
||||
<form action={unlinkEgov}>
|
||||
<Hidden fields={back} />
|
||||
<Button variant="destructive" size="sm">Отвязать</Button>
|
||||
</form>
|
||||
</Card>
|
||||
) : (
|
||||
<Card>
|
||||
<p className="m-0 text-sm">Привяжите свой ИИН: отсканируйте QR в eGov Mobile и подпишите. После этого можно входить в Пеппу через eGov.</p>
|
||||
<div className="max-w-xs">
|
||||
<EgovSign purpose="link" label="Привязать eGov" />
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
</Section>
|
||||
|
||||
<Section title="Telegram">
|
||||
{user.telegramChatId ? (
|
||||
<Row
|
||||
|
||||
29
apps/web/app/auth/egov/complete/route.ts
Normal file
29
apps/web/app/auth/egov/complete/route.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import { completeEgovFlow, isUserAllowed, PeppaError } from "@peppa/core";
|
||||
import { cookies } from "next/headers";
|
||||
import { NextResponse, type NextRequest } from "next/server";
|
||||
import { EGOV_COOKIE, egovCookieOptions, safeNext, sessionCookie } from "@/lib/auth";
|
||||
import { db } from "@/lib/db";
|
||||
|
||||
/** Finishes a signed eGov flow: logs in by the linked IIN, or links the IIN to the current account. */
|
||||
export async function POST(req: NextRequest) {
|
||||
const { next } = (await req.json().catch(() => ({}))) as { next?: string };
|
||||
const handle = (await cookies()).get(EGOV_COOKIE)?.value ?? "";
|
||||
const done = (body: object, status = 200) => {
|
||||
const res = NextResponse.json(body, { status });
|
||||
res.cookies.set(EGOV_COOKIE, "", egovCookieOptions(0));
|
||||
return res;
|
||||
};
|
||||
try {
|
||||
const r = await completeEgovFlow(db, handle);
|
||||
// The handle lives only in the starter's httpOnly cookie, so a link flow is finished by the
|
||||
// browser (and account) that started it.
|
||||
if (r.purpose === "link") return done({ redirect: "/settings?egov=linked" });
|
||||
if (!(await isUserAllowed(db, r.user))) return done({ error: "Нет доступа к Пеппе — попросите администратора" }, 403);
|
||||
const res = done({ redirect: safeNext(next) });
|
||||
const c = sessionCookie(r.user.id);
|
||||
res.cookies.set(c.name, c.value, c.options);
|
||||
return res;
|
||||
} catch (e) {
|
||||
return done({ error: e instanceof PeppaError ? e.message : "Не удалось войти через eGov" }, 400);
|
||||
}
|
||||
}
|
||||
20
apps/web/app/auth/egov/start/route.ts
Normal file
20
apps/web/app/auth/egov/start/route.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import { PeppaError, startEgovFlow, type EgovPurpose } from "@peppa/core";
|
||||
import { NextResponse, type NextRequest } from "next/server";
|
||||
import QRCode from "qrcode";
|
||||
import { currentUser, EGOV_COOKIE, egovCookieOptions } from "@/lib/auth";
|
||||
import { db } from "@/lib/db";
|
||||
|
||||
/** Starts an eGov QR flow (PEP-65): `login` from the login page, `link` from Settings (needs a session). */
|
||||
export async function POST(req: NextRequest) {
|
||||
const { purpose } = (await req.json().catch(() => ({}))) as { purpose?: EgovPurpose };
|
||||
try {
|
||||
const user = purpose === "link" ? await currentUser() : null;
|
||||
const flow = await startEgovFlow(db, purpose === "link" ? "link" : "login", user?.id ?? null);
|
||||
const qr = await QRCode.toDataURL(flow.qrContent, { errorCorrectionLevel: "M", margin: 2, width: 280 });
|
||||
const res = NextResponse.json({ qr, deeplink: flow.deeplink, expiresAt: flow.expiresAt });
|
||||
res.cookies.set(EGOV_COOKIE, flow.handle, egovCookieOptions(Math.ceil((flow.expiresAt - Date.now()) / 1000)));
|
||||
return res;
|
||||
} catch (e) {
|
||||
return NextResponse.json({ error: e instanceof PeppaError ? e.message : "Не удалось создать QR eGov" }, { status: 502 });
|
||||
}
|
||||
}
|
||||
14
apps/web/app/auth/egov/status/route.ts
Normal file
14
apps/web/app/auth/egov/status/route.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { egovFlowStatus, PeppaError } from "@peppa/core";
|
||||
import { cookies } from "next/headers";
|
||||
import { NextResponse } from "next/server";
|
||||
import { EGOV_COOKIE } from "@/lib/auth";
|
||||
import { db } from "@/lib/db";
|
||||
|
||||
/** Status of this browser's eGov QR flow: pending | scanned | completed | expired | rejected. */
|
||||
export async function GET() {
|
||||
try {
|
||||
return NextResponse.json({ status: await egovFlowStatus(db, (await cookies()).get(EGOV_COOKIE)?.value ?? "") });
|
||||
} catch (e) {
|
||||
return NextResponse.json({ error: e instanceof PeppaError ? e.message : "eGov недоступен" }, { status: 502 });
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,7 @@ import { redirect } from "next/navigation";
|
||||
import { currentUser, safeNext } from "@/lib/auth";
|
||||
import { Brand } from "@/components/Brand";
|
||||
import { Flash } from "@/components/common";
|
||||
import { EgovSign } from "@/components/EgovSign";
|
||||
import { Footer } from "@/components/Footer";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
@ -19,6 +20,7 @@ export default async function Login({ searchParams }: { searchParams: Promise<{
|
||||
<Button asChild variant="default" size="lg" className="w-full">
|
||||
<a href={`/auth/start?next=${encodeURIComponent(safeNext(next))}`}>Войти через Gitea</a>
|
||||
</Button>
|
||||
<EgovSign purpose="login" next={safeNext(next)} label="Войти через eGov" />
|
||||
<Footer />
|
||||
</div>
|
||||
</main>
|
||||
|
||||
76
apps/web/components/EgovSign.tsx
Normal file
76
apps/web/components/EgovSign.tsx
Normal file
@ -0,0 +1,76 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { QrCode, Smartphone } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
type Phase = { at: "idle" } | { at: "qr"; qr: string; deeplink: string; status: string } | { at: "done" } | { at: "error"; message: string };
|
||||
|
||||
const STATUS: Record<string, string> = {
|
||||
pending: "Отсканируйте QR в eGov Mobile",
|
||||
scanned: "QR отсканирован — подпишите в eGov Mobile",
|
||||
completed: "Подписано, входим…",
|
||||
};
|
||||
|
||||
/**
|
||||
* eGov QR (PEP-65): shows the relay's QR and a deep link for the same phone, polls the flow and
|
||||
* finishes it. `login` signs in; `link` binds the IIN to the current account (Settings).
|
||||
*/
|
||||
export function EgovSign({ purpose, next, label }: { purpose: "login" | "link"; next?: string; label: string }) {
|
||||
const [phase, setPhase] = useState<Phase>({ at: "idle" });
|
||||
const alive = useRef(true);
|
||||
// Set on mount too: StrictMode (dev) mounts, unmounts and mounts again.
|
||||
useEffect(() => {
|
||||
alive.current = true;
|
||||
return () => void (alive.current = false);
|
||||
}, []);
|
||||
|
||||
const fail = (message: string) => alive.current && setPhase({ at: "error", message });
|
||||
|
||||
async function start() {
|
||||
const r = await fetch("/auth/egov/start", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ purpose }) });
|
||||
const body = (await r.json()) as { qr?: string; deeplink?: string; error?: string };
|
||||
if (!r.ok || !body.qr) return fail(body.error ?? "Не удалось создать QR");
|
||||
setPhase({ at: "qr", qr: body.qr, deeplink: body.deeplink ?? "", status: "pending" });
|
||||
for (;;) {
|
||||
await new Promise((res) => setTimeout(res, 2000));
|
||||
const s = (await (await fetch("/auth/egov/status", { cache: "no-store" })).json().catch(() => ({}))) as { status?: string; error?: string };
|
||||
if (!alive.current) return;
|
||||
if (s.error) return fail(s.error);
|
||||
if (s.status === "expired") return fail("QR-код истёк — начните заново");
|
||||
if (s.status === "rejected") return fail("Подписание отменено в eGov Mobile");
|
||||
setPhase((p) => (p.at === "qr" ? { ...p, status: s.status ?? p.status } : p));
|
||||
if (s.status === "completed") break;
|
||||
}
|
||||
const c = await fetch("/auth/egov/complete", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ next }) });
|
||||
const done = (await c.json().catch(() => ({}))) as { redirect?: string; error?: string };
|
||||
if (!c.ok || !done.redirect) return fail(done.error ?? "Не удалось войти через eGov");
|
||||
setPhase({ at: "done" });
|
||||
window.location.assign(done.redirect);
|
||||
}
|
||||
|
||||
if (phase.at === "qr") {
|
||||
return (
|
||||
<div className="flex w-full flex-col items-center gap-3 rounded-lg border bg-card p-4">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element -- data URL from the server */}
|
||||
<img src={phase.qr} alt="QR для eGov Mobile" width={220} height={220} className="rounded-md bg-white p-1" />
|
||||
<p className="m-0 text-sm text-muted-foreground" aria-live="polite">{STATUS[phase.status] ?? phase.status}</p>
|
||||
{phase.deeplink && (
|
||||
<Button asChild variant="outline" size="sm" className="w-full">
|
||||
<a href={phase.deeplink}>
|
||||
<Smartphone /> Открыть в eGov Mobile
|
||||
</a>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="flex w-full flex-col gap-2">
|
||||
{phase.at === "error" && <p className="m-0 text-sm text-destructive">{phase.message}</p>}
|
||||
<Button variant="outline" size="lg" className="w-full" disabled={phase.at === "done"} onClick={() => void start().catch((e: Error) => fail(e.message))}>
|
||||
<QrCode /> {phase.at === "error" ? "Новый QR" : label}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -8,6 +8,8 @@ import { db } from "./db";
|
||||
export const SESSION_COOKIE = "peppa_session";
|
||||
export const STATE_COOKIE = "peppa_oauth_state";
|
||||
export const NEXT_COOKIE = "peppa_next";
|
||||
/** eGov QR flow handle (PEP-65): httpOnly, only for /auth/egov, lives as long as the QR. */
|
||||
export const EGOV_COOKIE = "peppa_egov";
|
||||
|
||||
/** Only same-site relative paths are allowed as a post-login destination. */
|
||||
export const safeNext = (n: string | null | undefined) => (n && n.startsWith("/") && !n.startsWith("//") ? n : "/");
|
||||
@ -43,6 +45,8 @@ export function sessionCookie(uid: number) {
|
||||
};
|
||||
}
|
||||
|
||||
export const egovCookieOptions = (maxAgeSec: number) => ({ httpOnly: true, sameSite: "lax" as const, secure: isHttps(), path: "/auth/egov", maxAge: maxAgeSec });
|
||||
|
||||
const isHttps = () => loadEnv().PEPPA_WEB_URL.startsWith("https://");
|
||||
|
||||
/**
|
||||
|
||||
@ -19,6 +19,11 @@ const config: NextConfig = {
|
||||
// Forwarded browser logs land in .next/dev/logs; the watcher picked that up as a change and the
|
||||
// page reloaded in a loop (every reload logs again). Errors still reach the terminal.
|
||||
logging: { browserToTerminal: "error" },
|
||||
// Dev chunks keep their names between edits; Cloudflare turns the dev server's `no-cache` into a
|
||||
// 4 h browser cache, so a reload ran stale code. `private, no-store` is passed through as is.
|
||||
async headers() {
|
||||
return process.env.NODE_ENV === "development" ? [{ source: "/_next/static/:path*", headers: [{ key: "Cache-Control", value: "private, no-store" }] }] : [];
|
||||
},
|
||||
transpilePackages: ["@peppa/db", "@peppa/shared", "@peppa/core", "@peppa/runner", "@peppa/mcp"],
|
||||
env: {
|
||||
NEXT_PUBLIC_PEPPA_VERSION: version,
|
||||
|
||||
@ -24,12 +24,14 @@
|
||||
"geist": "1.9.2",
|
||||
"lucide-react": "1.72.0",
|
||||
"next": "16.4.6",
|
||||
"qrcode": "1.5.4",
|
||||
"react": "19.3.1",
|
||||
"react-dom": "19.3.1",
|
||||
"tailwind-merge": "3.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "4.3.5",
|
||||
"@types/qrcode": "1.5.5",
|
||||
"@types/react": "19.3.0",
|
||||
"@types/react-dom": "19.3.0",
|
||||
"tailwindcss": "4.3.5"
|
||||
|
||||
67
docs/egov-reference/README.md
Normal file
67
docs/egov-reference/README.md
Normal file
@ -0,0 +1,67 @@
|
||||
# KazEDS eGov sign-in widget
|
||||
|
||||
This integration asks eGov Mobile to sign a short-lived XML challenge and gives the signed XML to the relying website. The website owns signature verification and the login decision.
|
||||
|
||||
## Install the backend adapter
|
||||
|
||||
Copy `signWidget.server.js` into the site's Node backend and install:
|
||||
|
||||
```sh
|
||||
npm install express qrcode
|
||||
```
|
||||
|
||||
Mount it in an existing Express app:
|
||||
|
||||
```js
|
||||
const { makeRouter } = require('./signWidget.server');
|
||||
app.use('/api/egov-login', makeRouter({
|
||||
onComplete: async ({ challenge, nonce, signedDocuments, request }) => {
|
||||
// Implement with YOUR XMLDSig verifier and account policy.
|
||||
// 1. Verify the signature over the returned XML.
|
||||
// 2. Confirm the signed XML contains this exact challenge and nonce.
|
||||
// 3. Validate the certificate chain, validity and revocation.
|
||||
// 4. Resolve/link the account and create YOUR site's session.
|
||||
// `challenge` and `nonce` come from server memory, not the browser.
|
||||
const identity = await verifyEgovLogin({ challenge, nonce, signedDocuments });
|
||||
if (!identity) throw new Error('Invalid eGov signature or challenge');
|
||||
await createSiteSession(request, identity);
|
||||
return { authenticated: true };
|
||||
},
|
||||
}));
|
||||
```
|
||||
|
||||
Set `KAZEDS_RELAY_BASE` if needed (default `https://sign.aitu.uz/relay/v1`), plus `EGOV_ORGANISATION_NAME` and `EGOV_ORGANISATION_BIN` for the relying site. Use the registered business identity and eGov-approved domain details required for your integration.
|
||||
|
||||
## Add the browser widget
|
||||
|
||||
Serve `signWidget.js` from the relying site and add:
|
||||
|
||||
```html
|
||||
<div id="egov-login"></div>
|
||||
<script src="/signWidget.js"></script>
|
||||
<script>
|
||||
SignWidget.mount({
|
||||
container: '#egov-login',
|
||||
apiBase: '/api/egov-login',
|
||||
onSigned: async (result) => {
|
||||
const response = await fetch('/api/egov-login/complete', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({ verificationHandle: result.verificationHandle }),
|
||||
});
|
||||
if (!response.ok) throw new Error('The site could not verify this signature');
|
||||
// The relying site's configured onComplete callback decides whether to log in.
|
||||
},
|
||||
onError: (error) => console.error('eGov login flow failed', error),
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
Implement `/api/egov-login/verify` on the relying site's backend. Verify the XMLDSig cryptographically, ensure the signed content contains the exact server-side challenge and nonce, check the certificate chain, validity and revocation, and only then map the certified identity to an account or ask the user to link/create one. Do not trust identity fields sent by the browser, and do not create a login session just because the widget reports `completed`.
|
||||
|
||||
The adapter stores short-lived correlation state in memory and is suitable for a single-process integration prototype. For multiple backend instances, replace its `Map` with shared storage and bind each flow to the site's authenticated/CSRF-protected browser session. The eGov Relay session store is also currently in memory.
|
||||
|
||||
## Test mode
|
||||
|
||||
The Relay's eGov routes are the real API shim, not a deployed mock signer. For local end-to-end UI testing, point `KAZEDS_RELAY_BASE` at a local mock implementing `POST /egov/sessions` and `GET /egov/:id/status`; have it return a completed sample XML document. Real signing still requires eGov Mobile and its domain allowlist. Never use a fabricated signature to grant an account login.
|
||||
33
docs/egov-reference/mockDemo.js
Normal file
33
docs/egov-reference/mockDemo.js
Normal file
@ -0,0 +1,33 @@
|
||||
// Entirely local, test-only journey. The owner callback checks challenge
|
||||
// plumbing but does NOT validate a real XML signature or authenticate anyone.
|
||||
const express = require('express');
|
||||
const { makeRouter } = require('./signWidget.server');
|
||||
|
||||
const app = express();
|
||||
app.get('/', (_req, res) => res.type('html').send(`<!doctype html>
|
||||
<html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>KazEDS local mock</title></head>
|
||||
<body style="font:16px system-ui;max-width:540px;margin:40px auto;padding:16px"><h1>eGov widget mock journey</h1>
|
||||
<p>Local UI test only. The signature is fabricated.</p><div id="egov-login"></div><p id="out" aria-live="polite"></p>
|
||||
<script src="/signWidget.js"></script><script>
|
||||
SignWidget.mount({container:'#egov-login',apiBase:'/api/egov-login',onSigned:async({verificationHandle})=>{
|
||||
const r=await fetch('/api/egov-login/complete',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({verificationHandle})});
|
||||
const data=await r.json();if(!r.ok)throw new Error(data.error||'Mock callback failed');
|
||||
document.querySelector('#out').textContent=data.message;
|
||||
},onError:(e)=>{document.querySelector('#out').textContent=e.message;}});
|
||||
</script></body></html>`));
|
||||
app.get('/signWidget.js', (_req, res) => res.sendFile(require('node:path').join(__dirname, 'signWidget.js')));
|
||||
app.use('/api/egov-login', makeRouter({
|
||||
onComplete: async ({ challenge, nonce, signedDocuments }) => {
|
||||
const xml = signedDocuments?.[0]?.documentXml || '';
|
||||
if (!xml.includes(`<challenge>${challenge}</challenge>`) || !xml.includes(`<nonce>${nonce}</nonce>`)) {
|
||||
throw new Error('Mock challenge/nonce mismatch');
|
||||
}
|
||||
if (!xml.includes('<SignatureValue>NOT_A_SIGNATURE</SignatureValue>')) {
|
||||
throw new Error('This demo expects the test mock response');
|
||||
}
|
||||
return { mockOnly: true, message: 'Challenge handoff passed; no signature was verified.' };
|
||||
},
|
||||
}));
|
||||
|
||||
const port = Number(process.env.PORT || 3102);
|
||||
app.listen(port, '127.0.0.1', () => console.log(`TEST WIDGET ADAPTER ONLY at http://127.0.0.1:${port}`));
|
||||
39
docs/egov-reference/mockRelay.js
Normal file
39
docs/egov-reference/mockRelay.js
Normal file
@ -0,0 +1,39 @@
|
||||
// LOCAL UI TEST ONLY. This returns fabricated XML and MUST NOT be used to
|
||||
// authenticate users or be exposed publicly.
|
||||
const express = require('express');
|
||||
const crypto = require('node:crypto');
|
||||
|
||||
const app = express();
|
||||
app.use(express.json());
|
||||
const sessions = new Map();
|
||||
|
||||
app.post('/v1/egov/sessions', (req, res) => {
|
||||
const id = crypto.randomUUID();
|
||||
const source = req.body?.documentsToSign?.[0]?.documentXml || '';
|
||||
const challenge = source.match(/<challenge>([^<]+)<\/challenge>/)?.[1] || 'MISSING_CHALLENGE';
|
||||
const nonce = source.match(/<nonce>([^<]+)<\/nonce>/)?.[1] || 'MISSING_NONCE';
|
||||
sessions.set(id, { createdAt: Date.now(), polls: 0, challenge, nonce });
|
||||
res.status(201).json({
|
||||
session_id: id,
|
||||
qr_content: `mobileSign:https://example.invalid/mgovSign/${id}`,
|
||||
deeplink: `https://m.egov.kz/mobileSign?link=https%3A%2F%2Fexample.invalid%2FmgovSign%2F${id}`,
|
||||
expires_at: new Date(Date.now() + 5 * 60_000).toISOString(),
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/v1/egov/:id/status', (req, res) => {
|
||||
const session = sessions.get(req.params.id);
|
||||
if (!session) return res.status(404).json({ error: 'Mock session not found' });
|
||||
session.polls += 1;
|
||||
if (session.polls < 3) return res.json({ status: session.polls === 1 ? 'scanned' : 'pending', expires_in: 290 });
|
||||
sessions.delete(req.params.id);
|
||||
const signed = `<auth><challenge>${session.challenge}</challenge><nonce>${session.nonce}</nonce><SignatureValue>NOT_A_SIGNATURE</SignatureValue><X509Certificate>NOT_A_CERTIFICATE</X509Certificate></auth>`;
|
||||
return res.json({
|
||||
status: 'completed',
|
||||
// Deliberately fabricated: only exercises UI plumbing; not a valid signature.
|
||||
signedDocuments: [{ id: 1, nameRu: 'Mock response (not signed)', documentXml: signed }],
|
||||
});
|
||||
});
|
||||
|
||||
const port = Number(process.env.MOCK_PORT || 3103);
|
||||
app.listen(port, '127.0.0.1', () => console.log(`TEST MOCK ONLY at http://127.0.0.1:${port}/v1`));
|
||||
13
docs/egov-reference/package.json
Normal file
13
docs/egov-reference/package.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "kazeds-egov-sign-widget-example",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"mock": "node mockRelay.js",
|
||||
"adapter": "node signWidget.server.js",
|
||||
"mock-demo": "node mockDemo.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.21.2",
|
||||
"qrcode": "^1.5.4"
|
||||
}
|
||||
}
|
||||
171
docs/egov-reference/signWidget.js
Normal file
171
docs/egov-reference/signWidget.js
Normal file
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* KazEDS eGov QR sign-in widget (browser side)
|
||||
*
|
||||
* Usage:
|
||||
* <div id="egov-login"></div>
|
||||
* <script src="/signWidget.js"></script>
|
||||
* <script>
|
||||
* SignWidget.mount({
|
||||
* container: '#egov-login',
|
||||
* apiBase: '/api/egov-login',
|
||||
* onSigned: async (result) => {
|
||||
* // POST result to YOUR backend and validate the XML signature,
|
||||
* // challenge, certificate chain, and revocation status there.
|
||||
* }
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* QR images are generated by the site's backend. No QR payload is sent to
|
||||
* a third-party image service.
|
||||
*/
|
||||
(function (global) {
|
||||
'use strict';
|
||||
|
||||
const DEFAULTS = {
|
||||
apiBase: '/api/egov-login',
|
||||
buttonText: 'Войти через eGov Mobile',
|
||||
onSigned: null,
|
||||
onError: null,
|
||||
pollIntervalMs: 2000,
|
||||
};
|
||||
|
||||
function mount(options) {
|
||||
const config = Object.assign({}, DEFAULTS, options || {});
|
||||
const container = typeof config.container === 'string'
|
||||
? document.querySelector(config.container)
|
||||
: config.container;
|
||||
if (!container) throw new Error('SignWidget: container was not found');
|
||||
|
||||
container.replaceChildren();
|
||||
const root = document.createElement('div');
|
||||
root.className = 'kazeds-sign-widget';
|
||||
root.innerHTML = `
|
||||
<style>
|
||||
.kazeds-sign-widget{font:14px/1.45 system-ui,-apple-system,sans-serif;color:#172033}
|
||||
.kazeds-sign-widget button{border:0;border-radius:9px;padding:12px 18px;background:#009fdb;color:#fff;font-weight:650;cursor:pointer}
|
||||
.kazeds-sign-widget button:disabled{opacity:.55;cursor:wait}
|
||||
.kazeds-sign-widget .kw-panel{margin-top:12px;padding:16px;border:1px solid #dbe3ed;border-radius:12px;text-align:center;background:#fff}
|
||||
.kazeds-sign-widget .kw-panel img{display:block;width:260px;height:260px;max-width:100%;margin:12px auto}
|
||||
.kazeds-sign-widget .kw-error{color:#b42318}.kazeds-sign-widget .kw-status{color:#475467}
|
||||
.kazeds-sign-widget a{color:#0676a8}
|
||||
</style>
|
||||
<button type="button" class="kw-start"></button>
|
||||
<div class="kw-panel" hidden aria-live="polite"></div>`;
|
||||
container.append(root);
|
||||
|
||||
const button = root.querySelector('.kw-start');
|
||||
const panel = root.querySelector('.kw-panel');
|
||||
button.textContent = config.buttonText;
|
||||
let timer = null;
|
||||
let active = false;
|
||||
let requestController = null;
|
||||
|
||||
function showError(error) {
|
||||
panel.hidden = false;
|
||||
panel.replaceChildren();
|
||||
const message = document.createElement('p');
|
||||
message.className = 'kw-error';
|
||||
message.textContent = error && error.message ? error.message : String(error || 'Login failed');
|
||||
panel.append(message);
|
||||
if (typeof config.onError === 'function') config.onError(error);
|
||||
}
|
||||
|
||||
async function jsonRequest(path, options) {
|
||||
const response = await fetch(config.apiBase.replace(/\/$/, '') + path, Object.assign({
|
||||
credentials: 'same-origin',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
}, options || {}));
|
||||
const body = await response.json().catch(() => ({}));
|
||||
if (!response.ok) throw new Error(body.error || `Request failed (${response.status})`);
|
||||
return body;
|
||||
}
|
||||
|
||||
async function poll(session) {
|
||||
try {
|
||||
while (active) {
|
||||
await new Promise((resolve) => { timer = setTimeout(resolve, config.pollIntervalMs); });
|
||||
if (!active) return;
|
||||
const state = await jsonRequest('/' + encodeURIComponent(session.clientSessionId), {
|
||||
method: 'GET',
|
||||
headers: {},
|
||||
});
|
||||
if (state.status === 'completed') {
|
||||
active = false;
|
||||
button.disabled = false;
|
||||
panel.replaceChildren();
|
||||
const done = document.createElement('p');
|
||||
done.className = 'kw-status';
|
||||
done.textContent = 'Подпись получена. Проверка выполняется сайтом.';
|
||||
panel.append(done);
|
||||
if (typeof config.onSigned === 'function') await config.onSigned(state);
|
||||
return;
|
||||
}
|
||||
if (state.status === 'expired' || state.status === 'rejected') {
|
||||
throw new Error(state.status === 'expired' ? 'QR-код истёк. Начните заново.' : 'Подписание отменено.');
|
||||
}
|
||||
const status = panel.querySelector('.kw-status');
|
||||
if (status) status.textContent = state.status === 'scanned'
|
||||
? 'QR отсканирован. Подтвердите подписание в eGov Mobile…'
|
||||
: 'Ожидание сканирования в eGov Mobile…';
|
||||
}
|
||||
} catch (error) {
|
||||
active = false;
|
||||
button.disabled = false;
|
||||
showError(error);
|
||||
}
|
||||
}
|
||||
|
||||
async function start() {
|
||||
if (active) return;
|
||||
button.disabled = true;
|
||||
panel.hidden = false;
|
||||
panel.replaceChildren();
|
||||
const status = document.createElement('p');
|
||||
status.className = 'kw-status';
|
||||
status.textContent = 'Создаём запрос…';
|
||||
panel.append(status);
|
||||
requestController = new AbortController();
|
||||
try {
|
||||
const session = await jsonRequest('/start', {
|
||||
method: 'POST',
|
||||
body: '{}',
|
||||
signal: requestController.signal,
|
||||
});
|
||||
panel.replaceChildren();
|
||||
const heading = document.createElement('p');
|
||||
heading.className = 'kw-status';
|
||||
heading.textContent = 'Откройте eGov Mobile и отсканируйте QR-код';
|
||||
const image = document.createElement('img');
|
||||
image.src = session.qrDataUrl;
|
||||
image.alt = 'eGov QR';
|
||||
const link = document.createElement('a');
|
||||
link.href = session.deeplink;
|
||||
link.textContent = 'Открыть eGov Mobile';
|
||||
link.rel = 'noopener';
|
||||
link.target = '_blank';
|
||||
const progress = document.createElement('p');
|
||||
progress.className = 'kw-status';
|
||||
progress.textContent = 'Ожидание сканирования в eGov Mobile…';
|
||||
panel.append(heading, image, link, progress);
|
||||
active = true;
|
||||
poll(session);
|
||||
} catch (error) {
|
||||
button.disabled = false;
|
||||
showError(error);
|
||||
}
|
||||
}
|
||||
|
||||
button.addEventListener('click', start);
|
||||
return {
|
||||
destroy() {
|
||||
active = false;
|
||||
clearTimeout(timer);
|
||||
if (requestController) requestController.abort();
|
||||
container.replaceChildren();
|
||||
},
|
||||
start,
|
||||
};
|
||||
}
|
||||
|
||||
global.SignWidget = { mount };
|
||||
})(window);
|
||||
126
docs/egov-reference/signWidget.server.js
Normal file
126
docs/egov-reference/signWidget.server.js
Normal file
@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Minimal Express adapter between a site's browser widget and KazEDS Relay.
|
||||
* Requires Node 20+, Express, and qrcode:
|
||||
* npm install express qrcode
|
||||
*
|
||||
* Mount this router only on the site that will verify the result. It returns
|
||||
* the signed XML to that site's browser; it does not authenticate a user.
|
||||
* The site MUST verify the XMLDSig, the exact challenge, certificate chain,
|
||||
* validity/revocation, and apply its own account/linking policy before login.
|
||||
*/
|
||||
const crypto = require('node:crypto');
|
||||
const express = require('express');
|
||||
const QRCode = require('qrcode');
|
||||
|
||||
const RELAY_BASE = (process.env.KAZEDS_RELAY_BASE || 'https://sign.aitu.uz/relay/v1').replace(/\/$/, '');
|
||||
const ORGANISATION_NAME = process.env.EGOV_ORGANISATION_NAME || 'Вход на сайт';
|
||||
const ORGANISATION_BIN = process.env.EGOV_ORGANISATION_BIN || '000000000000';
|
||||
const SESSION_TTL_MS = 5 * 60 * 1000;
|
||||
const sessions = new Map();
|
||||
|
||||
async function relay(path, init) {
|
||||
const response = await fetch(RELAY_BASE + path, Object.assign({
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
}, init || {}));
|
||||
const body = await response.json().catch(() => ({}));
|
||||
if (!response.ok) throw new Error(body.message || body.error || `KazEDS Relay returned ${response.status}`);
|
||||
return body;
|
||||
}
|
||||
|
||||
function makeRouter(options) {
|
||||
const settings = options || {};
|
||||
const router = express.Router();
|
||||
|
||||
// POST /api/egov-login/start
|
||||
router.post('/start', express.json({ limit: '2kb' }), async (_req, res) => {
|
||||
try {
|
||||
const clientSessionId = crypto.randomUUID();
|
||||
const challenge = crypto.randomBytes(32).toString('base64url');
|
||||
// Keep this exact value in server memory; compare it after owner-side
|
||||
// XMLDSig verification. Do not trust a challenge returned by the browser.
|
||||
const challengeXml = `<auth><challenge>${challenge}</challenge><nonce>${clientSessionId}</nonce></auth>`;
|
||||
const relaySession = await relay('/egov/sessions', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
description: `Авторизация: ${ORGANISATION_NAME}`,
|
||||
organisation: { nameRu: ORGANISATION_NAME, nameKz: ORGANISATION_NAME, nameEn: ORGANISATION_NAME, bin: ORGANISATION_BIN },
|
||||
signMethod: 'XML',
|
||||
documentsToSign: [{ id: 1, nameRu: `Вход на ${ORGANISATION_NAME}`, documentXml: challengeXml }],
|
||||
}),
|
||||
});
|
||||
sessions.set(clientSessionId, {
|
||||
relaySessionId: relaySession.session_id,
|
||||
challenge,
|
||||
nonce: clientSessionId,
|
||||
expiresAt: Date.now() + SESSION_TTL_MS,
|
||||
signedDocuments: null,
|
||||
});
|
||||
const qrDataUrl = await QRCode.toDataURL(relaySession.qr_content, { errorCorrectionLevel: 'H', margin: 2, width: 280 });
|
||||
res.status(201).json({ clientSessionId, qrDataUrl, deeplink: relaySession.deeplink, expiresAt: relaySession.expires_at });
|
||||
} catch (error) {
|
||||
res.status(502).json({ error: error.message || 'Could not create eGov QR session' });
|
||||
}
|
||||
});
|
||||
|
||||
// GET /api/egov-login/:clientSessionId
|
||||
router.get('/:clientSessionId', async (req, res) => {
|
||||
const entry = sessions.get(req.params.clientSessionId);
|
||||
if (!entry) return res.status(404).json({ error: 'Login session not found' });
|
||||
if (Date.now() >= entry.expiresAt) {
|
||||
sessions.delete(req.params.clientSessionId);
|
||||
return res.json({ status: 'expired' });
|
||||
}
|
||||
try {
|
||||
const state = await relay(`/egov/${encodeURIComponent(entry.relaySessionId)}/status`, { method: 'GET' });
|
||||
if (state.status === 'completed') {
|
||||
// Keep the signed content and expected challenge on the server. The
|
||||
// browser receives only a random handle and cannot replace either.
|
||||
entry.signedDocuments = state.signedDocuments;
|
||||
return res.json({ status: 'completed', verificationHandle: req.params.clientSessionId });
|
||||
}
|
||||
return res.json({ status: state.status, expires_in: state.expires_in });
|
||||
} catch (error) {
|
||||
return res.status(502).json({ error: error.message || 'Could not read eGov session status' });
|
||||
}
|
||||
});
|
||||
|
||||
// POST /api/egov-login/complete { verificationHandle }
|
||||
// The relying site supplies its own verifier/account policy via onComplete.
|
||||
router.post('/complete', express.json({ limit: '2kb' }), async (req, res) => {
|
||||
const handle = req.body && req.body.verificationHandle;
|
||||
const entry = typeof handle === 'string' ? sessions.get(handle) : null;
|
||||
if (!entry || !entry.signedDocuments) return res.status(404).json({ error: 'Completed login flow not found' });
|
||||
if (Date.now() >= entry.expiresAt) {
|
||||
sessions.delete(handle);
|
||||
return res.status(410).json({ error: 'Login flow expired' });
|
||||
}
|
||||
if (typeof settings.onComplete !== 'function') {
|
||||
return res.status(501).json({ error: 'Configure the relying site onComplete verifier before using this endpoint' });
|
||||
}
|
||||
try {
|
||||
const result = await settings.onComplete({
|
||||
challenge: entry.challenge,
|
||||
nonce: entry.nonce,
|
||||
signedDocuments: entry.signedDocuments,
|
||||
request: req,
|
||||
});
|
||||
sessions.delete(handle);
|
||||
return res.json(result || { authenticated: true });
|
||||
} catch (error) {
|
||||
sessions.delete(handle);
|
||||
return res.status(401).json({ error: error.message || 'Signature verification failed' });
|
||||
}
|
||||
});
|
||||
|
||||
return router;
|
||||
}
|
||||
|
||||
module.exports = { makeRouter };
|
||||
|
||||
// Optional standalone demo server: `node signWidget.server.js`
|
||||
if (require.main === module) {
|
||||
const app = express();
|
||||
app.use('/api/egov-login', makeRouter());
|
||||
const port = Number(process.env.PORT || 3102);
|
||||
app.listen(port, () => console.log(`KazEDS eGov widget adapter listening on :${port}`));
|
||||
}
|
||||
60
openspec/changes/pep-65-egov-login/design.md
Normal file
60
openspec/changes/pep-65-egov-login/design.md
Normal file
@ -0,0 +1,60 @@
|
||||
# Design: PEP-65 — вход через eGov QR
|
||||
|
||||
## Доверие (решение PM 2026-11-14)
|
||||
|
||||
Подпись XMLDSig Пеппа **сама криптографически не проверяет**: eGov Mobile подписывает
|
||||
ключами НУЦ РК (ГОСТ), стандартные библиотеки Node ГОСТ не умеют, а отдельный сервис
|
||||
проверки (NCANode) PM решил не поднимать. Доверяем relay `sign.aitu.uz`:
|
||||
|
||||
- id сессии relay знает только сервер Пеппы, статус и подписанный XML Пеппа забирает сама
|
||||
по HTTPS — браузер не может подсунуть чужой результат;
|
||||
- в подписанном XML должен быть ровно наш challenge (32 случайных байта) и nonce потока;
|
||||
- ИИН берётся из сертификата подписанта (`SERIALNUMBER=IIN…`) в этом XML.
|
||||
|
||||
Риск: компрометация relay или TLS до него = возможность войти под любым привязанным ИИН.
|
||||
Если понадобится строже — проверка через NCANode встаёт в `completeEgovFlow` без смены
|
||||
потока (одна функция `verifySigned`).
|
||||
|
||||
## Поток
|
||||
|
||||
```
|
||||
браузер веб Пеппы (route handlers) relay sign.aitu.uz
|
||||
«Войти через eGov» ──▶ POST /auth/egov/start {purpose} ──────▶ POST /egov/sessions
|
||||
settings egov.flow:<sha(handle)> ◀── session_id, qr_content,
|
||||
◀── {qr (data URL), deeplink, expiresAt} + cookie peppa_egov=handle deeplink, expires_at
|
||||
опрос каждые 2 с ─────▶ GET /auth/egov/status ─────────────────▶ GET /egov/:id/status
|
||||
◀── pending|scanned|completed|expired|rejected ◀── status, signedDocuments
|
||||
completed ────────────▶ POST /auth/egov/complete
|
||||
challenge+nonce в XML? ИИН из сертификата → пользователь →
|
||||
◀── {redirect} + peppa_session (вход) или привязка ИИН (настройки)
|
||||
```
|
||||
|
||||
- Handle — 24 случайных байта; в базе ключ — его хэш (`hashToken`), как у ссылок входа.
|
||||
Handle живёт только в httpOnly cookie `peppa_egov` (path `/auth/egov`, 5 мин) — его
|
||||
не видно скриптам и он не уходит в URL.
|
||||
- `purpose`: `login` (без входа) или `link` (нужна сессия; поток запоминает userId).
|
||||
- Поток одноразовый: `complete` удаляет запись при любом исходе.
|
||||
|
||||
## Сертификат
|
||||
|
||||
`documentXml` содержит `<ds:X509Certificate>` (base64 DER). Разбор — свой мини-проход по
|
||||
DER (OID `2.5.4.5` SERIALNUMBER, `2.5.4.3` CN, `2.5.4.4` SURNAME, `2.5.4.42` GIVENNAME),
|
||||
без `X509Certificate` из node:crypto: он может не принять ГОСТ-ключ, а нам нужны только
|
||||
поля субъекта. ИИН — 12 цифр после `IIN`, с проверкой контрольной цифры. Сертификат
|
||||
юрлица (`BIN…` в OU) не мешает: берём ИИН подписанта.
|
||||
|
||||
## Данные
|
||||
|
||||
- `users.egov_iin` (text, unique, nullable) + `users.egov_linked_at`. Одна учётка — один ИИН.
|
||||
- Потоки — в `settings` (ключ `egov.flow:<hash>`, JSON с `expiresAt`), просроченные
|
||||
удаляются при обращении и раз в тик вачдога не нужны: записи мелкие, ключ одноразовый.
|
||||
|
||||
## Окружение
|
||||
|
||||
- `KAZEDS_RELAY_BASE` — по умолчанию `https://sign.aitu.uz/relay/v1`.
|
||||
- `EGOV_ORGANISATION_NAME` — по умолчанию «Peppa»; `EGOV_ORGANISATION_BIN` — по умолчанию
|
||||
`241140100000` (сгенерирован с верной контрольной цифрой, по решению PM).
|
||||
- Мок: `mock-kazeds-relay` (`packages/testkit`), `KAZEDS_RELAY_BASE=http://127.0.0.1:<port>/v1`.
|
||||
Он сам «подписывает» на 3-м опросе и кладёт поддельный сертификат с ИИН из
|
||||
`MOCK_EGOV_IIN`; можно отказать (`MOCK_EGOV_REJECT=1`) и подменить challenge
|
||||
(`MOCK_EGOV_TAMPER=1`).
|
||||
39
openspec/changes/pep-65-egov-login/proposal.md
Normal file
39
openspec/changes/pep-65-egov-login/proposal.md
Normal file
@ -0,0 +1,39 @@
|
||||
# Proposal: PEP-65 — вход через eGov QR
|
||||
|
||||
Задача Пеппы: **PEP-65**.
|
||||
|
||||
## Why
|
||||
|
||||
Войти в Пеппу сейчас можно только через Gitea. Людям из Казахстана привычнее и быстрее
|
||||
войти через eGov Mobile: отсканировать QR и подписать. Relay KazEDS `sign.aitu.uz` уже
|
||||
доверенный в eGov, поэтому регистрировать свой домен не нужно.
|
||||
|
||||
## What Changes
|
||||
|
||||
- Страница входа: «Войти через eGov». Пеппа создаёт сессию подписи в relay
|
||||
(`POST /egov/sessions`, документ `<auth><challenge/><nonce/></auth>`), показывает QR
|
||||
и кнопку «Открыть в eGov Mobile» (для телефона), опрашивает статус; после подписи
|
||||
сверяет challenge и nonce в подписанном XML, берёт ИИН и ФИО из сертификата и входит
|
||||
под пользователем, к которому этот ИИН привязан.
|
||||
- «Настройки → eGov»: привязать свой ИИН (та же подпись QR) и отвязать. Войти через eGov
|
||||
может только пользователь с привязанным ИИН, которому разрешён вход (PEP-16).
|
||||
- CLI: `peppa user egov <login> <ИИН|->` — привязка вручную.
|
||||
- Состояние потоков входа — в SQLite (`settings`, TTL 5 мин), браузер получает только
|
||||
непрозрачный handle и cookie потока.
|
||||
- Мок `mock-kazeds-relay` с контрактом relay для тестов и проверок без телефона.
|
||||
- Пример интеграции из `apps/sign` переезжает в `docs/egov-reference/` (не пакет workspace).
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
|
||||
### Modified Capabilities
|
||||
- `web-auth`: вход через eGov QR, привязка ИИН.
|
||||
|
||||
## Impact
|
||||
|
||||
`packages/core/src/egov.ts` (relay, потоки, разбор сертификата), `packages/db` (колонка
|
||||
`users.egov_iin`, миграция), `packages/shared` (env `KAZEDS_RELAY_BASE`,
|
||||
`EGOV_ORGANISATION_NAME`, `EGOV_ORGANISATION_BIN`), `apps/web/app/auth/egov/*`,
|
||||
страница входа и «Настройки», `packages/cli`, `packages/testkit` (мок и тесты),
|
||||
зависимость `qrcode` в вебе.
|
||||
40
openspec/changes/pep-65-egov-login/specs/web-auth/spec.md
Normal file
40
openspec/changes/pep-65-egov-login/specs/web-auth/spec.md
Normal file
@ -0,0 +1,40 @@
|
||||
# Spec Delta: web-auth
|
||||
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Вход через eGov QR
|
||||
Страница входа SHALL предлагать «Войти через eGov»: Пеппа создаёт сессию подписи в relay
|
||||
KazEDS, показывает QR и ссылку для eGov Mobile и после подписи входит под пользователем,
|
||||
к которому привязан ИИН из сертификата подписанта. Подписанный документ SHALL содержать
|
||||
ровно challenge и nonce, созданные сервером для этого потока; поток одноразовый и живёт
|
||||
5 минут.
|
||||
|
||||
#### Scenario: Вход по QR
|
||||
- **GIVEN** у пользователя «asel» привязан ИИН 900101300126 и вход ему разрешён
|
||||
- **WHEN** он выбирает «Войти через eGov» и подписывает QR в eGov Mobile
|
||||
- **THEN** он входит в Пеппу как «asel»
|
||||
|
||||
#### Scenario: ИИН не привязан
|
||||
- **WHEN** QR подписал человек, чей ИИН не привязан ни к одному пользователю
|
||||
- **THEN** вход отклонён с подсказкой привязать eGov в «Настройках» после входа через Gitea
|
||||
|
||||
#### Scenario: Подменённый документ
|
||||
- **WHEN** в подписанном XML нет challenge или nonce этого потока
|
||||
- **THEN** вход отклонён, поток удалён
|
||||
|
||||
#### Scenario: Отказ или истечение
|
||||
- **WHEN** пользователь отменил подпись в eGov Mobile или QR истёк
|
||||
- **THEN** страница входа показывает причину и предлагает новый QR
|
||||
|
||||
### Requirement: Привязка ИИН
|
||||
Пользователь SHALL привязывать к своей учётке ИИН, подписав QR в «Настройках → eGov», и
|
||||
отвязывать его там же. Один ИИН привязан не больше чем к одной учётке.
|
||||
|
||||
#### Scenario: Привязка
|
||||
- **GIVEN** пользователь вошёл через Gitea
|
||||
- **WHEN** он нажимает «Привязать eGov» и подписывает QR
|
||||
- **THEN** в «Настройках» виден его ИИН (частично скрытый) и дальше он может входить через eGov
|
||||
|
||||
#### Scenario: ИИН уже занят
|
||||
- **WHEN** пользователь подписывает QR ИИН, привязанным к другой учётке
|
||||
- **THEN** привязка отклонена
|
||||
10
openspec/changes/pep-65-egov-login/tasks.md
Normal file
10
openspec/changes/pep-65-egov-login/tasks.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Tasks: PEP-65
|
||||
|
||||
- [x] 1.1 env (`KAZEDS_RELAY_BASE`, `EGOV_ORGANISATION_NAME`, `EGOV_ORGANISATION_BIN`), колонка `users.egov_iin`, миграция
|
||||
- [x] 1.2 `core/egov.ts`: клиент relay, потоки в `settings`, проверка challenge/nonce, разбор сертификата, привязка ИИН
|
||||
- [x] 1.3 Мок `mock-kazeds-relay` (testkit) по контракту relay
|
||||
- [x] 1.4 Route handlers `/auth/egov/{start,status,complete}`, cookie потока
|
||||
- [x] 1.5 UI: «Войти через eGov» на странице входа, «Настройки → eGov» (привязать / отвязать)
|
||||
- [x] 1.6 CLI `peppa user egov <login> <ИИН|->`
|
||||
- [x] 1.7 Тесты (testkit): вход, не привязан, подмена, отказ, истечение, привязка, занятый ИИН
|
||||
- [x] 1.8 `apps/sign` → `docs/egov-reference/`; AGENTS.md, «Помощь»; `openspec validate`
|
||||
@ -25,6 +25,8 @@ import {
|
||||
getSetting,
|
||||
setAllowedLogins,
|
||||
getUserByLogin,
|
||||
linkEgovIin,
|
||||
maskIin,
|
||||
giteaForBot,
|
||||
setProjectOwner,
|
||||
getTaskDetails,
|
||||
@ -75,6 +77,7 @@ const USAGE = `peppa — Peppa software factory CLI
|
||||
peppa status (services, outbox, runners, questions, admins)
|
||||
peppa telegram pair <login> | status | unpair <login> (users normally pair in web Settings)
|
||||
peppa user ensure mock-<name> (local test user)
|
||||
peppa user egov <login> <ИИН|-> (eGov QR login: link the IIN, "-" unlinks; users link it in web Settings)
|
||||
peppa web login-link <gitea-login> (one-time admin login, 10 minutes)
|
||||
peppa watchdog [--once] [--interval <sec>] [--stall <min>]
|
||||
peppa db migrate (apply schema migrations to PEPPA_DB)
|
||||
@ -404,6 +407,15 @@ async function main(): Promise<void> {
|
||||
console.log(`${u.login} (#${u.id})`);
|
||||
break;
|
||||
}
|
||||
case "user egov": {
|
||||
// PEP-65: link (or unlink with "-") the IIN a user logs in with through eGov QR.
|
||||
if (!args[0] || !args[1]) throw new PeppaError("usage: peppa user egov <login> <ИИН|->");
|
||||
const u = await getUserByLogin(db, args[0]);
|
||||
if (!u) throw new PeppaError(`нет пользователя ${args[0]}`);
|
||||
const linked = await linkEgovIin(db, u.id, args[1] === "-" ? null : args[1]);
|
||||
console.log(linked.egovIin ? `${u.login}: eGov ${maskIin(linked.egovIin)}` : `${u.login}: eGov отвязан`);
|
||||
break;
|
||||
}
|
||||
case "watchdog": {
|
||||
const wopts = {
|
||||
intervalMs: Number(opts.interval) * 1000,
|
||||
|
||||
217
packages/core/src/egov.ts
Normal file
217
packages/core/src/egov.ts
Normal file
@ -0,0 +1,217 @@
|
||||
// eGov QR login (PEP-65) through the KazEDS relay (sign.aitu.uz): Peppa asks eGov Mobile to sign a
|
||||
// short-lived <auth><challenge/><nonce/></auth>, reads the signed XML from the relay itself and takes
|
||||
// the signer's IIN from the certificate. The XMLDSig itself is not verified here — the relay is
|
||||
// trusted (PM decision, see openspec design); the challenge and nonce never leave the server.
|
||||
import { randomBytes, randomUUID } from "node:crypto";
|
||||
import { eq } from "drizzle-orm";
|
||||
import { users, type Db } from "@peppa/db";
|
||||
import { loadEnv } from "@peppa/shared";
|
||||
import { hashToken } from "./crypto.ts";
|
||||
import { PeppaError } from "./errors.ts";
|
||||
import { deleteSetting, getSetting, setSetting } from "./settings.ts";
|
||||
import { getUser, type User } from "./users.ts";
|
||||
|
||||
export const EGOV_FLOW_TTL_MS = 5 * 60_000;
|
||||
export type EgovPurpose = "login" | "link";
|
||||
export type EgovStatus = "pending" | "scanned" | "completed" | "expired" | "rejected";
|
||||
|
||||
interface Flow {
|
||||
purpose: EgovPurpose;
|
||||
/** The account being linked (purpose "link"). */
|
||||
userId: number | null;
|
||||
relaySessionId: string;
|
||||
challenge: string;
|
||||
nonce: string;
|
||||
expiresAt: number;
|
||||
}
|
||||
|
||||
interface SignedDocument {
|
||||
id: number;
|
||||
nameRu?: string;
|
||||
documentXml: string;
|
||||
}
|
||||
|
||||
const flowKey = (handle: string) => `egov.flow:${hashToken(handle)}`;
|
||||
|
||||
async function relay<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
const base = loadEnv().KAZEDS_RELAY_BASE.replace(/\/$/, "");
|
||||
const res = await fetch(base + path, { ...init, headers: { "Content-Type": "application/json" }, signal: AbortSignal.timeout(15_000) });
|
||||
const body = (await res.json().catch(() => ({}))) as T & { message?: string; error?: string };
|
||||
if (!res.ok) throw new PeppaError(`eGov relay: ${body.message ?? body.error ?? `HTTP ${res.status}`}`);
|
||||
return body;
|
||||
}
|
||||
|
||||
export interface EgovStart {
|
||||
/** Opaque handle: kept by the browser in an httpOnly cookie, never in a URL. */
|
||||
handle: string;
|
||||
/** What the QR encodes (eGov Mobile scans it). */
|
||||
qrContent: string;
|
||||
/** Opens eGov Mobile on the same phone. */
|
||||
deeplink: string;
|
||||
expiresAt: number;
|
||||
}
|
||||
|
||||
/** Starts a signing session in the relay for a login or for linking `userId`'s IIN. */
|
||||
export async function startEgovFlow(db: Db, purpose: EgovPurpose, userId: number | null = null): Promise<EgovStart> {
|
||||
if (purpose === "link" && !userId) throw new PeppaError("Привязать eGov можно только после входа");
|
||||
const env = loadEnv();
|
||||
const nonce = randomUUID();
|
||||
const challenge = randomBytes(32).toString("base64url");
|
||||
const org = env.EGOV_ORGANISATION_NAME;
|
||||
const s = await relay<{ session_id: string; qr_content: string; deeplink: string; expires_at?: string }>("/egov/sessions", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
description: purpose === "link" ? `Привязка eGov: ${org}` : `Авторизация: ${org}`,
|
||||
organisation: { nameRu: org, nameKz: org, nameEn: org, bin: env.EGOV_ORGANISATION_BIN },
|
||||
signMethod: "XML",
|
||||
documentsToSign: [{ id: 1, nameRu: `Вход в ${org}`, documentXml: `<auth><challenge>${challenge}</challenge><nonce>${nonce}</nonce></auth>` }],
|
||||
}),
|
||||
});
|
||||
const relayExpiry = s.expires_at ? Date.parse(s.expires_at) : NaN;
|
||||
const expiresAt = Math.min(Date.now() + EGOV_FLOW_TTL_MS, Number.isFinite(relayExpiry) ? relayExpiry : Infinity);
|
||||
const handle = randomBytes(24).toString("base64url");
|
||||
const flow: Flow = { purpose, userId, relaySessionId: s.session_id, challenge, nonce, expiresAt };
|
||||
await setSetting(db, flowKey(handle), flow);
|
||||
return { handle, qrContent: s.qr_content, deeplink: s.deeplink, expiresAt };
|
||||
}
|
||||
|
||||
async function loadFlow(db: Db, handle: string): Promise<Flow | null> {
|
||||
if (!handle) return null;
|
||||
const flow = await getSetting<Flow>(db, flowKey(handle));
|
||||
if (flow && Date.now() >= flow.expiresAt) {
|
||||
await deleteSetting(db, flowKey(handle));
|
||||
return null;
|
||||
}
|
||||
return flow;
|
||||
}
|
||||
|
||||
/** Relay status of a flow; "expired" once the flow is gone or past its TTL. */
|
||||
export async function egovFlowStatus(db: Db, handle: string): Promise<EgovStatus> {
|
||||
const flow = await loadFlow(db, handle);
|
||||
if (!flow) return "expired";
|
||||
const s = await relay<{ status: EgovStatus }>(`/egov/${encodeURIComponent(flow.relaySessionId)}/status`);
|
||||
return s.status;
|
||||
}
|
||||
|
||||
export interface EgovIdentity {
|
||||
iin: string;
|
||||
name: string | null;
|
||||
}
|
||||
|
||||
export type EgovResult = { purpose: "login"; user: User; identity: EgovIdentity } | { purpose: "link"; user: User; identity: EgovIdentity };
|
||||
|
||||
/**
|
||||
* Finishes a signed flow (one-shot: the flow is removed whatever happens): checks that the
|
||||
* signed XML carries this flow's challenge and nonce, reads the signer's IIN, then logs in the
|
||||
* account the IIN is linked to, or links it to the flow's account.
|
||||
*/
|
||||
export async function completeEgovFlow(db: Db, handle: string): Promise<EgovResult> {
|
||||
const flow = await loadFlow(db, handle);
|
||||
if (!flow) throw new PeppaError("QR-код истёк — начните заново");
|
||||
await deleteSetting(db, flowKey(handle));
|
||||
const s = await relay<{ status: EgovStatus; signedDocuments?: SignedDocument[] }>(`/egov/${encodeURIComponent(flow.relaySessionId)}/status`);
|
||||
if (s.status !== "completed") throw new PeppaError(s.status === "rejected" ? "Подписание отменено" : "Документ ещё не подписан");
|
||||
const identity = verifySigned(s.signedDocuments ?? [], flow);
|
||||
|
||||
if (flow.purpose === "link") {
|
||||
const user = await linkEgovIin(db, flow.userId!, identity.iin);
|
||||
return { purpose: "link", user, identity };
|
||||
}
|
||||
const [user] = await db.select().from(users).where(eq(users.egovIin, identity.iin));
|
||||
if (!user) throw new PeppaError("Этот ИИН не привязан к Пеппе — войдите через Gitea и привяжите eGov в «Настройках»");
|
||||
return { purpose: "login", user, identity };
|
||||
}
|
||||
|
||||
/** The trust check (relay trusted): our challenge and nonce are in the signed XML; signer from the certificate. */
|
||||
function verifySigned(docs: SignedDocument[], flow: Flow): EgovIdentity {
|
||||
const xml = docs[0]?.documentXml ?? "";
|
||||
if (!xml.includes(`<challenge>${flow.challenge}</challenge>`) || !xml.includes(`<nonce>${flow.nonce}</nonce>`)) {
|
||||
throw new PeppaError("Подписан не тот документ — начните заново");
|
||||
}
|
||||
const cert = /<(?:\w+:)?X509Certificate>\s*([A-Za-z0-9+/=\s]+?)\s*<\/(?:\w+:)?X509Certificate>/.exec(xml)?.[1];
|
||||
if (!cert) throw new PeppaError("В подписи нет сертификата");
|
||||
const subject = certificateSubject(Buffer.from(cert.replace(/\s+/g, ""), "base64"));
|
||||
const iin = /^IIN(\d{12})$/.exec(subject.serialNumber ?? "")?.[1];
|
||||
if (!iin || !isValidIin(iin)) throw new PeppaError("В сертификате нет ИИН");
|
||||
const name = subject.commonName ?? ([subject.surname, subject.givenName].filter(Boolean).join(" ") || null);
|
||||
return { iin, name };
|
||||
}
|
||||
|
||||
export interface CertSubject {
|
||||
serialNumber?: string;
|
||||
commonName?: string;
|
||||
surname?: string;
|
||||
givenName?: string;
|
||||
}
|
||||
|
||||
const SUBJECT_OIDS: Record<string, keyof CertSubject> = {
|
||||
"550405": "serialNumber", // 2.5.4.5
|
||||
"550403": "commonName", // 2.5.4.3
|
||||
"550404": "surname", // 2.5.4.4
|
||||
"55042a": "givenName", // 2.5.4.42
|
||||
};
|
||||
|
||||
/**
|
||||
* Subject fields of an X.509 certificate (DER), read by walking the ASN.1 tree. node:crypto's
|
||||
* X509Certificate is not used: it may refuse the GOST keys of NCA RK, and only the names matter.
|
||||
* The issuer comes before the subject in the certificate, so the last value of each field wins.
|
||||
*/
|
||||
export function certificateSubject(der: Buffer): CertSubject {
|
||||
const out: CertSubject = {};
|
||||
const walk = (start: number, end: number) => {
|
||||
let i = start;
|
||||
while (i < end) {
|
||||
const tag = der[i]!;
|
||||
let len = der[i + 1]!;
|
||||
let off = i + 2;
|
||||
if (len & 0x80) {
|
||||
const n = len & 0x7f;
|
||||
if (n === 0 || n > 4) return;
|
||||
len = 0;
|
||||
for (let k = 0; k < n; k++) len = len * 256 + der[off + k]!;
|
||||
off += n;
|
||||
}
|
||||
const next = off + len;
|
||||
if (next > end) return;
|
||||
if (tag === 0x30 && len > 2 && der[off] === 0x06) {
|
||||
// SEQUENCE { OID, value }: an AttributeTypeAndValue when the OID is a name attribute.
|
||||
const oidLen = der[off + 1]!;
|
||||
const field = SUBJECT_OIDS[der.subarray(off + 2, off + 2 + oidLen).toString("hex")];
|
||||
const v = off + 2 + oidLen;
|
||||
if (field && v + 2 <= next) {
|
||||
out[field] = der.subarray(v + 2, v + 2 + der[v + 1]!).toString(der[v] === 0x1e ? "utf16le" : "utf8");
|
||||
}
|
||||
}
|
||||
if (tag & 0x20) walk(off, next); // constructed: descend
|
||||
i = next;
|
||||
}
|
||||
};
|
||||
walk(0, der.length);
|
||||
return out;
|
||||
}
|
||||
|
||||
/** IIN control digit (the same algorithm as BIN). */
|
||||
export function isValidIin(iin: string): boolean {
|
||||
if (!/^\d{12}$/.test(iin)) return false;
|
||||
const d = [...iin].map(Number);
|
||||
const sum = (w: number[]) => w.reduce((a, x, i) => a + x * d[i]!, 0) % 11;
|
||||
let c = sum([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);
|
||||
if (c === 10) c = sum([3, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2]);
|
||||
return c !== 10 && c === d[11];
|
||||
}
|
||||
|
||||
/** Links an IIN to an account (or unlinks with null). One account per IIN. */
|
||||
export async function linkEgovIin(db: Db, userId: number, iin: string | null): Promise<User> {
|
||||
if (iin !== null && !isValidIin(iin)) throw new PeppaError("Неверный ИИН");
|
||||
if (iin) {
|
||||
const [other] = await db.select().from(users).where(eq(users.egovIin, iin));
|
||||
if (other && other.id !== userId) throw new PeppaError("Этот ИИН уже привязан к другой учётке");
|
||||
}
|
||||
await db.update(users).set({ egovIin: iin, egovLinkedAt: iin ? new Date() : null }).where(eq(users.id, userId));
|
||||
const user = await getUser(db, userId);
|
||||
if (!user) throw new PeppaError("Пользователь не найден");
|
||||
return user;
|
||||
}
|
||||
|
||||
/** "9001****0123" — enough to recognise your own IIN on screen. */
|
||||
export const maskIin = (iin: string) => `${iin.slice(0, 4)}****${iin.slice(8)}`;
|
||||
@ -17,3 +17,4 @@ export * from "./backup.ts";
|
||||
export * from "./repo-info.ts";
|
||||
export * from "./incidents.ts";
|
||||
export * from "./ci.ts";
|
||||
export * from "./egov.ts";
|
||||
|
||||
3
packages/db/migrations/0001_egov_iin.sql
Normal file
3
packages/db/migrations/0001_egov_iin.sql
Normal file
@ -0,0 +1,3 @@
|
||||
ALTER TABLE `users` ADD `egov_iin` text;--> statement-breakpoint
|
||||
ALTER TABLE `users` ADD `egov_linked_at` integer;--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `users_egov_iin_unique` ON `users` (`egov_iin`);
|
||||
2272
packages/db/migrations/meta/0001_snapshot.json
Normal file
2272
packages/db/migrations/meta/0001_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -8,6 +8,13 @@
|
||||
"when": 1794571062983,
|
||||
"tag": "0000_baseline",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 1,
|
||||
"version": "6",
|
||||
"when": 1794600109462,
|
||||
"tag": "0001_egov_iin",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -31,6 +31,9 @@ export const users = sqliteTable("users", {
|
||||
telegramUserId: integer("telegram_user_id"),
|
||||
telegramUsername: text("telegram_username"),
|
||||
telegramPairedAt: integer("telegram_paired_at", { mode: "timestamp_ms" }),
|
||||
// eGov login (PEP-65): the signer's IIN from the certificate, one account per IIN.
|
||||
egovIin: text("egov_iin").unique(),
|
||||
egovLinkedAt: integer("egov_linked_at", { mode: "timestamp_ms" }),
|
||||
createdAt: createdAt(),
|
||||
lastLoginAt: integer("last_login_at", { mode: "timestamp_ms" }),
|
||||
});
|
||||
|
||||
@ -16,6 +16,10 @@ const schema = z.object({
|
||||
PEPPA_SECRET: z.string().optional(),
|
||||
GITEA_OAUTH_CLIENT_ID: z.string().optional(),
|
||||
GITEA_OAUTH_CLIENT_SECRET: z.string().optional(),
|
||||
// eGov QR login (PEP-65) through the KazEDS relay, already trusted by eGov Mobile.
|
||||
KAZEDS_RELAY_BASE: z.string().url().default("https://sign.aitu.uz/relay/v1"),
|
||||
EGOV_ORGANISATION_NAME: z.string().default("Peppa"),
|
||||
EGOV_ORGANISATION_BIN: z.string().regex(/^\d{12}$/).default("241140100000"),
|
||||
});
|
||||
|
||||
export type Env = z.infer<typeof schema> & { PEPPA_DB: string };
|
||||
|
||||
3
packages/testkit/bin/mock-kazeds-relay
Executable file
3
packages/testkit/bin/mock-kazeds-relay
Executable file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
ROOT="$(cd "$(dirname "$(readlink -f "$0")")/../../.." && pwd)"
|
||||
exec "${PEPPA_NODE:-node}" --import "$ROOT/scripts/lib/require-node.mjs" "$ROOT/packages/testkit/src/mock-kazeds-relay.ts" "$@"
|
||||
109
packages/testkit/src/mock-kazeds-relay.ts
Normal file
109
packages/testkit/src/mock-kazeds-relay.ts
Normal file
@ -0,0 +1,109 @@
|
||||
// Mock KazEDS relay (PEP-65) for tests and checks without a phone: POST /v1/egov/sessions and
|
||||
// GET /v1/egov/:id/status with the relay's JSON shapes. The "phone" scans on the 1st poll and
|
||||
// signs on the 3rd; the signed XML echoes the document and carries a FAKE certificate whose
|
||||
// subject has SERIALNUMBER=IIN<iin> — not a signature, only the plumbing is exercised.
|
||||
// Standalone: `mock-kazeds-relay [port]` (MOCK_EGOV_IIN, MOCK_EGOV_NAME).
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { createServer, type Server } from "node:http";
|
||||
import type { AddressInfo } from "node:net";
|
||||
|
||||
export interface MockEgovSigner {
|
||||
iin: string;
|
||||
name: string;
|
||||
/** The phone declines to sign. */
|
||||
reject?: boolean;
|
||||
/** The phone signs some other document (challenge replaced). */
|
||||
tamper?: boolean;
|
||||
}
|
||||
|
||||
interface Session {
|
||||
documentXml: string;
|
||||
polls: number;
|
||||
signer: MockEgovSigner;
|
||||
expiresAt: number;
|
||||
}
|
||||
|
||||
const der = (tag: number, body: Buffer) => {
|
||||
const len = body.length < 0x80 ? Buffer.from([body.length]) : body.length < 0x100 ? Buffer.from([0x81, body.length]) : Buffer.from([0x82, body.length >> 8, body.length & 0xff]);
|
||||
return Buffer.concat([Buffer.from([tag]), len, body]);
|
||||
};
|
||||
const attr = (oidHex: string, value: string, tag = 0x0c) =>
|
||||
der(0x31, der(0x30, Buffer.concat([der(0x06, Buffer.from(oidHex, "hex")), der(tag, Buffer.from(value, "utf8"))])));
|
||||
|
||||
/** A certificate-shaped DER blob: issuer and subject names only (enough for Peppa's subject reader). */
|
||||
export function mockCertificate(signer: Pick<MockEgovSigner, "iin" | "name">): string {
|
||||
const issuer = der(0x30, Buffer.concat([attr("550403", "MOCK NCA RK (not a CA)"), attr("550406", "KZ", 0x13)]));
|
||||
const subject = der(0x30, Buffer.concat([attr("550403", signer.name), attr("550405", `IIN${signer.iin}`, 0x13), attr("550406", "KZ", 0x13)]));
|
||||
const tbs = der(0x30, Buffer.concat([der(0x02, Buffer.from([1])), issuer, subject]));
|
||||
return der(0x30, tbs).toString("base64");
|
||||
}
|
||||
|
||||
export class MockKazedsRelay {
|
||||
readonly sessions = new Map<string, Session>();
|
||||
/** Who signs the next sessions. */
|
||||
signer: MockEgovSigner;
|
||||
private server: Server | null = null;
|
||||
|
||||
constructor(signer: MockEgovSigner = { iin: "900101300126", name: "ТЕСТОВ ТЕСТ" }) {
|
||||
this.signer = signer;
|
||||
}
|
||||
|
||||
async start(port = 0): Promise<string> {
|
||||
this.server = createServer((req, res) => void this.handle(req.method ?? "GET", req.url ?? "/", req, res));
|
||||
await new Promise<void>((r) => this.server!.listen(port, "127.0.0.1", r));
|
||||
return `http://127.0.0.1:${(this.server.address() as AddressInfo).port}/v1`;
|
||||
}
|
||||
|
||||
async stop(): Promise<void> {
|
||||
await new Promise<void>((r) => (this.server ? this.server.close(() => r()) : r()));
|
||||
}
|
||||
|
||||
private async handle(method: string, url: string, req: import("node:http").IncomingMessage, res: import("node:http").ServerResponse) {
|
||||
const send = (code: number, body: unknown) => {
|
||||
res.writeHead(code, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify(body));
|
||||
};
|
||||
if (method === "POST" && url === "/v1/egov/sessions") {
|
||||
let raw = "";
|
||||
for await (const chunk of req) raw += chunk;
|
||||
const body = JSON.parse(raw || "{}") as { signMethod?: string; organisation?: { bin?: string }; documentsToSign?: Array<{ documentXml?: string }> };
|
||||
const xml = body.documentsToSign?.[0]?.documentXml;
|
||||
if (body.signMethod !== "XML" || !xml || !/^\d{12}$/.test(body.organisation?.bin ?? "")) {
|
||||
return send(400, { error: "Bad request", message: "signMethod XML, organisation.bin and documentsToSign[0].documentXml are required" });
|
||||
}
|
||||
const id = randomUUID();
|
||||
const expiresAt = Date.now() + 5 * 60_000;
|
||||
this.sessions.set(id, { documentXml: xml, polls: 0, signer: { ...this.signer }, expiresAt });
|
||||
return send(201, {
|
||||
session_id: id,
|
||||
qr_content: `mobileSign:https://sign.aitu.uz/mock/mgovSign/${id}`,
|
||||
deeplink: `https://m.egov.kz/mobileSign?link=${encodeURIComponent(`https://sign.aitu.uz/mock/mgovSign/${id}`)}`,
|
||||
expires_at: new Date(expiresAt).toISOString(),
|
||||
});
|
||||
}
|
||||
const m = /^\/v1\/egov\/([^/]+)\/status$/.exec(url);
|
||||
if (method === "GET" && m) {
|
||||
const s = this.sessions.get(decodeURIComponent(m[1]!));
|
||||
if (!s) return send(404, { error: "Not found", message: "Session not found" });
|
||||
const expiresIn = Math.max(0, Math.round((s.expiresAt - Date.now()) / 1000));
|
||||
if (expiresIn === 0) return send(200, { status: "expired", expires_in: 0 });
|
||||
s.polls += 1;
|
||||
if (s.polls < 3) return send(200, { status: s.polls === 1 ? "scanned" : "pending", expires_in: expiresIn });
|
||||
if (s.signer.reject) return send(200, { status: "rejected", expires_in: expiresIn });
|
||||
const doc = s.signer.tamper ? s.documentXml.replace(/<challenge>[^<]*<\/challenge>/, "<challenge>other</challenge>") : s.documentXml;
|
||||
const signed = doc.replace(
|
||||
"</auth>",
|
||||
`<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignatureValue>MOCK_NOT_A_SIGNATURE</ds:SignatureValue>` +
|
||||
`<ds:KeyInfo><ds:X509Data><ds:X509Certificate>${mockCertificate(s.signer)}</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature></auth>`,
|
||||
);
|
||||
return send(200, { status: "completed", expires_in: expiresIn, signedDocuments: [{ id: 1, nameRu: "Mock (not signed)", documentXml: signed }] });
|
||||
}
|
||||
send(404, { error: "Not found" });
|
||||
}
|
||||
}
|
||||
|
||||
if (import.meta.main) {
|
||||
const relay = new MockKazedsRelay({ iin: process.env.MOCK_EGOV_IIN ?? "900101300126", name: process.env.MOCK_EGOV_NAME ?? "ТЕСТОВ ТЕСТ" });
|
||||
const url = await relay.start(Number(process.argv[2] ?? process.env.MOCK_PORT ?? 3103));
|
||||
console.log(`mock-kazeds-relay (TEST ONLY, fake signatures): KAZEDS_RELAY_BASE=${url}`);
|
||||
}
|
||||
109
packages/testkit/test/egov.test.ts
Normal file
109
packages/testkit/test/egov.test.ts
Normal file
@ -0,0 +1,109 @@
|
||||
// PEP-65: eGov QR login through the KazEDS relay (mock-kazeds-relay): link an IIN, log in by it,
|
||||
// unknown IIN, tampered document, refusal, expiry, IIN taken by another account.
|
||||
import assert from "node:assert/strict";
|
||||
import { after, before, describe, test } from "node:test";
|
||||
import { core, db, teardown } from "./helpers.ts";
|
||||
import { mockCertificate, MockKazedsRelay } from "../src/mock-kazeds-relay.ts";
|
||||
|
||||
process.env.PEPPA_SECRET = "mock-secret-for-tests";
|
||||
const relay = new MockKazedsRelay({ iin: "900101300126", name: "ТЕСТОВА АСЕЛЬ" });
|
||||
|
||||
let asel: Awaited<ReturnType<typeof core.upsertUserFromGitea>>;
|
||||
let dana: Awaited<ReturnType<typeof core.upsertUserFromGitea>>;
|
||||
before(async () => {
|
||||
process.env.KAZEDS_RELAY_BASE = await relay.start();
|
||||
asel = await core.upsertUserFromGitea(db, { id: 651, login: "mock-asel" }, { access_token: "x" });
|
||||
dana = await core.upsertUserFromGitea(db, { id: 652, login: "mock-dana" }, { access_token: "x" });
|
||||
});
|
||||
after(async () => {
|
||||
await relay.stop();
|
||||
await teardown();
|
||||
});
|
||||
|
||||
/** The phone scans and signs: the relay answers scanned, pending, then the result. */
|
||||
async function scanAndSign(handle: string) {
|
||||
assert.equal(await core.egovFlowStatus(db, handle), "scanned");
|
||||
assert.equal(await core.egovFlowStatus(db, handle), "pending");
|
||||
}
|
||||
|
||||
describe("eGov QR", () => {
|
||||
test("certificate subject: IIN and name, issuer does not leak into the subject", () => {
|
||||
const s = core.certificateSubject(Buffer.from(mockCertificate({ iin: "900101300126", name: "ТЕСТОВА АСЕЛЬ" }), "base64"));
|
||||
assert.equal(s.serialNumber, "IIN900101300126");
|
||||
assert.equal(s.commonName, "ТЕСТОВА АСЕЛЬ");
|
||||
assert.ok(core.isValidIin("900101300126"));
|
||||
assert.ok(!core.isValidIin("900101300123"));
|
||||
});
|
||||
|
||||
test("unlinked IIN: signed, but no login", async () => {
|
||||
const f = await core.startEgovFlow(db, "login");
|
||||
assert.match(f.qrContent, /^mobileSign:/);
|
||||
assert.match(f.deeplink, /^https:\/\/m\.egov\.kz\//);
|
||||
await scanAndSign(f.handle);
|
||||
await assert.rejects(core.completeEgovFlow(db, f.handle), /не привязан к Пеппе/);
|
||||
await assert.rejects(core.completeEgovFlow(db, f.handle), /истёк/, "one-shot");
|
||||
});
|
||||
|
||||
test("link from Settings, then log in by eGov", async () => {
|
||||
await assert.rejects(core.startEgovFlow(db, "link", null), /после входа/);
|
||||
const link = await core.startEgovFlow(db, "link", asel.id);
|
||||
await scanAndSign(link.handle);
|
||||
const r = await core.completeEgovFlow(db, link.handle);
|
||||
assert.equal(r.purpose, "link");
|
||||
assert.equal(r.user.egovIin, "900101300126");
|
||||
assert.equal(r.identity.name, "ТЕСТОВА АСЕЛЬ");
|
||||
assert.equal(core.maskIin(r.user.egovIin!), "9001****0126");
|
||||
|
||||
const login = await core.startEgovFlow(db, "login");
|
||||
await scanAndSign(login.handle);
|
||||
const l = await core.completeEgovFlow(db, login.handle);
|
||||
assert.equal(l.purpose, "login");
|
||||
assert.equal(l.user.id, asel.id);
|
||||
});
|
||||
|
||||
test("not signed yet → error, and the flow is spent", async () => {
|
||||
const f = await core.startEgovFlow(db, "login");
|
||||
await assert.rejects(core.completeEgovFlow(db, f.handle), /ещё не подписан/);
|
||||
assert.equal(await core.egovFlowStatus(db, f.handle), "expired");
|
||||
});
|
||||
|
||||
test("tampered document and refusal are rejected", async () => {
|
||||
relay.signer = { iin: "900101300126", name: "ТЕСТОВА АСЕЛЬ", tamper: true };
|
||||
const t = await core.startEgovFlow(db, "login");
|
||||
await scanAndSign(t.handle);
|
||||
await assert.rejects(core.completeEgovFlow(db, t.handle), /не тот документ/);
|
||||
|
||||
relay.signer = { iin: "900101300126", name: "ТЕСТОВА АСЕЛЬ", reject: true };
|
||||
const r = await core.startEgovFlow(db, "login");
|
||||
await scanAndSign(r.handle);
|
||||
assert.equal(await core.egovFlowStatus(db, r.handle), "rejected");
|
||||
await assert.rejects(core.completeEgovFlow(db, r.handle), /отменено/);
|
||||
relay.signer = { iin: "900101300126", name: "ТЕСТОВА АСЕЛЬ" };
|
||||
});
|
||||
|
||||
test("expired flow and unknown handle", async () => {
|
||||
const f = await core.startEgovFlow(db, "login");
|
||||
const key = `egov.flow:${core.hashToken(f.handle)}`;
|
||||
const saved = (await core.getSetting<{ expiresAt: number }>(db, key))!;
|
||||
await core.setSetting(db, key, { ...saved, expiresAt: Date.now() - 1 });
|
||||
assert.equal(await core.egovFlowStatus(db, f.handle), "expired");
|
||||
await assert.rejects(core.completeEgovFlow(db, f.handle), /истёк/);
|
||||
assert.equal(await core.egovFlowStatus(db, "no-such-handle"), "expired");
|
||||
});
|
||||
|
||||
test("an IIN links to one account only; unlink frees it", async () => {
|
||||
const f = await core.startEgovFlow(db, "link", dana.id);
|
||||
await scanAndSign(f.handle);
|
||||
await assert.rejects(core.completeEgovFlow(db, f.handle), /уже привязан к другой учётке/);
|
||||
await assert.rejects(core.linkEgovIin(db, dana.id, "123"), /Неверный ИИН/);
|
||||
await core.linkEgovIin(db, asel.id, null);
|
||||
assert.equal((await core.linkEgovIin(db, dana.id, "900101300126")).egovIin, "900101300126");
|
||||
});
|
||||
|
||||
test("relay errors surface as Peppa errors", async () => {
|
||||
const real = process.env.KAZEDS_RELAY_BASE;
|
||||
process.env.KAZEDS_RELAY_BASE = `${real}/missing`;
|
||||
await assert.rejects(core.startEgovFlow(db, "login"), /eGov relay/);
|
||||
process.env.KAZEDS_RELAY_BASE = real;
|
||||
});
|
||||
});
|
||||
226
pnpm-lock.yaml
generated
226
pnpm-lock.yaml
generated
@ -235,6 +235,9 @@ importers:
|
||||
next:
|
||||
specifier: 16.4.6
|
||||
version: 16.4.6(@types/node@26.6.6)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
|
||||
qrcode:
|
||||
specifier: 1.5.4
|
||||
version: 1.5.4
|
||||
react:
|
||||
specifier: 19.3.1
|
||||
version: 19.3.1
|
||||
@ -248,6 +251,9 @@ importers:
|
||||
'@tailwindcss/postcss':
|
||||
specifier: 4.3.5
|
||||
version: 4.3.5
|
||||
'@types/qrcode':
|
||||
specifier: 1.5.5
|
||||
version: 1.5.5
|
||||
'@types/react':
|
||||
specifier: 19.3.0
|
||||
version: 19.3.0
|
||||
@ -1215,6 +1221,9 @@ packages:
|
||||
'@types/node@26.6.6':
|
||||
resolution: {integrity: sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==}
|
||||
|
||||
'@types/qrcode@1.5.5':
|
||||
resolution: {integrity: sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg==}
|
||||
|
||||
'@types/react-dom@19.3.0':
|
||||
resolution: {integrity: sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==}
|
||||
peerDependencies:
|
||||
@ -1238,6 +1247,14 @@ packages:
|
||||
ajv@8.20.0:
|
||||
resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==}
|
||||
|
||||
ansi-regex@5.0.1:
|
||||
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
ansi-styles@4.3.0:
|
||||
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
baseline-browser-mapping@2.11.35:
|
||||
resolution: {integrity: sha512-GNk8KX52CHqeNKGk8+7tZnQab/2k1t/BgrUHPKNdijzpEhF1saPQZHVKb6m5loSAxB39gyrTYw34Qf9CQ3u1qQ==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
@ -1262,6 +1279,10 @@ packages:
|
||||
resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
camelcase@5.3.1:
|
||||
resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
caniuse-lite@1.0.30001826:
|
||||
resolution: {integrity: sha512-wTB+9tIbLro/BCXwLuNV1meHE4L9dS6dArMDwgYfNBPMYScqClHyGunhkCSDtHhe/69Xl0sHlKgBVZ+fNsYtWA==}
|
||||
|
||||
@ -1271,10 +1292,20 @@ packages:
|
||||
client-only@0.0.1:
|
||||
resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==}
|
||||
|
||||
cliui@6.0.0:
|
||||
resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==}
|
||||
|
||||
clsx@2.1.1:
|
||||
resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
color-convert@2.0.1:
|
||||
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
|
||||
engines: {node: '>=7.0.0'}
|
||||
|
||||
color-name@1.1.4:
|
||||
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
|
||||
|
||||
content-disposition@2.0.1:
|
||||
resolution: {integrity: sha512-e+H0ZXHSWYrENhQzw1LPuP4oF5MzVKmDU6d3hxlvaPEYLLg62MxtQNPRx4SYSuYJSBUgnQIG4HIN2tEtNv7Dog==}
|
||||
engines: {node: '>=18'}
|
||||
@ -1315,6 +1346,10 @@ packages:
|
||||
supports-color:
|
||||
optional: true
|
||||
|
||||
decamelize@1.2.0:
|
||||
resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
depd@2.0.0:
|
||||
resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==}
|
||||
engines: {node: '>= 0.8'}
|
||||
@ -1323,6 +1358,9 @@ packages:
|
||||
resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
dijkstrajs@1.0.3:
|
||||
resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==}
|
||||
|
||||
drizzle-kit@0.31.11:
|
||||
resolution: {integrity: sha512-YCYqxTLIB2OCqf6w9/Vef13baBVbwQIPcbT4Y56AfO6B9ajZhDhD8Jkveg/hJvT/iuMloKD/IYYkyMMNhr7Kqg==}
|
||||
hasBin: true
|
||||
@ -1429,6 +1467,9 @@ packages:
|
||||
ee-first@1.1.1:
|
||||
resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==}
|
||||
|
||||
emoji-regex@8.0.0:
|
||||
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
|
||||
|
||||
encodeurl@2.0.1:
|
||||
resolution: {integrity: sha512-Ev/hIyePLZtpL98x562lvPtenrUfGr0lfaf44HFZ+hDEwso7ccV9QAZrEVLg0hxNAzygaAFxy2dYaAKKM0G06A==}
|
||||
engines: {node: '>= 0.8'}
|
||||
@ -1499,6 +1540,10 @@ packages:
|
||||
resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==}
|
||||
engines: {node: '>= 18.0.0'}
|
||||
|
||||
find-up@4.1.0:
|
||||
resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
forwarded@0.2.0:
|
||||
resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==}
|
||||
engines: {node: '>= 0.6'}
|
||||
@ -1520,6 +1565,10 @@ packages:
|
||||
peerDependencies:
|
||||
next: '>=13.2.0'
|
||||
|
||||
get-caller-file@2.0.5:
|
||||
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
|
||||
engines: {node: 6.* || 8.* || >= 10.*}
|
||||
|
||||
get-intrinsic@1.3.0:
|
||||
resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@ -1569,6 +1618,10 @@ packages:
|
||||
resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==}
|
||||
engines: {node: '>= 0.10'}
|
||||
|
||||
is-fullwidth-code-point@3.0.0:
|
||||
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
is-promise@4.0.0:
|
||||
resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==}
|
||||
|
||||
@ -1662,6 +1715,10 @@ packages:
|
||||
resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==}
|
||||
engines: {node: '>= 12.0.0'}
|
||||
|
||||
locate-path@5.0.0:
|
||||
resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
lucide-react@1.72.0:
|
||||
resolution: {integrity: sha512-fbF5i1GU8GODETa3Q7rXqrJrcx3iPYrQtxthom103zGx+Z0BGwKYAW9s+9435ohYJ7hQm0av0PoZcqI1CRwNrg==}
|
||||
peerDependencies:
|
||||
@ -1742,10 +1799,26 @@ packages:
|
||||
once@1.4.0:
|
||||
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
|
||||
|
||||
p-limit@2.3.0:
|
||||
resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
p-locate@4.1.0:
|
||||
resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
p-try@2.2.0:
|
||||
resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
parseurl@1.3.3:
|
||||
resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
||||
path-exists@4.0.0:
|
||||
resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
path-key@3.1.1:
|
||||
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
|
||||
engines: {node: '>=8'}
|
||||
@ -1760,6 +1833,10 @@ packages:
|
||||
resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
|
||||
pngjs@5.0.0:
|
||||
resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
|
||||
postcss@8.5.23:
|
||||
resolution: {integrity: sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
@ -1776,6 +1853,11 @@ packages:
|
||||
resolution: {integrity: sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==}
|
||||
engines: {node: '>= 0.10'}
|
||||
|
||||
qrcode@1.5.4:
|
||||
resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
hasBin: true
|
||||
|
||||
qs@6.17.1:
|
||||
resolution: {integrity: sha512-jd3COkaKVgGUW+ZHyEHCG9bH7RoaaiWuMgzsIBjUMVjLAaWGWpoUAVwljVvBHxRu/2qEHnadLGZrkutYUBPQJA==}
|
||||
engines: {node: '>=0.6'}
|
||||
@ -1797,10 +1879,17 @@ packages:
|
||||
resolution: {integrity: sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
require-directory@2.1.1:
|
||||
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
require-from-string@2.0.2:
|
||||
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
require-main-filename@2.0.0:
|
||||
resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==}
|
||||
|
||||
resolve-pkg-maps@1.0.0:
|
||||
resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
|
||||
|
||||
@ -1827,6 +1916,9 @@ packages:
|
||||
resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
set-blocking@2.0.0:
|
||||
resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
|
||||
|
||||
setprototypeof@1.2.0:
|
||||
resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==}
|
||||
|
||||
@ -1878,6 +1970,14 @@ packages:
|
||||
resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
||||
string-width@4.2.3:
|
||||
resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
strip-ansi@6.0.1:
|
||||
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
styled-jsx@5.1.6:
|
||||
resolution: {integrity: sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==}
|
||||
engines: {node: '>= 12.0.0'}
|
||||
@ -1933,14 +2033,32 @@ packages:
|
||||
resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
||||
which-module@2.0.1:
|
||||
resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==}
|
||||
|
||||
which@2.0.2:
|
||||
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
|
||||
engines: {node: '>= 8'}
|
||||
hasBin: true
|
||||
|
||||
wrap-ansi@6.2.0:
|
||||
resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
wrappy@1.0.2:
|
||||
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
|
||||
|
||||
y18n@4.0.3:
|
||||
resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==}
|
||||
|
||||
yargs-parser@18.1.3:
|
||||
resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
yargs@15.4.1:
|
||||
resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
zod-to-json-schema@3.25.2:
|
||||
resolution: {integrity: sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==}
|
||||
peerDependencies:
|
||||
@ -2460,6 +2578,10 @@ snapshots:
|
||||
dependencies:
|
||||
undici-types: 8.9.0
|
||||
|
||||
'@types/qrcode@1.5.5':
|
||||
dependencies:
|
||||
'@types/node': 26.6.6
|
||||
|
||||
'@types/react-dom@19.3.0(@types/react@19.3.0)':
|
||||
dependencies:
|
||||
'@types/react': 19.3.0
|
||||
@ -2484,6 +2606,12 @@ snapshots:
|
||||
json-schema-traverse: 1.0.0
|
||||
require-from-string: 2.0.2
|
||||
|
||||
ansi-regex@5.0.1: {}
|
||||
|
||||
ansi-styles@4.3.0:
|
||||
dependencies:
|
||||
color-convert: 2.0.1
|
||||
|
||||
baseline-browser-mapping@2.11.35: {}
|
||||
|
||||
body-parser@2.4.0:
|
||||
@ -2514,6 +2642,8 @@ snapshots:
|
||||
call-bind-apply-helpers: 1.0.2
|
||||
get-intrinsic: 1.3.0
|
||||
|
||||
camelcase@5.3.1: {}
|
||||
|
||||
caniuse-lite@1.0.30001826: {}
|
||||
|
||||
class-variance-authority@0.7.1:
|
||||
@ -2522,8 +2652,20 @@ snapshots:
|
||||
|
||||
client-only@0.0.1: {}
|
||||
|
||||
cliui@6.0.0:
|
||||
dependencies:
|
||||
string-width: 4.2.3
|
||||
strip-ansi: 6.0.1
|
||||
wrap-ansi: 6.2.0
|
||||
|
||||
clsx@2.1.1: {}
|
||||
|
||||
color-convert@2.0.1:
|
||||
dependencies:
|
||||
color-name: 1.1.4
|
||||
|
||||
color-name@1.1.4: {}
|
||||
|
||||
content-disposition@2.0.1: {}
|
||||
|
||||
content-type@1.0.5: {}
|
||||
@ -2551,10 +2693,14 @@ snapshots:
|
||||
dependencies:
|
||||
ms: 2.1.3
|
||||
|
||||
decamelize@1.2.0: {}
|
||||
|
||||
depd@2.0.0: {}
|
||||
|
||||
detect-libc@2.1.2: {}
|
||||
|
||||
dijkstrajs@1.0.3: {}
|
||||
|
||||
drizzle-kit@0.31.11:
|
||||
dependencies:
|
||||
'@drizzle-team/brocli': 0.10.2
|
||||
@ -2574,6 +2720,8 @@ snapshots:
|
||||
|
||||
ee-first@1.1.1: {}
|
||||
|
||||
emoji-regex@8.0.0: {}
|
||||
|
||||
encodeurl@2.0.1: {}
|
||||
|
||||
enhanced-resolve@5.26.1:
|
||||
@ -2738,6 +2886,11 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
find-up@4.1.0:
|
||||
dependencies:
|
||||
locate-path: 5.0.0
|
||||
path-exists: 4.0.0
|
||||
|
||||
forwarded@0.2.0: {}
|
||||
|
||||
fresh@2.0.0: {}
|
||||
@ -2751,6 +2904,8 @@ snapshots:
|
||||
dependencies:
|
||||
next: 16.4.6(@types/node@26.6.6)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
|
||||
|
||||
get-caller-file@2.0.5: {}
|
||||
|
||||
get-intrinsic@1.3.0:
|
||||
dependencies:
|
||||
call-bind-apply-helpers: 1.0.2
|
||||
@ -2803,6 +2958,8 @@ snapshots:
|
||||
|
||||
ipaddr.js@1.9.1: {}
|
||||
|
||||
is-fullwidth-code-point@3.0.0: {}
|
||||
|
||||
is-promise@4.0.0: {}
|
||||
|
||||
isexe@2.0.0: {}
|
||||
@ -2864,6 +3021,10 @@ snapshots:
|
||||
lightningcss-win32-arm64-msvc: 1.33.0
|
||||
lightningcss-win32-x64-msvc: 1.33.0
|
||||
|
||||
locate-path@5.0.0:
|
||||
dependencies:
|
||||
p-locate: 4.1.0
|
||||
|
||||
lucide-react@1.72.0(@types/react@19.3.0)(react@19.3.1):
|
||||
dependencies:
|
||||
react: 19.3.1
|
||||
@ -2931,8 +3092,20 @@ snapshots:
|
||||
dependencies:
|
||||
wrappy: 1.0.2
|
||||
|
||||
p-limit@2.3.0:
|
||||
dependencies:
|
||||
p-try: 2.2.0
|
||||
|
||||
p-locate@4.1.0:
|
||||
dependencies:
|
||||
p-limit: 2.3.0
|
||||
|
||||
p-try@2.2.0: {}
|
||||
|
||||
parseurl@1.3.3: {}
|
||||
|
||||
path-exists@4.0.0: {}
|
||||
|
||||
path-key@3.1.1: {}
|
||||
|
||||
path-to-regexp@8.4.2: {}
|
||||
@ -2941,6 +3114,8 @@ snapshots:
|
||||
|
||||
pkce-challenge@5.0.1: {}
|
||||
|
||||
pngjs@5.0.0: {}
|
||||
|
||||
postcss@8.5.23:
|
||||
dependencies:
|
||||
nanoid: 3.3.20
|
||||
@ -2960,6 +3135,12 @@ snapshots:
|
||||
forwarded: 0.2.0
|
||||
ipaddr.js: 1.9.1
|
||||
|
||||
qrcode@1.5.4:
|
||||
dependencies:
|
||||
dijkstrajs: 1.0.3
|
||||
pngjs: 5.0.0
|
||||
yargs: 15.4.1
|
||||
|
||||
qs@6.17.1:
|
||||
dependencies:
|
||||
es-define-property: 1.0.1
|
||||
@ -2981,8 +3162,12 @@ snapshots:
|
||||
|
||||
react@19.3.1: {}
|
||||
|
||||
require-directory@2.1.1: {}
|
||||
|
||||
require-from-string@2.0.2: {}
|
||||
|
||||
require-main-filename@2.0.0: {}
|
||||
|
||||
resolve-pkg-maps@1.0.0: {}
|
||||
|
||||
router@2.2.0:
|
||||
@ -3027,6 +3212,8 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
set-blocking@2.0.0: {}
|
||||
|
||||
setprototypeof@1.2.0: {}
|
||||
|
||||
sharp@0.35.5(@types/node@26.6.6):
|
||||
@ -3108,6 +3295,16 @@ snapshots:
|
||||
|
||||
statuses@2.0.2: {}
|
||||
|
||||
string-width@4.2.3:
|
||||
dependencies:
|
||||
emoji-regex: 8.0.0
|
||||
is-fullwidth-code-point: 3.0.0
|
||||
strip-ansi: 6.0.1
|
||||
|
||||
strip-ansi@6.0.1:
|
||||
dependencies:
|
||||
ansi-regex: 5.0.1
|
||||
|
||||
styled-jsx@5.1.6(react@19.3.1):
|
||||
dependencies:
|
||||
client-only: 0.0.1
|
||||
@ -3143,12 +3340,41 @@ snapshots:
|
||||
|
||||
vary@1.1.2: {}
|
||||
|
||||
which-module@2.0.1: {}
|
||||
|
||||
which@2.0.2:
|
||||
dependencies:
|
||||
isexe: 2.0.0
|
||||
|
||||
wrap-ansi@6.2.0:
|
||||
dependencies:
|
||||
ansi-styles: 4.3.0
|
||||
string-width: 4.2.3
|
||||
strip-ansi: 6.0.1
|
||||
|
||||
wrappy@1.0.2: {}
|
||||
|
||||
y18n@4.0.3: {}
|
||||
|
||||
yargs-parser@18.1.3:
|
||||
dependencies:
|
||||
camelcase: 5.3.1
|
||||
decamelize: 1.2.0
|
||||
|
||||
yargs@15.4.1:
|
||||
dependencies:
|
||||
cliui: 6.0.0
|
||||
decamelize: 1.2.0
|
||||
find-up: 4.1.0
|
||||
get-caller-file: 2.0.5
|
||||
require-directory: 2.1.1
|
||||
require-main-filename: 2.0.0
|
||||
set-blocking: 2.0.0
|
||||
string-width: 4.2.3
|
||||
which-module: 2.0.1
|
||||
y18n: 4.0.3
|
||||
yargs-parser: 18.1.3
|
||||
|
||||
zod-to-json-schema@3.25.2(zod@4.6.7):
|
||||
dependencies:
|
||||
zod: 4.6.7
|
||||
|
||||
Loading…
Reference in New Issue
Block a user