diff --git a/.agents/skills/classic-to-default-sync/SKILL.md b/.agents/skills/classic-to-default-sync/SKILL.md deleted file mode 100644 index 282e0492e1..0000000000 --- a/.agents/skills/classic-to-default-sync/SKILL.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -name: classic-to-default-sync -description: Inspect a given commit's web/classic changes and sync all features/fixes to web/default. Use when the user provides a commit ID and wants to audit whether web/default already has the same features as web/classic, port missing features, improve suboptimal implementations, fix bugs, and remove redundant code. Trigger phrases include: "/classic-to-default-sync ", "classic-to-default-sync ", "sync classic to default", "port from classic", "compare classic commit", "classic 和 default 对比", "把这次 classic 的修改同步到 default", "查看这次提交 classic 中的修改并同步", or any request supplying a commit hash together with classic/default comparison intent. ---- - -# Classic-to-Default Sync - -Given a **commit ID**, audit all `web/classic` changes and ensure `web/default` reaches feature parity with the best possible implementation. - -## Input - -The user must supply a ``. - -## Workflow - -### Step 1 — Extract classic diff - -```bash -git show -- web/classic -``` - -Read every changed file in `web/classic`. Identify the **logical changes** (new features, UI/UX improvements, bug fixes, config tweaks, removed dead code, etc.) — not just line diffs. - -### Step 2 — Map to default counterparts - -For each logical change found in Step 1, locate the equivalent file(s) in `web/default/src/`. Use Glob/Grep/SemanticSearch as needed. Consider that: - -- `web/classic` uses **React 18 + Vite + Semi Design** -- `web/default` uses **React 19 + Rsbuild + Base UI + Tailwind CSS** -- Component names, file paths, and API shapes may differ; match by **functionality**, not filename. - -### Step 3 — Triage each change - -Classify every logical change as one of: - -| Status | Meaning | -|--------|---------| -| ✅ Already present & optimal | No action needed | -| ⚠️ Present but suboptimal | Improve: logic, layout, style, or code quality | -| ❌ Missing | Implement from scratch in default's stack | - -### Step 4 — Implement - -For each **⚠️** or **❌** item: - -1. **Read the target file(s) in `web/default`** before editing (required by project conventions). -2. Implement using `web/default` conventions: - - React 19 patterns (hooks, Suspense, etc.) - - Base UI primitives where applicable - - Tailwind CSS for styling (no inline styles or Semi Design imports) - - `useTranslation()` + `t('English key')` for all user-visible strings - - TypeScript — explicit types, no `any` - - No dead code, no redundant comments -3. Follow **Rule 6** (pointer types for optional relay DTOs) if touching relay-related TS types. -4. After editing, run `ReadLints` on changed files and fix any introduced lint errors. - -### Step 5 — i18n - -If any new user-visible strings were added, run the i18n sync: - -```bash -cd web/default && bun run i18n:sync -``` - -Then add missing translations for all supported locales (en, zh, fr, ja, ru, vi) following the **i18n-translate** skill. - -### Step 6 — Report - -Summarise the work in a concise table: - -| # | Change (from classic commit) | Status | Action taken | -|---|------------------------------|--------|--------------| -| 1 | … | ✅ / ⚠️ / ❌ | None / Improved / Implemented | - -If every item is ✅ with no action needed, simply reply: **"已完成 — web/default 已具备此次提交的所有功能,且实现质量良好,无需修改。"** - -## Quality bar - -- No unused imports, variables, or components -- No commented-out code left behind -- Consistent naming with surrounding `web/default` code -- All interactive elements accessible (keyboard nav, ARIA labels where Radix doesn't provide them automatically) -- No regressions: existing behaviour in `web/default` must not break diff --git a/.agents/skills/i18n-translate/SKILL.md b/.agents/skills/i18n-translate/SKILL.md index 83695e1128..6b17ac3d6d 100755 --- a/.agents/skills/i18n-translate/SKILL.md +++ b/.agents/skills/i18n-translate/SKILL.md @@ -3,7 +3,7 @@ name: i18n-translate description: >- Complete and maintain frontend i18n translations for this project. Covers finding missing translation keys, detecting untranslated entries, and adding - translations for all supported locales (en, zh, fr, ja, ru, vi). Use for any + translations for all supported locales (en, zh, zh-TW, fr, ja, ru, vi). Use for any task involving frontend locale files, missing translation keys, untranslated UI text, `t(...)` keys, `useTranslation()`, static i18n keys, button/label/ toast/dialog/placeholder/validation copy, or adding/fixing even a single @@ -24,12 +24,12 @@ description: >- ### Hard Constraint: Locale Writes Go Through the Script -- You MUST NOT edit `web/default/src/i18n/locales/*.json` directly with text-editing tools (StrReplace, Write, search-and-replace, manual JSON edits, etc.). This applies even to a single key. +- You MUST NOT edit `web/src/i18n/locales/*.json` directly with text-editing tools (StrReplace, Write, search-and-replace, manual JSON edits, etc.). This applies even to a single key. - ALL locale writes MUST go through the `add-missing-keys.mjs` script, followed by `bun run i18n:sync`. The script is the only sanctioned way to add or change locale values. - Why this is mandatory, not optional: - - Hand-editing reliably drops one or more of the six locales (`en`, `zh`, `fr`, `ja`, `ru`, `vi`), leaving keys missing in some languages. + - Hand-editing reliably drops one or more of the seven locales (`en`, `zh`, `zh-TW`, `fr`, `ja`, `ru`, `vi`), leaving keys missing in some languages. - Hand-editing breaks the required alphabetical key order and introduces JSON syntax errors (trailing commas, mismatched quotes). - - The script writes all six files atomically with consistent sorting, so the locale set stays in sync by construction. + - The script writes all seven files atomically with consistent sorting, so the locale set stays in sync by construction. - The script does not do the translation for you. You still must reason out each locale's copy and populate the script's `newKeys` object; the script only handles insertion, sorting, and writing. Do not skip the script just because the thinking happens regardless. ## Scope Checklist @@ -45,10 +45,10 @@ Do not skip this workflow because the fix is "just one key". ## Overview -- Locale files: `web/default/src/i18n/locales/{en,zh,fr,ja,ru,vi}.json` +- Locale files: `web/src/i18n/locales/{en,zh,zh-TW,fr,ja,ru,vi}.json` - Format: flat JSON under `"translation"` key, keys are English source strings - Base locale: `en.json` (most keys), fallback: `zh` (Chinese) -- Sync script: `bun run i18n:sync` (from `web/default/`) +- Sync script: `bun run i18n:sync` (from `web/`) - All `t()` calls must have corresponding keys in every locale file ## Small Fix Path @@ -56,7 +56,7 @@ Do not skip this workflow because the fix is "just one key". For a single known missing key (still script-only, no direct JSON edits): 1. Confirm the exact key at the call site and verify it is absent from all locale files. -2. Add the key via `add-missing-keys.mjs`, populating its `newKeys` object for every supported locale: `en`, `zh`, `fr`, `ja`, `ru`, `vi`. Even one key goes through the script; do not hand-edit the JSON. +2. Add the key via `add-missing-keys.mjs`, populating its `newKeys` object for every supported locale: `en`, `zh`, `zh-TW`, `fr`, `ja`, `ru`, `vi`. Even one key goes through the script; do not hand-edit the JSON. 3. The script preserves the flat `"translation"` object and keeps keys alphabetically sorted automatically. 4. Run a targeted search for the key in code and locale files. 5. Run `bun run i18n:sync` to normalize file order. This step is mandatory, not optional. @@ -66,14 +66,14 @@ For a single known missing key (still script-only, no direct JSON edits): ### Step 1: Run sync and read report ```bash -cd web/default && bun run i18n:sync +cd web && bun run i18n:sync ``` -Read `web/default/src/i18n/locales/_reports/_sync-report.json` to see per-locale status (missingCount, extrasCount, untranslatedCount). +Read `web/src/i18n/locales/_reports/_sync-report.json` to see per-locale status (missingCount, extrasCount, untranslatedCount). ### Step 2: Find missing keys (used in code but not in locale files) -Create and run `web/default/scripts/find-missing-keys.mjs`: +Create and run `web/scripts/find-missing-keys.mjs`: ```javascript import fs from 'node:fs/promises' @@ -136,7 +136,7 @@ if (missingKeys.size === 0) { ### Step 3: Find untranslated entries (value equals English) -Create and run `web/default/scripts/find-untranslated.mjs`: +Create and run `web/scripts/find-untranslated.mjs`: ```javascript import fs from 'node:fs/promises' @@ -167,7 +167,7 @@ const brandNames = new Set([ 'WeChat','Xinference','Xunfei','AI Proxy','One API', ]) -const locales = ['fr', 'ja', 'ru', 'zh', 'vi'] +const locales = ['fr', 'ja', 'ru', 'zh', 'zh-TW', 'vi'] for (const locale of locales) { const locFile = JSON.parse(await fs.readFile(path.join(LOCALES_DIR, `${locale}.json`), 'utf8')) @@ -196,7 +196,7 @@ for (const locale of locales) { ### Step 4: Add translations -This script is the ONLY sanctioned way to write locale values. You MUST NOT bypass it by hand-filling the JSON files. Create `web/default/scripts/add-missing-keys.mjs` with this exact structure: +This script is the ONLY sanctioned way to write locale values. You MUST NOT bypass it by hand-filling the JSON files. Create `web/scripts/add-missing-keys.mjs` with this exact structure: ```javascript import fs from 'node:fs/promises' @@ -211,6 +211,7 @@ function stableStringify(obj) { const newKeys = { en: { /* "key": "English value" */ }, zh: { /* "key": "中文翻译" */ }, + 'zh-TW': { /* "key": "繁體中文翻譯" */ }, fr: { /* "key": "Traduction française" */ }, ja: { /* "key": "日本語翻訳" */ }, ru: { /* "key": "Русский перевод" */ }, @@ -257,7 +258,7 @@ Populate the `newKeys` object with actual translations for each locale. ### Step 5: Verify and clean up ```bash -cd web/default +cd web node scripts/add-missing-keys.mjs # apply translations node scripts/find-missing-keys.mjs # verify: should say "All t() keys found" bun run i18n:sync # normalize file order @@ -285,6 +286,7 @@ Delete temporary scripts after completion. |----------|------|-------| | English | en | Base locale, key = value | | Chinese | zh | Fallback locale, must be complete | +| Traditional Chinese | zh-TW | Use natural Traditional Chinese wording | | French | fr | Many English cognates are valid (e.g., "Configuration") | | Japanese | ja | Use katakana for technical loanwords | | Russian | ru | Use formal register | @@ -303,7 +305,7 @@ Delete temporary scripts after completion. ## Key Rules -1. All scripts run from `web/default/` directory +1. All scripts run from `web/` directory 2. Use `node scripts/xxx.mjs` (ESM format with top-level await) 3. Sort keys alphabetically when writing locale files 4. Always run `bun run i18n:sync` as the final step diff --git a/.agents/skills/shadcn-ui/SKILL.md b/.agents/skills/shadcn-ui/SKILL.md index c106690d53..7622820958 100644 --- a/.agents/skills/shadcn-ui/SKILL.md +++ b/.agents/skills/shadcn-ui/SKILL.md @@ -3,7 +3,7 @@ name: shadcn-ui description: >- Give the assistant project-aware shadcn/ui context: components.json, composition patterns, CLI, registries, theming, and MCP. Use when working on - web/default UI, shadcn components, or presets. Overview aligns with + web UI, shadcn components, or presets. Overview aligns with https://ui.shadcn.com/docs/skills.md; full upstream skill text is vendored under vendor/shadcn/. --- @@ -37,7 +37,7 @@ npx skills add shadcn/ui That installs the skill where the `skills` CLI is available. **This repository** keeps the same intent under `.agents/skills/shadcn-ui/` (overview here + **vendored** upstream docs in [`vendor/shadcn/`](./vendor/shadcn/)) and runs the shadcn CLI from the frontend app root: ```bash -cd web/default && bunx shadcn@latest info --json +cd web && bunx shadcn@latest info --json ``` Learn more about skills at [skills.sh](https://skills.sh). @@ -48,7 +48,7 @@ Learn more about skills at [skills.sh](https://skills.sh). ### Project context -Run **`shadcn info --json`** (here: `cd web/default && bunx shadcn@latest info --json`) for framework, Tailwind version, aliases, base (`radix` | `base`), icon library, installed components, and resolved paths. +Run **`shadcn info --json`** (here: `cd web && bunx shadcn@latest info --json`) for framework, Tailwind version, aliases, base (`radix` | `base`), icon library, installed components, and resolved paths. ### CLI commands @@ -70,7 +70,7 @@ Vendored: [`vendor/shadcn/mcp.md`](./vendor/shadcn/mcp.md). Live docs: [MCP Serv ## How it works -1. **Project detection** — Applies when `components.json` exists (here: `web/default/components.json`). +1. **Project detection** — Applies when `components.json` exists (here: `web/components.json`). 2. **Context injection** — Use `shadcn info --json` as ground truth for imports and APIs. 3. **Pattern enforcement** — Use [`vendor/shadcn/rules/`](./vendor/shadcn/rules/) for concrete markup checks; the complete official workflow reference is listed below for deeper CLI, registry, and preset questions. 4. **Component discovery** — `shadcn docs`, `shadcn search`, MCP, or registries — see the official workflow reference and MCP doc when deeper context is needed. @@ -102,4 +102,4 @@ Snapshot from [shadcn-ui/ui `skills/shadcn`](https://github.com/shadcn-ui/ui/tre | Styling | [`vendor/shadcn/rules/styling.md`](./vendor/shadcn/rules/styling.md) | | Base vs Radix | [`vendor/shadcn/rules/base-vs-radix.md`](./vendor/shadcn/rules/base-vs-radix.md) | -**Workflow:** Prefer this **root** `SKILL.md` for repo paths (`web/default`, Bun). Read **`vendor/shadcn/official-shadcn-ui-workflow.md`** only when you need the complete official component, registry, or preset workflow. Use **`vendor/shadcn/rules/*.md`** when validating concrete markup. +**Workflow:** Prefer this **root** `SKILL.md` for repo paths (`web`, Bun). Read **`vendor/shadcn/official-shadcn-ui-workflow.md`** only when you need the complete official component, registry, or preset workflow. Use **`vendor/shadcn/rules/*.md`** when validating concrete markup. diff --git a/.dockerignore b/.dockerignore index 7a7193627a..0204d2e898 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,8 +8,5 @@ docs .eslintcache .gocache /web/node_modules -/web/default/node_modules -/web/default/dist -/web/classic/node_modules -/web/classic/dist +/web/dist !THIRD-PARTY-LICENSES.md diff --git a/.env.example b/.env.example index a63ed7668e..d62e114603 100644 --- a/.env.example +++ b/.env.example @@ -64,14 +64,33 @@ # TLS / HTTP 跳过验证设置 # TLS_INSECURE_SKIP_VERIFY=false +# Gin 可信反向代理(逗号分隔的 IP/CIDR) +# 未配置/留空:默认信任 127.0.0.0/8、::1、RFC1918 私网和 fc00::/7,并打印启动告警。 +# none:严格模式,不信任任何代理且必须单独使用;显式列表完全替代默认值,应填写代理自身地址。 +# TRUSTED_PROXIES=none +# TRUSTED_PROXIES=127.0.0.1,172.20.0.0/16 + # Gemini 识别图片 最大图片数量 # GEMINI_VISION_MAX_IMAGE_NUM=16 # 会话密钥 # SESSION_SECRET=random_string -# 启用 Secure session cookie,必须同时配置可信 HTTPS 入口地址;多个地址用英文逗号分隔 +# false/未配置:本地 HTTP 模式,关闭 refresh/logout OriginGuard,且不得设置 TRUSTED_URL;兼容本地开发代理。 +# true:启用 Secure Refresh Cookie 和严格 OriginGuard,必须同时列出全部可信 HTTPS Origin。 +# SESSION_COOKIE_TRUSTED_URL 多项用英文逗号分隔;不支持通配符、路径或域名后缀匹配。 +# 这些设置不修改 relay CORS。 # SESSION_COOKIE_SECURE=false # SESSION_COOKIE_TRUSTED_URL=https://example.com,https://admin.example.com +# 每用户最多保留的活跃登录 Session +# USER_SESSION_ACTIVE_LIMIT=50 +# 单用户在签发窗口内允许创建的 Session 总数(包含已撤销) +# USER_SESSION_ISSUANCE_LIMIT=100 +# Session 签发计数窗口(秒);不得大于 revoked 保留期,超出时会自动钳制 +# USER_SESSION_ISSUANCE_WINDOW_SECONDS=86400 +# revoked Session 审计保留天数 +# USER_SESSION_REVOKED_RETENTION_DAYS=7 +# 最近一小时全局 Session 签发量超过此值时记录告警,不会拒绝登录 +# USER_SESSION_HOURLY_ALERT_THRESHOLD=5000 # 其他配置 # 生成默认token diff --git a/.github/workflows/electron-build.yml b/.github/workflows/electron-build.yml index edb1817aa3..ac4804a3b1 100644 --- a/.github/workflows/electron-build.yml +++ b/.github/workflows/electron-build.yml @@ -34,7 +34,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: '20' + node-version: '22' - name: Setup Go uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 @@ -47,7 +47,7 @@ jobs: NODE_OPTIONS: "--max-old-space-size=4096" run: | cd web - bun install + bun install --frozen-lockfile DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(git describe --tags) bun run build cd .. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e51974979..547f5ed47c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,24 +29,14 @@ jobs: - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version: latest - - name: Build Frontend (default) + - name: Build Frontend env: CI: "" run: | cd web bun install --frozen-lockfile - cd default DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$VERSION bun run build - cd ../.. - - name: Build Frontend (classic) - env: - CI: "" - run: | - cd web - bun install --filter ./classic --frozen-lockfile - cd classic - VITE_REACT_APP_VERSION=$VERSION bun run build - cd ../.. + cd .. - name: Set up Go uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: @@ -88,25 +78,15 @@ jobs: - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version: latest - - name: Build Frontend (default) + - name: Build Frontend env: CI: "" NODE_OPTIONS: "--max-old-space-size=4096" run: | cd web bun install --frozen-lockfile - cd default DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$VERSION bun run build - cd ../.. - - name: Build Frontend (classic) - env: - CI: "" - run: | - cd web - bun install --filter ./classic --frozen-lockfile - cd classic - VITE_REACT_APP_VERSION=$VERSION bun run build - cd ../.. + cd .. - name: Set up Go uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: @@ -146,24 +126,14 @@ jobs: - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version: latest - - name: Build Frontend (default) + - name: Build Frontend env: CI: "" run: | cd web bun install --frozen-lockfile - cd default DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$VERSION bun run build - cd ../.. - - name: Build Frontend (classic) - env: - CI: "" - run: | - cd web - bun install --filter ./classic --frozen-lockfile - cd classic - VITE_REACT_APP_VERSION=$VERSION bun run build - cd ../.. + cd .. - name: Set up Go uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: diff --git a/.gitignore b/.gitignore index c3afceb021..25f8469ee5 100644 --- a/.gitignore +++ b/.gitignore @@ -8,10 +8,8 @@ upload build *.db-journal logs -web/default/dist -web/classic/dist -web/node_modules web/dist +web/node_modules .env one-api new-api @@ -28,7 +26,7 @@ plans electron/node_modules electron/dist -data/ +/data/ .gomodcache/ .gocache-temp .gopath diff --git a/AGENTS.md b/AGENTS.md index 8f41dcf72c..8f6e6daca3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,10 +35,8 @@ types/ — Type definitions (relay formats, file sources, errors) i18n/ — Backend internationalization (go-i18n, en/zh) oauth/ — OAuth provider implementations pkg/ — Internal packages (cachex, ionet) -web/ — Frontend themes container - web/default/ — Default frontend (React 19, Rsbuild, Base UI, Tailwind) - web/classic/ — Classic frontend (React 18, Vite, Semi Design) - web/default/src/i18n/ — Frontend internationalization (i18next, zh/en/fr/ru/ja/vi) +web/ — Frontend (React 19, Rsbuild, Base UI, Tailwind) + src/i18n/ — Frontend internationalization (i18next, en/zh/zh-TW/fr/ru/ja/vi) ``` ## Internationalization (i18n) @@ -47,12 +45,12 @@ web/ — Frontend themes container - Library: `nicksnyder/go-i18n/v2` - Languages: en, zh -### Frontend (`web/default/src/i18n/`) +### Frontend (`web/src/i18n/`) - Library: `i18next` + `react-i18next` + `i18next-browser-languagedetector` -- Languages: en (base), zh (fallback), fr, ru, ja, vi -- Translation files: `web/default/src/i18n/locales/{lang}.json` — flat JSON, keys are English source strings +- Languages: en (base), zh (fallback), zh-TW, fr, ru, ja, vi +- Translation files: `web/src/i18n/locales/{lang}.json` — flat JSON, keys are English source strings - Usage: `useTranslation()` hook, call `t('English key')` in components -- CLI tools: `bun run i18n:sync` (from `web/default/`) +- CLI tools: `bun run i18n:sync` (from `web/`) ## Rules @@ -126,14 +124,14 @@ Do NOT directly import or call `encoding/json` in business code. `json.RawMessag ### Frontend Rules -- Use `bun` as the preferred package manager and script runner for the frontend (`web/default/`): +- Use `bun` as the preferred package manager and script runner for the frontend (`web/`): - `bun install` for dependency installation - `bun run dev` for development server - `bun run build` for production build - `bun run i18n:*` for i18n tooling -- Frontend UI text must support i18n with `i18next`/`react-i18next`. Use flat JSON locale files in `web/default/src/i18n/locales/{lang}.json`, with English source strings as keys. +- Frontend UI text must support i18n with `i18next`/`react-i18next`. Use flat JSON locale files in `web/src/i18n/locales/{lang}.json`, with English source strings as keys. - In React components, use `useTranslation()` and call `t('English key')` for user-facing text. -- Follow `web/default/AGENTS.md` for detailed frontend conventions, including TypeScript, component structure, styling, accessibility, testing, and build checks. +- Follow `web/AGENTS.md` for detailed frontend conventions, including TypeScript, component structure, styling, accessibility, testing, and build checks. ### Project Governance diff --git a/Dockerfile b/Dockerfile index e2788f55b2..10345a5c85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,23 +2,10 @@ FROM oven/bun:1@sha256:0733e50325078969732ebe3b15ce4c4be5082f18c4ac1a0f0ca4839c2 WORKDIR /build/web COPY web/package.json web/bun.lock ./ -COPY web/default/package.json ./default/package.json -COPY web/classic/package.json ./classic/package.json RUN bun install --frozen-lockfile -COPY ./web/default ./default +COPY ./web ./ COPY ./VERSION /build/VERSION -RUN cd default && DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(cat /build/VERSION) bun run build - -FROM oven/bun:1@sha256:0733e50325078969732ebe3b15ce4c4be5082f18c4ac1a0f0ca4839c2e4e42a7 AS builder-classic - -WORKDIR /build/web -COPY web/package.json web/bun.lock ./ -COPY web/default/package.json ./default/package.json -COPY web/classic/package.json ./classic/package.json -RUN bun install --filter ./classic --frozen-lockfile -COPY ./web/classic ./classic -COPY ./VERSION /build/VERSION -RUN cd classic && VITE_REACT_APP_VERSION=$(cat /build/VERSION) bun run build +RUN DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(cat /build/VERSION) bun run build FROM golang:1.26.1-alpine@sha256:2389ebfa5b7f43eeafbd6be0c3700cc46690ef842ad962f6c5bd6be49ed82039 AS builder2 ENV GO111MODULE=on CGO_ENABLED=0 @@ -34,8 +21,7 @@ ADD go.mod go.sum ./ RUN go mod download COPY . . -COPY --from=builder /build/web/default/dist ./web/default/dist -COPY --from=builder-classic /build/web/classic/dist ./web/classic/dist +COPY --from=builder /build/web/dist ./web/dist RUN go build -ldflags "-s -w -X 'github.com/QuantumNous/new-api/common.Version=$(cat VERSION)'" -o new-api FROM debian:bookworm-slim@sha256:f06537653ac770703bc45b4b113475bd402f451e85223f0f2837acbf89ab020a diff --git a/Dockerfile.dev b/Dockerfile.dev index 81c221bf11..bdc5be42da 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,5 +1,5 @@ # Backend-only build for frontend development -# Skips frontend build, uses a placeholder for //go:embed web/dist +# Skips frontend build and uses a placeholder for //go:embed web/dist FROM golang:1.26.1-alpine AS builder @@ -16,9 +16,8 @@ RUN go mod download COPY . . -RUN mkdir -p web/default/dist web/classic/dist && \ - echo 'devuse frontend dev server' > web/default/dist/index.html && \ - echo 'devuse frontend dev server' > web/classic/dist/index.html +RUN mkdir -p web/dist && \ + echo 'devuse frontend dev server' > web/dist/index.html RUN go build -ldflags "-s -w -X 'github.com/QuantumNous/new-api/common.Version=$(cat VERSION)'" -o new-api diff --git a/README.en.md b/README.en.md index 35e8d82be0..68b1c18cf2 100644 --- a/README.en.md +++ b/README.en.md @@ -1,6 +1,6 @@
-![new-api](/web/default/public/logo.png) +![new-api](/web/public/logo.png) # New API @@ -306,8 +306,16 @@ docker run --name new-api -d --restart always \ | Variable Name | Description | Default Value | |--------|------|--------| -| `SESSION_SECRET` | Session secret (required for multi-machine deployment) | - | -| `CRYPTO_SECRET` | Encryption secret (required for Redis) | - | +| `SESSION_SECRET` | Authentication signing secret; must be identical on every node | - | +| `SESSION_COOKIE_SECURE` | `false`/unset disables the refresh/logout OriginGuard for local HTTP dev proxies; `true` enables the Secure cookie and strict Origin checks | `false` | +| `SESSION_COOKIE_TRUSTED_URL` | Required with Secure mode: comma-separated exact HTTPS Origins allowed to call refresh/logout; not a relay CORS allowlist | - | +| `TRUSTED_PROXIES` | Unset/blank trusts loopback, RFC 1918 and IPv6 ULA with a startup warning; `none` trusts no proxies; an explicit proxy IP/CIDR list replaces the defaults | `127.0.0.0/8, ::1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7` | +| `USER_SESSION_ACTIVE_LIMIT` | Maximum active login Sessions per user | `50` | +| `USER_SESSION_ISSUANCE_LIMIT` | Maximum Sessions created per user within the issuance window, including revoked Sessions | `100` | +| `USER_SESSION_ISSUANCE_WINDOW_SECONDS` | Per-user Session issuance window; clamped to the revoked retention period when configured higher | `86400` | +| `USER_SESSION_REVOKED_RETENTION_DAYS` | Days to retain revoked Session rows for audit and issuance accounting | `7` | +| `USER_SESSION_HOURLY_ALERT_THRESHOLD` | Global Sessions created per hour that triggers an alert only; it never blocks login | `5000` | +| `CRYPTO_SECRET` | HMAC secret for cache keys; nodes sharing Redis must use the same effective value | Defaults to `SESSION_SECRET` | | `SQL_DSN` | Database connection string | - | | `REDIS_CONN_STRING` | Redis connection string | - | | `STREAMING_TIMEOUT` | Streaming timeout (seconds) | `300` | @@ -388,8 +396,20 @@ docker run --name new-api -d --restart always \ ### ⚠️ Multi-machine Deployment Considerations > [!WARNING] -> - **Must set** `SESSION_SECRET` - Otherwise login status inconsistent -> - **Shared Redis must set** `CRYPTO_SECRET` - Otherwise data cannot be decrypted +> - All nodes must use the same primary database and the same `SESSION_SECRET`; otherwise Access Tokens, refresh sessions, and temporary authentication flows cannot be verified consistently. +> - Nodes connected to the same Redis must also use the same `CRYPTO_SECRET`, or their cache-key digests will differ and shared entries cannot be reused consistently. + +The database is authoritative for login Sessions and for the per-user active/issuance limits. Redis Session entries are short-lived caches whose TTL follows `SYNC_FREQUENCY` (60 seconds by default) and never exceeds the Session's remaining lifetime. + +| Redis topology | Session propagation | Rate limiting | +| --- | --- | --- | +| Shared Redis | Revocations and version publications normally propagate immediately | Redis limits are shared across nodes | +| Independent Redis per node | Nodes converge from the database within the effective `SYNC_FREQUENCY`; a newly rotated token may receive a temporary 401 on a node with stale cache | Each node has its own allowance, so aggregate capacity can reach roughly the configured limit multiplied by the node count | +| No Redis | Every Session validation reads the database | In-memory limits are independent per node | + +A shorter `SYNC_FREQUENCY` reduces the independent-Redis staleness window but causes one additional primary-key Session lookup per active SID, per node, per TTL. These guarantees make Session authentication bounded-stale across the supported topologies; rate limits and other Redis-backed control-plane caches remain topology-dependent. + +See [User authentication and login sessions](./docs/authentication.md) for the token, Origin-check and PAT contracts. ### 🔄 Channel Retry and Cache diff --git a/README.fr.md b/README.fr.md index 1a6d8e4635..aa45a9ce88 100644 --- a/README.fr.md +++ b/README.fr.md @@ -1,6 +1,6 @@
-![new-api](/web/default/public/logo.png) +![new-api](/web/public/logo.png) # New API @@ -313,8 +313,16 @@ docker run --name new-api -d --restart always \ | Nom de variable | Description | Valeur par défaut | |--------|------|--------| -| `SESSION_SECRET` | Secret de session (requis pour le déploiement multi-machines) | -| `CRYPTO_SECRET` | Secret de chiffrement (requis pour Redis) | - | +| `SESSION_SECRET` | Secret de signature d’authentification, identique sur tous les nœuds | - | +| `SESSION_COOKIE_SECURE` | `false`/non défini désactive l’OriginGuard de refresh/logout pour les proxys HTTP locaux ; `true` active le cookie Secure et le contrôle strict de l’Origin | `false` | +| `SESSION_COOKIE_TRUSTED_URL` | Obligatoire en mode Secure : Origins HTTPS exactes autorisées pour refresh/logout, séparées par des virgules ; ce n’est pas une liste CORS relay | - | +| `TRUSTED_PROXIES` | Variable absente/vide : approuve le bouclage, les réseaux RFC 1918 et l’ULA IPv6 avec un avertissement au démarrage ; `none` n’approuve aucun proxy ; une liste IP/CIDR explicite remplace les valeurs par défaut | `127.0.0.0/8, ::1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7` | +| `USER_SESSION_ACTIVE_LIMIT` | Nombre maximal de Sessions de connexion actives par utilisateur | `50` | +| `USER_SESSION_ISSUANCE_LIMIT` | Nombre maximal de Sessions créées par utilisateur dans la fenêtre, y compris les Sessions révoquées | `100` | +| `USER_SESSION_ISSUANCE_WINDOW_SECONDS` | Fenêtre de comptage des Sessions ; limitée à la durée de conservation des Sessions révoquées si elle est supérieure | `86400` | +| `USER_SESSION_REVOKED_RETENTION_DAYS` | Conservation en jours des Sessions révoquées pour l’audit et le comptage | `7` | +| `USER_SESSION_HOURLY_ALERT_THRESHOLD` | Seuil global horaire déclenchant uniquement une alerte, sans bloquer les connexions | `5000` | +| `CRYPTO_SECRET` | Secret HMAC des clés de cache ; les nœuds partageant Redis doivent utiliser la même valeur effective | Par défaut, `SESSION_SECRET` | | `SQL_DSN` | Chaine de connexion à la base de données | - | | `REDIS_CONN_STRING` | Chaine de connexion Redis | - | | `STREAMING_TIMEOUT` | Délai d'expiration du streaming (secondes) | `300` | @@ -395,8 +403,20 @@ docker run --name new-api -d --restart always \ ### ⚠️ Considérations sur le déploiement multi-machines > [!WARNING] -> - **Doit définir** `SESSION_SECRET` - Sinon l'état de connexion sera incohérent sur plusieurs machines -> - **Redis partagé doit définir** `CRYPTO_SECRET` - Sinon les données ne pourront pas être déchiffrées +> - Tous les nœuds doivent utiliser la même base de données principale et la même valeur `SESSION_SECRET` ; sinon les Access Tokens, sessions Refresh et flux d’authentification temporaires ne peuvent pas être vérifiés de façon cohérente. +> - Les nœuds connectés au même Redis doivent aussi utiliser le même `CRYPTO_SECRET`, faute de quoi les empreintes de clé de cache diffèrent et les entrées partagées ne peuvent pas être réutilisées de façon cohérente. + +La base de données fait autorité pour les Sessions de connexion et pour les limites actives/d’émission par utilisateur. Les entrées Session de Redis sont des caches de courte durée dont le TTL suit `SYNC_FREQUENCY` (60 secondes par défaut), sans jamais dépasser la durée de vie restante de la Session. + +| Topologie Redis | Propagation des Sessions | Limitation de débit | +| --- | --- | --- | +| Redis partagé | Les révocations et publications de version se propagent normalement immédiatement | Les quotas Redis sont partagés entre les nœuds | +| Redis indépendant par nœud | Les nœuds se resynchronisent depuis la base dans le délai effectif de `SYNC_FREQUENCY` ; un nouveau Token issu d’une rotation peut recevoir temporairement une réponse 401 sur un nœud dont le cache est obsolète | Chaque nœud possède son propre quota ; la capacité agrégée peut donc atteindre environ la limite configurée multipliée par le nombre de nœuds | +| Sans Redis | Chaque validation de Session consulte directement la base de données | Les limites en mémoire sont indépendantes sur chaque nœud | + +Réduire `SYNC_FREQUENCY` raccourcit la fenêtre d’obsolescence avec des Redis indépendants, mais ajoute une lecture de Session par clé primaire, par SID actif, par nœud et par TTL. Ces garanties donnent une obsolescence bornée à l’authentification Session ; les limites et les autres caches du plan de contrôle adossés à Redis restent dépendants de la topologie. + +Consultez [Authentification utilisateur et sessions de connexion](./docs/authentication.md) pour les contrats de token, de vérification Origin et de PAT. ### 🔄 Nouvelle tentative de canal et cache diff --git a/README.ja.md b/README.ja.md index e0702a7d46..bd3c0f2c5c 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,6 +1,6 @@
-![new-api](/web/default/public/logo.png) +![new-api](/web/public/logo.png) # New API @@ -315,8 +315,16 @@ docker run --name new-api -d --restart always \ | 変数名 | 説明 | デフォルト値 | |--------|------|--------| -| `SESSION_SECRET` | セッションシークレット(マルチマシンデプロイに必須) | - | -| `CRYPTO_SECRET` | 暗号化シークレット(Redisに必須) | - | +| `SESSION_SECRET` | 認証署名シークレット。すべてのノードで同じ値が必要 | - | +| `SESSION_COOKIE_SECURE` | `false`/未設定ではローカル HTTP 開発プロキシ向けに refresh/logout の OriginGuard を無効化し、`true` では Secure Cookie と厳格な Origin 検証を有効化 | `false` | +| `SESSION_COOKIE_TRUSTED_URL` | Secure モードでは必須。refresh/logout を許可する完全一致の HTTPS Origin をカンマ区切りで指定。relay CORS 設定ではありません | - | +| `TRUSTED_PROXIES` | 未設定/空ではループバック、RFC 1918、IPv6 ULA を信頼して起動時に警告し、`none` ではすべて無効、明示的なプロキシ IP/CIDR リストは既定値を完全に置き換えます | `127.0.0.0/8, ::1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7` | +| `USER_SESSION_ACTIVE_LIMIT` | 1 ユーザーあたりの有効なログイン Session 上限 | `50` | +| `USER_SESSION_ISSUANCE_LIMIT` | カウント期間内に作成できる Session 数の上限(取り消し済みを含む) | `100` | +| `USER_SESSION_ISSUANCE_WINDOW_SECONDS` | Session 発行のカウント期間(秒)。取り消し済み Session の保持期間を超える場合は自動的に制限 | `86400` | +| `USER_SESSION_REVOKED_RETENTION_DAYS` | 監査と発行数計算のため取り消し済み Session を保持する日数 | `7` | +| `USER_SESSION_HOURLY_ALERT_THRESHOLD` | 1 時間あたりのグローバル Session 発行数の警告閾値。ログインは拒否しません | `5000` | +| `CRYPTO_SECRET` | キャッシュキー用 HMAC シークレット。Redis を共有するノードでは同じ実効値が必要 | デフォルトは `SESSION_SECRET` | | `SQL_DSN** | データベース接続文字列 | - | | `REDIS_CONN_STRING` | Redis接続文字列 | - | | `STREAMING_TIMEOUT` | ストリーミング応答のタイムアウト時間(秒) | `300` | @@ -395,8 +403,20 @@ docker run --name new-api -d --restart always \ ### ⚠️ マルチマシンデプロイの注意事項 > [!WARNING] -> - **必ず設定する必要があります** `SESSION_SECRET` - そうしないとマルチマシンデプロイ時にログイン状態が不一致になります -> - **共有Redisは必ず設定する必要があります** `CRYPTO_SECRET` - そうしないとデータを復号化できません +> - すべてのノードで同じプライマリデータベースと同じ `SESSION_SECRET` を使用してください。異なる場合、Access Token、Refresh セッション、一時認証フローを一貫して検証できません。 +> - 同じ Redis に接続するノードでは同じ `CRYPTO_SECRET` も設定してください。異なる場合、キャッシュキーのダイジェストが一致せず、共有エントリを正しく再利用できません。 + +ログイン Session とユーザー単位の有効数/発行数制限では、データベースが信頼できる唯一の情報源です。Redis の Session エントリは短期キャッシュであり、TTL は `SYNC_FREQUENCY`(デフォルト 60 秒)に従い、Session の残り有効期間を超えません。 + +| Redis トポロジー | Session 状態の伝播 | レート制限 | +| --- | --- | --- | +| すべてのノードで Redis を共有 | 取り消しとバージョン更新は通常即時に伝播 | Redis の制限枠はノード間で共有 | +| ノードごとに独立した Redis | 有効な `SYNC_FREQUENCY` 以内にデータベースへフォールバックして収束。バージョンローテーション直後の新しい Token は、古いキャッシュを持つノードで一時的に 401 になる場合があります | ノードごとに独立して計数するため、クラスター全体では設定値の約ノード数倍まで許可される可能性があります | +| Redis なし | Session の検証ごとにデータベースを直接参照 | メモリ内の制限枠はノードごとに独立 | + +`SYNC_FREQUENCY` を短くすると独立 Redis のキャッシュ陳腐化時間は短くなりますが、有効な SID ごと、ノードごと、TTL ごとにデータベースへの主キー照会が 1 回増えます。この保証は Session 認証の陳腐化時間を限定するものです。レート制限や Redis を使うその他のコントロールプレーンキャッシュは、引き続きトポロジーに依存します。 + +Token、Origin 検証、PAT の契約については[ユーザー認証とログインセッション](./docs/authentication.md)を参照してください。 ### 🔄 チャネルリトライとキャッシュ diff --git a/README.md b/README.md index 65e3facdb2..6730cfae7c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-![new-api](/web/default/public/logo.png) +![new-api](/web/public/logo.png) # New API @@ -313,8 +313,16 @@ docker run --name new-api -d --restart always \ | Variable Name | Description | Default Value | |--------|------|--------| -| `SESSION_SECRET` | Session secret (required for multi-machine deployment) | - | -| `CRYPTO_SECRET` | Encryption secret (required for Redis) | - | +| `SESSION_SECRET` | Authentication signing secret; must be identical on every node | - | +| `SESSION_COOKIE_SECURE` | `false`/unset disables the refresh/logout OriginGuard for local HTTP dev proxies; `true` enables the Secure cookie and strict Origin checks | `false` | +| `SESSION_COOKIE_TRUSTED_URL` | Required with Secure mode: comma-separated exact HTTPS Origins allowed to call refresh/logout; not a relay CORS allowlist | - | +| `TRUSTED_PROXIES` | Unset/blank trusts loopback, RFC 1918 and IPv6 ULA with a startup warning; `none` trusts no proxies; an explicit proxy IP/CIDR list replaces the defaults | `127.0.0.0/8, ::1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7` | +| `USER_SESSION_ACTIVE_LIMIT` | Maximum active login Sessions per user | `50` | +| `USER_SESSION_ISSUANCE_LIMIT` | Maximum Sessions created per user within the issuance window, including revoked Sessions | `100` | +| `USER_SESSION_ISSUANCE_WINDOW_SECONDS` | Per-user Session issuance window; clamped to the revoked retention period when configured higher | `86400` | +| `USER_SESSION_REVOKED_RETENTION_DAYS` | Days to retain revoked Session rows for audit and issuance accounting | `7` | +| `USER_SESSION_HOURLY_ALERT_THRESHOLD` | Global Sessions created per hour that triggers an alert only; it never blocks login | `5000` | +| `CRYPTO_SECRET` | HMAC secret for cache keys; nodes sharing Redis must use the same effective value | Defaults to `SESSION_SECRET` | | `SQL_DSN` | Database connection string | - | | `REDIS_CONN_STRING` | Redis connection string | - | | `RELAY_IDLE_CONN_TIMEOUT` | Idle keep-alive timeout for relay HTTP clients, seconds. Defaults to Go standard library behavior; set `0` to disable | `90` | @@ -396,8 +404,20 @@ docker run --name new-api -d --restart always \ ### ⚠️ Multi-machine Deployment Considerations > [!WARNING] -> - **Must set** `SESSION_SECRET` - Otherwise login status inconsistent -> - **Shared Redis must set** `CRYPTO_SECRET` - Otherwise data cannot be decrypted +> - All nodes must use the same primary database and the same `SESSION_SECRET`; otherwise Access Tokens, refresh sessions, and temporary authentication flows cannot be verified consistently. +> - Nodes connected to the same Redis must also use the same `CRYPTO_SECRET`, or their cache-key digests will differ and shared entries cannot be reused consistently. + +The database is authoritative for login Sessions and for the per-user active/issuance limits. Redis Session entries are short-lived caches whose TTL follows `SYNC_FREQUENCY` (60 seconds by default) and never exceeds the Session's remaining lifetime. + +| Redis topology | Session propagation | Rate limiting | +| --- | --- | --- | +| Shared Redis | Revocations and version publications normally propagate immediately | Redis limits are shared across nodes | +| Independent Redis per node | Nodes converge from the database within the effective `SYNC_FREQUENCY`; a newly rotated token may receive a temporary 401 on a node with stale cache | Each node has its own allowance, so aggregate capacity can reach roughly the configured limit multiplied by the node count | +| No Redis | Every Session validation reads the database | In-memory limits are independent per node | + +A shorter `SYNC_FREQUENCY` reduces the independent-Redis staleness window but causes one additional primary-key Session lookup per active SID, per node, per TTL. These guarantees make Session authentication bounded-stale across the supported topologies; rate limits and other Redis-backed control-plane caches remain topology-dependent. + +See [User authentication and login sessions](./docs/authentication.md) for the token, Origin-check and PAT contracts. ### 🔄 Channel Retry and Cache diff --git a/README.zh_CN.md b/README.zh_CN.md index 33878843f3..eb7cadd927 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -1,6 +1,6 @@
-![new-api](/web/default/public/logo.png) +![new-api](/web/public/logo.png) # New API @@ -313,8 +313,16 @@ docker run --name new-api -d --restart always \ | 变量名 | 说明 | 默认值 | |--------|--------------------------------------------------------------|--------| -| `SESSION_SECRET` | 会话密钥(多机部署必须) | - | -| `CRYPTO_SECRET` | 加密密钥(Redis 必须) | - | +| `SESSION_SECRET` | 鉴权签名密钥;所有节点必须保持一致 | - | +| `SESSION_COOKIE_SECURE` | `false`/未配置时关闭 refresh/logout OriginGuard 以兼容本地 HTTP 开发代理;`true` 时启用 Secure Cookie 和严格 Origin 校验 | `false` | +| `SESSION_COOKIE_TRUSTED_URL` | Secure 模式必填:允许调用 refresh/logout 的精确 HTTPS Origin,多个用英文逗号分隔;不是 relay CORS 白名单 | - | +| `TRUSTED_PROXIES` | 未配置/留空时信任回环、RFC1918 和 IPv6 ULA 并输出启动告警;`none` 不信任任何代理;显式代理 IP/CIDR 列表完全替代默认值 | `127.0.0.0/8, ::1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7` | +| `USER_SESSION_ACTIVE_LIMIT` | 单用户最大活跃登录 Session 数 | `50` | +| `USER_SESSION_ISSUANCE_LIMIT` | 单用户在签发窗口内可创建的 Session 总数,包含已撤销 Session | `100` | +| `USER_SESSION_ISSUANCE_WINDOW_SECONDS` | Session 签发计数窗口(秒);高于 revoked 保留期时自动钳制 | `86400` | +| `USER_SESSION_REVOKED_RETENTION_DAYS` | revoked Session 用于审计和签发计数的保留天数 | `7` | +| `USER_SESSION_HOURLY_ALERT_THRESHOLD` | 全局每小时 Session 签发告警阈值;只告警,不拒绝登录 | `5000` | +| `CRYPTO_SECRET` | 缓存键 HMAC 密钥;共享 Redis 的节点必须使用相同有效值 | 默认跟随 `SESSION_SECRET` | | `SQL_DSN` | 数据库连接字符串 | - | | `REDIS_CONN_STRING` | Redis 连接字符串 | - | | `STREAMING_TIMEOUT` | 流式超时时间(秒) | `300` | @@ -395,8 +403,20 @@ docker run --name new-api -d --restart always \ ### ⚠️ 多机部署注意事项 > [!WARNING] -> - **必须设置** `SESSION_SECRET` - 否则登录状态不一致 -> - **公用 Redis 必须设置** `CRYPTO_SECRET` - 否则数据无法解密 +> - 所有节点必须使用同一个主数据库,并设置相同的 `SESSION_SECRET`;否则 Access Token、Refresh 会话和临时鉴权流程无法一致校验。 +> - 连接同一个 Redis 的节点还必须设置相同的 `CRYPTO_SECRET`,否则节点生成的缓存键摘要不一致,无法正确共享缓存。 + +登录 Session 和单用户活跃数/签发数限制均以数据库为权威。Redis 中的 Session 仅为短期缓存,TTL 跟随 `SYNC_FREQUENCY`(默认 60 秒),且不会超过 Session 的剩余寿命。 + +| Redis 拓扑 | Session 状态传播 | 限流语义 | +| --- | --- | --- | +| 所有节点共享 Redis | 撤销和版本发布通常即时传播 | Redis 限流额度在节点间共享 | +| 每个节点使用独立 Redis | 最迟在有效 `SYNC_FREQUENCY` 内回源数据库收敛;版本轮换后,新 Token 在持有旧缓存的节点上可能短暂返回 401 | 每个节点独立计数,集群总额度最坏约为单节点阈值乘以节点数 | +| 不使用 Redis | 每次 Session 校验直接读取数据库 | 各节点使用独立的内存限流额度 | + +缩短 `SYNC_FREQUENCY` 可减小独立 Redis 的陈旧窗口,但每个活跃 SID 在每个节点上会按该 TTL 增加一次数据库主键点查。上述保证只让 Session 鉴权在不同拓扑下保持有界陈旧;限流和其他 Redis 控制面缓存仍受拓扑影响。 + +Token、Origin 校验和 PAT 契约见[用户鉴权与登录会话](./docs/authentication.md)。 ### 🔄 渠道重试与缓存 diff --git a/README.zh_TW.md b/README.zh_TW.md index 0845d5acbb..aaa4d0f155 100644 --- a/README.zh_TW.md +++ b/README.zh_TW.md @@ -1,6 +1,6 @@
-![new-api](/web/default/public/logo.png) +![new-api](/web/public/logo.png) # New API @@ -313,8 +313,16 @@ docker run --name new-api -d --restart always \ | 變數名 | 說明 | 預設值 | |--------|--------------------------------------------------------------|--------| -| `SESSION_SECRET` | 會話密鑰(多機部署必須) | - | -| `CRYPTO_SECRET` | 加密密鑰(Redis 必須) | - | +| `SESSION_SECRET` | 鑑權簽章密鑰;所有節點必須保持一致 | - | +| `SESSION_COOKIE_SECURE` | `false`/未設定時關閉 refresh/logout OriginGuard 以相容本機 HTTP 開發代理;`true` 時啟用 Secure Cookie 和嚴格 Origin 驗證 | `false` | +| `SESSION_COOKIE_TRUSTED_URL` | Secure 模式必填:允許呼叫 refresh/logout 的精確 HTTPS Origin,多個值以英文逗號分隔;不是 relay CORS 白名單 | - | +| `TRUSTED_PROXIES` | 未設定/留空時信任本機回送、RFC1918 和 IPv6 ULA 並輸出啟動警告;`none` 不信任任何代理;明確指定的代理 IP/CIDR 清單會完整取代預設值 | `127.0.0.0/8, ::1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7` | +| `USER_SESSION_ACTIVE_LIMIT` | 單一用戶最大活躍登入 Session 數 | `50` | +| `USER_SESSION_ISSUANCE_LIMIT` | 單一用戶在簽發視窗內可建立的 Session 總數,包含已撤銷 Session | `100` | +| `USER_SESSION_ISSUANCE_WINDOW_SECONDS` | Session 簽發計數視窗(秒);高於 revoked 保留期時自動限制 | `86400` | +| `USER_SESSION_REVOKED_RETENTION_DAYS` | revoked Session 用於稽核與簽發計數的保留天數 | `7` | +| `USER_SESSION_HOURLY_ALERT_THRESHOLD` | 全域每小時 Session 簽發告警門檻;只告警,不拒絕登入 | `5000` | +| `CRYPTO_SECRET` | 快取鍵 HMAC 密鑰;共用 Redis 的節點必須使用相同有效值 | 預設跟隨 `SESSION_SECRET` | | `SQL_DSN` | 資料庫連接字符串 | - | | `REDIS_CONN_STRING` | Redis 連接字符串 | - | | `STREAMING_TIMEOUT` | 流式超時時間(秒) | `300` | @@ -395,8 +403,20 @@ docker run --name new-api -d --restart always \ ### ⚠️ 多機部署注意事項 > [!WARNING] -> - **必須設置** `SESSION_SECRET` - 否則登錄狀態不一致 -> - **公用 Redis 必須設置** `CRYPTO_SECRET` - 否則數據無法解密 +> - 所有節點必須使用同一個主資料庫,並設定相同的 `SESSION_SECRET`;否則 Access Token、Refresh 工作階段和臨時鑑權流程無法一致驗證。 +> - 連線至同一個 Redis 的節點還必須設定相同的 `CRYPTO_SECRET`,否則節點產生的快取鍵摘要不一致,無法正確共用快取。 + +登入 Session 和單一使用者的活躍數/簽發數限制均以資料庫為權威。Redis 中的 Session 僅為短期快取,TTL 跟隨 `SYNC_FREQUENCY`(預設 60 秒),且不會超過 Session 的剩餘有效期。 + +| Redis 拓撲 | Session 狀態傳播 | 限流語義 | +| --- | --- | --- | +| 所有節點共用 Redis | 撤銷和版本發布通常即時傳播 | Redis 限流額度在節點間共用 | +| 每個節點使用獨立 Redis | 最遲在有效 `SYNC_FREQUENCY` 內回源資料庫並收斂;版本輪換後,新 Token 在持有舊快取的節點上可能短暫傳回 401 | 每個節點獨立計數,叢集總額度最壞約為單一節點門檻乘以節點數 | +| 不使用 Redis | 每次 Session 驗證都直接讀取資料庫 | 各節點使用獨立的記憶體限流額度 | + +縮短 `SYNC_FREQUENCY` 可減少獨立 Redis 的陳舊視窗,但每個活躍 SID 在每個節點上會依該 TTL 增加一次資料庫主鍵查詢。上述保證只讓 Session 鑑權在不同拓撲下維持有界陳舊;限流和其他 Redis 控制面快取仍受拓撲影響。 + +Token、Origin 驗證和 PAT 契約請參閱[使用者鑑權與登入工作階段](./docs/authentication.md)。 ### 🔄 管道重試與快取 diff --git a/THIRD-PARTY-LICENSES.md b/THIRD-PARTY-LICENSES.md index 4b8b1b1739..e04a8cd702 100644 --- a/THIRD-PARTY-LICENSES.md +++ b/THIRD-PARTY-LICENSES.md @@ -3,7 +3,7 @@ This file summarizes direct third-party dependencies used by distributed builds of this project. It is an engineering compliance artifact and should be kept with Docker images, standalone binaries, frontend bundles, and Electron installers. -Scope: direct dependencies from `go.mod`, `web/default/package.json`, `web/classic/package.json`, and `electron/package.json`. +Scope: direct dependencies from `go.mod`, `web/package.json`, and `electron/package.json`. Transitive dependencies should be audited before a final external release. ## Dependency Inventory @@ -12,6 +12,7 @@ Transitive dependencies should be audited before a final external release. |-------------|-------------|-----------|-------------------------------------------------------|--------------------------------------|----------------------------------------------------| | backend | production | Go | `github.com/Calcium-Ion/go-epay` | `v0.0.4` | Proprietary/Internal - owned by project maintainer | | backend | production | Go | `github.com/abema/go-mp4` | `v1.4.1` | MIT | +| backend | test | Go | `github.com/alicebob/miniredis/v2` | `v2.38.0` | MIT | | backend | production | Go | `github.com/andybalholm/brotli` | `v1.1.1` | MIT | | backend | production | Go | `github.com/anknown/ahocorasick` | `v0.0.0-20190904063843-d75dbd5169c0` | MIT | | backend | production | Go | `github.com/aws/aws-sdk-go-v2` | `v1.41.5` | Apache-2.0 | @@ -21,7 +22,6 @@ Transitive dependencies should be audited before a final external release. | backend | production | Go | `github.com/bytedance/gopkg` | `v0.1.3` | Apache-2.0 | | backend | production | Go | `github.com/gin-contrib/cors` | `v1.7.2` | MIT | | backend | production | Go | `github.com/gin-contrib/gzip` | `v0.0.6` | MIT | -| backend | production | Go | `github.com/gin-contrib/sessions` | `v0.0.5` | MIT | | backend | production | Go | `github.com/gin-contrib/static` | `v0.0.1` | MIT | | backend | production | Go | `github.com/gin-gonic/gin` | `v1.9.1` | MIT | | backend | production | Go | `github.com/glebarez/sqlite` | `v1.9.0` | MIT | @@ -65,132 +65,79 @@ Transitive dependencies should be audited before a final external release. | backend | production | Go | `gorm.io/driver/postgres` | `v1.5.2` | MIT | | backend | production | Go | `gorm.io/gorm` | `v1.25.2` | MIT | | backend | production | Go | `github.com/expr-lang/expr` | `v1.17.8` | MIT | -| web/default | production | npm | `@base-ui/react` | `1.4.1` | MIT | -| web/default | production | npm | `@fontsource-variable/public-sans` | `5.2.7` | OFL-1.1 | -| web/default | production | npm | `@hookform/resolvers` | `5.2.2` | MIT | -| web/default | production | npm | `@hugeicons/core-free-icons` | `4.1.1` | MIT | -| web/default | production | npm | `@hugeicons/react` | `1.1.6` | MIT | -| web/default | production | npm | `@lobehub/icons` | `4.12.0` | MIT | -| web/default | production | npm | `@tailwindcss/postcss` | `4.2.2` | MIT | -| web/default | production | npm | `@tanstack/react-query` | `5.97.0` | MIT | -| web/default | production | npm | `@tanstack/react-router` | `1.168.23` | MIT | -| web/default | production | npm | `@tanstack/react-table` | `8.21.3` | MIT | -| web/default | production | npm | `@tanstack/react-virtual` | `3.13.23` | MIT | -| web/default | production | npm | `@visactor/react-vchart` | `2.0.21` | MIT | -| web/default | production | npm | `@visactor/vchart` | `2.0.21` | MIT | -| web/default | production | npm | `ai` | `6.0.158` | Apache-2.0 | -| web/default | production | npm | `auto-skeleton-react` | `1.0.5` | MIT | -| web/default | production | npm | `axios` | `1.15.0` | MIT | -| web/default | production | npm | `class-variance-authority` | `0.7.1` | Apache-2.0 | -| web/default | production | npm | `clsx` | `2.1.1` | MIT | -| web/default | production | npm | `cmdk` | `1.1.1` | MIT | -| web/default | production | npm | `date-fns` | `4.1.0` | MIT | -| web/default | production | npm | `dayjs` | `1.11.20` | MIT | -| web/default | production | npm | `i18next` | `25.10.10` | MIT | -| web/default | production | npm | `i18next-browser-languagedetector` | `8.2.1` | MIT | -| web/default | production | npm | `input-otp` | `1.4.2` | MIT | -| web/default | production | npm | `lucide-react` | `1.8.0` | ISC | -| web/default | production | npm | `motion` | `12.38.0` | MIT | -| web/default | production | npm | `nanoid` | `5.1.7` | MIT | -| web/default | production | npm | `next-themes` | `0.4.6` | MIT | -| web/default | production | npm | `qrcode.react` | `4.2.0` | ISC | -| web/default | production | npm | `react` | `19.2.5` | MIT | -| web/default | production | npm | `react-day-picker` | `9.14.0` | MIT | -| web/default | production | npm | `react-dom` | `19.2.5` | MIT | -| web/default | production | npm | `react-hook-form` | `7.72.1` | MIT | -| web/default | production | npm | `react-i18next` | `16.6.6` | MIT | -| web/default | production | npm | `react-icons` | `5.6.0` | MIT | -| web/default | production | npm | `react-markdown` | `10.1.0` | MIT | -| web/default | production | npm | `react-resizable-panels` | `4.11.0` | MIT | -| web/default | production | npm | `react-top-loading-bar` | `3.0.2` | MIT | -| web/default | production | npm | `recharts` | `3.8.0` | MIT | -| web/default | production | npm | `rehype-raw` | `7.0.0` | MIT | -| web/default | production | npm | `remark-gfm` | `4.0.1` | MIT | -| web/default | production | npm | `shiki` | `4.0.2` | MIT | -| web/default | production | npm | `sonner` | `2.0.7` | MIT | -| web/default | production | npm | `sse.js` | `2.8.0` | Apache-2.0 | -| web/default | production | npm | `streamdown` | `2.5.0` | Apache-2.0 | -| web/default | production | npm | `tailwind-merge` | `3.5.0` | MIT | -| web/default | production | npm | `tailwindcss` | `4.2.2` | MIT | -| web/default | production | npm | `tokenlens` | `1.3.1` | MIT | -| web/default | production | npm | `tw-animate-css` | `1.4.0` | MIT | -| web/default | production | npm | `use-stick-to-bottom` | `1.1.3` | MIT | -| web/default | production | npm | `vaul` | `1.1.2` | MIT | -| web/default | production | npm | `zod` | `4.3.6` | MIT | -| web/default | production | npm | `zustand` | `5.0.12` | MIT | -| web/default | development | npm | `@eslint/js` | `10.0.1` | MIT | -| web/default | development | npm | `@rsbuild/core` | `2.0.1` | MIT | -| web/default | development | npm | `@rsbuild/plugin-react` | `2.0.0` | MIT | -| web/default | development | npm | `@tanstack/eslint-plugin-query` | `5.97.0` | MIT | -| web/default | development | npm | `@tanstack/react-query-devtools` | `5.97.0` | MIT | -| web/default | development | npm | `@tanstack/react-router-devtools` | `1.166.13` | MIT | -| web/default | development | npm | `@tanstack/router-plugin` | `1.167.23` | MIT | -| web/default | development | npm | `@trivago/prettier-plugin-sort-imports` | `6.0.2` | Apache-2.0 | -| web/default | development | npm | `@types/node` | `25.6.0` | MIT | -| web/default | development | npm | `@types/react` | `19.2.14` | MIT | -| web/default | development | npm | `@types/react-dom` | `19.2.3` | MIT | -| web/default | development | npm | `@xyflow/react` | `12.10.2` | MIT | -| web/default | development | npm | `embla-carousel-react` | `8.6.0` | MIT | -| web/default | development | npm | `eslint` | `10.2.0` | MIT | -| web/default | development | npm | `eslint-plugin-react-hooks` | `7.0.1` | MIT | -| web/default | development | npm | `eslint-plugin-react-refresh` | `0.5.2` | MIT | -| web/default | development | npm | `globals` | `17.4.0` | MIT | -| web/default | development | npm | `knip` | `6.3.1` | ISC | -| web/default | development | npm | `prettier` | `3.8.2` | MIT | -| web/default | development | npm | `prettier-plugin-tailwindcss` | `0.7.2` | MIT | -| web/default | development | npm | `shadcn` | `3.8.5` | MIT | -| web/default | development | npm | `typescript` | `5.9.3` | Apache-2.0 | -| web/default | development | npm | `typescript-eslint` | `8.58.1` | MIT | -| web/classic | production | npm | `@douyinfe/semi-icons` | `2.72.2` | MIT | -| web/classic | production | npm | `@douyinfe/semi-ui` | `2.72.2` | MIT | -| web/classic | production | npm | `@lobehub/icons` | `2.1.0` | MIT | -| web/classic | production | npm | `@visactor/react-vchart` | `1.8.11` | MIT | -| web/classic | production | npm | `@visactor/vchart` | `1.8.11` | MIT | -| web/classic | production | npm | `@visactor/vchart-semi-theme` | `1.8.8` | MIT | -| web/classic | production | npm | `axios` | `1.15.0` | MIT | -| web/classic | production | npm | `clsx` | `2.1.1` | MIT | -| web/classic | production | npm | `dayjs` | `1.11.13` | MIT | -| web/classic | production | npm | `history` | `5.3.0` | MIT | -| web/classic | production | npm | `i18next` | `23.16.8` | MIT | -| web/classic | production | npm | `i18next-browser-languagedetector` | `7.2.2` | MIT | -| web/classic | production | npm | `katex` | `0.16.22` | MIT | -| web/classic | production | npm | `lucide-react` | `0.511.0` | ISC | -| web/classic | production | npm | `marked` | `4.3.0` | MIT | -| web/classic | production | npm | `mermaid` | `11.6.0` | MIT | -| web/classic | production | npm | `qrcode.react` | `4.2.0` | ISC | -| web/classic | production | npm | `react` | `18.3.1` | MIT | -| web/classic | production | npm | `react-dom` | `18.3.1` | MIT | -| web/classic | production | npm | `react-dropzone` | `14.3.5` | MIT | -| web/classic | production | npm | `react-fireworks` | `1.0.4` | ISC | -| web/classic | production | npm | `react-i18next` | `13.5.0` | MIT | -| web/classic | production | npm | `react-icons` | `5.5.0` | MIT | -| web/classic | production | npm | `react-markdown` | `10.1.0` | MIT | -| web/classic | production | npm | `react-router-dom` | `6.28.1` | MIT | -| web/classic | production | npm | `react-telegram-login` | `1.1.2` | MIT | -| web/classic | production | npm | `react-toastify` | `9.1.3` | MIT | -| web/classic | production | npm | `react-turnstile` | `1.1.4` | MIT | -| web/classic | production | npm | `rehype-highlight` | `7.0.2` | MIT | -| web/classic | production | npm | `rehype-katex` | `7.0.1` | MIT | -| web/classic | production | npm | `remark-breaks` | `4.0.0` | MIT | -| web/classic | production | npm | `remark-gfm` | `4.0.1` | MIT | -| web/classic | production | npm | `remark-math` | `6.0.0` | MIT | -| web/classic | production | npm | `sse.js` | `2.6.0` | Apache-2.0 | -| web/classic | production | npm | `unist-util-visit` | `5.0.0` | MIT | -| web/classic | production | npm | `use-debounce` | `10.0.4` | MIT | -| web/classic | development | npm | `@douyinfe/vite-plugin-semi` | `2.74.0-alpha.6` | MIT | -| web/classic | development | npm | `@so1ve/prettier-config` | `3.1.0` | MIT | -| web/classic | development | npm | `@vitejs/plugin-react` | `4.3.4` | MIT | -| web/classic | development | npm | `autoprefixer` | `10.4.21` | MIT | -| web/classic | development | npm | `code-inspector-plugin` | `1.3.3` | MIT | -| web/classic | development | npm | `eslint` | `8.57.0` | MIT | -| web/classic | development | npm | `eslint-plugin-header` | `3.1.1` | MIT | -| web/classic | development | npm | `eslint-plugin-react-hooks` | `5.2.0` | MIT | -| web/classic | development | npm | `i18next-cli` | `1.15.0` | MIT | -| web/classic | development | npm | `postcss` | `8.5.3` | MIT | -| web/classic | development | npm | `prettier` | `3.4.2` | MIT | -| web/classic | development | npm | `tailwindcss` | `3.4.17` | MIT | -| web/classic | development | npm | `typescript` | `4.4.2` | Apache-2.0 | -| web/classic | development | npm | `vite` | `5.4.11` | MIT | +| web | production | npm | `@base-ui/react` | `1.6.0` | MIT | +| web | production | npm | `@codemirror/lang-markdown` | `6.5.1` | MIT | +| web | production | npm | `@codemirror/language` | `6.12.4` | MIT | +| web | production | npm | `@codemirror/state` | `6.7.1` | MIT | +| web | production | npm | `@codemirror/view` | `6.43.6` | MIT | +| web | production | npm | `@fontsource-variable/lora` | `5.3.0` | OFL-1.1 | +| web | production | npm | `@fontsource-variable/public-sans` | `5.3.0` | OFL-1.1 | +| web | production | npm | `@hookform/resolvers` | `5.4.0` | MIT | +| web | production | npm | `@hugeicons/core-free-icons` | `4.2.2` | MIT | +| web | production | npm | `@hugeicons/react` | `1.1.9` | MIT | +| web | production | npm | `@lezer/highlight` | `1.2.3` | MIT | +| web | production | npm | `@lobehub/icons` | `5.14.0` | MIT | +| web | production | npm | `@tanstack/react-query` | `5.101.2` | MIT | +| web | production | npm | `@tanstack/react-router` | `1.170.18` | MIT | +| web | production | npm | `@tanstack/react-table` | `8.21.3` | MIT | +| web | production | npm | `@tanstack/react-virtual` | `3.14.6` | MIT | +| web | production | npm | `@visactor/react-vchart` | `2.1.4` | MIT | +| web | production | npm | `@visactor/vchart` | `2.1.4` | MIT | +| web | production | npm | `ai` | `7.0.31` | Apache-2.0 | +| web | production | npm | `auto-skeleton-react` | `1.0.5` | MIT | +| web | production | npm | `axios` | `1.18.1` | MIT | +| web | production | npm | `class-variance-authority` | `0.7.1` | Apache-2.0 | +| web | production | npm | `clsx` | `2.1.1` | MIT | +| web | production | npm | `cmdk` | `1.1.1` | MIT | +| web | production | npm | `dayjs` | `1.11.21` | MIT | +| web | production | npm | `dompurify` | `3.4.11` | Apache-2.0 OR MPL-2.0 | +| web | production | npm | `i18next` | `26.3.6` | MIT | +| web | production | npm | `i18next-browser-languagedetector` | `8.2.1` | MIT | +| web | production | npm | `input-otp` | `1.4.2` | MIT | +| web | production | npm | `katex` | `0.17.0` | MIT | +| web | production | npm | `lucide-react` | `1.25.0` | ISC | +| web | production | npm | `marked` | `18.0.6` | MIT | +| web | production | npm | `motion` | `12.42.2` | MIT | +| web | production | npm | `nanoid` | `5.1.16` | MIT | +| web | production | npm | `next-themes` | `0.4.6` | MIT | +| web | production | npm | `qrcode.react` | `4.2.0` | ISC | +| web | production | npm | `react` | `19.2.7` | MIT | +| web | production | npm | `react-day-picker` | `10.0.1` | MIT | +| web | production | npm | `react-dom` | `19.2.7` | MIT | +| web | production | npm | `react-hook-form` | `7.82.0` | MIT | +| web | production | npm | `react-i18next` | `17.0.10` | MIT | +| web | production | npm | `react-icons` | `5.7.0` | MIT | +| web | production | npm | `react-resizable-panels` | `4.12.2` | MIT | +| web | production | npm | `react-top-loading-bar` | `3.0.2` | MIT | +| web | production | npm | `recharts` | `3.9.1` | MIT | +| web | production | npm | `shiki` | `4.3.1` | MIT | +| web | production | npm | `sonner` | `2.0.7` | MIT | +| web | production | npm | `sse.js` | `2.8.0` | Apache-2.0 | +| web | production | npm | `stream-markdown-parser` | `1.1.3` | MIT | +| web | production | npm | `tailwind-merge` | `3.6.0` | MIT | +| web | production | npm | `tailwindcss` | `4.3.3` | MIT | +| web | production | npm | `tokenlens` | `1.3.1` | MIT | +| web | production | npm | `tw-animate-css` | `1.4.0` | MIT | +| web | production | npm | `use-stick-to-bottom` | `1.1.6` | MIT | +| web | production | npm | `vaul` | `1.1.2` | MIT | +| web | production | npm | `zod` | `4.4.3` | MIT | +| web | production | npm | `zustand` | `5.0.14` | MIT | +| web | development | npm | `@rsbuild/core` | `2.1.6` | MIT | +| web | development | npm | `@rsbuild/plugin-react` | `2.1.0` | MIT | +| web | development | npm | `@rsbuild/plugin-tailwindcss` | `2.0.3` | MIT | +| web | development | npm | `@tanstack/react-query-devtools` | `5.101.2` | MIT | +| web | development | npm | `@tanstack/react-router-devtools` | `1.167.0` | MIT | +| web | development | npm | `@tanstack/router-plugin` | `1.168.23` | MIT | +| web | development | npm | `@types/node` | `26.1.1` | MIT | +| web | development | npm | `@types/react` | `19.2.17` | MIT | +| web | development | npm | `@types/react-dom` | `19.2.3` | MIT | +| web | development | npm | `@typescript/native-preview` | `7.0.0-dev.20260707.2` | Apache-2.0 | +| web | development | npm | `@xyflow/react` | `12.11.2` | MIT | +| web | development | npm | `embla-carousel-react` | `8.6.0` | MIT | +| web | development | npm | `knip` | `6.27.0` | ISC | +| web | development | npm | `oxfmt` | `0.57.0` | MIT | +| web | development | npm | `oxlint` | `1.74.0` | MIT | +| web | development | npm | `shadcn` | `4.13.1` | MIT | | electron | development | npm | `cross-env` | `7.0.3` | MIT | | electron | development | npm | `electron` | `39.8.5` | MIT | | electron | development | npm | `electron-builder` | `26.7.0` | MIT | @@ -372,4 +319,3 @@ this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. For more information, please refer to https://unlicense.org/ - diff --git a/common/constants.go b/common/constants.go index 87d212f997..d6b4fb5228 100644 --- a/common/constants.go +++ b/common/constants.go @@ -4,9 +4,7 @@ import ( "crypto/tls" //"os" //"strconv" - "strings" "sync" - "sync/atomic" "time" "github.com/google/uuid" @@ -19,44 +17,6 @@ var Footer = "" var Logo = "" var TopUpLink = "" -var themeValue atomic.Value // stores string; safe for concurrent read/write - -func init() { - themeValue.Store("classic") -} - -func GetTheme() string { - return themeValue.Load().(string) -} - -// SetTheme updates the frontend theme atomically. -// Only "default" and "classic" are accepted; other values are silently ignored. -func SetTheme(t string) { - if t == "default" || t == "classic" { - themeValue.Store(t) - } -} - -// ThemeAwarePath rewrites legacy /console/* paths to the default-theme -// equivalents when the active theme is "default". For "classic" (or any -// other theme) the path is returned unchanged. The function only touches -// known prefixes so it is safe to call with arbitrary suffixes and query -// strings. -func ThemeAwarePath(suffix string) string { - if GetTheme() != "default" { - return suffix - } - switch { - case strings.HasPrefix(suffix, "/console/topup"): - return strings.Replace(suffix, "/console/topup", "/wallet", 1) - case strings.HasPrefix(suffix, "/console/log"): - return strings.Replace(suffix, "/console/log", "/usage-logs", 1) - case strings.HasPrefix(suffix, "/console/personal"): - return strings.Replace(suffix, "/console/personal", "/profile", 1) - } - return suffix -} - // var ChatLink = "" // var ChatLink2 = "" var QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens @@ -77,6 +37,22 @@ var CryptoSecret = uuid.New().String() var SessionCookieSecure = false var SessionCookieTrustedURLs []string +const ( + DefaultUserSessionActiveLimit = 50 + DefaultUserSessionIssuanceLimit = 100 + DefaultUserSessionIssuanceWindowSeconds = 24 * 60 * 60 + DefaultUserSessionRevokedRetentionDays = 7 + DefaultUserSessionHourlyAlertThreshold = 5000 +) + +var ( + UserSessionActiveLimit = DefaultUserSessionActiveLimit + UserSessionIssuanceLimit = DefaultUserSessionIssuanceLimit + UserSessionIssuanceWindowSeconds = int64(DefaultUserSessionIssuanceWindowSeconds) + UserSessionRevokedRetentionDays = DefaultUserSessionRevokedRetentionDays + UserSessionHourlyAlertThreshold = DefaultUserSessionHourlyAlertThreshold +) + var OptionMap map[string]string var OptionMapRWMutex sync.RWMutex diff --git a/common/embed-file-system.go b/common/embed-file-system.go index e76fbb8016..8de8699506 100644 --- a/common/embed-file-system.go +++ b/common/embed-file-system.go @@ -41,29 +41,3 @@ func EmbedFolder(fsEmbed embed.FS, targetPath string) static.ServeFileSystem { FileSystem: http.FS(efs), } } - -// themeAwareFileSystem delegates to the appropriate embedded FS based on -// the current theme (via GetTheme). This enables runtime theme switching -// without restarting the server. -type themeAwareFileSystem struct { - defaultFS static.ServeFileSystem - classicFS static.ServeFileSystem -} - -func (t *themeAwareFileSystem) Exists(prefix string, path string) bool { - if GetTheme() == "classic" { - return t.classicFS.Exists(prefix, path) - } - return t.defaultFS.Exists(prefix, path) -} - -func (t *themeAwareFileSystem) Open(name string) (http.File, error) { - if GetTheme() == "classic" { - return t.classicFS.Open(name) - } - return t.defaultFS.Open(name) -} - -func NewThemeAwareFS(defaultFS, classicFS static.ServeFileSystem) static.ServeFileSystem { - return &themeAwareFileSystem{defaultFS: defaultFS, classicFS: classicFS} -} diff --git a/common/init.go b/common/init.go index 88b2dc3e62..4d4c62b27c 100644 --- a/common/init.go +++ b/common/init.go @@ -4,6 +4,7 @@ import ( "flag" "fmt" "log" + "math" "net/http" "os" "path/filepath" @@ -64,6 +65,7 @@ func InitEnv() { if err := InitSessionCookieSettings(); err != nil { log.Fatal(err) } + initUserSessionSettings() if os.Getenv("SQLITE_PATH") != "" { SQLitePath = os.Getenv("SQLITE_PATH") } @@ -134,6 +136,43 @@ func InitEnv() { initConstantEnv() } +func initUserSessionSettings() { + UserSessionActiveLimit = positiveUserSessionEnv("USER_SESSION_ACTIVE_LIMIT", DefaultUserSessionActiveLimit) + UserSessionIssuanceLimit = positiveUserSessionEnv("USER_SESSION_ISSUANCE_LIMIT", DefaultUserSessionIssuanceLimit) + UserSessionIssuanceWindowSeconds = int64(positiveUserSessionEnv("USER_SESSION_ISSUANCE_WINDOW_SECONDS", DefaultUserSessionIssuanceWindowSeconds)) + UserSessionRevokedRetentionDays = positiveUserSessionEnv("USER_SESSION_REVOKED_RETENTION_DAYS", DefaultUserSessionRevokedRetentionDays) + UserSessionHourlyAlertThreshold = positiveUserSessionEnv("USER_SESSION_HOURLY_ALERT_THRESHOLD", DefaultUserSessionHourlyAlertThreshold) + + const secondsPerDay = 24 * 60 * 60 + if int64(UserSessionRevokedRetentionDays) > math.MaxInt64/secondsPerDay { + SysError(fmt.Sprintf( + "USER_SESSION_REVOKED_RETENTION_DAYS is too large, using default value: %d", + DefaultUserSessionRevokedRetentionDays, + )) + UserSessionRevokedRetentionDays = DefaultUserSessionRevokedRetentionDays + } + retentionSeconds := int64(UserSessionRevokedRetentionDays) * secondsPerDay + if UserSessionIssuanceWindowSeconds > retentionSeconds { + configuredWindow := UserSessionIssuanceWindowSeconds + UserSessionIssuanceWindowSeconds = retentionSeconds + SysError(fmt.Sprintf( + "USER_SESSION_ISSUANCE_WINDOW_SECONDS exceeds revoked retention; configured_window_seconds=%d revoked_retention_seconds=%d effective_window_seconds=%d", + configuredWindow, + retentionSeconds, + UserSessionIssuanceWindowSeconds, + )) + } +} + +func positiveUserSessionEnv(name string, fallback int) int { + value := GetEnvOrDefault(name, fallback) + if value <= 0 { + SysError(fmt.Sprintf("%s must be positive, using default value: %d", name, fallback)) + return fallback + } + return value +} + func initConstantEnv() { constant.StreamingTimeout = GetEnvOrDefault("STREAMING_TIMEOUT", 300) constant.DifyDebug = GetEnvOrDefaultBool("DIFY_DEBUG", true) diff --git a/common/session_cookie.go b/common/session_cookie.go index 74e3e25cb3..28981ce9d8 100644 --- a/common/session_cookie.go +++ b/common/session_cookie.go @@ -2,11 +2,45 @@ package common import ( "fmt" + "net" "net/url" "os" "strings" ) +// NormalizeOrigin validates and canonicalizes a browser origin. Only an exact +// scheme/host/effective-port match is meaningful; paths and wildcards are not +// accepted for authentication cookie endpoints. +func NormalizeOrigin(raw string) (string, error) { + raw = strings.TrimSpace(raw) + if raw == "" || raw == "null" || strings.ContainsAny(raw, "\r\n") { + return "", fmt.Errorf("origin is empty or invalid") + } + parsedURL, err := url.Parse(raw) + if err != nil { + return "", fmt.Errorf("invalid origin: %w", err) + } + if parsedURL.Scheme != "http" && parsedURL.Scheme != "https" { + return "", fmt.Errorf("origin scheme must be http or https") + } + if parsedURL.Host == "" || parsedURL.User != nil || parsedURL.RawQuery != "" || parsedURL.Fragment != "" || (parsedURL.Path != "" && parsedURL.Path != "/") { + return "", fmt.Errorf("origin must contain only scheme and host") + } + hostname := strings.ToLower(parsedURL.Hostname()) + if hostname == "" || strings.Contains(hostname, "*") { + return "", fmt.Errorf("origin host is empty") + } + port := parsedURL.Port() + normalizedHost := hostname + if strings.Contains(hostname, ":") { + normalizedHost = "[" + hostname + "]" + } + if port == "" || (parsedURL.Scheme == "http" && port == "80") || (parsedURL.Scheme == "https" && port == "443") { + return parsedURL.Scheme + "://" + normalizedHost, nil + } + return parsedURL.Scheme + "://" + net.JoinHostPort(hostname, port), nil +} + func InitSessionCookieSettings() error { secureRaw := strings.TrimSpace(os.Getenv("SESSION_COOKIE_SECURE")) trustedURLsRaw := strings.TrimSpace(os.Getenv("SESSION_COOKIE_TRUSTED_URL")) @@ -35,14 +69,14 @@ func InitSessionCookieSettings() error { if trustedURL == "" { return fmt.Errorf("SESSION_COOKIE_TRUSTED_URL contains an empty URL") } - parsedURL, err := url.Parse(trustedURL) + normalizedOrigin, err := NormalizeOrigin(trustedURL) if err != nil { return fmt.Errorf("invalid SESSION_COOKIE_TRUSTED_URL: %w", err) } - if parsedURL.Scheme != "https" || parsedURL.Host == "" { + if !strings.HasPrefix(normalizedOrigin, "https://") { return fmt.Errorf("SESSION_COOKIE_TRUSTED_URL must contain only https URLs with hosts") } - SessionCookieTrustedURLs = append(SessionCookieTrustedURLs, trustedURL) + SessionCookieTrustedURLs = append(SessionCookieTrustedURLs, normalizedOrigin) } SessionCookieSecure = true diff --git a/common/sys_log.go b/common/sys_log.go index 1fa4ebb575..2d6022f774 100644 --- a/common/sys_log.go +++ b/common/sys_log.go @@ -47,9 +47,10 @@ func LogStartupSuccess(startTime time.Time, port string) { defer LogWriterMu.RUnlock() if SessionCookieSecure == false { - // log warning if session cookie is not secure + // Warn when the local HTTP compatibility mode disables cookie transport + // security and refresh/logout Origin validation. fmt.Fprintf(gin.DefaultWriter, "\n") - fmt.Fprintf(gin.DefaultWriter, " \033[33mWarning: Session cookie is not secure. Please set SESSION_COOKIE_SECURE=true in production.\033[0m\n") + fmt.Fprintf(gin.DefaultWriter, " \033[33mWarning: Refresh cookie is not secure and refresh/logout Origin validation is disabled. Please set SESSION_COOKIE_SECURE=true in production.\033[0m\n") fmt.Fprintf(gin.DefaultWriter, "\n") } diff --git a/common/url_validator_test.go b/common/url_validator_test.go index 478832a331..4342500cf9 100644 --- a/common/url_validator_test.go +++ b/common/url_validator_test.go @@ -193,3 +193,29 @@ func TestInitSessionCookieSettingsRejectsEmptyTrustedURLInList(t *testing.T) { require.Error(t, InitSessionCookieSettings()) } + +func TestInitSessionCookieSettingsNormalizesExactOrigins(t *testing.T) { + resetSessionCookieSettingsAfterTest(t) + t.Setenv("SESSION_COOKIE_SECURE", "true") + t.Setenv("SESSION_COOKIE_TRUSTED_URL", "https://EXAMPLE.com:443,https://admin.example.com:8443/") + + require.NoError(t, InitSessionCookieSettings()) + assert.Equal(t, []string{"https://example.com", "https://admin.example.com:8443"}, SessionCookieTrustedURLs) +} + +func TestInitSessionCookieSettingsRejectsNonOriginURLs(t *testing.T) { + for _, trustedURL := range []string{ + "https://*.example.com", + "https://user@example.com", + "https://example.com/admin", + "https://example.com?next=admin", + "https://example.com#admin", + } { + t.Run(trustedURL, func(t *testing.T) { + resetSessionCookieSettingsAfterTest(t) + t.Setenv("SESSION_COOKIE_SECURE", "true") + t.Setenv("SESSION_COOKIE_TRUSTED_URL", trustedURL) + require.Error(t, InitSessionCookieSettings()) + }) + } +} diff --git a/common/user_session_test.go b/common/user_session_test.go new file mode 100644 index 0000000000..a6c2a5c36b --- /dev/null +++ b/common/user_session_test.go @@ -0,0 +1,60 @@ +package common + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestInitUserSessionSettingsUsesPositiveFallbacksAndClampsWindow(t *testing.T) { + previousActiveLimit := UserSessionActiveLimit + previousIssuanceLimit := UserSessionIssuanceLimit + previousIssuanceWindow := UserSessionIssuanceWindowSeconds + previousRevokedRetention := UserSessionRevokedRetentionDays + previousAlertThreshold := UserSessionHourlyAlertThreshold + t.Cleanup(func() { + UserSessionActiveLimit = previousActiveLimit + UserSessionIssuanceLimit = previousIssuanceLimit + UserSessionIssuanceWindowSeconds = previousIssuanceWindow + UserSessionRevokedRetentionDays = previousRevokedRetention + UserSessionHourlyAlertThreshold = previousAlertThreshold + }) + + t.Setenv("USER_SESSION_ACTIVE_LIMIT", "0") + t.Setenv("USER_SESSION_ISSUANCE_LIMIT", "-2") + t.Setenv("USER_SESSION_ISSUANCE_WINDOW_SECONDS", "invalid") + t.Setenv("USER_SESSION_REVOKED_RETENTION_DAYS", "0") + t.Setenv("USER_SESSION_HOURLY_ALERT_THRESHOLD", "-1") + initUserSessionSettings() + + assert.Equal(t, DefaultUserSessionActiveLimit, UserSessionActiveLimit) + assert.Equal(t, DefaultUserSessionIssuanceLimit, UserSessionIssuanceLimit) + assert.Equal(t, int64(DefaultUserSessionIssuanceWindowSeconds), UserSessionIssuanceWindowSeconds) + assert.Equal(t, DefaultUserSessionRevokedRetentionDays, UserSessionRevokedRetentionDays) + assert.Equal(t, DefaultUserSessionHourlyAlertThreshold, UserSessionHourlyAlertThreshold) + + t.Setenv("USER_SESSION_ACTIVE_LIMIT", "12") + t.Setenv("USER_SESSION_ISSUANCE_LIMIT", "34") + t.Setenv("USER_SESSION_ISSUANCE_WINDOW_SECONDS", "172800") + t.Setenv("USER_SESSION_REVOKED_RETENTION_DAYS", "1") + t.Setenv("USER_SESSION_HOURLY_ALERT_THRESHOLD", "56") + initUserSessionSettings() + + assert.Equal(t, 12, UserSessionActiveLimit) + assert.Equal(t, 34, UserSessionIssuanceLimit) + assert.Equal(t, int64(24*60*60), UserSessionIssuanceWindowSeconds) + assert.Equal(t, 1, UserSessionRevokedRetentionDays) + assert.Equal(t, 56, UserSessionHourlyAlertThreshold) + + t.Setenv("USER_SESSION_ISSUANCE_WINDOW_SECONDS", "43200") + initUserSessionSettings() + assert.Equal(t, int64(12*60*60), UserSessionIssuanceWindowSeconds, "a window below retention remains unchanged") + + t.Setenv("USER_SESSION_ISSUANCE_WINDOW_SECONDS", "86400") + initUserSessionSettings() + assert.Equal(t, int64(24*60*60), UserSessionIssuanceWindowSeconds, "a window equal to retention remains unchanged") + + t.Setenv("USER_SESSION_REVOKED_RETENTION_DAYS", "9223372036854775807") + initUserSessionSettings() + assert.Equal(t, DefaultUserSessionRevokedRetentionDays, UserSessionRevokedRetentionDays) +} diff --git a/controller/audit.go b/controller/audit.go index 36080724f8..d6974b9008 100644 --- a/controller/audit.go +++ b/controller/audit.go @@ -12,7 +12,7 @@ import ( ) // auditContentTemplates 将稳定的操作标识 action 映射为英文兜底模板,渲染后写入 -// Log.Content(供导出 / 经典前端等非本地化消费者使用)。占位符为 ${name},由该 +// Log.Content(供导出等非本地化消费者使用)。占位符为 ${name},由该 // action 的 params 填充。本地化展示文案在前端 i18n 模板中维护,本表是语言中立的 // 英文基线——调用方因此无需在每个埋点处手写句子(避免与 params 重复书写同一份值)。 var auditContentTemplates = map[string]string{ diff --git a/controller/auth_flow_test.go b/controller/auth_flow_test.go new file mode 100644 index 0000000000..3fe08b4278 --- /dev/null +++ b/controller/auth_flow_test.go @@ -0,0 +1,224 @@ +package controller + +import ( + "context" + "errors" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/model" + "github.com/QuantumNous/new-api/oauth" + "github.com/gin-gonic/gin" + "github.com/glebarez/sqlite" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +type authFlowTestOAuthProvider struct { + exchangeErr error + userInfoErr error + exchangeCalls int + userInfoCalls int +} + +func (*authFlowTestOAuthProvider) GetName() string { return "Auth Flow Test" } +func (*authFlowTestOAuthProvider) IsEnabled() bool { return true } +func (provider *authFlowTestOAuthProvider) ExchangeToken(context.Context, string, *gin.Context) (*oauth.OAuthToken, error) { + provider.exchangeCalls++ + if provider.exchangeErr != nil { + return nil, provider.exchangeErr + } + return &oauth.OAuthToken{}, nil +} +func (provider *authFlowTestOAuthProvider) GetUserInfo(context.Context, *oauth.OAuthToken) (*oauth.OAuthUser, error) { + provider.userInfoCalls++ + if provider.userInfoErr != nil { + return nil, provider.userInfoErr + } + return &oauth.OAuthUser{ProviderUserID: "external-user"}, nil +} +func (*authFlowTestOAuthProvider) IsUserIDTaken(string) bool { return false } +func (*authFlowTestOAuthProvider) FillUserByProviderID(*model.User, string) error { return nil } +func (*authFlowTestOAuthProvider) SetProviderUserID(*model.User, string) {} +func (*authFlowTestOAuthProvider) GetProviderPrefix() string { return "flow_" } + +func setupAuthFlowControllerTest(t *testing.T) *authFlowTestOAuthProvider { + t.Helper() + previousDB := model.DB + previousType := common.MainDatabaseType() + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + require.NoError(t, err) + require.NoError(t, db.AutoMigrate(&model.AuthFlow{})) + model.DB = db + common.SetMainDatabaseType(common.DatabaseTypeSQLite) + provider := &authFlowTestOAuthProvider{} + oauth.Register("auth-flow-test", provider) + t.Cleanup(func() { + oauth.Unregister("auth-flow-test") + model.DB = previousDB + common.SetMainDatabaseType(previousType) + }) + return provider +} + +func TestGenerateOAuthCodeCarriesAffiliateInLoginFlow(t *testing.T) { + setupAuthFlowControllerTest(t) + recorder := httptest.NewRecorder() + c, _ := gin.CreateTestContext(recorder) + c.Request = httptest.NewRequest(http.MethodPost, "/api/oauth/state", strings.NewReader(`{"provider":"auth-flow-test","intent":"login","aff":"invite-code"}`)) + c.Request.Header.Set("Content-Type", "application/json") + + GenerateOAuthCode(c) + + require.Equal(t, http.StatusOK, recorder.Code) + var response struct { + Success bool `json:"success"` + Data struct { + FlowToken string `json:"flow_token"` + } `json:"data"` + } + require.NoError(t, common.Unmarshal(recorder.Body.Bytes(), &response)) + require.True(t, response.Success) + flow, err := model.GetAuthFlow(response.Data.FlowToken, model.AuthFlowMatch{ + Purpose: model.AuthFlowPurposeOAuth, Provider: "auth-flow-test", Intent: model.AuthFlowIntentLogin, + }) + require.NoError(t, err) + var payload oauthFlowPayload + require.NoError(t, common.UnmarshalJsonStr(flow.Payload, &payload)) + assert.Equal(t, "invite-code", payload.AffiliateCode) + assert.Zero(t, flow.UserId) + assert.Empty(t, flow.SessionId) +} + +func TestGenerateOAuthCodeBindsFlowToAuthenticatedSession(t *testing.T) { + setupAuthFlowControllerTest(t) + recorder := httptest.NewRecorder() + c, _ := gin.CreateTestContext(recorder) + c.Request = httptest.NewRequest(http.MethodPost, "/api/oauth/state", strings.NewReader(`{"provider":"auth-flow-test","intent":"bind"}`)) + c.Request.Header.Set("Content-Type", "application/json") + c.Set("id", 42) + c.Set("session_id", "session-42") + c.Set("auth_version", int64(3)) + c.Set("session_version", int64(2)) + + GenerateOAuthCode(c) + + require.Equal(t, http.StatusOK, recorder.Code) + var response struct { + Success bool `json:"success"` + Data struct { + FlowToken string `json:"flow_token"` + } `json:"data"` + } + require.NoError(t, common.Unmarshal(recorder.Body.Bytes(), &response)) + require.True(t, response.Success) + flow, err := model.GetAuthFlow(response.Data.FlowToken, model.AuthFlowMatch{ + Purpose: model.AuthFlowPurposeOAuth, Provider: "auth-flow-test", Intent: model.AuthFlowIntentBind, + UserId: 42, SessionId: "session-42", + }) + require.NoError(t, err) + assert.Equal(t, 42, flow.UserId) + assert.Equal(t, "session-42", flow.SessionId) +} + +func TestOAuthLoginConsumesFlowOnlyAfterProviderIdentity(t *testing.T) { + provider := setupAuthFlowControllerTest(t) + + tests := []struct { + name string + exchangeErr error + userInfoErr error + }{ + {name: "exchange failure", exchangeErr: errors.New("exchange failed")}, + {name: "user info failure", userInfoErr: errors.New("user info failed")}, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + provider.exchangeErr = test.exchangeErr + provider.userInfoErr = test.userInfoErr + token, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeOAuth, Provider: "auth-flow-test", Intent: model.AuthFlowIntentLogin, + Payload: `{}`, ExpiresAt: time.Now().Add(time.Minute), + }) + require.NoError(t, err) + + router := gin.New() + router.GET("/api/oauth/:provider", HandleOAuth) + request := httptest.NewRequest(http.MethodGet, "/api/oauth/auth-flow-test?state="+token+"&code=test", nil) + response := httptest.NewRecorder() + router.ServeHTTP(response, request) + + flow, err := model.GetAuthFlow(token, model.AuthFlowMatch{ + Purpose: model.AuthFlowPurposeOAuth, Provider: "auth-flow-test", Intent: model.AuthFlowIntentLogin, + }) + require.NoError(t, err) + assert.Nil(t, flow.ConsumedAt) + }) + } +} + +func TestOAuthLoginConsumesFlowAfterProviderIdentityAndOnProviderError(t *testing.T) { + provider := setupAuthFlowControllerTest(t) + + provider.exchangeErr = nil + provider.userInfoErr = nil + successToken, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeOAuth, Provider: "auth-flow-test", Intent: model.AuthFlowIntentLogin, + Payload: `{invalid`, ExpiresAt: time.Now().Add(time.Minute), + }) + require.NoError(t, err) + router := gin.New() + router.GET("/api/oauth/:provider", HandleOAuth) + request := httptest.NewRequest(http.MethodGet, "/api/oauth/auth-flow-test?state="+successToken+"&code=test", nil) + response := httptest.NewRecorder() + router.ServeHTTP(response, request) + _, err = model.GetAuthFlow(successToken, model.AuthFlowMatch{Purpose: model.AuthFlowPurposeOAuth}) + assert.ErrorIs(t, err, model.ErrAuthFlowConsumed) + assert.Equal(t, 1, provider.exchangeCalls) + assert.Equal(t, 1, provider.userInfoCalls) + + providerErrorToken, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeOAuth, Provider: "auth-flow-test", Intent: model.AuthFlowIntentLogin, + Payload: `{}`, ExpiresAt: time.Now().Add(time.Minute), + }) + require.NoError(t, err) + request = httptest.NewRequest(http.MethodGet, "/api/oauth/auth-flow-test?state="+providerErrorToken+"&error=access_denied", nil) + response = httptest.NewRecorder() + router.ServeHTTP(response, request) + _, err = model.GetAuthFlow(providerErrorToken, model.AuthFlowMatch{Purpose: model.AuthFlowPurposeOAuth}) + assert.ErrorIs(t, err, model.ErrAuthFlowConsumed) + assert.Equal(t, 1, provider.exchangeCalls) + assert.Equal(t, 1, provider.userInfoCalls) +} + +func TestOAuthBindProviderErrorConsumesSessionBoundFlow(t *testing.T) { + provider := setupAuthFlowControllerTest(t) + flowToken, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeOAuth, Provider: "auth-flow-test", Intent: model.AuthFlowIntentBind, + UserId: 42, SessionId: "session-42", Payload: `{}`, ExpiresAt: time.Now().Add(time.Minute), + }) + require.NoError(t, err) + router := gin.New() + router.Use(func(c *gin.Context) { + c.Set("id", 42) + c.Set("session_id", "session-42") + c.Set("auth_version", int64(1)) + c.Set("session_version", int64(1)) + c.Next() + }) + router.GET("/api/oauth/:provider", HandleOAuth) + request := httptest.NewRequest(http.MethodGet, "/api/oauth/auth-flow-test?state="+flowToken+"&error=access_denied&error_description=cancelled", nil) + response := httptest.NewRecorder() + router.ServeHTTP(response, request) + + assert.Equal(t, http.StatusOK, response.Code) + _, err = model.GetAuthFlow(flowToken, model.AuthFlowMatch{Purpose: model.AuthFlowPurposeOAuth}) + assert.ErrorIs(t, err, model.ErrAuthFlowConsumed) + assert.Zero(t, provider.exchangeCalls) + assert.Zero(t, provider.userInfoCalls) +} diff --git a/controller/auth_session.go b/controller/auth_session.go new file mode 100644 index 0000000000..0f1599c596 --- /dev/null +++ b/controller/auth_session.go @@ -0,0 +1,189 @@ +package controller + +import ( + "errors" + "net/http" + "strings" + + "github.com/QuantumNous/new-api/middleware" + "github.com/QuantumNous/new-api/model" + "github.com/QuantumNous/new-api/service" + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +func RefreshAuth(c *gin.Context) { + setAuthNoStore(c) + rawRefreshToken, err := c.Cookie(service.RefreshCookieName) + if err != nil || rawRefreshToken == "" { + service.ClearRefreshCookie(c) + writeAuthSessionError(c, service.ErrRefreshTokenInvalid) + return + } + bundle, user, err := service.RefreshLoginSession(rawRefreshToken, c.GetHeader("X-Auth-Session"), c.ClientIP(), c.Request.UserAgent()) + if err != nil { + if errors.Is(err, service.ErrRefreshTokenInvalid) || errors.Is(err, service.ErrLoginSessionRevoked) { + service.ClearRefreshCookie(c) + } + writeAuthSessionError(c, err) + return + } + service.WriteRefreshCookie(c, bundle.RefreshToken) + c.JSON(http.StatusOK, gin.H{ + "success": true, + "message": "", + "data": gin.H{ + "access_token": bundle.AccessToken, + "token_type": bundle.TokenType, + "access_expires_at": bundle.AccessExpiresAt, + "user": buildSelfUserData(user), + "session": bundle.Session, + }, + }) +} + +func AuthLogout(c *gin.Context) { + setAuthNoStore(c) + expectedSID := strings.TrimSpace(c.GetHeader("X-Auth-Session")) + rawRefreshToken, cookieErr := c.Cookie(service.RefreshCookieName) + cookieSID, hasCookieSID := service.RefreshTokenSID(rawRefreshToken) + if expectedSID != "" && cookieErr == nil && hasCookieSID && cookieSID != expectedSID { + writeAuthSessionError(c, service.ErrLoginSessionMismatch) + return + } + + if rawAccessToken, ok := dashboardBearer(c.GetHeader("Authorization")); ok { + if identity, err := service.ParseAccessToken(rawAccessToken); err == nil { + if expectedSID != "" && expectedSID != identity.SessionID { + writeAuthSessionError(c, service.ErrLoginSessionMismatch) + return + } + if _, err := model.RevokeUserSession(identity.UserID, identity.SessionID, "logout"); err != nil { + writeAuthSessionError(c, err) + return + } + cookieCleared := false + if cookieErr == nil && hasCookieSID && cookieSID == identity.SessionID { + if err := service.RevokeByRefreshToken(rawRefreshToken, identity.SessionID, "logout"); err != nil { + writeAuthSessionError(c, err) + return + } + service.ClearRefreshCookie(c) + cookieCleared = true + } + c.JSON(http.StatusOK, gin.H{ + "success": true, + "message": "", + "data": gin.H{"revoked_sid": identity.SessionID, "cookie_cleared": cookieCleared}, + }) + return + } + } + if cookieErr != nil || rawRefreshToken == "" { + service.ClearRefreshCookie(c) + c.JSON(http.StatusOK, gin.H{"success": true, "message": ""}) + return + } + if err := service.RevokeByRefreshToken(rawRefreshToken, expectedSID, "logout"); err != nil { + writeAuthSessionError(c, err) + return + } + service.ClearRefreshCookie(c) + c.JSON(http.StatusOK, gin.H{"success": true, "message": ""}) +} + +func GetLoginSessions(c *gin.Context) { + identity, ok := requireBrowserSession(c) + if !ok { + return + } + sessions, err := service.ListLoginSessions(identity.UserID, identity.SessionID) + if err != nil { + writeAuthSessionError(c, err) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "message": "", "data": sessions}) +} + +func DeleteLoginSession(c *gin.Context) { + identity, ok := requireBrowserSession(c) + if !ok { + return + } + sid := strings.TrimSpace(c.Param("sid")) + if sid == "" { + c.JSON(http.StatusBadRequest, gin.H{"success": false, "code": "AUTH_SESSION_ID_REQUIRED", "message": "session id is required"}) + return + } + revoked, err := model.RevokeUserSession(identity.UserID, sid, "user_revoked") + if err != nil { + writeAuthSessionError(c, err) + return + } + if !revoked { + c.JSON(http.StatusNotFound, gin.H{"success": false, "code": "AUTH_SESSION_NOT_FOUND", "message": "session not found"}) + return + } + if rawRefreshToken, cookieErr := c.Cookie(service.RefreshCookieName); cookieErr == nil { + cookieSID, ok := service.RefreshTokenSID(rawRefreshToken) + if ok && cookieSID == sid { + service.ClearRefreshCookie(c) + } + } + c.JSON(http.StatusOK, gin.H{"success": true, "message": "", "data": gin.H{"revoked_sid": sid, "current": sid == identity.SessionID}}) +} + +func RevokeOtherLoginSessions(c *gin.Context) { + identity, ok := requireBrowserSession(c) + if !ok { + return + } + count, err := model.RevokeOtherUserSessions(identity.UserID, identity.SessionID, "user_revoked_others") + if err != nil { + writeAuthSessionError(c, err) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "message": "", "data": gin.H{"revoked_count": count}}) +} + +func requireBrowserSession(c *gin.Context) (service.AuthIdentity, bool) { + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + c.JSON(http.StatusForbidden, gin.H{ + "success": false, + "code": "AUTH_SESSION_REQUIRED", + "message": "a dashboard login session is required", + }) + return service.AuthIdentity{}, false + } + return identity, true +} + +func writeAuthSessionError(c *gin.Context, err error) { + status, code := service.AuthSessionErrorCode(err) + if errors.Is(err, gorm.ErrRecordNotFound) { + status, code = http.StatusUnauthorized, "AUTH_UNAUTHORIZED" + } + c.JSON(status, gin.H{"success": false, "code": code, "message": http.StatusText(status)}) +} + +func setAuthNoStore(c *gin.Context) { + c.Header("Cache-Control", "no-store") +} + +func authRotationData(bundle *service.AuthBundle) gin.H { + return gin.H{ + "access_token": bundle.AccessToken, + "token_type": bundle.TokenType, + "access_expires_at": bundle.AccessExpiresAt, + "session": bundle.Session, + } +} + +func dashboardBearer(header string) (string, bool) { + parts := strings.Fields(header) + if len(parts) != 2 || !strings.EqualFold(parts[0], "Bearer") || parts[1] == "" { + return "", false + } + return parts[1], true +} diff --git a/controller/auth_session_test.go b/controller/auth_session_test.go new file mode 100644 index 0000000000..670d7ce9ff --- /dev/null +++ b/controller/auth_session_test.go @@ -0,0 +1,155 @@ +package controller + +import ( + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/model" + "github.com/QuantumNous/new-api/service" + "github.com/gin-gonic/gin" + "github.com/glebarez/sqlite" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +func TestAuthLogoutRejectsRefreshCookieSessionMismatch(t *testing.T) { + previousDB := model.DB + previousRedis := common.RedisEnabled + previousSecret := common.SessionSecret + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + require.NoError(t, err) + require.NoError(t, db.AutoMigrate(&model.User{}, &model.UserSession{})) + model.DB = db + common.RedisEnabled = false + common.SessionSecret = "auth-logout-mismatch-test-secret" + t.Cleanup(func() { + model.DB = previousDB + common.RedisEnabled = previousRedis + common.SessionSecret = previousSecret + }) + + user := &model.User{ + Username: "logout-mismatch-user", Password: "unused", Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, Group: "default", AuthVersion: 1, + } + require.NoError(t, db.Create(user).Error) + sessionA, err := service.CreateLoginSession(user.Id, "password", "127.0.0.1", "agent-a") + require.NoError(t, err) + sessionB, err := service.CreateLoginSession(user.Id, "password", "127.0.0.1", "agent-b") + require.NoError(t, err) + + gin.SetMode(gin.TestMode) + recorder := httptest.NewRecorder() + c, _ := gin.CreateTestContext(recorder) + c.Request = httptest.NewRequest(http.MethodPost, "/api/user/auth/logout", nil) + c.Request.Header.Set("Authorization", "Bearer "+sessionA.AccessToken) + c.Request.Header.Set("X-Auth-Session", sessionA.Session.SID) + c.Request.AddCookie(&http.Cookie{Name: service.RefreshCookieName, Value: sessionB.RefreshToken}) + + AuthLogout(c) + + assert.Equal(t, http.StatusConflict, recorder.Code) + var response struct { + Success bool `json:"success"` + Code string `json:"code"` + } + require.NoError(t, common.Unmarshal(recorder.Body.Bytes(), &response)) + assert.False(t, response.Success) + assert.Equal(t, "AUTH_SESSION_MISMATCH", response.Code) + for _, sid := range []string{sessionA.Session.SID, sessionB.Session.SID} { + stored, err := model.GetUserSessionBySID(sid) + require.NoError(t, err) + assert.Equal(t, model.UserSessionStatusActive, stored.Status) + } +} + +func TestWriteAuthSessionErrorMapsSessionGrowthLimits(t *testing.T) { + gin.SetMode(gin.TestMode) + tests := []struct { + name string + err error + expectedStatus int + expectedCode string + }{ + { + name: "active session limit", + err: model.ErrUserSessionLimit, + expectedStatus: http.StatusConflict, + expectedCode: "AUTH_SESSION_LIMIT", + }, + { + name: "issuance limit", + err: model.ErrUserSessionIssuanceLimit, + expectedStatus: http.StatusTooManyRequests, + expectedCode: "AUTH_SESSION_ISSUANCE_LIMIT", + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + recorder := httptest.NewRecorder() + c, _ := gin.CreateTestContext(recorder) + writeAuthSessionError(c, test.err) + + assert.Equal(t, test.expectedStatus, recorder.Code) + var response struct { + Success bool `json:"success"` + Code string `json:"code"` + } + require.NoError(t, common.Unmarshal(recorder.Body.Bytes(), &response)) + assert.False(t, response.Success) + assert.Equal(t, test.expectedCode, response.Code) + }) + } +} + +func TestSessionLimitDoesNotRecordRejectedLoginAsSuccessful(t *testing.T) { + previousDB := model.DB + previousRedis := common.RedisEnabled + previousActiveLimit := common.UserSessionActiveLimit + previousIssuanceLimit := common.UserSessionIssuanceLimit + previousIssuanceWindow := common.UserSessionIssuanceWindowSeconds + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + require.NoError(t, err) + require.NoError(t, db.AutoMigrate(&model.User{}, &model.UserSession{})) + model.DB = db + common.RedisEnabled = false + common.UserSessionActiveLimit = 1 + common.UserSessionIssuanceLimit = 100 + common.UserSessionIssuanceWindowSeconds = int64(common.DefaultUserSessionIssuanceWindowSeconds) + t.Cleanup(func() { + model.DB = previousDB + common.RedisEnabled = previousRedis + common.UserSessionActiveLimit = previousActiveLimit + common.UserSessionIssuanceLimit = previousIssuanceLimit + common.UserSessionIssuanceWindowSeconds = previousIssuanceWindow + }) + + const previousLastLoginAt = int64(123) + user := &model.User{ + Username: "rejected-login-audit-user", Password: "unused", Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, Group: "default", AuthVersion: 1, LastLoginAt: previousLastLoginAt, + } + require.NoError(t, db.Create(user).Error) + now := time.Now().Unix() + require.NoError(t, db.Create(&model.UserSession{ + SID: "existing-active-session", UserID: user.Id, Version: 1, UserAuthVersion: user.AuthVersion, + Status: model.UserSessionStatusActive, RefreshHash: "hash", LoginMethod: "password", + CreatedAt: now, LastActiveAt: now, ExpiresAt: now + 3600, + }).Error) + + gin.SetMode(gin.TestMode) + recorder := httptest.NewRecorder() + c, _ := gin.CreateTestContext(recorder) + c.Request = httptest.NewRequest(http.MethodPost, "/api/user/login", nil) + setupLogin(user, c) + + assert.Equal(t, http.StatusConflict, recorder.Code) + var stored model.User + require.NoError(t, db.First(&stored, user.Id).Error) + assert.Equal(t, previousLastLoginAt, stored.LastLoginAt) +} diff --git a/controller/console_migrate.go b/controller/console_migrate.go deleted file mode 100644 index 4584961047..0000000000 --- a/controller/console_migrate.go +++ /dev/null @@ -1,106 +0,0 @@ -// 用于迁移检测的旧键,该文件下个版本会删除 - -package controller - -import ( - "encoding/json" - "net/http" - - "github.com/QuantumNous/new-api/common" - "github.com/QuantumNous/new-api/model" - - "github.com/gin-gonic/gin" -) - -// MigrateConsoleSetting 迁移旧的控制台相关配置到 console_setting.* -func MigrateConsoleSetting(c *gin.Context) { - // 读取全部 option - opts, err := model.AllOption() - if err != nil { - common.SysError("failed to get all options: " + err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"success": false, "message": "获取配置失败,请稍后重试"}) - return - } - // 建立 map - valMap := map[string]string{} - for _, o := range opts { - valMap[o.Key] = o.Value - } - - // 处理 APIInfo - if v := valMap["ApiInfo"]; v != "" { - var arr []map[string]interface{} - if err := json.Unmarshal([]byte(v), &arr); err == nil { - if len(arr) > 50 { - arr = arr[:50] - } - bytes, _ := json.Marshal(arr) - model.UpdateOption("console_setting.api_info", string(bytes)) - } - model.UpdateOption("ApiInfo", "") - } - // Announcements 直接搬 - if v := valMap["Announcements"]; v != "" { - model.UpdateOption("console_setting.announcements", v) - model.UpdateOption("Announcements", "") - } - // FAQ 转换 - if v := valMap["FAQ"]; v != "" { - var arr []map[string]interface{} - if err := json.Unmarshal([]byte(v), &arr); err == nil { - out := []map[string]interface{}{} - for _, item := range arr { - q, _ := item["question"].(string) - if q == "" { - q, _ = item["title"].(string) - } - a, _ := item["answer"].(string) - if a == "" { - a, _ = item["content"].(string) - } - if q != "" && a != "" { - out = append(out, map[string]interface{}{"question": q, "answer": a}) - } - } - if len(out) > 50 { - out = out[:50] - } - bytes, _ := json.Marshal(out) - model.UpdateOption("console_setting.faq", string(bytes)) - } - model.UpdateOption("FAQ", "") - } - // Uptime Kuma 迁移到新的 groups 结构(console_setting.uptime_kuma_groups) - url := valMap["UptimeKumaUrl"] - slug := valMap["UptimeKumaSlug"] - if url != "" && slug != "" { - // 仅当同时存在 URL 与 Slug 时才进行迁移 - groups := []map[string]interface{}{ - { - "id": 1, - "categoryName": "old", - "url": url, - "slug": slug, - "description": "", - }, - } - bytes, _ := json.Marshal(groups) - model.UpdateOption("console_setting.uptime_kuma_groups", string(bytes)) - } - // 清空旧键内容 - if url != "" { - model.UpdateOption("UptimeKumaUrl", "") - } - if slug != "" { - model.UpdateOption("UptimeKumaSlug", "") - } - - // 删除旧键记录 - oldKeys := []string{"ApiInfo", "Announcements", "FAQ", "UptimeKumaUrl", "UptimeKumaSlug"} - model.DB.Where("key IN ?", oldKeys).Delete(&model.Option{}) - - // 重新加载 OptionMap - model.InitOptionMap() - common.SysLog("console setting migrated") - c.JSON(http.StatusOK, gin.H{"success": true, "message": "migrated"}) -} diff --git a/controller/log.go b/controller/log.go index ce9b4666fa..470c759fc1 100644 --- a/controller/log.go +++ b/controller/log.go @@ -149,29 +149,3 @@ func GetLogsSelfStat(c *gin.Context) { }) return } - -// DeleteHistoryLogs is the legacy synchronous log cleanup endpoint (DELETE /api/log/). -// It deletes directly instead of going through the async system task. It is kept only -// for the classic frontend; the default frontend uses POST /api/system-task/log-cleanup. -// TODO: remove this handler (and its route) once the classic frontend is removed. -func DeleteHistoryLogs(c *gin.Context) { - targetTimestamp, _ := strconv.ParseInt(c.Query("target_timestamp"), 10, 64) - if targetTimestamp == 0 { - c.JSON(http.StatusOK, gin.H{ - "success": false, - "message": "target timestamp is required", - }) - return - } - count, err := model.DeleteOldLog(c.Request.Context(), targetTimestamp, 100) - if err != nil { - common.ApiError(c, err) - return - } - c.JSON(http.StatusOK, gin.H{ - "success": true, - "message": "", - "data": count, - }) - return -} diff --git a/controller/misc.go b/controller/misc.go index fb20298787..1a48399bcc 100644 --- a/controller/misc.go +++ b/controller/misc.go @@ -63,7 +63,7 @@ func GetStatus(c *gin.Context) { "linuxdo_minimum_trust_level": common.LinuxDOMinimumTrustLevel, "telegram_oauth": common.TelegramOAuthEnabled, "telegram_bot_name": common.TelegramBotName, - "theme": system_setting.GetThemeSettings().Frontend, + "theme": "default", "system_name": common.SystemName, "logo": common.Logo, "footer_html": common.Footer, diff --git a/controller/model_list_test.go b/controller/model_list_test.go index 55334b1bf4..3077948d48 100644 --- a/controller/model_list_test.go +++ b/controller/model_list_test.go @@ -14,8 +14,6 @@ import ( "github.com/QuantumNous/new-api/model" "github.com/QuantumNous/new-api/setting/config" "github.com/QuantumNous/new-api/setting/operation_setting" - "github.com/gin-contrib/sessions" - "github.com/gin-contrib/sessions/cookie" "github.com/gin-gonic/gin" "github.com/glebarez/sqlite" "github.com/stretchr/testify/assert" @@ -417,7 +415,7 @@ func TestCheckUpdatePasswordRejectsHistoricalEmptyPassword(t *testing.T) { func TestSetupLoginDoesNotTouchPasswordWhenPasswordFieldOmitted(t *testing.T) { db := setupModelListControllerTestDB(t) - require.NoError(t, db.AutoMigrate(&model.Log{})) + require.NoError(t, db.AutoMigrate(&model.Log{}, &model.UserSession{})) hashedPassword, err := common.Password2Hash("CurrentPassword123") require.NoError(t, err) @@ -431,8 +429,6 @@ func TestSetupLoginDoesNotTouchPasswordWhenPasswordFieldOmitted(t *testing.T) { require.NoError(t, db.Create(user).Error) router := gin.New() - store := cookie.NewStore([]byte("test-session-secret")) - router.Use(sessions.Sessions("session", store)) router.GET("/", func(c *gin.Context) { setupLogin(&model.User{ Id: user.Id, diff --git a/controller/oauth.go b/controller/oauth.go index 9ada6ddd26..a477f5b1d0 100644 --- a/controller/oauth.go +++ b/controller/oauth.go @@ -5,16 +5,30 @@ import ( "fmt" "net/http" "strconv" + "strings" + "time" "github.com/QuantumNous/new-api/common" "github.com/QuantumNous/new-api/i18n" + "github.com/QuantumNous/new-api/middleware" "github.com/QuantumNous/new-api/model" "github.com/QuantumNous/new-api/oauth" - "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" "gorm.io/gorm" ) +const oauthAuthFlowTTL = 10 * time.Minute + +type oauthStateRequest struct { + Provider string `json:"provider"` + Intent string `json:"intent"` + Aff string `json:"aff,omitempty"` +} + +type oauthFlowPayload struct { + AffiliateCode string `json:"affiliate_code,omitempty"` +} + // providerParams returns map with Provider key for i18n templates func providerParams(name string) map[string]any { return map[string]any{"Provider": name} @@ -22,14 +36,47 @@ func providerParams(name string) map[string]any { // GenerateOAuthCode generates a state code for OAuth CSRF protection func GenerateOAuthCode(c *gin.Context) { - session := sessions.Default(c) - state := common.GetRandomString(12) - affCode := c.Query("aff") - if affCode != "" { - session.Set("aff", affCode) + var request oauthStateRequest + if err := common.DecodeJson(c.Request.Body, &request); err != nil { + common.ApiErrorI18n(c, i18n.MsgInvalidParams) + return } - session.Set("oauth_state", state) - err := session.Save() + request.Provider = strings.TrimSpace(request.Provider) + request.Intent = strings.TrimSpace(request.Intent) + request.Aff = strings.TrimSpace(request.Aff) + if oauth.GetProvider(request.Provider) == nil || + (request.Intent != model.AuthFlowIntentLogin && request.Intent != model.AuthFlowIntentBind) || + len(request.Aff) > 32 || + (request.Intent == model.AuthFlowIntentBind && request.Aff != "") { + common.ApiErrorI18n(c, i18n.MsgInvalidParams) + return + } + userID := 0 + sessionID := "" + if request.Intent == model.AuthFlowIntentBind { + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + c.JSON(http.StatusUnauthorized, gin.H{"success": false, "message": "绑定操作需要登录"}) + return + } + userID = identity.UserID + sessionID = identity.SessionID + } + payload, err := common.Marshal(oauthFlowPayload{AffiliateCode: request.Aff}) + if err != nil { + common.ApiError(c, err) + return + } + expiresAt := time.Now().Add(oauthAuthFlowTTL) + state, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeOAuth, + Provider: request.Provider, + Intent: request.Intent, + UserId: userID, + SessionId: sessionID, + Payload: string(payload), + ExpiresAt: expiresAt, + }) if err != nil { common.ApiError(c, err) return @@ -37,7 +84,10 @@ func GenerateOAuthCode(c *gin.Context) { c.JSON(http.StatusOK, gin.H{ "success": true, "message": "", - "data": state, + "data": gin.H{ + "flow_token": state, + "expires_at": expiresAt.Unix(), + }, }) } @@ -53,11 +103,13 @@ func HandleOAuth(c *gin.Context) { return } - session := sessions.Default(c) - // 1. Validate state (CSRF protection) state := c.Query("state") - if state == "" || session.Get("oauth_state") == nil || state != session.Get("oauth_state").(string) { + pendingFlow, err := model.GetAuthFlow(state, model.AuthFlowMatch{ + Purpose: model.AuthFlowPurposeOAuth, + Provider: providerName, + }) + if err != nil { c.JSON(http.StatusForbidden, gin.H{ "success": false, "message": i18n.T(c, i18n.MsgOAuthStateInvalid), @@ -65,10 +117,25 @@ func HandleOAuth(c *gin.Context) { return } - // 2. Check if user is already logged in (bind flow) - username := session.Get("username") - if username != nil { - handleOAuthBind(c, provider) + consumeMatch := model.AuthFlowMatch{ + Purpose: model.AuthFlowPurposeOAuth, + Provider: providerName, + Intent: pendingFlow.Intent, + } + // 2. Bind flows are bound to the live dashboard Session that created them. + if pendingFlow.Intent == model.AuthFlowIntentBind { + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok || identity.UserID != pendingFlow.UserId || identity.SessionID != pendingFlow.SessionId { + c.JSON(http.StatusForbidden, gin.H{ + "success": false, + "message": i18n.T(c, i18n.MsgOAuthStateInvalid), + }) + return + } + consumeMatch.UserId = identity.UserID + consumeMatch.SessionId = identity.SessionID + } else if pendingFlow.Intent != model.AuthFlowIntentLogin { + common.ApiErrorI18n(c, i18n.MsgInvalidParams) return } @@ -81,13 +148,24 @@ func HandleOAuth(c *gin.Context) { // 4. Handle error from provider errorCode := c.Query("error") if errorCode != "" { + if _, err := model.ConsumeAuthFlow(state, consumeMatch); err != nil { + c.JSON(http.StatusForbidden, gin.H{"success": false, "message": i18n.T(c, i18n.MsgOAuthStateInvalid)}) + return + } errorDescription := c.Query("error_description") + if errorDescription == "" { + errorDescription = errorCode + } c.JSON(http.StatusOK, gin.H{ "success": false, "message": errorDescription, }) return } + if pendingFlow.Intent == model.AuthFlowIntentBind { + handleOAuthBind(c, provider, pendingFlow, state) + return + } // 5. Exchange code for token code := c.Query("code") @@ -103,9 +181,19 @@ func HandleOAuth(c *gin.Context) { handleOAuthError(c, err) return } + flow, err := model.ConsumeAuthFlow(state, consumeMatch) + if err != nil { + c.JSON(http.StatusForbidden, gin.H{"success": false, "message": i18n.T(c, i18n.MsgOAuthStateInvalid)}) + return + } // 7. Find or create user - user, err := findOrCreateOAuthUser(c, provider, oauthUser, session) + var payload oauthFlowPayload + if err := common.UnmarshalJsonStr(flow.Payload, &payload); err != nil { + common.ApiError(c, err) + return + } + user, err := findOrCreateOAuthUser(c, provider, oauthUser, payload.AffiliateCode) if err != nil { if errors.Is(err, model.ErrEmailAlreadyTaken) { common.ApiErrorI18n(c, i18n.MsgUserEmailAlreadyTaken) @@ -135,12 +223,7 @@ func HandleOAuth(c *gin.Context) { } // handleOAuthBind handles binding OAuth account to existing user -func handleOAuthBind(c *gin.Context, provider oauth.Provider) { - if !provider.IsEnabled() { - common.ApiErrorI18n(c, i18n.MsgOAuthNotEnabled, providerParams(provider.GetName())) - return - } - +func handleOAuthBind(c *gin.Context, provider oauth.Provider, pendingFlow *model.AuthFlow, flowToken string) { // Exchange code for token code := c.Query("code") token, err := provider.ExchangeToken(c.Request.Context(), code, c) @@ -169,10 +252,18 @@ func handleOAuthBind(c *gin.Context, provider oauth.Provider) { } } - // Get current user from session - session := sessions.Default(c) - id := session.Get("id") - user := model.User{Id: id.(int)} + if _, err := model.ConsumeAuthFlow(flowToken, model.AuthFlowMatch{ + Purpose: model.AuthFlowPurposeOAuth, + Provider: pendingFlow.Provider, + Intent: model.AuthFlowIntentBind, + UserId: pendingFlow.UserId, + SessionId: pendingFlow.SessionId, + }); err != nil { + c.JSON(http.StatusForbidden, gin.H{"success": false, "message": i18n.T(c, i18n.MsgOAuthStateInvalid)}) + return + } + + user := model.User{Id: pendingFlow.UserId} err = user.FillUserById() if err != nil { common.ApiError(c, err) @@ -203,7 +294,7 @@ func handleOAuthBind(c *gin.Context, provider oauth.Provider) { } // findOrCreateOAuthUser finds existing user or creates new user -func findOrCreateOAuthUser(c *gin.Context, provider oauth.Provider, oauthUser *oauth.OAuthUser, session sessions.Session) (*model.User, error) { +func findOrCreateOAuthUser(c *gin.Context, provider oauth.Provider, oauthUser *oauth.OAuthUser, affiliateCode string) (*model.User, error) { user := &model.User{} // Check if user already exists with new ID @@ -276,10 +367,9 @@ func findOrCreateOAuthUser(c *gin.Context, provider oauth.Provider, oauthUser *o user.Status = common.UserStatusEnabled // Handle affiliate code - affCode := session.Get("aff") inviterId := 0 - if affCode != nil { - inviterId, _ = model.GetUserIdByAffCode(affCode.(string)) + if affiliateCode != "" { + inviterId, _ = model.GetUserIdByAffCode(affiliateCode) } // Use transaction to ensure user creation and OAuth binding are atomic diff --git a/controller/option.go b/controller/option.go index a97f07b841..6a91086a6c 100644 --- a/controller/option.go +++ b/controller/option.go @@ -80,6 +80,9 @@ func GetOptions(c *gin.Context) { optionValues := make(map[string]string) common.OptionMapRWMutex.Lock() for k, v := range common.OptionMap { + if k == "theme.frontend" { + continue + } value := common.Interface2String(v) isSensitiveKey := strings.HasSuffix(k, "Token") || strings.HasSuffix(k, "Secret") || @@ -216,10 +219,10 @@ func UpdateOption(c *gin.Context) { return } case "theme.frontend": - if option.Value != "default" && option.Value != "classic" { + if option.Value != "default" { c.JSON(http.StatusOK, gin.H{ "success": false, - "message": "无效的主题值,可选值:default(新版前端)、classic(经典前端)", + "message": "Classic 前端已移除,主题只能设置为 default", }) return } diff --git a/controller/passkey.go b/controller/passkey.go index 6c73b006a7..198df804b8 100644 --- a/controller/passkey.go +++ b/controller/passkey.go @@ -1,6 +1,7 @@ package controller import ( + "encoding/json" "errors" "fmt" "net/http" @@ -8,16 +9,43 @@ import ( "time" "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/middleware" "github.com/QuantumNous/new-api/model" + "github.com/QuantumNous/new-api/service" passkeysvc "github.com/QuantumNous/new-api/service/passkey" "github.com/QuantumNous/new-api/setting/system_setting" - "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" "github.com/go-webauthn/webauthn/protocol" webauthnlib "github.com/go-webauthn/webauthn/webauthn" ) +const ( + securityProofScopeChannelKeyRead = "channel.key.read" + securityProofScopePasskeyRegister = "passkey.register" + securityProofScopePasskeyDelete = "passkey.delete" +) + +type passkeyFinishRequest struct { + FlowToken string `json:"flow_token"` + Credential json.RawMessage `json:"credential"` +} + +type passkeyVerifyBeginRequest struct { + Scope string `json:"scope"` +} + +func parsePasskeyFinishRequest(c *gin.Context) (*passkeyFinishRequest, error) { + var request passkeyFinishRequest + if err := common.DecodeJson(c.Request.Body, &request); err != nil { + return nil, err + } + if request.FlowToken == "" || len(request.Credential) == 0 { + return nil, errors.New("Passkey 流程参数不完整") + } + return &request, nil +} + func PasskeyRegisterBegin(c *gin.Context) { if !system_setting.GetPasskeySettings().Enabled { c.JSON(http.StatusOK, gin.H{ @@ -27,7 +55,7 @@ func PasskeyRegisterBegin(c *gin.Context) { return } - user, err := getSessionUser(c) + user, err := getAuthenticatedUser(c) if err != nil { c.JSON(http.StatusUnauthorized, gin.H{ "success": false, @@ -68,7 +96,19 @@ func PasskeyRegisterBegin(c *gin.Context) { return } - if err := passkeysvc.SaveSessionData(c, passkeysvc.RegistrationSessionKey, sessionData); err != nil { + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + common.ApiError(c, errors.New("当前认证方式不支持安全验证")) + return + } + flowToken, expiresAt, err := passkeysvc.CreateSessionDataFlow( + model.AuthFlowPurposePasskeyRegister, + user.Id, + identity.SessionID, + securityProofScopePasskeyRegister, + sessionData, + ) + if err != nil { common.ApiError(c, err) return } @@ -77,7 +117,9 @@ func PasskeyRegisterBegin(c *gin.Context) { "success": true, "message": "", "data": gin.H{ - "options": creation, + "options": creation, + "flow_token": flowToken, + "expires_at": expiresAt, }, }) } @@ -91,7 +133,7 @@ func PasskeyRegisterFinish(c *gin.Context) { return } - user, err := getSessionUser(c) + user, err := getAuthenticatedUser(c) if err != nil { c.JSON(http.StatusUnauthorized, gin.H{ "success": false, @@ -99,11 +141,21 @@ func PasskeyRegisterFinish(c *gin.Context) { }) return } - if !requirePasskeyRegistrationVerification(c, user.Id) { return } + request, err := parsePasskeyFinishRequest(c) + if err != nil { + common.ApiError(c, err) + return + } + parsedCredential, err := protocol.ParseCredentialCreationResponseBytes(request.Credential) + if err != nil { + common.ApiError(c, err) + return + } + wa, err := passkeysvc.BuildWebAuthn(c.Request) if err != nil { common.ApiError(c, err) @@ -119,14 +171,24 @@ func PasskeyRegisterFinish(c *gin.Context) { credentialRecord = nil } - sessionData, err := passkeysvc.PopSessionData(c, passkeysvc.RegistrationSessionKey) + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + common.ApiError(c, errors.New("当前认证方式不支持安全验证")) + return + } + sessionData, _, err := passkeysvc.PopSessionDataFlow( + request.FlowToken, + model.AuthFlowPurposePasskeyRegister, + user.Id, + identity.SessionID, + ) if err != nil { common.ApiError(c, err) return } waUser := passkeysvc.NewWebAuthnUser(user, credentialRecord) - credential, err := wa.FinishRegistration(waUser, *sessionData, c.Request) + credential, err := wa.CreateCredential(waUser, *sessionData, parsedCredential) if err != nil { common.ApiError(c, err) return @@ -138,7 +200,12 @@ func PasskeyRegisterFinish(c *gin.Context) { return } - if err := model.UpsertPasskeyCredential(passkeyCredential); err != nil { + if err := model.UpsertPasskeyCredentialWithAuthVersion(passkeyCredential); err != nil { + common.ApiError(c, err) + return + } + bundle, err := service.AdvanceCurrentSessionToUserVersion(identity, "passkey_registered") + if err != nil { common.ApiError(c, err) return } @@ -147,11 +214,12 @@ func PasskeyRegisterFinish(c *gin.Context) { c.JSON(http.StatusOK, gin.H{ "success": true, "message": "Passkey 注册成功", + "data": authRotationData(bundle), }) } func PasskeyDelete(c *gin.Context) { - user, err := getSessionUser(c) + user, err := getAuthenticatedUser(c) if err != nil { c.JSON(http.StatusUnauthorized, gin.H{ "success": false, @@ -164,7 +232,17 @@ func PasskeyDelete(c *gin.Context) { return } - if err := model.DeletePasskeyByUserID(user.Id); err != nil { + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + common.ApiError(c, errors.New("当前认证方式不支持安全验证")) + return + } + if err := model.DeletePasskeyByUserIDWithAuthVersion(user.Id); err != nil { + common.ApiError(c, err) + return + } + bundle, err := service.AdvanceCurrentSessionToUserVersion(identity, "passkey_deleted") + if err != nil { common.ApiError(c, err) return } @@ -173,11 +251,12 @@ func PasskeyDelete(c *gin.Context) { c.JSON(http.StatusOK, gin.H{ "success": true, "message": "Passkey 已解绑", + "data": authRotationData(bundle), }) } func PasskeyStatus(c *gin.Context) { - user, err := getSessionUser(c) + user, err := getAuthenticatedUser(c) if err != nil { c.JSON(http.StatusUnauthorized, gin.H{ "success": false, @@ -235,7 +314,14 @@ func PasskeyLoginBegin(c *gin.Context) { return } - if err := passkeysvc.SaveSessionData(c, passkeysvc.LoginSessionKey, sessionData); err != nil { + flowToken, expiresAt, err := passkeysvc.CreateSessionDataFlow( + model.AuthFlowPurposePasskeyLogin, + 0, + "", + "", + sessionData, + ) + if err != nil { common.ApiError(c, err) return } @@ -244,7 +330,9 @@ func PasskeyLoginBegin(c *gin.Context) { "success": true, "message": "", "data": gin.H{ - "options": assertion, + "options": assertion, + "flow_token": flowToken, + "expires_at": expiresAt, }, }) } @@ -258,13 +346,29 @@ func PasskeyLoginFinish(c *gin.Context) { return } + request, err := parsePasskeyFinishRequest(c) + if err != nil { + common.ApiError(c, err) + return + } + parsedCredential, err := protocol.ParseCredentialRequestResponseBytes(request.Credential) + if err != nil { + common.ApiError(c, err) + return + } + wa, err := passkeysvc.BuildWebAuthn(c.Request) if err != nil { common.ApiError(c, err) return } - sessionData, err := passkeysvc.PopSessionData(c, passkeysvc.LoginSessionKey) + sessionData, _, err := passkeysvc.PopSessionDataFlow( + request.FlowToken, + model.AuthFlowPurposePasskeyLogin, + 0, + "", + ) if err != nil { common.ApiError(c, err) return @@ -300,7 +404,7 @@ func PasskeyLoginFinish(c *gin.Context) { return passkeysvc.NewWebAuthnUser(user, credential), nil } - waUser, credential, err := wa.FinishPasskeyLogin(handler, *sessionData, c.Request) + waUser, credential, err := wa.ValidatePasskeyLogin(handler, *sessionData, parsedCredential) if err != nil { common.ApiError(c, err) return @@ -323,15 +427,7 @@ func PasskeyLoginFinish(c *gin.Context) { return } - // 更新凭证信息 - updatedCredential := model.NewPasskeyCredentialFromWebAuthn(modelUser.Id, credential) - if updatedCredential == nil { - common.ApiErrorMsg(c, "Passkey 凭证更新失败") - return - } - now := time.Now() - updatedCredential.LastUsedAt = &now - if err := model.UpsertPasskeyCredential(updatedCredential); err != nil { + if err := model.UpdatePasskeyAssertionState(modelUser.Id, credential, time.Now()); err != nil { common.ApiError(c, err) return } @@ -369,7 +465,11 @@ func AdminResetPasskey(c *gin.Context) { return } - if err := model.DeletePasskeyByUserID(user.Id); err != nil { + if err := model.DeletePasskeyByUserIDWithAuthVersion(user.Id); err != nil { + common.ApiError(c, err) + return + } + if _, err := model.RevokeAllUserSessions(user.Id, "admin_passkey_reset"); err != nil { common.ApiError(c, err) return } @@ -393,7 +493,7 @@ func PasskeyVerifyBegin(c *gin.Context) { return } - user, err := getSessionUser(c) + user, err := getAuthenticatedUser(c) if err != nil { c.JSON(http.StatusUnauthorized, gin.H{ "success": false, @@ -401,6 +501,15 @@ func PasskeyVerifyBegin(c *gin.Context) { }) return } + var request passkeyVerifyBeginRequest + if err := common.DecodeJson(c.Request.Body, &request); err != nil { + common.ApiError(c, errors.New("无效的 Passkey 验证请求")) + return + } + if !isAllowedSecurityProofScope(request.Scope) { + common.ApiError(c, errors.New("不支持的安全验证范围")) + return + } credential, err := model.GetPasskeyByUserID(user.Id) if err != nil { @@ -424,7 +533,19 @@ func PasskeyVerifyBegin(c *gin.Context) { return } - if err := passkeysvc.SaveSessionData(c, passkeysvc.VerifySessionKey, sessionData); err != nil { + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + common.ApiError(c, errors.New("当前认证方式不支持安全验证")) + return + } + flowToken, expiresAt, err := passkeysvc.CreateSessionDataFlow( + model.AuthFlowPurposePasskeyStepUp, + user.Id, + identity.SessionID, + request.Scope, + sessionData, + ) + if err != nil { common.ApiError(c, err) return } @@ -433,7 +554,9 @@ func PasskeyVerifyBegin(c *gin.Context) { "success": true, "message": "", "data": gin.H{ - "options": assertion, + "options": assertion, + "flow_token": flowToken, + "expires_at": expiresAt, }, }) } @@ -447,7 +570,7 @@ func PasskeyVerifyFinish(c *gin.Context) { return } - user, err := getSessionUser(c) + user, err := getAuthenticatedUser(c) if err != nil { c.JSON(http.StatusUnauthorized, gin.H{ "success": false, @@ -456,6 +579,17 @@ func PasskeyVerifyFinish(c *gin.Context) { return } + request, err := parsePasskeyFinishRequest(c) + if err != nil { + common.ApiError(c, err) + return + } + parsedCredential, err := protocol.ParseCredentialRequestResponseBytes(request.Credential) + if err != nil { + common.ApiError(c, err) + return + } + wa, err := passkeysvc.BuildWebAuthn(c.Request) if err != nil { common.ApiError(c, err) @@ -471,53 +605,57 @@ func PasskeyVerifyFinish(c *gin.Context) { return } - sessionData, err := passkeysvc.PopSessionData(c, passkeysvc.VerifySessionKey) + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + common.ApiError(c, errors.New("当前认证方式不支持安全验证")) + return + } + sessionData, scope, err := passkeysvc.PopSessionDataFlow( + request.FlowToken, + model.AuthFlowPurposePasskeyStepUp, + user.Id, + identity.SessionID, + ) if err != nil { common.ApiError(c, err) return } waUser := passkeysvc.NewWebAuthnUser(user, credential) - _, err = wa.FinishLogin(waUser, *sessionData, c.Request) + validatedCredential, err := wa.ValidateLogin(waUser, *sessionData, parsedCredential) if err != nil { common.ApiError(c, err) return } - // 更新凭证的最后使用时间 - now := time.Now() - credential.LastUsedAt = &now - if err := model.UpsertPasskeyCredential(credential); err != nil { + if err := model.UpdatePasskeyAssertionState(user.Id, validatedCredential, time.Now()); err != nil { common.ApiError(c, err) return } - session := sessions.Default(c) - // Mark passkey as ready; /api/verify will convert this into the final secure verification session. - session.Set(PasskeyReadySessionKey, time.Now().Unix()) - session.Delete(SecureVerificationSessionKey) - session.Delete(secureVerificationMethodSessionKey) - if err := session.Save(); err != nil { - common.ApiError(c, fmt.Errorf("保存验证状态失败: %v", err)) + proofToken, proofExpiresAt, err := service.IssueSecurityProof(identity, secureVerificationMethodPasskey, []string{scope}) + if err != nil { + common.ApiError(c, err) return } c.JSON(http.StatusOK, gin.H{ "success": true, "message": "Passkey 验证成功", + "data": gin.H{ + "proof_token": proofToken, + "expires_at": proofExpiresAt, + "method": secureVerificationMethodPasskey, + "scope": scope, + }, }) } -func getSessionUser(c *gin.Context) (*model.User, error) { - session := sessions.Default(c) - idRaw := session.Get("id") - if idRaw == nil { +func getAuthenticatedUser(c *gin.Context) (*model.User, error) { + id := c.GetInt("id") + if id == 0 { return nil, errors.New("未登录") } - id, ok := idRaw.(int) - if !ok { - return nil, errors.New("无效的会话信息") - } user := &model.User{Id: id} if err := user.FillUserById(); err != nil { return nil, err @@ -537,7 +675,7 @@ func requirePasskeyRegistrationVerification(c *gin.Context, userID int) bool { if twoFA == nil || !twoFA.IsEnabled { return true } - return requireSecureVerificationMethod(c, secureVerificationMethod2FA) + return middleware.RequireSecurityProof(c, securityProofScopePasskeyRegister, []string{secureVerificationMethod2FA}) } func requirePasskeyDeleteVerification(c *gin.Context, userID int) bool { @@ -547,7 +685,7 @@ func requirePasskeyDeleteVerification(c *gin.Context, userID int) bool { return false } if twoFA != nil && twoFA.IsEnabled { - return requireSecureVerificationMethod(c, secureVerificationMethod2FA) + return middleware.RequireSecurityProof(c, securityProofScopePasskeyDelete, []string{secureVerificationMethod2FA}) } _, err = model.GetPasskeyByUserID(userID) @@ -563,24 +701,5 @@ func requirePasskeyDeleteVerification(c *gin.Context, userID int) bool { return false } - return requireSecureVerificationMethod(c, secureVerificationMethodPasskey) -} - -func requireSecureVerificationMethod(c *gin.Context, method string) bool { - session := sessions.Default(c) - verifiedAt, ok := session.Get(SecureVerificationSessionKey).(int64) - if !ok || time.Now().Unix()-verifiedAt >= SecureVerificationTimeout { - session.Delete(SecureVerificationSessionKey) - session.Delete(secureVerificationMethodSessionKey) - _ = session.Save() - common.ApiErrorMsg(c, "请先完成安全验证") - return false - } - - if verifiedMethod, ok := session.Get(secureVerificationMethodSessionKey).(string); !ok || verifiedMethod != method { - common.ApiErrorMsg(c, "请先完成对应的安全验证") - return false - } - - return true + return middleware.RequireSecurityProof(c, securityProofScopePasskeyDelete, []string{secureVerificationMethodPasskey}) } diff --git a/controller/passkey_test.go b/controller/passkey_test.go new file mode 100644 index 0000000000..84cdbf4ecb --- /dev/null +++ b/controller/passkey_test.go @@ -0,0 +1,130 @@ +package controller + +import ( + "fmt" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/model" + "github.com/QuantumNous/new-api/service" + "github.com/QuantumNous/new-api/setting/system_setting" + "github.com/gin-gonic/gin" + "github.com/glebarez/sqlite" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +type passkeyTestBody struct { + *strings.Reader +} + +func (*passkeyTestBody) Close() error { return nil } + +func TestParsePasskeyFinishRequestDoesNotRewriteRequestBody(t *testing.T) { + gin.SetMode(gin.TestMode) + bodyText := `{"flow_token":"flow-1","credential":{"id":"credential-1"}}` + body := &passkeyTestBody{Reader: strings.NewReader(bodyText)} + request := httptest.NewRequest(http.MethodPost, "/api/user/passkey/register/finish", nil) + request.Body = body + request.ContentLength = int64(len(bodyText)) + context, _ := gin.CreateTestContext(httptest.NewRecorder()) + context.Request = request + + parsed, err := parsePasskeyFinishRequest(context) + require.NoError(t, err) + assert.Equal(t, "flow-1", parsed.FlowToken) + assert.JSONEq(t, `{"id":"credential-1"}`, string(parsed.Credential)) + assert.Same(t, body, context.Request.Body) + assert.Equal(t, int64(len(bodyText)), context.Request.ContentLength) +} + +func TestPasskeyRegisterFinishRejectsMissingOrWrongProofWithoutConsumingFlow(t *testing.T) { + previousDB := model.DB + previousType := common.MainDatabaseType() + previousRedis := common.RedisEnabled + previousSecret := common.SessionSecret + settings := system_setting.GetPasskeySettings() + previousSettings := *settings + dsn := fmt.Sprintf("file:%s?mode=memory&cache=shared", strings.ReplaceAll(t.Name(), "/", "_")) + db, err := gorm.Open(sqlite.Open(dsn), &gorm.Config{}) + require.NoError(t, err) + require.NoError(t, db.AutoMigrate(&model.User{}, &model.TwoFA{}, &model.AuthFlow{})) + model.DB = db + common.SetMainDatabaseType(common.DatabaseTypeSQLite) + common.RedisEnabled = false + common.SessionSecret = "passkey-register-proof-test-secret" + *settings = system_setting.PasskeySettings{Enabled: true} + t.Cleanup(func() { + model.DB = previousDB + common.SetMainDatabaseType(previousType) + common.RedisEnabled = previousRedis + common.SessionSecret = previousSecret + *settings = previousSettings + sqlDB, dbErr := db.DB() + if dbErr == nil { + _ = sqlDB.Close() + } + }) + + user := &model.User{ + Username: "passkey-proof-user", Password: "password-placeholder", Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, Group: "default", AuthVersion: 1, + } + require.NoError(t, db.Create(user).Error) + require.NoError(t, db.Create(&model.TwoFA{UserId: user.Id, Secret: "totp-secret", IsEnabled: true}).Error) + identity := service.AuthIdentity{ + UserID: user.Id, SessionID: "passkey-proof-session", UserAuthVersion: 1, SessionVersion: 1, + } + wrongScopeProof, _, err := service.IssueSecurityProof(identity, secureVerificationMethod2FA, []string{securityProofScopePasskeyDelete}) + require.NoError(t, err) + + tests := []struct { + name string + proof string + expectedCode string + }{ + {name: "missing proof", expectedCode: "SECURITY_PROOF_REQUIRED"}, + {name: "wrong scope proof", proof: wrongScopeProof, expectedCode: "SECURITY_PROOF_SCOPE_MISMATCH"}, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + flowToken, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposePasskeyRegister, UserId: user.Id, SessionId: identity.SessionID, + Payload: `{}`, ExpiresAt: time.Now().Add(time.Minute), + }) + require.NoError(t, err) + body := fmt.Sprintf(`{"flow_token":%q,"credential":{}}`, flowToken) + request := httptest.NewRequest(http.MethodPost, "/api/user/passkey/register/finish", strings.NewReader(body)) + request.Header.Set("Content-Type", "application/json") + if test.proof != "" { + request.Header.Set("X-Security-Proof", test.proof) + } + response := httptest.NewRecorder() + context, _ := gin.CreateTestContext(response) + context.Request = request + context.Set("id", identity.UserID) + context.Set("session_id", identity.SessionID) + context.Set("auth_version", identity.UserAuthVersion) + context.Set("session_version", identity.SessionVersion) + + PasskeyRegisterFinish(context) + + assert.Equal(t, http.StatusForbidden, response.Code) + var responseBody struct { + Code string `json:"code"` + } + require.NoError(t, common.Unmarshal(response.Body.Bytes(), &responseBody)) + assert.Equal(t, test.expectedCode, responseBody.Code) + flow, err := model.GetAuthFlow(flowToken, model.AuthFlowMatch{ + Purpose: model.AuthFlowPurposePasskeyRegister, UserId: user.Id, SessionId: identity.SessionID, + }) + require.NoError(t, err) + assert.Nil(t, flow.ConsumedAt) + }) + } +} diff --git a/controller/return_path.go b/controller/return_path.go index 28378b7e5f..55c348e261 100644 --- a/controller/return_path.go +++ b/controller/return_path.go @@ -3,11 +3,10 @@ package controller import ( "strings" - "github.com/QuantumNous/new-api/common" "github.com/QuantumNous/new-api/setting/system_setting" ) func paymentReturnPath(suffix string) string { base := strings.TrimRight(system_setting.ServerAddress, "/") - return base + common.ThemeAwarePath(suffix) + return base + suffix } diff --git a/controller/return_path_test.go b/controller/return_path_test.go new file mode 100644 index 0000000000..f4f499b322 --- /dev/null +++ b/controller/return_path_test.go @@ -0,0 +1,25 @@ +package controller + +import ( + "testing" + + "github.com/QuantumNous/new-api/setting/system_setting" + "github.com/stretchr/testify/assert" +) + +func TestPaymentReturnPathUsesDefaultDashboardRoutes(t *testing.T) { + previousAddress := system_setting.ServerAddress + system_setting.ServerAddress = "https://dashboard.example.com/" + t.Cleanup(func() { system_setting.ServerAddress = previousAddress }) + + assert.Equal( + t, + "https://dashboard.example.com/wallet?pay=success", + paymentReturnPath("/wallet?pay=success"), + ) + assert.Equal( + t, + "https://dashboard.example.com/usage-logs", + paymentReturnPath("/usage-logs"), + ) +} diff --git a/controller/secure_verification.go b/controller/secure_verification.go index 7640269eb5..f4d4ba8299 100644 --- a/controller/secure_verification.go +++ b/controller/secure_verification.go @@ -1,179 +1,88 @@ package controller import ( + "errors" "fmt" "net/http" - "time" + "strings" "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/middleware" "github.com/QuantumNous/new-api/model" - "github.com/gin-contrib/sessions" + "github.com/QuantumNous/new-api/service" "github.com/gin-gonic/gin" ) const ( - // SecureVerificationSessionKey means the user has fully passed secure verification. - SecureVerificationSessionKey = "secure_verified_at" - secureVerificationMethodSessionKey = "secure_verified_method" - secureVerificationMethod2FA = "2fa" - secureVerificationMethodPasskey = "passkey" - // PasskeyReadySessionKey means WebAuthn finished and /api/verify can finalize step-up verification. - PasskeyReadySessionKey = "secure_passkey_ready_at" - // SecureVerificationTimeout 验证有效期(秒) - SecureVerificationTimeout = 300 // 5分钟 - // PasskeyReadyTimeout passkey ready 标记有效期(秒) - PasskeyReadyTimeout = 60 + secureVerificationMethod2FA = "2fa" + secureVerificationMethodPasskey = "passkey" ) type UniversalVerifyRequest struct { - Method string `json:"method"` // "2fa" 或 "passkey" + Method string `json:"method"` Code string `json:"code,omitempty"` + Scope string `json:"scope"` } -type VerificationStatusResponse struct { - Verified bool `json:"verified"` - ExpiresAt int64 `json:"expires_at,omitempty"` -} - -// UniversalVerify 通用验证接口 -// 支持 2FA 和 Passkey 验证,验证成功后在 session 中记录时间戳 func UniversalVerify(c *gin.Context) { - userId := c.GetInt("id") - if userId == 0 { - c.JSON(http.StatusUnauthorized, gin.H{ - "success": false, - "message": "未登录", - }) + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + c.JSON(http.StatusUnauthorized, gin.H{"success": false, "message": "当前认证方式不支持安全验证"}) return } - - var req UniversalVerifyRequest - if err := c.ShouldBindJSON(&req); err != nil { + var request UniversalVerifyRequest + if err := common.DecodeJson(c.Request.Body, &request); err != nil { common.ApiError(c, fmt.Errorf("参数错误: %v", err)) return } - - // 获取用户信息 - user := &model.User{Id: userId} - if err := user.FillUserById(); err != nil { - common.ApiError(c, fmt.Errorf("获取用户信息失败: %v", err)) + if request.Method != secureVerificationMethod2FA { + common.ApiError(c, errors.New("Passkey 验证必须使用 Passkey verify 流程")) return } - - if user.Status != common.UserStatusEnabled { - common.ApiError(c, fmt.Errorf("该用户已被禁用")) + if !isAllowedSecurityProofScope(request.Scope) { + common.ApiError(c, errors.New("不支持的安全验证范围")) return } - - // 检查用户的验证方式 - twoFA, _ := model.GetTwoFAByUserId(userId) - has2FA := twoFA != nil && twoFA.IsEnabled - - passkey, passkeyErr := model.GetPasskeyByUserID(userId) - hasPasskey := passkeyErr == nil && passkey != nil - - if !has2FA && !hasPasskey { - common.ApiError(c, fmt.Errorf("用户未启用2FA或Passkey")) + if strings.TrimSpace(request.Code) == "" { + common.ApiError(c, errors.New("验证码不能为空")) return } - - // 根据验证方式进行验证 - var verified bool - var verifyMethod string - var err error - - switch req.Method { - case "2fa": - if !has2FA { - common.ApiError(c, fmt.Errorf("用户未启用2FA")) - return - } - if req.Code == "" { - common.ApiError(c, fmt.Errorf("验证码不能为空")) - return - } - verified = validateTwoFactorAuth(twoFA, req.Code) - verifyMethod = "2FA" - - case "passkey": - if !hasPasskey { - common.ApiError(c, fmt.Errorf("用户未启用Passkey")) - return - } - // Passkey branch only trusts the short-lived marker written by PasskeyVerifyFinish. - verified, err = consumePasskeyReady(c) - if err != nil { - common.ApiError(c, fmt.Errorf("Passkey 验证状态异常: %v", err)) - return - } - if !verified { - common.ApiError(c, fmt.Errorf("请先完成 Passkey 验证")) - return - } - verifyMethod = "Passkey" - - default: - common.ApiError(c, fmt.Errorf("不支持的验证方式: %s", req.Method)) - return - } - - if !verified { - common.ApiError(c, fmt.Errorf("验证失败,请检查验证码")) - return - } - - // 验证成功,在 session 中记录时间戳 - now, err := setSecureVerificationSession(c, req.Method) + twoFA, err := model.GetTwoFAByUserId(identity.UserID) if err != nil { - common.ApiError(c, fmt.Errorf("保存验证状态失败: %v", err)) + common.ApiError(c, err) return } - - // 记录日志 - model.RecordLog(userId, model.LogTypeSystem, fmt.Sprintf("通用安全验证成功 (验证方式: %s)", verifyMethod)) - + if twoFA == nil || !twoFA.IsEnabled { + common.ApiError(c, errors.New("用户未启用2FA")) + return + } + if !validateTwoFactorAuth(twoFA, request.Code) { + common.ApiError(c, errors.New("验证失败,请检查验证码")) + return + } + proofToken, expiresAt, err := service.IssueSecurityProof(identity, request.Method, []string{request.Scope}) + if err != nil { + common.ApiError(c, err) + return + } + model.RecordLog(identity.UserID, model.LogTypeSystem, "通用安全验证成功 (验证方式: 2FA)") c.JSON(http.StatusOK, gin.H{ "success": true, "message": "验证成功", "data": gin.H{ - "verified": true, - "expires_at": now + SecureVerificationTimeout, + "proof_token": proofToken, + "expires_at": expiresAt, + "method": request.Method, + "scope": request.Scope, }, }) } -func setSecureVerificationSession(c *gin.Context, method string) (int64, error) { - session := sessions.Default(c) - session.Delete(PasskeyReadySessionKey) - now := time.Now().Unix() - session.Set(SecureVerificationSessionKey, now) - session.Set(secureVerificationMethodSessionKey, method) - if err := session.Save(); err != nil { - return 0, err +func isAllowedSecurityProofScope(scope string) bool { + switch scope { + case securityProofScopeChannelKeyRead, securityProofScopePasskeyRegister, securityProofScopePasskeyDelete: + return true + default: + return false } - return now, nil -} - -func consumePasskeyReady(c *gin.Context) (bool, error) { - session := sessions.Default(c) - readyAtRaw := session.Get(PasskeyReadySessionKey) - if readyAtRaw == nil { - return false, nil - } - - readyAt, ok := readyAtRaw.(int64) - if !ok { - session.Delete(PasskeyReadySessionKey) - _ = session.Save() - return false, fmt.Errorf("无效的 Passkey 验证状态") - } - session.Delete(PasskeyReadySessionKey) - if err := session.Save(); err != nil { - return false, err - } - // Expired ready markers cannot be reused. - if time.Now().Unix()-readyAt >= PasskeyReadyTimeout { - return false, nil - } - return true, nil } diff --git a/controller/subscription_payment_epay.go b/controller/subscription_payment_epay.go index 7dece6badc..139b7b8101 100644 --- a/controller/subscription_payment_epay.go +++ b/controller/subscription_payment_epay.go @@ -176,7 +176,7 @@ func SubscriptionEpayReturn(c *gin.Context) { if c.Request.Method == "POST" { // POST 请求:从 POST body 解析参数 if err := c.Request.ParseForm(); err != nil { - c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=fail")) + c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=fail")) return } params = lo.Reduce(lo.Keys(c.Request.PostForm), func(r map[string]string, t string, i int) map[string]string { @@ -192,29 +192,29 @@ func SubscriptionEpayReturn(c *gin.Context) { } if len(params) == 0 { - c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=fail")) + c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=fail")) return } client := GetEpayClient() if client == nil { - c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=fail")) + c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=fail")) return } verifyInfo, err := client.Verify(params) if err != nil || !verifyInfo.VerifyStatus { - c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=fail")) + c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=fail")) return } if verifyInfo.TradeStatus == epay.StatusTradeSuccess { LockOrder(verifyInfo.ServiceTradeNo) defer UnlockOrder(verifyInfo.ServiceTradeNo) if err := model.CompleteSubscriptionOrder(verifyInfo.ServiceTradeNo, common.GetJsonString(verifyInfo), model.PaymentProviderEpay, verifyInfo.Type); err != nil { - c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=fail")) + c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=fail")) return } - c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=success")) + c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=success")) return } - c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=pending")) + c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=pending")) } diff --git a/controller/subscription_payment_stripe.go b/controller/subscription_payment_stripe.go index f6e95867ca..07121e973b 100644 --- a/controller/subscription_payment_stripe.go +++ b/controller/subscription_payment_stripe.go @@ -114,8 +114,8 @@ func genStripeSubscriptionLink(referenceId string, customerId string, email stri params := &stripe.CheckoutSessionParams{ ClientReferenceID: stripe.String(referenceId), - SuccessURL: stripe.String(paymentReturnPath("/console/topup")), - CancelURL: stripe.String(paymentReturnPath("/console/topup")), + SuccessURL: stripe.String(paymentReturnPath("/wallet")), + CancelURL: stripe.String(paymentReturnPath("/wallet")), LineItems: []*stripe.CheckoutSessionLineItemParams{ { Price: stripe.String(priceId), diff --git a/controller/telegram.go b/controller/telegram.go index d51bed2bb0..e738307ff8 100644 --- a/controller/telegram.go +++ b/controller/telegram.go @@ -13,10 +13,12 @@ import ( "time" "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/middleware" "github.com/QuantumNous/new-api/model" + "github.com/QuantumNous/new-api/service" - "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" + "gorm.io/gorm" ) const ( @@ -24,61 +26,211 @@ const ( // so captured callbacks cannot be reused indefinitely. telegramAuthorizationMaxAge = 5 * time.Minute telegramAuthorizationFutureSkew = 2 * time.Minute + telegramBindFlowTTL = 5 * time.Minute + + telegramBindErrorDisabled = "TELEGRAM_BIND_DISABLED" + telegramBindErrorInvalidRequest = "TELEGRAM_BIND_INVALID_REQUEST" + telegramBindErrorFlowInvalid = "TELEGRAM_BIND_FLOW_INVALID" + telegramBindErrorSessionInvalid = "TELEGRAM_BIND_SESSION_INVALID" + telegramBindErrorAlreadyBound = "TELEGRAM_BIND_ALREADY_BOUND" + telegramBindErrorUserDeleted = "TELEGRAM_BIND_USER_DELETED" + telegramBindErrorUserDisabled = "TELEGRAM_BIND_USER_DISABLED" + telegramBindErrorInternal = "TELEGRAM_BIND_INTERNAL_ERROR" ) -func TelegramBind(c *gin.Context) { +var ( + errTelegramAccountAlreadyBound = errors.New("telegram account is already bound") + errTelegramBindAssertionInvalid = errors.New("telegram bind assertion is invalid") + errTelegramBindUserDeleted = errors.New("telegram bind user was deleted") + errTelegramBindUserDisabled = errors.New("telegram bind user is disabled") +) + +func TelegramBindStart(c *gin.Context) { if !common.TelegramOAuthEnabled { - c.JSON(200, gin.H{ + c.JSON(http.StatusOK, gin.H{ "message": "管理员未开启通过 Telegram 登录以及注册", "success": false, }) return } + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + c.JSON(http.StatusUnauthorized, gin.H{"success": false, "message": "未登录"}) + return + } + expiresAt := time.Now().Add(telegramBindFlowTTL) + flowToken, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeTelegramBind, + UserId: identity.UserID, + SessionId: identity.SessionID, + ExpiresAt: expiresAt, + }) + if err != nil { + common.ApiError(c, err) + return + } + callbackURL := "/api/oauth/telegram/bind/" + flowToken + c.JSON(http.StatusOK, gin.H{ + "success": true, + "message": "", + "data": gin.H{ + "flow_token": flowToken, + "callback_url": callbackURL, + "expires_at": expiresAt.Unix(), + }, + }) +} + +func TelegramBind(c *gin.Context) { + if !common.TelegramOAuthEnabled { + telegramBindFailure(c, telegramBindErrorDisabled) + return + } params := c.Request.URL.Query() telegramId, err := verifyTelegramAuthorization(params, common.TelegramBotToken, time.Now()) if err != nil { common.SysLog("TelegramBind authorization failed: " + err.Error()) - c.JSON(200, gin.H{ - "message": "无效的请求", - "success": false, - }) + telegramBindFailure(c, telegramBindErrorInvalidRequest) return } - if model.IsTelegramIdAlreadyTaken(telegramId) { - c.JSON(200, gin.H{ - "message": "该 Telegram 账户已被绑定", - "success": false, - }) + pendingFlow, err := model.GetAuthFlow(c.Param("flow_token"), model.AuthFlowMatch{ + Purpose: model.AuthFlowPurposeTelegramBind, + }) + if err != nil { + if !errors.Is(err, model.ErrAuthFlowInvalid) && + !errors.Is(err, model.ErrAuthFlowExpired) && + !errors.Is(err, model.ErrAuthFlowConsumed) { + common.SysError("TelegramBind flow lookup failed: " + err.Error()) + telegramBindFailure(c, telegramBindErrorInternal) + return + } + telegramBindFailure(c, telegramBindErrorFlowInvalid) + return + } + if _, err := service.ValidateSessionReference(pendingFlow.UserId, pendingFlow.SessionId); err != nil { + if !errors.Is(err, service.ErrLoginSessionInvalid) && + !errors.Is(err, service.ErrLoginSessionRevoked) && + !errors.Is(err, model.ErrUserSessionInactive) && + !errors.Is(err, gorm.ErrRecordNotFound) { + common.SysError("TelegramBind session validation failed: " + err.Error()) + telegramBindFailure(c, telegramBindErrorInternal) + return + } + + var user model.User + userErr := model.DB.First(&user, pendingFlow.UserId).Error + switch { + case errors.Is(userErr, gorm.ErrRecordNotFound): + telegramBindFailure(c, telegramBindErrorUserDeleted) + case userErr != nil: + common.SysError("TelegramBind user status lookup failed: " + userErr.Error()) + telegramBindFailure(c, telegramBindErrorInternal) + case user.Status != common.UserStatusEnabled: + telegramBindFailure(c, telegramBindErrorUserDisabled) + default: + telegramBindFailure(c, telegramBindErrorSessionInvalid) + } + return + } + assertion, assertionExpiresAt, err := telegramAuthorizationClaim(params, time.Now()) + if err != nil { + common.SysLog("TelegramBind authorization claim failed: " + err.Error()) + telegramBindFailure(c, telegramBindErrorInvalidRequest) + return + } + _, err = model.ConsumeAuthFlowWithAction(c.Param("flow_token"), model.AuthFlowMatch{ + Purpose: model.AuthFlowPurposeTelegramBind, + UserId: pendingFlow.UserId, + SessionId: pendingFlow.SessionId, + }, func(tx *gorm.DB, flow *model.AuthFlow) error { + if err := model.ClaimExternalAuthAssertionWithTx(tx, model.AuthFlowPurposeTelegramAssertion, assertion, assertionExpiresAt); err != nil { + if errors.Is(err, model.ErrAuthFlowInvalid) || errors.Is(err, model.ErrAuthFlowConsumed) { + return errors.Join(errTelegramBindAssertionInvalid, err) + } + return err + } + + var user model.User + if err := tx.First(&user, flow.UserId).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return errTelegramBindUserDeleted + } + return err + } + if user.Status != common.UserStatusEnabled { + return errTelegramBindUserDisabled + } + + var session model.UserSession + if err := tx.Where("sid = ? AND user_id = ?", flow.SessionId, flow.UserId).First(&session).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return service.ErrLoginSessionRevoked + } + return err + } + if session.Status != model.UserSessionStatusActive || session.RevokedAt != 0 || session.ExpiresAt <= time.Now().Unix() { + return service.ErrLoginSessionRevoked + } + if session.UserAuthVersion != user.AuthVersion { + return service.ErrLoginSessionRevoked + } + if user.TelegramId != "" { + return errTelegramAccountAlreadyBound + } + if err := model.ClaimExternalIdentityWithTx( + tx, + model.ExternalIdentityProviderTelegram, + telegramId, + user.Id, + ); err != nil { + if errors.Is(err, model.ErrExternalIdentityAlreadyClaimed) { + return errTelegramAccountAlreadyBound + } + return err + } + result := tx.Model(&model.User{}). + Where("id = ? AND status = ? AND auth_version = ? AND telegram_id = ?", user.Id, common.UserStatusEnabled, user.AuthVersion, ""). + Update("telegram_id", telegramId) + if result.Error != nil { + return result.Error + } + if result.RowsAffected != 1 { + return errTelegramAccountAlreadyBound + } + return nil + }) + if err != nil { + switch { + case errors.Is(err, errTelegramBindAssertionInvalid): + telegramBindFailure(c, telegramBindErrorInvalidRequest) + case errors.Is(err, errTelegramAccountAlreadyBound): + telegramBindFailure(c, telegramBindErrorAlreadyBound) + case errors.Is(err, errTelegramBindUserDeleted): + telegramBindFailure(c, telegramBindErrorUserDeleted) + case errors.Is(err, errTelegramBindUserDisabled): + telegramBindFailure(c, telegramBindErrorUserDisabled) + case errors.Is(err, service.ErrLoginSessionRevoked): + telegramBindFailure(c, telegramBindErrorSessionInvalid) + case errors.Is(err, model.ErrAuthFlowInvalid), errors.Is(err, model.ErrAuthFlowExpired), errors.Is(err, model.ErrAuthFlowConsumed): + telegramBindFailure(c, telegramBindErrorFlowInvalid) + default: + common.SysError("TelegramBind failed: " + err.Error()) + telegramBindFailure(c, telegramBindErrorInternal) + } return } - session := sessions.Default(c) - id := session.Get("id") - user := model.User{Id: id.(int)} - if err := user.FillUserById(); err != nil { - c.JSON(200, gin.H{ - "message": err.Error(), - "success": false, - }) - return - } - if user.Id == 0 { - c.JSON(http.StatusOK, gin.H{ - "success": false, - "message": "用户已注销", - }) - return - } - user.TelegramId = telegramId - if err := user.Update(false); err != nil { - c.JSON(200, gin.H{ - "message": err.Error(), - "success": false, - }) - return - } + callback := "/oauth/telegram?telegram_bind=success&flow_token=" + url.QueryEscape(c.Param("flow_token")) + c.Redirect(http.StatusFound, callback) +} - c.Redirect(302, common.ThemeAwarePath("/console/personal")) +func telegramBindFailure(c *gin.Context, errorCode string) { + query := url.Values{ + "telegram_bind": {"error"}, + "flow_token": {c.Param("flow_token")}, + "error_code": {errorCode}, + } + c.Redirect(http.StatusFound, "/oauth/telegram?"+query.Encode()) } func TelegramLogin(c *gin.Context) { @@ -108,9 +260,41 @@ func TelegramLogin(c *gin.Context) { }) return } + if err := claimTelegramAuthorization(params, time.Now()); err != nil { + common.SysLog("TelegramLogin assertion replay rejected: " + err.Error()) + c.JSON(http.StatusForbidden, gin.H{ + "message": "该登录凭据已被使用", + "success": false, + }) + return + } setupLogin(&user, c) } +func claimTelegramAuthorization(params url.Values, now time.Time) error { + assertion, expiresAt, err := telegramAuthorizationClaim(params, now) + if err != nil { + return err + } + return model.ClaimExternalAuthAssertion(model.AuthFlowPurposeTelegramAssertion, assertion, expiresAt) +} + +func telegramAuthorizationClaim(params url.Values, now time.Time) (string, time.Time, error) { + authDate, err := strconv.ParseInt(params.Get("auth_date"), 10, 64) + if err != nil { + return "", time.Time{}, errors.New("telegram authorization date is invalid") + } + hashBytes, err := hex.DecodeString(params.Get("hash")) + if err != nil { + return "", time.Time{}, errors.New("telegram authorization signature is invalid") + } + expiresAt := time.Unix(authDate, 0).Add(telegramAuthorizationMaxAge) + if !expiresAt.After(now) { + return "", time.Time{}, errors.New("telegram authorization has expired") + } + return hex.EncodeToString(hashBytes), expiresAt, nil +} + func verifyTelegramAuthorization(params url.Values, token string, now time.Time) (string, error) { if token == "" { return "", errors.New("telegram bot token is empty") diff --git a/controller/telegram_test.go b/controller/telegram_test.go index 5b683fb7ec..5064472412 100644 --- a/controller/telegram_test.go +++ b/controller/telegram_test.go @@ -4,6 +4,9 @@ import ( "crypto/hmac" "crypto/sha256" "encoding/hex" + "errors" + "net/http" + "net/http/httptest" "net/url" "sort" "strconv" @@ -11,8 +14,13 @@ import ( "testing" "time" + "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/model" + "github.com/gin-gonic/gin" + "github.com/glebarez/sqlite" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gorm.io/gorm" ) func TestVerifyTelegramAuthorization(t *testing.T) { @@ -31,6 +39,7 @@ func TestVerifyTelegramAuthorization(t *testing.T) { {name: "expired", authDate: now.Add(-telegramAuthorizationMaxAge - time.Second), wantErr: "expired"}, {name: "too far in future", authDate: now.Add(telegramAuthorizationFutureSkew + time.Second), wantErr: "expired"}, {name: "invalid signature", authDate: now, mutate: func(values url.Values) { values.Set("hash", "00") }, wantErr: "signature"}, + {name: "unsigned flow token query is rejected", authDate: now, mutate: func(values url.Values) { values.Set("flow_token", "must-be-in-path") }, wantErr: "signature"}, {name: "duplicate parameter", authDate: now, mutate: func(values url.Values) { values["id"] = append(values["id"], "654321") }, wantErr: "duplicate"}, } @@ -61,8 +70,16 @@ func signedTelegramAuthorization(token string, authDate time.Time) url.Values { "first_name": {"Test"}, "id": {"123456"}, } + signTelegramAuthorization(token, params) + return params +} + +func signTelegramAuthorization(token string, params url.Values) { keys := make([]string, 0, len(params)) for key := range params { + if key == "hash" { + continue + } keys = append(keys, key) } sort.Strings(keys) @@ -74,5 +91,319 @@ func signedTelegramAuthorization(token string, authDate time.Time) url.Values { mac := hmac.New(sha256.New, secret[:]) _, _ = mac.Write([]byte(strings.Join(dataCheck, "\n"))) params.Set("hash", hex.EncodeToString(mac.Sum(nil))) - return params +} + +func createTelegramBindTestFlow(t *testing.T, db *gorm.DB, name string, status int, now time.Time) (*model.User, string) { + t.Helper() + user := &model.User{ + Username: name, Password: "password-placeholder", Role: common.RoleCommonUser, + Status: status, Group: "default", AuthVersion: 1, AffCode: name, + } + require.NoError(t, db.Create(user).Error) + session := &model.UserSession{ + SID: name + "-session", UserID: user.Id, Version: 1, UserAuthVersion: user.AuthVersion, + Status: model.UserSessionStatusActive, RefreshHash: name + "-refresh-hash", LoginMethod: "password", + CreatedAt: now.Unix(), LastActiveAt: now.Unix(), ExpiresAt: now.Add(time.Hour).Unix(), + } + require.NoError(t, model.CreateUserSession(session)) + flowToken, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeTelegramBind, UserId: user.Id, SessionId: session.SID, + ExpiresAt: now.Add(time.Minute), + }) + require.NoError(t, err) + return user, flowToken +} + +func assertTelegramBindRedirect(t *testing.T, response *httptest.ResponseRecorder, flowToken, errorCode string) { + t.Helper() + require.Equal(t, http.StatusFound, response.Code) + location, err := url.Parse(response.Header().Get("Location")) + require.NoError(t, err) + assert.Equal(t, "/oauth/telegram", location.Path) + assert.Equal(t, "error", location.Query().Get("telegram_bind")) + assert.Equal(t, flowToken, location.Query().Get("flow_token")) + assert.Equal(t, errorCode, location.Query().Get("error_code")) + assert.Empty(t, location.Query().Get("error_description")) + assert.Empty(t, location.Query().Get("message")) +} + +func TestTelegramBindFailureResponseContract(t *testing.T) { + failures := []struct { + name string + errorCode string + }{ + {name: "disabled", errorCode: telegramBindErrorDisabled}, + {name: "invalid request", errorCode: telegramBindErrorInvalidRequest}, + {name: "invalid flow", errorCode: telegramBindErrorFlowInvalid}, + {name: "invalid session", errorCode: telegramBindErrorSessionInvalid}, + {name: "already bound", errorCode: telegramBindErrorAlreadyBound}, + {name: "deleted user", errorCode: telegramBindErrorUserDeleted}, + {name: "disabled user", errorCode: telegramBindErrorUserDisabled}, + {name: "internal error", errorCode: telegramBindErrorInternal}, + } + + for _, failure := range failures { + t.Run(failure.name, func(t *testing.T) { + response := httptest.NewRecorder() + context, _ := gin.CreateTestContext(response) + context.Params = gin.Params{{Key: "flow_token", Value: "flow token"}} + context.Request = httptest.NewRequest(http.MethodGet, "/api/oauth/telegram/bind/flow-token", nil) + + telegramBindFailure(context, failure.errorCode) + + assertTelegramBindRedirect(t, response, "flow token", failure.errorCode) + }) + } +} + +func TestTelegramBindCommitsFlowAssertionAndBindingAtomically(t *testing.T) { + previousDB := model.DB + previousType := common.MainDatabaseType() + previousRedis := common.RedisEnabled + previousEnabled := common.TelegramOAuthEnabled + previousToken := common.TelegramBotToken + previousSecret := common.SessionSecret + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + require.NoError(t, err) + require.NoError(t, db.AutoMigrate( + &model.User{}, + &model.UserSession{}, + &model.AuthFlow{}, + &model.ExternalIdentityClaim{}, + )) + model.DB = db + common.SetMainDatabaseType(common.DatabaseTypeSQLite) + common.RedisEnabled = false + common.TelegramOAuthEnabled = true + common.TelegramBotToken = "telegram-bind-test-token" + common.SessionSecret = "telegram-bind-session-secret" + t.Cleanup(func() { + model.DB = previousDB + common.SetMainDatabaseType(previousType) + common.RedisEnabled = previousRedis + common.TelegramOAuthEnabled = previousEnabled + common.TelegramBotToken = previousToken + common.SessionSecret = previousSecret + }) + + user := &model.User{ + Username: "telegram-bind-user", Password: "password-placeholder", Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, Group: "default", AuthVersion: 1, AffCode: "telegram-bind-user", + } + require.NoError(t, db.Create(user).Error) + now := time.Now() + session := &model.UserSession{ + SID: "telegram-bind-session", UserID: user.Id, Version: 1, UserAuthVersion: user.AuthVersion, + Status: model.UserSessionStatusActive, RefreshHash: "refresh-hash", LoginMethod: "password", + CreatedAt: now.Unix(), LastActiveAt: now.Unix(), ExpiresAt: now.Add(time.Hour).Unix(), + } + require.NoError(t, model.CreateUserSession(session)) + flowToken, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeTelegramBind, UserId: user.Id, SessionId: session.SID, + ExpiresAt: now.Add(time.Minute), + }) + require.NoError(t, err) + params := signedTelegramAuthorization(common.TelegramBotToken, now) + router := gin.New() + router.GET("/api/oauth/telegram/bind/:flow_token", TelegramBind) + + common.TelegramOAuthEnabled = false + request := httptest.NewRequest(http.MethodGet, "/api/oauth/telegram/bind/disabled-flow", nil) + response := httptest.NewRecorder() + router.ServeHTTP(response, request) + assertTelegramBindRedirect(t, response, "disabled-flow", telegramBindErrorDisabled) + common.TelegramOAuthEnabled = true + + request = httptest.NewRequest(http.MethodGet, "/api/oauth/telegram/bind/invalid-request", nil) + response = httptest.NewRecorder() + router.ServeHTTP(response, request) + assertTelegramBindRedirect(t, response, "invalid-request", telegramBindErrorInvalidRequest) + + request = httptest.NewRequest(http.MethodGet, "/api/oauth/telegram/bind/missing-flow?"+params.Encode(), nil) + response = httptest.NewRecorder() + router.ServeHTTP(response, request) + assertTelegramBindRedirect(t, response, "missing-flow", telegramBindErrorFlowInvalid) + + invalidSessionFlowToken, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeTelegramBind, UserId: user.Id, SessionId: "missing-session", + ExpiresAt: now.Add(time.Minute), + }) + require.NoError(t, err) + request = httptest.NewRequest( + http.MethodGet, + "/api/oauth/telegram/bind/"+invalidSessionFlowToken+"?"+params.Encode(), + nil, + ) + response = httptest.NewRecorder() + router.ServeHTTP(response, request) + assertTelegramBindRedirect(t, response, invalidSessionFlowToken, telegramBindErrorSessionInvalid) + invalidSessionFlow, err := model.GetAuthFlow(invalidSessionFlowToken, model.AuthFlowMatch{Purpose: model.AuthFlowPurposeTelegramBind}) + require.NoError(t, err) + assert.Nil(t, invalidSessionFlow.ConsumedAt) + + request = httptest.NewRequest(http.MethodGet, "/api/oauth/telegram/bind/"+flowToken+"?"+params.Encode(), nil) + response = httptest.NewRecorder() + router.ServeHTTP(response, request) + + assert.Equal(t, http.StatusFound, response.Code) + assert.Equal(t, "/oauth/telegram?telegram_bind=success&flow_token="+url.QueryEscape(flowToken), response.Header().Get("Location")) + var storedUser model.User + require.NoError(t, db.First(&storedUser, user.Id).Error) + assert.Equal(t, "123456", storedUser.TelegramId) + var identityClaim model.ExternalIdentityClaim + require.NoError(t, db.Where("provider = ? AND subject = ?", model.ExternalIdentityProviderTelegram, "123456"). + First(&identityClaim).Error) + assert.Equal(t, user.Id, identityClaim.UserId) + _, err = model.GetAuthFlow(flowToken, model.AuthFlowMatch{Purpose: model.AuthFlowPurposeTelegramBind}) + assert.ErrorIs(t, err, model.ErrAuthFlowConsumed) + + replayFlowToken, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeTelegramBind, UserId: user.Id, SessionId: session.SID, + ExpiresAt: now.Add(time.Minute), + }) + require.NoError(t, err) + request = httptest.NewRequest(http.MethodGet, "/api/oauth/telegram/bind/"+replayFlowToken+"?"+params.Encode(), nil) + response = httptest.NewRecorder() + router.ServeHTTP(response, request) + assertTelegramBindRedirect(t, response, replayFlowToken, telegramBindErrorInvalidRequest) + replayFlow, err := model.GetAuthFlow(replayFlowToken, model.AuthFlowMatch{Purpose: model.AuthFlowPurposeTelegramBind}) + require.NoError(t, err) + assert.Nil(t, replayFlow.ConsumedAt) + + competingUser := &model.User{ + Username: "telegram-bind-competing-user", Password: "password-placeholder", Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, Group: "default", AuthVersion: 1, AffCode: "telegram-bind-competing-user", + } + require.NoError(t, db.Create(competingUser).Error) + competingSession := &model.UserSession{ + SID: "telegram-bind-competing-session", UserID: competingUser.Id, Version: 1, + UserAuthVersion: competingUser.AuthVersion, Status: model.UserSessionStatusActive, + RefreshHash: "competing-refresh-hash", LoginMethod: "password", + CreatedAt: now.Unix(), LastActiveAt: now.Unix(), ExpiresAt: now.Add(time.Hour).Unix(), + } + require.NoError(t, model.CreateUserSession(competingSession)) + competingFlowToken, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeTelegramBind, UserId: competingUser.Id, SessionId: competingSession.SID, + ExpiresAt: now.Add(time.Minute), + }) + require.NoError(t, err) + competingParams := signedTelegramAuthorization(common.TelegramBotToken, now) + competingParams.Set("first_name", "Competing") + signTelegramAuthorization(common.TelegramBotToken, competingParams) + request = httptest.NewRequest( + http.MethodGet, + "/api/oauth/telegram/bind/"+competingFlowToken+"?"+competingParams.Encode(), + nil, + ) + response = httptest.NewRecorder() + router.ServeHTTP(response, request) + assertTelegramBindRedirect(t, response, competingFlowToken, telegramBindErrorAlreadyBound) + + require.NoError(t, db.First(competingUser, competingUser.Id).Error) + assert.Empty(t, competingUser.TelegramId) + competingFlow, err := model.GetAuthFlow(competingFlowToken, model.AuthFlowMatch{Purpose: model.AuthFlowPurposeTelegramBind}) + require.NoError(t, err) + assert.Nil(t, competingFlow.ConsumedAt) + competingAssertion, competingAssertionExpiry, err := telegramAuthorizationClaim(competingParams, time.Now()) + require.NoError(t, err) + require.NoError(t, model.ClaimExternalAuthAssertion( + model.AuthFlowPurposeTelegramAssertion, + competingAssertion, + competingAssertionExpiry, + )) + + disabledUser, disabledFlowToken := createTelegramBindTestFlow( + t, db, "telegram-bind-disabled-user", common.UserStatusDisabled, now, + ) + disabledParams := signedTelegramAuthorization(common.TelegramBotToken, now) + disabledParams.Set("id", "disabled-telegram-id") + disabledParams.Set("first_name", "Disabled") + signTelegramAuthorization(common.TelegramBotToken, disabledParams) + request = httptest.NewRequest( + http.MethodGet, + "/api/oauth/telegram/bind/"+disabledFlowToken+"?"+disabledParams.Encode(), + nil, + ) + response = httptest.NewRecorder() + router.ServeHTTP(response, request) + assertTelegramBindRedirect(t, response, disabledFlowToken, telegramBindErrorUserDisabled) + var storedDisabledUser model.User + require.NoError(t, db.First(&storedDisabledUser, disabledUser.Id).Error) + assert.Empty(t, storedDisabledUser.TelegramId) + disabledFlow, err := model.GetAuthFlow(disabledFlowToken, model.AuthFlowMatch{Purpose: model.AuthFlowPurposeTelegramBind}) + require.NoError(t, err) + assert.Nil(t, disabledFlow.ConsumedAt) + disabledAssertion, disabledAssertionExpiry, err := telegramAuthorizationClaim(disabledParams, time.Now()) + require.NoError(t, err) + require.NoError(t, model.ClaimExternalAuthAssertion( + model.AuthFlowPurposeTelegramAssertion, + disabledAssertion, + disabledAssertionExpiry, + )) + + deletedUser, deletedFlowToken := createTelegramBindTestFlow( + t, db, "telegram-bind-deleted-user", common.UserStatusEnabled, now, + ) + require.NoError(t, db.Delete(deletedUser).Error) + deletedParams := signedTelegramAuthorization(common.TelegramBotToken, now) + deletedParams.Set("id", "deleted-telegram-id") + deletedParams.Set("first_name", "Deleted") + signTelegramAuthorization(common.TelegramBotToken, deletedParams) + request = httptest.NewRequest( + http.MethodGet, + "/api/oauth/telegram/bind/"+deletedFlowToken+"?"+deletedParams.Encode(), + nil, + ) + response = httptest.NewRecorder() + router.ServeHTTP(response, request) + assertTelegramBindRedirect(t, response, deletedFlowToken, telegramBindErrorUserDeleted) + deletedFlow, err := model.GetAuthFlow(deletedFlowToken, model.AuthFlowMatch{Purpose: model.AuthFlowPurposeTelegramBind}) + require.NoError(t, err) + assert.Nil(t, deletedFlow.ConsumedAt) + deletedAssertion, deletedAssertionExpiry, err := telegramAuthorizationClaim(deletedParams, time.Now()) + require.NoError(t, err) + require.NoError(t, model.ClaimExternalAuthAssertion( + model.AuthFlowPurposeTelegramAssertion, + deletedAssertion, + deletedAssertionExpiry, + )) + + _, internalFlowToken := createTelegramBindTestFlow( + t, db, "telegram-bind-internal-error", common.UserStatusEnabled, now, + ) + internalParams := signedTelegramAuthorization(common.TelegramBotToken, now) + internalParams.Set("id", "internal-error-telegram-id") + internalParams.Set("first_name", "Internal") + signTelegramAuthorization(common.TelegramBotToken, internalParams) + forcedError := errors.New("forced telegram session query failure") + const callbackName = "test:telegram-bind-session-query-failure" + require.NoError(t, db.Callback().Query().Before("gorm:query").Register(callbackName, func(tx *gorm.DB) { + if tx.Statement.Table != "user_sessions" { + return + } + if _, inTransaction := tx.Statement.ConnPool.(gorm.TxCommitter); inTransaction { + tx.AddError(forcedError) + } + })) + request = httptest.NewRequest( + http.MethodGet, + "/api/oauth/telegram/bind/"+internalFlowToken+"?"+internalParams.Encode(), + nil, + ) + response = httptest.NewRecorder() + router.ServeHTTP(response, request) + db.Callback().Query().Remove(callbackName) + assertTelegramBindRedirect(t, response, internalFlowToken, telegramBindErrorInternal) + assert.NotContains(t, response.Header().Get("Location"), forcedError.Error()) + internalFlow, err := model.GetAuthFlow(internalFlowToken, model.AuthFlowMatch{Purpose: model.AuthFlowPurposeTelegramBind}) + require.NoError(t, err) + assert.Nil(t, internalFlow.ConsumedAt) + internalAssertion, internalAssertionExpiry, err := telegramAuthorizationClaim(internalParams, time.Now()) + require.NoError(t, err) + require.NoError(t, model.ClaimExternalAuthAssertion( + model.AuthFlowPurposeTelegramAssertion, + internalAssertion, + internalAssertionExpiry, + )) + } diff --git a/controller/theme_compat_test.go b/controller/theme_compat_test.go new file mode 100644 index 0000000000..28cb823ec9 --- /dev/null +++ b/controller/theme_compat_test.go @@ -0,0 +1,47 @@ +package controller + +import ( + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/QuantumNous/new-api/common" + "github.com/gin-gonic/gin" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestUpdateOptionRejectsRetiredFrontendTheme(t *testing.T) { + response := httptest.NewRecorder() + context, _ := gin.CreateTestContext(response) + context.Request = httptest.NewRequest( + http.MethodPut, + "/api/option/", + strings.NewReader(`{"key":"theme.frontend","value":"classic"}`), + ) + + UpdateOption(context) + + assert.Equal(t, http.StatusOK, response.Code) + assert.JSONEq(t, `{"success":false,"message":"Classic 前端已移除,主题只能设置为 default"}`, response.Body.String()) +} + +func TestGetStatusAdvertisesDefaultDashboard(t *testing.T) { + previousMap := common.OptionMap + common.OptionMap = map[string]string{} + t.Cleanup(func() { common.OptionMap = previousMap }) + response := httptest.NewRecorder() + context, _ := gin.CreateTestContext(response) + context.Request = httptest.NewRequest(http.MethodGet, "/api/status", nil) + + GetStatus(context) + + var payload struct { + Success bool `json:"success"` + Data map[string]any `json:"data"` + } + require.NoError(t, common.Unmarshal(response.Body.Bytes(), &payload)) + assert.True(t, payload.Success) + assert.Equal(t, "default", payload.Data["theme"]) +} diff --git a/controller/topup.go b/controller/topup.go index 69e1b5e304..390f53f7dc 100644 --- a/controller/topup.go +++ b/controller/topup.go @@ -45,14 +45,14 @@ func GetTopUpInfo(c *gin.Context) { stripeMethod := map[string]string{ "name": "Stripe", "type": "stripe", - "color": "rgba(var(--semi-purple-5), 1)", + "color": "#635BFF", "min_topup": strconv.Itoa(setting.StripeMinTopUp), } payMethods = append(payMethods, stripeMethod) } } - // Waffo Pancake displayed above the legacy Waffo gateway. + // Waffo Pancake is displayed above the standard Waffo gateway. enableWaffoPancake := isWaffoPancakeTopUpEnabled() if enableWaffoPancake { hasWaffoPancake := false @@ -67,7 +67,7 @@ func GetTopUpInfo(c *gin.Context) { payMethods = append(payMethods, map[string]string{ "name": "Waffo Pancake", "type": model.PaymentMethodWaffoPancake, - "color": "rgba(var(--semi-orange-5), 1)", + "color": "#F97316", "min_topup": strconv.Itoa(setting.WaffoPancakeMinTopUp), }) } @@ -88,7 +88,7 @@ func GetTopUpInfo(c *gin.Context) { waffoMethod := map[string]string{ "name": "Waffo (Global Payment)", "type": model.PaymentMethodWaffo, - "color": "rgba(var(--semi-blue-5), 1)", + "color": "#3B82F6", "min_topup": strconv.Itoa(setting.WaffoMinTopUp), } payMethods = append(payMethods, waffoMethod) @@ -216,7 +216,7 @@ func RequestEpay(c *gin.Context) { } callBackAddress := service.GetCallbackAddress() - returnUrl, _ := url.Parse(paymentReturnPath("/console/log")) + returnUrl, _ := url.Parse(paymentReturnPath("/usage-logs")) notifyUrl, _ := url.Parse(callBackAddress + "/api/user/epay/notify") tradeNo := fmt.Sprintf("%s%d", common.GetRandomString(6), time.Now().Unix()) tradeNo = fmt.Sprintf("USR%dNO%s", id, tradeNo) diff --git a/controller/topup_stripe.go b/controller/topup_stripe.go index bcae201ec4..8a39576659 100644 --- a/controller/topup_stripe.go +++ b/controller/topup_stripe.go @@ -347,10 +347,10 @@ func genStripeLink(referenceId string, customerId string, email string, amount i // Use custom URLs if provided, otherwise use defaults if successURL == "" { - successURL = paymentReturnPath("/console/log") + successURL = paymentReturnPath("/usage-logs") } if cancelURL == "" { - cancelURL = paymentReturnPath("/console/topup") + cancelURL = paymentReturnPath("/wallet") } params := &stripe.CheckoutSessionParams{ diff --git a/controller/topup_waffo.go b/controller/topup_waffo.go index 9c646bd611..4ac3b2b5dd 100644 --- a/controller/topup_waffo.go +++ b/controller/topup_waffo.go @@ -248,7 +248,7 @@ func RequestWaffoPay(c *gin.Context) { if setting.WaffoNotifyUrl != "" { notifyUrl = setting.WaffoNotifyUrl } - returnUrl := paymentReturnPath("/console/topup?show_history=true") + returnUrl := paymentReturnPath("/wallet?show_history=true") if setting.WaffoReturnUrl != "" { returnUrl = setting.WaffoReturnUrl } diff --git a/controller/twofa.go b/controller/twofa.go index ec9ef1a006..27aae855dc 100644 --- a/controller/twofa.go +++ b/controller/twofa.go @@ -6,9 +6,10 @@ import ( "strconv" "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/middleware" "github.com/QuantumNous/new-api/model" + "github.com/QuantumNous/new-api/service" - "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" ) @@ -19,7 +20,12 @@ type Setup2FARequest struct { // Verify2FARequest 验证2FA请求结构 type Verify2FARequest struct { - Code string `json:"code" binding:"required"` + Code string `json:"code" binding:"required"` + FlowToken string `json:"flow_token,omitempty"` +} + +type twoFALoginFlowPayload struct { + AuthVersion int64 `json:"auth_version"` } // Setup2FAResponse 设置2FA响应结构 @@ -49,7 +55,7 @@ func Setup2FA(c *gin.Context) { // 如果存在已禁用的2FA记录,先删除它 if existing != nil && !existing.IsEnabled { - if err := existing.Delete(); err != nil { + if err := existing.DeletePendingTwoFASetup(); err != nil { common.ApiError(c, err) return } @@ -95,22 +101,13 @@ func Setup2FA(c *gin.Context) { IsEnabled: false, } - if existing != nil { - // 更新现有记录 - twoFA.Id = existing.Id - err = twoFA.Update() - } else { - // 创建新记录 - err = twoFA.Create() - } - - if err != nil { + if err := twoFA.CreatePendingTwoFASetup(); err != nil { common.ApiError(c, err) return } // 创建备用码记录 - if err := model.CreateBackupCodes(userId, backupCodes); err != nil { + if err := model.CreatePendingTwoFASetupBackupCodes(userId, backupCodes); err != nil { c.JSON(http.StatusOK, gin.H{ "success": false, "message": "保存备用码失败", @@ -185,8 +182,18 @@ func Enable2FA(c *gin.Context) { return } - // 启用2FA - if err := twoFA.Enable(); err != nil { + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + common.ApiError(c, errors.New("当前认证方式不支持安全验证")) + return + } + // 启用2FA并原子推进用户鉴权版本 + if err := twoFA.EnableWithAuthVersion(); err != nil { + common.ApiError(c, err) + return + } + bundle, err := service.AdvanceCurrentSessionToUserVersion(identity, "twofa_enabled") + if err != nil { common.ApiError(c, err) return } @@ -197,6 +204,7 @@ func Enable2FA(c *gin.Context) { c.JSON(http.StatusOK, gin.H{ "success": true, "message": "两步验证启用成功", + "data": authRotationData(bundle), }) } @@ -257,8 +265,18 @@ func Disable2FA(c *gin.Context) { return } - // 禁用2FA - if err := model.DisableTwoFA(userId); err != nil { + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + common.ApiError(c, errors.New("当前认证方式不支持安全验证")) + return + } + // 禁用2FA并原子推进用户鉴权版本 + if err := model.DisableTwoFAWithAuthVersion(userId); err != nil { + common.ApiError(c, err) + return + } + bundle, err := service.AdvanceCurrentSessionToUserVersion(identity, "twofa_disabled") + if err != nil { common.ApiError(c, err) return } @@ -269,6 +287,7 @@ func Disable2FA(c *gin.Context) { c.JSON(http.StatusOK, gin.H{ "success": true, "message": "两步验证已禁用", + "data": authRotationData(bundle), }) } @@ -372,8 +391,13 @@ func RegenerateBackupCodes(c *gin.Context) { return } - // 保存新的备用码 - if err := model.CreateBackupCodes(userId, backupCodes); err != nil { + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + common.ApiError(c, errors.New("当前认证方式不支持安全验证")) + return + } + // 保存新的备用码并原子推进用户鉴权版本 + if err := model.ReplaceBackupCodesWithAuthVersion(userId, backupCodes); err != nil { c.JSON(http.StatusOK, gin.H{ "success": false, "message": "保存备用码失败", @@ -381,16 +405,21 @@ func RegenerateBackupCodes(c *gin.Context) { common.SysLog("保存备用码失败: " + err.Error()) return } + bundle, err := service.AdvanceCurrentSessionToUserVersion(identity, "twofa_backup_codes_regenerated") + if err != nil { + common.ApiError(c, err) + return + } // 记录操作日志 model.RecordLog(userId, model.LogTypeSystem, "重新生成两步验证备用码") + data := authRotationData(bundle) + data["backup_codes"] = backupCodes c.JSON(http.StatusOK, gin.H{ "success": true, "message": "备用码重新生成成功", - "data": map[string]interface{}{ - "backup_codes": backupCodes, - }, + "data": data, }) } @@ -405,26 +434,16 @@ func Verify2FALogin(c *gin.Context) { return } - // 从会话中获取pending用户信息 - session := sessions.Default(c) - pendingUserId := session.Get("pending_user_id") - if pendingUserId == nil { + flow, err := model.GetAuthFlow(req.FlowToken, model.AuthFlowMatch{Purpose: model.AuthFlowPurposeTwoFALogin}) + if err != nil { c.JSON(http.StatusOK, gin.H{ "success": false, "message": "会话已过期,请重新登录", }) return } - userId, ok := pendingUserId.(int) - if !ok { - c.JSON(http.StatusOK, gin.H{ - "success": false, - "message": "会话数据无效,请重新登录", - }) - return - } // 获取用户信息 - user, err := model.GetUserById(userId, false) + user, err := model.GetUserById(flow.UserId, false) if err != nil { c.JSON(http.StatusOK, gin.H{ "success": false, @@ -432,6 +451,21 @@ func Verify2FALogin(c *gin.Context) { }) return } + if user.Status != common.UserStatusEnabled { + c.JSON(http.StatusOK, gin.H{ + "success": false, + "message": "用户已被禁用", + }) + return + } + var flowPayload twoFALoginFlowPayload + if err := common.UnmarshalJsonStr(flow.Payload, &flowPayload); err != nil || flowPayload.AuthVersion <= 0 || flowPayload.AuthVersion != user.AuthVersion { + c.JSON(http.StatusOK, gin.H{ + "success": false, + "message": "会话已过期,请重新登录", + }) + return + } // 获取2FA记录 twoFA, err := model.GetTwoFAByUserId(user.Id) @@ -477,12 +511,18 @@ func Verify2FALogin(c *gin.Context) { return } - // 2FA验证成功,清理pending会话信息并完成登录 - session.Delete("pending_username") - session.Delete("pending_user_id") - session.Save() + if _, err := model.ConsumeAuthFlow(req.FlowToken, model.AuthFlowMatch{ + Purpose: model.AuthFlowPurposeTwoFALogin, + UserId: user.Id, + }); err != nil { + c.JSON(http.StatusOK, gin.H{ + "success": false, + "message": "会话已过期,请重新登录", + }) + return + } - setupLogin(user, c) + setupLoginAtAuthVersion(user, flowPayload.AuthVersion, c) } // Admin2FAStats 管理员获取2FA统计信息 @@ -529,7 +569,7 @@ func AdminDisable2FA(c *gin.Context) { } // 禁用2FA - if err := model.DisableTwoFA(userId); err != nil { + if err := model.DisableTwoFAWithAuthVersion(userId); err != nil { if errors.Is(err, model.ErrTwoFANotEnabled) { c.JSON(http.StatusOK, gin.H{ "success": false, @@ -540,6 +580,10 @@ func AdminDisable2FA(c *gin.Context) { common.ApiError(c, err) return } + if _, err := model.RevokeAllUserSessions(userId, "admin_twofa_disabled"); err != nil { + common.ApiError(c, err) + return + } recordManageAuditFor(c, userId, "user.2fa_disable", nil) diff --git a/controller/user.go b/controller/user.go index 466353a434..202b43b677 100644 --- a/controller/user.go +++ b/controller/user.go @@ -1,7 +1,6 @@ package controller import ( - "encoding/json" "errors" "fmt" "net/http" @@ -9,11 +8,13 @@ import ( "strconv" "strings" "sync" + "time" "github.com/QuantumNous/new-api/common" "github.com/QuantumNous/new-api/dto" "github.com/QuantumNous/new-api/i18n" "github.com/QuantumNous/new-api/logger" + "github.com/QuantumNous/new-api/middleware" "github.com/QuantumNous/new-api/model" "github.com/QuantumNous/new-api/service" "github.com/QuantumNous/new-api/service/authz" @@ -22,7 +23,6 @@ import ( "github.com/QuantumNous/new-api/constant" - "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" "gorm.io/gorm" ) @@ -43,7 +43,7 @@ func Login(c *gin.Context) { return } var loginRequest LoginRequest - err := json.NewDecoder(c.Request.Body).Decode(&loginRequest) + err := common.DecodeJson(c.Request.Body, &loginRequest) if err != nil { common.ApiErrorI18n(c, i18n.MsgInvalidParams) return @@ -80,13 +80,20 @@ func Login(c *gin.Context) { return } if twoFAEnabled { - // 设置pending session,等待2FA验证 - session := sessions.Default(c) - session.Set("pending_username", user.Username) - session.Set("pending_user_id", user.Id) - err := session.Save() + expiresAt := time.Now().Add(5 * time.Minute) + payload, err := common.Marshal(twoFALoginFlowPayload{AuthVersion: user.AuthVersion}) if err != nil { - common.ApiErrorI18n(c, i18n.MsgUserSessionSaveFailed) + common.ApiError(c, err) + return + } + flowToken, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: model.AuthFlowPurposeTwoFALogin, + UserId: user.Id, + Payload: string(payload), + ExpiresAt: expiresAt, + }) + if err != nil { + common.ApiError(c, err) return } @@ -95,6 +102,8 @@ func Login(c *gin.Context) { "success": true, "data": map[string]interface{}{ "require_2fa": true, + "flow_token": flowToken, + "expires_at": expiresAt.Unix(), }, }) return @@ -140,52 +149,60 @@ func recordLoginAudit(user *model.User, c *gin.Context) { }, extra) } -// setup session & cookies and then return user info +// setupLogin creates a server-controlled login Session and returns the shared +// authentication bundle used by every login method. func setupLogin(user *model.User, c *gin.Context) { - model.UpdateUserLastLoginAt(user.Id) - session := sessions.Default(c) - session.Set("id", user.Id) - session.Set("username", user.Username) - session.Set("role", user.Role) - session.Set("status", user.Status) - session.Set("group", user.Group) - err := session.Save() - if err != nil { - common.ApiErrorI18n(c, i18n.MsgUserSessionSaveFailed) + setupLoginAtAuthVersion(user, 0, c) +} + +func setupLoginAtAuthVersion(user *model.User, expectedAuthVersion int64, c *gin.Context) { + if user == nil || user.Id <= 0 || user.Status != common.UserStatusEnabled { + common.ApiErrorI18n(c, i18n.MsgAuthUserBanned) return } + currentUser, err := model.GetUserById(user.Id, false) + if err != nil { + common.ApiError(c, err) + return + } + var bundle *service.AuthBundle + if expectedAuthVersion > 0 { + bundle, err = service.CreateLoginSessionAtAuthVersion( + user.Id, + expectedAuthVersion, + loginMethodFromContext(c), + c.ClientIP(), + c.Request.UserAgent(), + ) + } else { + bundle, err = service.CreateLoginSession( + user.Id, + loginMethodFromContext(c), + c.ClientIP(), + c.Request.UserAgent(), + ) + } + if err != nil { + writeAuthSessionError(c, err) + return + } + model.UpdateUserLastLoginAt(user.Id) + service.WriteRefreshCookie(c, bundle.RefreshToken) + setAuthNoStore(c) recordLoginAudit(user, c) c.JSON(http.StatusOK, gin.H{ "message": "", "success": true, - "data": map[string]any{ - "id": user.Id, - "username": user.Username, - "display_name": user.DisplayName, - "role": user.Role, - "status": user.Status, - "group": user.Group, + "data": gin.H{ + "access_token": bundle.AccessToken, + "token_type": bundle.TokenType, + "access_expires_at": bundle.AccessExpiresAt, + "session": bundle.Session, + "user": buildSelfUserData(currentUser), }, }) } -func Logout(c *gin.Context) { - session := sessions.Default(c) - session.Clear() - err := session.Save() - if err != nil { - c.JSON(http.StatusOK, gin.H{ - "message": err.Error(), - "success": false, - }) - return - } - c.JSON(http.StatusOK, gin.H{ - "message": "", - "success": true, - }) -} - func Register(c *gin.Context) { if !common.RegisterEnabled { common.ApiErrorI18n(c, i18n.MsgUserRegisterDisabled) @@ -196,7 +213,7 @@ func Register(c *gin.Context) { return } var user model.User - err := json.NewDecoder(c.Request.Body).Decode(&user) + err := common.DecodeJson(c.Request.Body, &user) if err != nil { common.ApiErrorI18n(c, i18n.MsgInvalidParams) return @@ -476,18 +493,30 @@ func GetSelf(c *gin.Context) { common.ApiError(c, err) return } - // Hide admin remarks: set to empty to trigger omitempty tag, ensuring the remark field is not included in JSON returned to regular users - user.Remark = "" - - // 计算用户权限信息 + responseData := buildSelfUserData(user) + // The authenticated role is loaded from GetUserCache. It should equal the + // row role, but use it for capabilities so GetSelf and login/refresh remain + // consistent with the authorization decision made for this request. permissions := calculateUserPermissions(userRole) permissions["admin_permissions"] = authz.Capabilities(id, userRole) + responseData["permissions"] = permissions - // 获取用户设置并提取sidebar_modules + c.JSON(http.StatusOK, gin.H{ + "success": true, + "message": "", + "data": responseData, + }) + return +} + +// buildSelfUserData is the single safe dashboard-user DTO used by GetSelf, +// login and refresh. It intentionally excludes password, management PAT and +// administrator-only remarks. +func buildSelfUserData(user *model.User) map[string]interface{} { userSetting := user.GetSetting() - - // 构建响应数据,包含用户信息和权限 - responseData := map[string]interface{}{ + permissions := calculateUserPermissions(user.Role) + permissions["admin_permissions"] = authz.Capabilities(user.Id, user.Role) + return map[string]interface{}{ "id": user.Id, "username": user.Username, "display_name": user.DisplayName, @@ -512,15 +541,8 @@ func GetSelf(c *gin.Context) { "setting": user.Setting, "stripe_customer": user.StripeCustomer, "sidebar_modules": userSetting.SidebarModules, // 正确提取sidebar_modules字段 - "permissions": permissions, // 新增权限字段 + "permissions": permissions, } - - c.JSON(http.StatusOK, gin.H{ - "success": true, - "message": "", - "data": responseData, - }) - return } // 计算用户权限的辅助函数 @@ -604,7 +626,7 @@ func generateDefaultSidebarConfig(userRole int) string { // 普通用户不包含admin区域 // 转换为JSON字符串 - configBytes, err := json.Marshal(defaultConfig) + configBytes, err := common.Marshal(defaultConfig) if err != nil { common.SysLog("生成默认边栏配置失败: " + err.Error()) return "" @@ -661,7 +683,7 @@ func GetUserModels(c *gin.Context) { func UpdateUser(c *gin.Context) { var updatedUser model.User - err := json.NewDecoder(c.Request.Body).Decode(&updatedUser) + err := common.DecodeJson(c.Request.Body, &updatedUser) if err != nil || updatedUser.Id == 0 { common.ApiErrorI18n(c, i18n.MsgInvalidParams) return @@ -715,8 +737,15 @@ func UpdateUser(c *gin.Context) { return } } - if err := model.InvalidateUserCache(updatedUser.Id); err != nil { - common.SysLog(fmt.Sprintf("failed to invalidate user cache for user %d: %s", updatedUser.Id, err.Error())) + if updatedUser.AuthVersion > originUser.AuthVersion { + if _, err := model.RevokeAllUserSessions(updatedUser.Id, "admin_user_update"); err != nil { + common.ApiError(c, err) + return + } + } + if err := model.PublishUserAuthCache(updatedUser.Id); err != nil { + common.ApiError(c, err) + return } recordManageAuditFor(c, updatedUser.Id, "user.update", map[string]interface{}{ "username": originUser.Username, @@ -872,15 +901,45 @@ func UpdateSelf(c *gin.Context) { common.ApiError(c, err) return } - if err := cleanUser.Update(updatePassword); err != nil { + if updatePassword { + identity, ok := middleware.GetSessionAuthIdentity(c) + if !ok { + common.ApiError(c, errors.New("当前认证方式不支持安全验证")) + return + } + if err := model.DB.Transaction(func(tx *gorm.DB) error { + return cleanUser.UpdateWithTx(tx, true) + }); err != nil { + common.ApiError(c, err) + return + } + if err := model.PublishUserAuthCache(cleanUser.Id); err != nil { + common.ApiError(c, err) + return + } + bundle, err := service.AdvanceCurrentSessionToUserVersion(identity, "password_changed") + if err != nil { + common.ApiError(c, err) + return + } + c.JSON(http.StatusOK, gin.H{ + "success": true, + "message": "", + "data": gin.H{ + "access_token": bundle.AccessToken, + "token_type": bundle.TokenType, + "access_expires_at": bundle.AccessExpiresAt, + "session": bundle.Session, + }, + }) + return + } + if err := cleanUser.Update(false); err != nil { common.ApiError(c, err) return } - c.JSON(http.StatusOK, gin.H{ - "success": true, - "message": "", - }) + c.JSON(http.StatusOK, gin.H{"success": true, "message": ""}) return } @@ -962,7 +1021,7 @@ func DeleteSelf(c *gin.Context) { func CreateUser(c *gin.Context) { var user model.User - err := json.NewDecoder(c.Request.Body).Decode(&user) + err := common.DecodeJson(c.Request.Body, &user) user.Username = strings.TrimSpace(user.Username) if err != nil || user.Username == "" || user.Password == "" { common.ApiErrorI18n(c, i18n.MsgInvalidParams) @@ -1044,7 +1103,7 @@ type ManageRequest struct { // ManageUser Only admin user can do this func ManageUser(c *gin.Context) { var req ManageRequest - err := json.NewDecoder(c.Request.Body).Decode(&req) + err := common.DecodeJson(c.Request.Body, &req) if err != nil { common.ApiErrorI18n(c, i18n.MsgInvalidParams) @@ -1090,6 +1149,16 @@ func ManageUser(c *gin.Context) { if err := model.InvalidateUserTokensCache(user.Id); err != nil { common.SysLog(fmt.Sprintf("failed to invalidate tokens cache for user %d: %s", user.Id, err.Error())) } + recordManageAuditFor(c, user.Id, "user.manage", map[string]interface{}{ + "action": req.Action, + "username": user.Username, + "id": user.Id, + }) + c.JSON(http.StatusOK, gin.H{ + "success": true, + "message": "", + }) + return case "promote": if myRole != common.RoleRootUser { common.ApiErrorI18n(c, i18n.MsgUserAdminCannotPromote) @@ -1155,25 +1224,32 @@ func ManageUser(c *gin.Context) { "message": "", }) return + default: + common.ApiErrorI18n(c, i18n.MsgInvalidParams) + return } - authzTouched := false if req.Action == "demote" { if err := model.DB.Transaction(func(tx *gorm.DB) error { if err := user.UpdateWithTx(tx, false); err != nil { return err } - authzTouched = true return authz.ClearUserAuthorizationInTx(tx, user.Id) }); err != nil { common.ApiError(c, err) return } - if authzTouched { - if err := authz.ReloadPolicy(); err != nil { - common.ApiError(c, err) - return - } + if err := authz.ReloadPolicy(); err != nil { + common.ApiError(c, err) + return + } + if err := model.PublishUserAuthCache(user.Id); err != nil { + common.ApiError(c, err) + return + } + if _, err := model.RevokeAllUserSessions(user.Id, "admin_demote"); err != nil { + common.ApiError(c, err) + return } } else { if err := user.Update(false); err != nil { @@ -1181,17 +1257,12 @@ func ManageUser(c *gin.Context) { return } } - // 禁用 / 角色调整后,强制失效用户缓存与其全部令牌缓存, - // 避免在 Redis TTL 过期前仍使用旧状态(尤其是禁用后仍可发起请求的问题)。 - // InvalidateUserCache 会让下一次 GetUserCache 从数据库重新加载, - // InvalidateUserTokensCache 则确保令牌侧的缓存也同步刷新。 - if req.Action == "disable" || req.Action == "promote" || req.Action == "demote" { - if err := model.InvalidateUserCache(user.Id); err != nil { - common.SysLog(fmt.Sprintf("failed to invalidate user cache for user %d: %s", user.Id, err.Error())) - } - if err := model.InvalidateUserTokensCache(user.Id); err != nil { - common.SysLog(fmt.Sprintf("failed to invalidate tokens cache for user %d: %s", user.Id, err.Error())) - } + // Update/UpdateWithTx has already published the new user hash and revoked + // browser sessions exactly once. Only PAT/relay token caches still need an + // explicit invalidation; deleting the user hash here would discard the + // freshly published auth-version floor. + if err := model.InvalidateUserTokensCache(user.Id); err != nil { + common.SysLog(fmt.Sprintf("failed to invalidate tokens cache for user %d: %s", user.Id, err.Error())) } recordManageAuditFor(c, user.Id, "user.manage", map[string]interface{}{ "action": req.Action, @@ -1228,10 +1299,12 @@ func EmailBind(c *gin.Context) { common.ApiErrorI18n(c, i18n.MsgUserVerificationCodeError) return } - session := sessions.Default(c) - id := session.Get("id") user := model.User{ - Id: id.(int), + Id: c.GetInt("id"), + } + if user.Id == 0 { + c.JSON(http.StatusUnauthorized, gin.H{"success": false, "message": "not authenticated"}) + return } err := user.FillUserById() if err != nil { diff --git a/controller/user_manage_test.go b/controller/user_manage_test.go new file mode 100644 index 0000000000..1b52ece088 --- /dev/null +++ b/controller/user_manage_test.go @@ -0,0 +1,161 @@ +package controller + +import ( + "fmt" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/model" + "github.com/QuantumNous/new-api/service/authz" + + "github.com/gin-gonic/gin" + "github.com/glebarez/sqlite" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +func setupManageUserTestDB(t *testing.T) *gorm.DB { + t.Helper() + previousDB, previousLogDB := model.DB, model.LOG_DB + previousRedisEnabled := common.RedisEnabled + previousMainDatabaseType, previousLogDatabaseType := common.MainDatabaseType(), common.LogDatabaseType() + common.RedisEnabled = false + common.SetDatabaseTypes(common.DatabaseTypeSQLite, common.DatabaseTypeSQLite) + + dsn := fmt.Sprintf("file:%s?mode=memory&cache=shared", strings.ReplaceAll(t.Name(), "/", "_")) + db, err := gorm.Open(sqlite.Open(dsn), &gorm.Config{}) + require.NoError(t, err) + model.DB, model.LOG_DB = db, db + require.NoError(t, db.AutoMigrate( + &model.User{}, &model.UserSession{}, &model.Log{}, &model.CasbinRule{}, &model.AuthzRole{}, + )) + + t.Cleanup(func() { + model.DB, model.LOG_DB = previousDB, previousLogDB + common.RedisEnabled = previousRedisEnabled + common.SetDatabaseTypes(previousMainDatabaseType, previousLogDatabaseType) + sqlDB, err := db.DB() + if err == nil { + _ = sqlDB.Close() + } + }) + return db +} + +func performManageUserRequest(t *testing.T, body string) *httptest.ResponseRecorder { + t.Helper() + gin.SetMode(gin.TestMode) + recorder := httptest.NewRecorder() + c, _ := gin.CreateTestContext(recorder) + c.Request = httptest.NewRequest(http.MethodPost, "/api/user/manage", strings.NewReader(body)) + c.Request.Header.Set("Content-Type", "application/json") + c.Set("id", 9999) + c.Set("role", common.RoleRootUser) + c.Set("username", "root-operator") + ManageUser(c) + return recorder +} + +func TestManageUserDisableAdvancesAuthVersionOnceAndRevokesSession(t *testing.T) { + db := setupManageUserTestDB(t) + now := time.Now().Unix() + user := model.User{ + Username: "managed-disable-user", Password: "password", Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, Group: "default", AuthVersion: 1, + } + require.NoError(t, db.Create(&user).Error) + require.NoError(t, db.Create(&model.UserSession{ + SID: "managed-disable-session", UserID: user.Id, Version: 1, UserAuthVersion: 1, + Status: model.UserSessionStatusActive, RefreshHash: "refresh-hash", LoginMethod: "password", + LastActiveAt: now, ExpiresAt: now + 3600, + }).Error) + + recorder := performManageUserRequest(t, fmt.Sprintf(`{"id":%d,"action":"disable"}`, user.Id)) + assert.Equal(t, http.StatusOK, recorder.Code) + assert.Contains(t, recorder.Body.String(), `"success":true`) + + var updated model.User + require.NoError(t, db.First(&updated, user.Id).Error) + assert.Equal(t, common.UserStatusDisabled, updated.Status) + assert.EqualValues(t, 2, updated.AuthVersion) + var session model.UserSession + require.NoError(t, db.First(&session, "sid = ?", "managed-disable-session").Error) + assert.Equal(t, model.UserSessionStatusRevoked, session.Status) +} + +func TestManageUserDemoteAdvancesAuthVersionAndRevokesSessionsOnce(t *testing.T) { + db := setupManageUserTestDB(t) + previousMaster := common.IsMasterNode + common.IsMasterNode = false + t.Cleanup(func() { common.IsMasterNode = previousMaster }) + require.NoError(t, authz.Init(db)) + + now := time.Now().Unix() + user := model.User{ + Username: "managed-demote-user", Password: "password", Role: common.RoleAdminUser, + Status: common.UserStatusEnabled, Group: "default", AuthVersion: 1, + } + require.NoError(t, db.Create(&user).Error) + for _, sid := range []string{"managed-demote-session-one", "managed-demote-session-two"} { + require.NoError(t, db.Create(&model.UserSession{ + SID: sid, UserID: user.Id, Version: 1, UserAuthVersion: 1, + Status: model.UserSessionStatusActive, RefreshHash: "refresh-" + sid, LoginMethod: "password", + LastActiveAt: now, ExpiresAt: now + 3600, + }).Error) + } + + sessionUpdateCount := 0 + require.NoError(t, db.Callback().Update().Before("gorm:update").Register("test:count_demote_session_updates", func(tx *gorm.DB) { + if tx.Statement != nil && tx.Statement.Table == "user_sessions" { + sessionUpdateCount++ + } + })) + + recorder := performManageUserRequest(t, fmt.Sprintf(`{"id":%d,"action":"demote"}`, user.Id)) + assert.Equal(t, http.StatusOK, recorder.Code) + assert.Contains(t, recorder.Body.String(), `"success":true`) + + var updated model.User + require.NoError(t, db.First(&updated, user.Id).Error) + assert.Equal(t, common.RoleCommonUser, updated.Role) + assert.EqualValues(t, 2, updated.AuthVersion) + var sessions []model.UserSession + require.NoError(t, db.Where("user_id = ?", user.Id).Order("sid asc").Find(&sessions).Error) + require.Len(t, sessions, 2) + for _, session := range sessions { + assert.Equal(t, model.UserSessionStatusRevoked, session.Status) + assert.Equal(t, "admin_demote", session.RevokedReason) + } + assert.Equal(t, 1, sessionUpdateCount) +} + +func TestManageUserDeleteReturnsImmediatelyAndUnknownActionFails(t *testing.T) { + db := setupManageUserTestDB(t) + deleted := model.User{ + Username: "managed-delete-user", Password: "password", Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, Group: "default", AuthVersion: 1, AffCode: "delete-aff", + } + require.NoError(t, db.Create(&deleted).Error) + + recorder := performManageUserRequest(t, fmt.Sprintf(`{"id":%d,"action":"delete"}`, deleted.Id)) + assert.Contains(t, recorder.Body.String(), `"success":true`) + var deletedCount int64 + require.NoError(t, db.Unscoped().Model(&model.User{}).Where("id = ? AND deleted_at IS NOT NULL", deleted.Id).Count(&deletedCount).Error) + assert.EqualValues(t, 1, deletedCount) + + unchanged := model.User{ + Username: "managed-unknown-user", Password: "password", Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, Group: "default", AuthVersion: 1, AffCode: "unknown-aff", + } + require.NoError(t, db.Create(&unchanged).Error) + recorder = performManageUserRequest(t, fmt.Sprintf(`{"id":%d,"action":"unknown"}`, unchanged.Id)) + assert.Contains(t, recorder.Body.String(), `"success":false`) + require.NoError(t, db.First(&unchanged, unchanged.Id).Error) + assert.EqualValues(t, 1, unchanged.AuthVersion) + assert.Equal(t, common.UserStatusEnabled, unchanged.Status) +} diff --git a/controller/wechat.go b/controller/wechat.go index 8889daca77..dd185735e2 100644 --- a/controller/wechat.go +++ b/controller/wechat.go @@ -1,7 +1,6 @@ package controller import ( - "encoding/json" "errors" "fmt" "net/http" @@ -12,7 +11,6 @@ import ( "github.com/QuantumNous/new-api/common" "github.com/QuantumNous/new-api/model" - "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" ) @@ -40,7 +38,7 @@ func getWeChatIdByCode(code string) (string, error) { } defer httpResponse.Body.Close() var res wechatLoginResponse - err = json.NewDecoder(httpResponse.Body).Decode(&res) + err = common.DecodeJson(httpResponse.Body, &res) if err != nil { return "", err } @@ -158,10 +156,12 @@ func WeChatBind(c *gin.Context) { }) return } - session := sessions.Default(c) - id := session.Get("id") user := model.User{ - Id: id.(int), + Id: c.GetInt("id"), + } + if user.Id == 0 { + c.JSON(http.StatusUnauthorized, gin.H{"success": false, "message": "未登录"}) + return } err = user.FillUserById() if err != nil { diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index f98f4b0d8d..6438b0c455 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -2,8 +2,8 @@ # # Usage: # 1. docker compose -f docker-compose.dev.yml up -d -# 2. cd web && bun install && bun run dev -# 3. Open http://localhost:3001 (Rsbuild dev server, API auto-proxied to :3000) +# 2. make dev-web +# 3. Open http://localhost:5173 (Rsbuild dev server, API auto-proxied to :3000) # # Rebuild backend after Go code changes: # docker compose -f docker-compose.dev.yml up -d --build new-api @@ -31,7 +31,9 @@ services: - REDIS_CONN_STRING=redis://redis - TZ=Asia/Shanghai - BATCH_UPDATE_ENABLED=true - # Enable only when accessing the dev backend through HTTPS. SESSION_COOKIE_TRUSTED_URL is required when true. + # Local HTTP dev mode: keep Secure=false and leave TRUSTED_URL unset. This disables the refresh/logout OriginGuard so the :5173 -> :3000 dev proxy works. + - SESSION_COOKIE_SECURE=false + # For HTTPS only: set Secure=true and list every exact trusted HTTPS browser Origin. This does not configure relay CORS. # - SESSION_COOKIE_SECURE=true # - SESSION_COOKIE_TRUSTED_URL=https://example.com,https://admin.example.com depends_on: diff --git a/docker-compose.yml b/docker-compose.yml index f5881f4a24..8e6fe4b57b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,8 +39,14 @@ services: # - STREAMING_TIMEOUT=300 # 流模式无响应超时时间,单位秒,默认120秒,如果出现空补全可以尝试改为更大值 (Streaming timeout in seconds, default is 120s. Increase if experiencing empty completions) # - RELAY_IDLE_CONN_TIMEOUT=90 # Relay HTTP 客户端空闲连接超时时间,单位秒,默认跟随 Go 标准库,设置为0表示不限制 (Relay HTTP client idle keep-alive timeout in seconds, defaults to Go standard library; set 0 to disable) # - SESSION_SECRET=random_string # 多机部署时设置,必须修改这个随机字符串!! (multi-node deployment, set this to a random string!!!!!!!) -# - SESSION_COOKIE_SECURE=true # 启用 Secure session cookie,必须同时配置 SESSION_COOKIE_TRUSTED_URL (Enable Secure session cookies; requires SESSION_COOKIE_TRUSTED_URL) -# - SESSION_COOKIE_TRUSTED_URL=https://example.com,https://admin.example.com # 可信 HTTPS 入口地址,多个用英文逗号分隔 (Trusted HTTPS entry URLs, comma-separated) +# - SESSION_COOKIE_SECURE=true # true:启用 Secure Refresh Cookie 和严格 refresh/logout OriginGuard;false/未配置:关闭 OriginGuard,仅用于本地 HTTP (true: Secure cookie + strict refresh/logout OriginGuard; false/unset: guard disabled for local HTTP only) +# - SESSION_COOKIE_TRUSTED_URL=https://example.com,https://admin.example.com # Secure=true 时必填的精确 HTTPS Origin;不是 relay CORS 白名单,不支持通配符/路径 (Required exact HTTPS origins when Secure=true; not a relay CORS allowlist, no wildcard/path) +# - TRUSTED_PROXIES=172.20.0.0/16 # 未配置时信任回环/RFC1918/fc00::/7 并告警,none 为严格模式,显式列表替代默认值 (Unset trusts loopback/RFC 1918/fc00::/7 with a warning; none trusts no proxies; an explicit list replaces defaults) +# - USER_SESSION_ACTIVE_LIMIT=50 +# - USER_SESSION_ISSUANCE_LIMIT=100 +# - USER_SESSION_ISSUANCE_WINDOW_SECONDS=86400 # 不得大于 revoked 保留期 (must not exceed revoked retention) +# - USER_SESSION_REVOKED_RETENTION_DAYS=7 +# - USER_SESSION_HOURLY_ALERT_THRESHOLD=5000 # 仅告警,不做全局拒绝 (alert only; never globally rejects login) # - SYNC_FREQUENCY=60 # Uncomment if regular database syncing is needed # - GOOGLE_ANALYTICS_ID=G-XXXXXXXXXX # Google Analytics 的测量 ID (Google Analytics Measurement ID) # - UMAMI_WEBSITE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx # Umami 网站 ID (Umami Website ID) diff --git a/docs/authentication.md b/docs/authentication.md new file mode 100644 index 0000000000..b7b5f870ee --- /dev/null +++ b/docs/authentication.md @@ -0,0 +1,173 @@ +# 用户鉴权与登录会话 + +面板鉴权采用短期 Access Token、HttpOnly Refresh Cookie 与服务端登录会话控制面的组合。面板请求不再依赖 Gin session,也不再要求 `New-Api-User` 请求头。 + +## 鉴权模型 + +- Access Token 是有效期 15 分钟的 JWT,只保存在浏览器内存中,通过 `Authorization: Bearer ` 发送。 +- Refresh Token 是随机不透明值,有效期最长 30 天。浏览器只通过 `HttpOnly`、`SameSite=Strict` Cookie 持有它;服务端仅保存 HMAC 摘要,并在每次刷新时轮换。 +- `user_sessions` 是登录会话控制面,记录设备、IP、登录方式、最后活跃时间、到期时间和撤销状态。数据库中的 Session 状态是最终权威;撤销传播速度取决于下文所述的 Redis 拓扑。 +- 用户的密码、状态、角色或安全因子发生安全相关变化时,`auth_version` 会递增并使旧登录会话失效。订阅带来的分组升降级只刷新授权缓存,不会退出任何登录设备。 +- Redis 缓存保存用户鉴权快照和登录会话快照。版本栅栏和撤销 tombstone 防止旧缓存重新授权;Session 快照使用跟随 `SYNC_FREQUENCY` 的短 TTL,缓存未命中或未启用 Redis 时回退到数据库校验。 + +`SESSION_SECRET` 用于派生 Access Token、Security Proof、Refresh Token 摘要和 AuthFlow 摘要的不同用途密钥。生产环境及多节点部署必须在所有节点配置相同的高强度随机值;更换该值会使现有登录、临时鉴权流程和 Security Proof 全部失效。 + +## 多节点 Redis 拓扑 + +多节点部署必须共用同一主数据库。登录 Session、账户级活跃 Session 上限和签发窗口计数都以数据库为权威,因此这些限制在应用节点间全局生效。Redis 中的 Session Hash(包含 `revoking`/`revoked` tombstone)只是缓存,其 TTL 为 Session 剩余寿命与有效 `SYNC_FREQUENCY` 中的较小值;`SYNC_FREQUENCY` 默认及非法值回退均为 `60` 秒。读取缓存不会续期,过期后会按 SID 回源数据库。延迟完成的 active 缓存回写只能使用其数据库观察窗口尚未消耗的 TTL,不能在撤销 tombstone 到期后重新启动一个完整缓存周期。 + +| Redis 部署方式 | Session 状态传播 | 限流语义 | +| --- | --- | --- | +| 所有节点共享 Redis | 正常撤销和版本发布通过同一缓存即时传播 | Redis 限流额度在所有节点间共享 | +| 每个节点使用独立 Redis | 最迟在该节点 Session 缓存 TTL 到期后回源收敛,即不超过有效 `SYNC_FREQUENCY`;版本轮换期间,新 Token 在持有旧缓存的节点上可能短暂返回 401 | 每个节点独立计数,集群总额度最坏约为单节点阈值乘以节点数 | +| 不使用 Redis | 每次 Session 校验直接读取数据库 | 使用各节点的内存限流器,额度同样按节点独立 | + +`SYNC_FREQUENCY` 越大,独立 Redis 部署的陈旧窗口越长;值越小,每个活跃 SID 在每个节点上回源数据库的频率越高。默认配置下,持续活跃的 Session 每个节点最多约每 60 秒增加一次数据库主键点查。共享 Redis 时,撤销 tombstone 和版本发布仍保持即时传播。 + +所有节点必须使用相同的 `SESSION_SECRET`。当多个节点连接同一个 Redis 时,还必须使用相同的 `CRYPTO_SECRET`,否则节点生成的缓存键摘要不一致,无法正确共享缓存。上述保证只覆盖登录 Session 鉴权的有界陈旧语义;限流额度及其他 Redis 缓存仍会受到 Redis 拓扑影响,不能据此认为整个控制面与拓扑无关。 + +## 浏览器接口 + +登录成功后,密码登录、2FA、Passkey、OAuth、WeChat 和 Telegram 登录均返回统一数据: + +```json +{ + "success": true, + "data": { + "access_token": "...", + "token_type": "Bearer", + "access_expires_at": 1730000000, + "user": {}, + "session": { + "sid": "...", + "current": true, + "login_method": "password", + "ip": "...", + "user_agent": "...", + "created_at": 1730000000, + "last_active_at": 1730000000, + "expires_at": 1732592000 + } + } +} +``` + +会话相关接口: + +| 接口 | 鉴权 | 用途 | +| --- | --- | --- | +| `POST /api/user/auth/refresh` | Refresh Cookie;Secure 模式附加 Origin 校验 | 轮换 Refresh Token 并签发新的 Access Token | +| `POST /api/user/auth/logout` | Refresh Cookie;Secure 模式附加 Origin 校验,可同时携带 Bearer | 撤销当前登录会话并清除 Cookie | +| `GET /api/user/sessions` | Bearer | 查看当前鉴权版本的有效登录会话,当前会话优先,最多 100 条 | +| `DELETE /api/user/sessions/:sid` | Bearer | 撤销指定登录会话,包括当前会话 | +| `POST /api/user/sessions/revoke-others` | Bearer | 保留当前会话并撤销其他会话 | + +客户端内存中已有会话时,应在 refresh/logout 请求中发送 `X-Auth-Session: `。Refresh Cookie 与该 SID 不一致时,两个端点都返回 `409 AUTH_SESSION_MISMATCH`,且不会轮换、撤销或清除任何会话;客户端先通过 refresh 清除本标签页的旧 SID、恢复 Cookie 当前对应的会话,再重试 logout。冷启动尚无内存会话时可以省略该请求头。 + +并发使用同一个 Refresh Token 时,服务端通过确定性轮换恢复同一个后继 Token,多个浏览器标签页不会因丢失“胜者”响应而被迫退出。最近一代 Refresh Token 在短暂容错窗口结束后再次出现会撤销对应会话;无法识别的更早代或随机 Token 只会被拒绝,不会允许攻击者凭猜测踢掉会话。 + +前端使用 Web Locks 串行化同一浏览器配置文件中的刷新,并通过 BroadcastChannel(不支持时回退到 `storage` 事件)仅同步会话标识和登录/退出事件;Access Token 与 Refresh Token 都不会通过跨标签页消息传递或持久化到 Web Storage。 + +前端将冷启动状态与登录状态分开管理。网络或服务端临时故障允许后续导航重试 refresh;服务端确认 Refresh Cookie 无效时才进入已完成的匿名状态。内存 SID 与 Cookie SID 不一致时,客户端清除旧内存身份并在不携带旧 SID 的情况下重试一次。 + +## Session 签发限额与保留策略 + +服务端在所有登录方式的统一 Session 签发出口执行两级账户限制: + +- `USER_SESSION_ACTIVE_LIMIT`(默认 `50`):单用户未过期且状态为 active 的 Session 上限。达到上限时新登录返回 `409 AUTH_SESSION_LIMIT`。 +- `USER_SESSION_ISSUANCE_LIMIT`(默认 `100`)和 `USER_SESSION_ISSUANCE_WINDOW_SECONDS`(默认 `86400`):统计窗口内该用户创建的所有 Session,包含已撤销和旧鉴权版本的记录。达到上限时返回 `429 AUTH_SESSION_ISSUANCE_LIMIT`。 +- 这两次计数与插入不加跨数据库锁;极端并发登录可能出现少量超额,但计数失败会拒绝签发,不会降级放行。 + +升级时已经超过活跃上限的账户不会被自动下线或挤掉旧会话;限制只作用于后续的新 Session 签发。 + +`USER_SESSION_REVOKED_RETENTION_DAYS`(默认 `7`)控制 revoked 行的审计保留期。签发计数依赖窗口内的行仍存在,因此签发窗口不得超过 revoked 保留期。如果配置超出,启动时会记录告警并将实际窗口钳制到保留期,避免提前删除 revoked 行导致限流计数被低估。 + +定时清理即使发现 `expires_at` 已过期,也不会删除 `created_at` 仍落在实际签发窗口内的行;尚未达到 revoked 保留期的撤销记录同样会继续保留。这样在扩大配置窗口时,过期清理不会静默削弱签发计数或审计保留。 + +活跃数量会计入状态仍为 active 但 `user_auth_version` 已过期的异常残留行,而设备列表只展示当前鉴权版本。因此遇到 `AUTH_SESSION_LIMIT` 时,应优先在仍已登录的设备上执行“撤销其他会话”,该操作会同时清理不可见的旧版本 active 行;没有可用设备时可使用密码重置撤销所有会话。密码重置不会清空签发窗口计数。 + +仅 master 节点每小时分批删除过期 Session 和超过保留期的 revoked Session。`USER_SESSION_HOURLY_ALERT_THRESHOLD`(默认 `5000`)只在最近一小时全局签发量异常时记录告警,不会形成可被滥用的全站登录拒绝开关。 + +## Refresh/Logout 的 Origin 校验 + +refresh/logout 的 Origin 防护与 Refresh Cookie 的 Secure 模式绑定: + +- 未配置 `SESSION_COOKIE_SECURE` 或显式设为 `false` 时,Refresh Cookie 可用于本地 HTTP,refresh/logout 的 OriginGuard 关闭,并且不得配置 `SESSION_COOKIE_TRUSTED_URL`。这使 `http://localhost` 上不同端口的 Rsbuild/Vite 开发代理可以正常转发请求。该模式仅用于可信的本地开发环境,不应暴露到公网。 +- `SESSION_COOKIE_SECURE=true` 时,Refresh Cookie 仅通过 HTTPS 发送,同时启用严格 OriginGuard。`POST /api/user/auth/refresh` 和 `POST /api/user/auth/logout` 会校验浏览器的 `Origin`;缺少 `Origin` 时只接受合法的单一 `Referer` 作为回退。允许来源包括请求自身的精确 Origin,以及 `SESSION_COOKIE_TRUSTED_URL` 中配置的精确 Origin。 + +Secure 模式的 Origin 校验不信任客户端直接发送的 `X-Forwarded-Proto`。TLS 在反向代理终止时,应将面板的公开 HTTPS Origin 明确写入 `SESSION_COOKIE_TRUSTED_URL`。 + +`SESSION_COOKIE_TRUSTED_URL` 现在具有明确的新语义:它是 refresh/logout Cookie 端点的可信 Origin 列表,不是 CORS 白名单。配置规则如下: + +- 仅在 `SESSION_COOKIE_SECURE=true` 时配置;多个值用英文逗号分隔。 +- 每项必须是精确的 HTTPS Origin,例如 `https://panel.example.com` 或 `https://panel.example.com:8443`。 +- 不接受通配符、路径、查询参数、用户信息或域名后缀匹配。 +- 不会修改 relay、旧 billing dashboard、`/api/usage/token` 或 `/api/log/token` 的 CORS 行为。浏览器使用 `sk-` key 直连 relay 的场景保持不变。 + +本地 HTTP 开发示例(OriginGuard 关闭): + +```env +SESSION_SECRET= +SESSION_COOKIE_SECURE=false +# SESSION_COOKIE_TRUSTED_URL 不得设置 +``` + +生产 HTTPS 示例(OriginGuard 开启): + +```env +SESSION_SECRET= +SESSION_COOKIE_SECURE=true +SESSION_COOKIE_TRUSTED_URL=https://panel.example.com,https://admin.example.com +``` + +该开关只控制面板 Refresh Cookie 和 refresh/logout 的 OriginGuard,不会修改 relay、旧 billing dashboard、`/api/usage/token` 或 `/api/log/token` 的 CORS 行为。 + +## 可信代理与 IP 限流 + +Gin 默认会信任所有代理提供的客户端 IP 请求头。本项目改为兼顾常见反代拓扑和公网直连安全的三态配置: + +- 未配置、空字符串或纯空白的 `TRUSTED_PROXIES` 默认信任 `127.0.0.0/8`、`::1`、`10.0.0.0/8`、`172.16.0.0/12`、`192.168.0.0/16` 和 `fc00::/7`,并输出启动告警。该默认值覆盖同机 Nginx、Docker Compose 和常见内网反代;公网直连地址不在列表中,其伪造的 `X-Forwarded-For` 会被忽略。 +- `TRUSTED_PROXIES=none`(大小写不敏感且必须单独使用)启用严格直连模式,不信任任何代理,`ClientIP()` 只使用 TCP 直连地址。 +- 其他非空值按英文逗号解析为代理 IP/CIDR,并完全替代默认列表。应填写反向代理自身的地址而不是客户端网段;非法 CIDR、空列表或将 `none` 与其他值混用都会阻止服务启动。 + +Gin 只在请求的直连来源属于可信代理时解析客户端 IP 请求头,并从转发链右侧向左寻找首个非可信地址。因此常见 Nginx `$proxy_add_x_forwarded_for` 链中的公网客户端地址会阻止更左侧的伪造前缀生效。默认信任私网的残余风险是:能够从同一私网直接访问应用的其他机器或容器仍可伪造这些请求头;需要消除此风险时应使用 `none` 或配置精确代理地址。 + +Redis 限流使用原子 Lua 固定窗口,替代旧的近似滑动窗口 List 实现。这是有意的语义变化:窗口边界两侧可分别打满一次,极短时间内通过量最高约为配置值的两倍。例如 `20 次/20 分钟` 在边界可通过约 40 次。帐户级 Session 上限和签发窗口继续控制数据库增长;如未来需要严格抑制边界突发,需单独迁移为 ZSET 滑动窗口。 + +用户级模型成功请求限流仍使用原有 Redis List 近似滑动窗口,但列表时间戳统一写为 UTC。滚动升级期间,旧节点写入的本地时间字符串和新节点写入的 UTC 字符串无法从格式上区分,可能在一个模型限流窗口内临时误放行或误拒绝。所有节点升级完成并经过一个完整窗口后会自然收敛;本次升级不会切换 Key 或主动删除现有列表。 + +开放注册仍会受 Critical IP 限流保护,但分布式 IP 多账号攻击不能仅靠 IP 限流阻止。公网开放注册的部署应同时启用 Turnstile 和邮箱验证;更强的设备或多维风控需作为独立安全项目设计。 + +## PAT 调用契约 + +`User.AccessToken`(面板 PAT)继续支持 `Authorization: Bearer `,也兼容原有的单值 `Authorization: `。`New-Api-User` 不再参与鉴权,外部脚本不需要再发送 Bearer 与用户 ID 双请求头。这是有意的调用契约简化;旧 PAT 本身无需重新生成。 + +PAT 不是浏览器登录会话,不能调用登录会话管理接口,也不能签发绑定具体登录会话的 Security Proof。 + +## 临时鉴权流程与二次验证 + +OAuth state、2FA pending、Passkey ceremony、Telegram bind 等临时状态存放在 `auth_flows`。客户端只持有随机 `flow_token`,数据库仅保存 HMAC 摘要;流程具有用途、provider、intent、用户和登录会话绑定,并且只能原子消费一次。OAuth 注册的 affiliate code 也随登录 AuthFlow 保存。 + +标准 OAuth 绑定回调由 popup 通过同源 `postMessage` 交给 opener;只有 opener 使用自身内存中的 Bearer 调用后端绑定接口。Telegram 绑定先由已登录前端创建绑定 AuthFlow,再让 widget 回调携带路径中的 `flow_token`,回调时会重新确认原登录会话仍有效。Telegram 的已签名 widget assertion 也会登记为一次性凭据,重复回放会被拒绝。 + +敏感操作使用有效期 5 分钟的 `X-Security-Proof`: + +- `channel.key.read`:查看渠道密钥; +- `passkey.register`:注册 Passkey; +- `passkey.delete`:删除 Passkey。 + +Proof 同时绑定用户、登录会话、用户鉴权版本、会话版本和 scope,不能跨用户、跨会话或跨用途复用。 + +启用了 2FA 的用户注册 Passkey 时,register begin 与 finish 都必须携带有效的 `passkey.register` Proof;finish 会在消费一次性 AuthFlow 之前重新验证 Proof。未启用 2FA 的首次 Passkey 注册不要求该请求头。 + +## 升级注意事项 + +- 旧 `session` Cookie 不再使用;升级后现有面板登录会失效,用户需要重新登录。 +- 数据库迁移会新增 `user_sessions`、`auth_flows`、`external_identity_claims` 和 `users.auth_version`,并为已有用户初始化鉴权版本、回填 Telegram 账号唯一归属;若历史数据中同一 Telegram ID 已绑定多个用户,迁移会拒绝继续启动,需先消除歧义。 +- 数据库迁移会为 Session 签发计数和分批清理新增索引;已有 `user_sessions` 很大时应为首次启动预留维护窗口。 +- `user_sessions.previous_refresh_hash` 会从定长 `char(64)` 迁移为 `varchar(64)`。应用会兼容读取历史定长字段留下的空格填充;迁移后的目标结构必须保持幂等,连续启动不应反复执行列类型变更。 +- 仅 master 节点定时清理过期登录会话、超过配置保留期的 revoked 会话和已过保留期的 AuthFlow。 +- 未配置 `TRUSTED_PROXIES` 时会兼容信任回环和常见私网代理;使用公网负载均衡器、`100.64.0.0/10`、链路本地地址或自定义 CNI 网段的部署仍需显式配置。需要严格忽略所有转发头时设置为 `none`。 +- Redis 限流从近似滑动窗口改为原子固定窗口,存在明确的边界双倍突发语义。 +- 用户级模型成功请求限流的 UTC 时间戳在滚动升级期间存在一个窗口的混合格式过渡,期间可能临时误放行或误拒绝。 +- 自建客户端应按新的 AuthBundle、`flow_token` 和 Security Proof 契约升级;PAT 客户端可直接移除 `New-Api-User`。 diff --git a/docs/openapi/api.json b/docs/openapi/api.json index 493c61e489..8f5bc89e9b 100644 --- a/docs/openapi/api.json +++ b/docs/openapi/api.json @@ -569,7 +569,7 @@ "post": { "summary": "用户登录", "deprecated": false, - "description": "🔓 无需鉴权", + "description": "🔓 无需鉴权。签发新登录 Session 时可能返回 409 AUTH_SESSION_LIMIT 或 429 AUTH_SESSION_ISSUANCE_LIMIT。", "tags": [ "用户登陆注册" ], @@ -595,6 +595,26 @@ "200": { "description": "成功", "headers": {} + }, + "409": { + "description": "该用户的活跃登录 Session 已达上限", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthSessionIssuanceError" + } + } + } + }, + "429": { + "description": "该用户在统计窗口内创建的 Session 已达上限", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthSessionIssuanceError" + } + } + } } }, "security": [ @@ -611,7 +631,7 @@ "post": { "summary": "两步验证登录", "deprecated": false, - "description": "🔓 无需鉴权(登录流程)", + "description": "🔓 无需鉴权(登录流程)。签发新登录 Session 时可能返回 409 AUTH_SESSION_LIMIT 或 429 AUTH_SESSION_ISSUANCE_LIMIT。", "tags": [ "用户登陆注册" ], @@ -624,6 +644,10 @@ "properties": { "code": { "type": "string" + }, + "flow_token": { + "type": "string", + "description": "密码校验成功后返回的一次性 2FA 登录流程令牌" } } } @@ -634,6 +658,26 @@ "200": { "description": "成功", "headers": {} + }, + "409": { + "description": "该用户的活跃登录 Session 已达上限", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthSessionIssuanceError" + } + } + } + }, + "429": { + "description": "该用户在统计窗口内创建的 Session 已达上限", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthSessionIssuanceError" + } + } + } } }, "security": [ @@ -646,11 +690,125 @@ ] } }, - "/api/user/logout": { - "get": { - "summary": "用户登出", + "/api/user/auth/refresh": { + "post": { + "summary": "刷新面板登录", "deprecated": false, - "description": "🔓 无需鉴权", + "description": "使用 HttpOnly Refresh Cookie 轮换刷新令牌并返回新的 AuthBundle;SESSION_COOKIE_SECURE=true 时要求同源或可信 Origin,false/未配置时保持本地 HTTP 兼容模式。已有内存会话时通过 X-Auth-Session 绑定预期 SID,Cookie 不匹配返回 409 AUTH_SESSION_MISMATCH 且不修改 Cookie。", + "tags": [ + "用户登陆注册" + ], + "parameters": [ + { + "name": "X-Auth-Session", + "in": "header", + "description": "可选的预期登录会话 SID;冷启动时可省略", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "成功", + "headers": {} + }, + "409": { + "description": "X-Auth-Session 与 Refresh Cookie 的 SID 不一致;不修改 Cookie 或会话", + "headers": {} + } + }, + "security": [] + } + }, + "/api/user/auth/logout": { + "post": { + "summary": "撤销当前登录会话", + "deprecated": false, + "description": "撤销明确的 Bearer/X-Auth-Session 会话;仅当 HttpOnly Refresh Cookie 属于同一 SID 时才撤销并清除 Cookie,避免跨标签页误踢其他账号。SESSION_COOKIE_SECURE=true 时要求同源或可信 Origin,false/未配置时保持本地 HTTP 兼容模式。", + "tags": [ + "用户登陆注册" + ], + "parameters": [ + { + "name": "X-Auth-Session", + "in": "header", + "description": "可选的预期登录会话 SID", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "成功", + "headers": {} + } + }, + "security": [] + } + }, + "/api/user/sessions": { + "get": { + "summary": "查看登录会话", + "deprecated": false, + "description": "🔐 需要面板 Access Token;PAT 不能管理浏览器登录会话。只返回当前 user_auth_version 的有效会话,当前会话优先,最多 100 条。", + "tags": [ + "用户登陆注册" + ], + "parameters": [], + "responses": { + "200": { + "description": "返回当前鉴权版本的有效登录会话", + "headers": {} + } + }, + "security": [ + { + "AccessToken1": [] + } + ] + } + }, + "/api/user/sessions/{sid}": { + "delete": { + "summary": "撤销指定登录会话", + "deprecated": false, + "description": "🔐 需要面板 Access Token,可撤销当前会话", + "tags": [ + "用户登陆注册" + ], + "parameters": [ + { + "name": "sid", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "成功", + "headers": {} + } + }, + "security": [ + { + "AccessToken1": [] + } + ] + } + }, + "/api/user/sessions/revoke-others": { + "post": { + "summary": "撤销其他登录会话", + "deprecated": false, + "description": "🔐 保留当前登录会话并撤销该用户的其他会话,包含列表不可见的旧 user_auth_version active 残留行", "tags": [ "用户登陆注册" ], @@ -663,10 +821,7 @@ }, "security": [ { - "Combination343": [] - }, - { - "Combination1243": [] + "AccessToken1": [] } ] } @@ -725,7 +880,7 @@ "post": { "summary": "完成Passkey登录", "deprecated": false, - "description": "🔓 无需鉴权", + "description": "🔓 无需鉴权。签发新登录 Session 时可能返回 409 AUTH_SESSION_LIMIT 或 429 AUTH_SESSION_ISSUANCE_LIMIT。", "tags": [ "用户登陆注册" ], @@ -734,6 +889,26 @@ "200": { "description": "成功", "headers": {} + }, + "409": { + "description": "该用户的活跃登录 Session 已达上限", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthSessionIssuanceError" + } + } + } + }, + "429": { + "description": "该用户在统计窗口内创建的 Session 已达上限", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthSessionIssuanceError" + } + } + } } }, "security": [ @@ -750,7 +925,7 @@ "get": { "summary": "GitHub OAuth登录", "deprecated": false, - "description": "🔓 无需鉴权(OAuth回调)", + "description": "🔓 无需鉴权(OAuth 回调)。创建本地登录 Session 时同样受 AUTH_SESSION_LIMIT 和 AUTH_SESSION_ISSUANCE_LIMIT 约束。", "tags": [ "OAuth" ], @@ -769,6 +944,12 @@ "200": { "description": "成功", "headers": {} + }, + "409": { + "$ref": "#/components/responses/AuthSessionLimit" + }, + "429": { + "$ref": "#/components/responses/AuthSessionIssuanceLimit" } }, "security": [ @@ -785,7 +966,7 @@ "get": { "summary": "Discord OAuth登录", "deprecated": false, - "description": "🔓 无需鉴权(OAuth回调)", + "description": "🔓 无需鉴权(OAuth 回调)。创建本地登录 Session 时同样受 AUTH_SESSION_LIMIT 和 AUTH_SESSION_ISSUANCE_LIMIT 约束。", "tags": [ "OAuth" ], @@ -804,6 +985,12 @@ "200": { "description": "成功", "headers": {} + }, + "409": { + "$ref": "#/components/responses/AuthSessionLimit" + }, + "429": { + "$ref": "#/components/responses/AuthSessionIssuanceLimit" } }, "security": [ @@ -820,7 +1007,7 @@ "get": { "summary": "OIDC登录", "deprecated": false, - "description": "🔓 无需鉴权(OAuth回调)", + "description": "🔓 无需鉴权(OAuth 回调)。创建本地登录 Session 时同样受 AUTH_SESSION_LIMIT 和 AUTH_SESSION_ISSUANCE_LIMIT 约束。", "tags": [ "OAuth" ], @@ -829,6 +1016,12 @@ "200": { "description": "成功", "headers": {} + }, + "409": { + "$ref": "#/components/responses/AuthSessionLimit" + }, + "429": { + "$ref": "#/components/responses/AuthSessionIssuanceLimit" } }, "security": [ @@ -845,7 +1038,7 @@ "get": { "summary": "LinuxDO OAuth登录", "deprecated": false, - "description": "🔓 无需鉴权(OAuth回调)", + "description": "🔓 无需鉴权(OAuth 回调)。创建本地登录 Session 时同样受 AUTH_SESSION_LIMIT 和 AUTH_SESSION_ISSUANCE_LIMIT 约束。", "tags": [ "OAuth" ], @@ -854,6 +1047,12 @@ "200": { "description": "成功", "headers": {} + }, + "409": { + "$ref": "#/components/responses/AuthSessionLimit" + }, + "429": { + "$ref": "#/components/responses/AuthSessionIssuanceLimit" } }, "security": [ @@ -867,14 +1066,44 @@ } }, "/api/oauth/state": { - "get": { + "post": { "summary": "生成OAuth State", "deprecated": false, - "description": "🔓 无需鉴权", + "description": "创建一次性 OAuth AuthFlow。login 无需鉴权;bind 需要面板 Access Token 并绑定当前登录会话", "tags": [ "OAuth" ], "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "provider", + "intent" + ], + "properties": { + "provider": { + "type": "string" + }, + "intent": { + "type": "string", + "enum": [ + "login", + "bind" + ] + }, + "aff": { + "type": "string", + "description": "仅 login intent 可用的 affiliate code" + } + } + } + } + } + }, "responses": { "200": { "description": "成功", @@ -895,7 +1124,7 @@ "get": { "summary": "微信OAuth登录", "deprecated": false, - "description": "🔓 无需鉴权(OAuth回调)", + "description": "🔓 无需鉴权(OAuth 回调)。创建本地登录 Session 时同样受 AUTH_SESSION_LIMIT 和 AUTH_SESSION_ISSUANCE_LIMIT 约束。", "tags": [ "OAuth" ], @@ -904,6 +1133,12 @@ "200": { "description": "成功", "headers": {} + }, + "409": { + "$ref": "#/components/responses/AuthSessionLimit" + }, + "429": { + "$ref": "#/components/responses/AuthSessionIssuanceLimit" } }, "security": [ @@ -917,14 +1152,32 @@ } }, "/api/oauth/wechat/bind": { - "get": { + "post": { "summary": "绑定微信", "deprecated": false, - "description": "🔓 无需鉴权", + "description": "🔐 需要面板 Access Token", "tags": [ "OAuth" ], "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string" + } + } + } + } + } + }, "responses": { "200": { "description": "成功", @@ -933,42 +1186,43 @@ }, "security": [ { - "Combination343": [] - }, - { - "Combination1243": [] + "AccessToken1": [] } ] } }, "/api/oauth/email/bind": { - "get": { + "post": { "summary": "绑定邮箱", "deprecated": false, - "description": "🔓 无需鉴权", + "description": "🔐 需要面板 Access Token", "tags": [ "OAuth" ], - "parameters": [ - { - "name": "email", - "in": "query", - "description": "", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "code", - "in": "query", - "description": "", - "required": false, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "email", + "code" + ], + "properties": { + "email": { + "type": "string", + "format": "email" + }, + "code": { + "type": "string" + } + } + } } } - ], + }, "responses": { "200": { "description": "成功", @@ -977,10 +1231,7 @@ }, "security": [ { - "Combination343": [] - }, - { - "Combination1243": [] + "AccessToken1": [] } ] } @@ -989,7 +1240,7 @@ "get": { "summary": "Telegram登录", "deprecated": false, - "description": "🔓 无需鉴权(OAuth回调)", + "description": "🔓 无需鉴权(OAuth 回调)。创建本地登录 Session 时同样受 AUTH_SESSION_LIMIT 和 AUTH_SESSION_ISSUANCE_LIMIT 约束。", "tags": [ "OAuth" ], @@ -998,6 +1249,12 @@ "200": { "description": "成功", "headers": {} + }, + "409": { + "$ref": "#/components/responses/AuthSessionLimit" + }, + "429": { + "$ref": "#/components/responses/AuthSessionIssuanceLimit" } }, "security": [ @@ -1010,11 +1267,11 @@ ] } }, - "/api/oauth/telegram/bind": { - "get": { - "summary": "绑定Telegram", + "/api/oauth/telegram/bind/start": { + "post": { + "summary": "创建 Telegram 绑定流程", "deprecated": false, - "description": "🔓 无需鉴权", + "description": "🔐 需要面板 Access Token;返回绑定 widget 使用的一次性 flow_token 与 callback_url", "tags": [ "OAuth" ], @@ -1027,14 +1284,38 @@ }, "security": [ { - "Combination343": [] - }, - { - "Combination1243": [] + "AccessToken1": [] } ] } }, + "/api/oauth/telegram/bind/{flow_token}": { + "get": { + "summary": "完成 Telegram 绑定", + "deprecated": false, + "description": "Telegram widget 回调;通过一次性 flow_token 关联并重新校验创建该流程的登录会话。始终以 302 回到 /oauth/telegram:成功携带 telegram_bind=success,失败携带 telegram_bind=error、flow_token 和稳定 error_code(TELEGRAM_BIND_DISABLED、TELEGRAM_BIND_INVALID_REQUEST、TELEGRAM_BIND_FLOW_INVALID、TELEGRAM_BIND_SESSION_INVALID、TELEGRAM_BIND_ALREADY_BOUND、TELEGRAM_BIND_USER_DELETED、TELEGRAM_BIND_USER_DISABLED 或 TELEGRAM_BIND_INTERNAL_ERROR),不会透传底层错误文案。", + "tags": [ + "OAuth" + ], + "parameters": [ + { + "name": "flow_token", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "302": { + "description": "重定向到 /oauth/telegram 的绑定结果回调", + "headers": {} + } + }, + "security": [] + } + }, "/api/user/self/groups": { "get": { "summary": "获取当前用户分组", @@ -3900,18 +4181,30 @@ "Combination1243": [] } ] - }, - "delete": { - "summary": "删除历史日志", + } + }, + "/api/system-task/log-cleanup": { + "post": { + "summary": "创建日志清理任务", "deprecated": false, - "description": "👨‍💼 需要管理员权限(Admin)", + "description": "👑 需要超级管理员权限(Root)。使用 target_timestamp 指定需清理的历史日志边界,并返回异步系统任务。", "tags": [ "日志" ], - "parameters": [], + "parameters": [ + { + "name": "target_timestamp", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], "responses": { "200": { - "description": "成功", + "description": "成功创建任务或返回参数错误", "headers": {} } }, @@ -4818,7 +5111,7 @@ "get": { "summary": "获取系统选项", "deprecated": false, - "description": "👑 需要超级管理员权限(Root)", + "description": "👑 需要超级管理员权限(Root)。已退役的 theme.frontend 不在列表中返回。", "tags": [ "系统设置" ], @@ -4841,7 +5134,7 @@ "put": { "summary": "更新系统选项", "deprecated": false, - "description": "👑 需要超级管理员权限(Root)", + "description": "👑 需要超级管理员权限(Root)。兼容期内 theme.frontend=default 可幂等写入,其他主题值会被拒绝。", "tags": [ "系统设置" ], @@ -4887,31 +5180,6 @@ ] } }, - "/api/option/migrate_console_setting": { - "post": { - "summary": "迁移控制台设置", - "deprecated": false, - "description": "👑 需要超级管理员权限(Root)", - "tags": [ - "系统设置" - ], - "parameters": [], - "responses": { - "200": { - "description": "成功", - "headers": {} - } - }, - "security": [ - { - "Combination343": [] - }, - { - "Combination1243": [] - } - ] - } - }, "/api/ratio_sync/channels": { "get": { "summary": "获取可同步渠道", @@ -4977,6 +5245,32 @@ "data": {} } }, + "AuthSessionIssuanceError": { + "type": "object", + "required": [ + "success", + "code", + "message" + ], + "properties": { + "success": { + "type": "boolean", + "enum": [ + false + ] + }, + "code": { + "type": "string", + "enum": [ + "AUTH_SESSION_LIMIT", + "AUTH_SESSION_ISSUANCE_LIMIT" + ] + }, + "message": { + "type": "string" + } + } + }, "PageInfo": { "type": "object", "properties": { @@ -5141,33 +5435,63 @@ } } }, - "responses": {}, + "responses": { + "AuthSessionLimit": { + "description": "该用户的活跃登录 Session 已达上限", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthSessionIssuanceError" + } + } + } + }, + "AuthSessionIssuanceLimit": { + "description": "该用户在统计窗口内创建的 Session 已达上限", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthSessionIssuanceError" + } + } + } + } + }, "securitySchemes": { "SessionAuth1": { "type": "apiKey", "in": "cookie", "name": "session", - "description": "Session认证,通过登录接口获取" + "description": "已废弃:Gin session 不再用于面板鉴权" }, "AccessToken1": { - "type": "apiKey", - "in": "header", - "name": "Authorization", - "description": "Access Token认证,格式: Bearer {access_token},通过 /api/user/token 接口生成" + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT or PAT", + "description": "面板短期 JWT 或 User.AccessToken PAT;不再要求 New-Api-User" }, "NewApiUser1": { "type": "apiKey", "in": "header", "name": "New-Api-User", - "description": "用户ID请求头,必须与当前登录用户ID匹配,使用Session或AccessToken认证时必须提供" + "description": "已废弃且不再参与鉴权;PAT 客户端可以移除此请求头" + }, + "RefreshCookie": { + "type": "apiKey", + "in": "cookie", + "name": "new_api_refresh", + "description": "仅 refresh/logout 使用的 HttpOnly、SameSite=Strict Cookie" + }, + "SecurityProof": { + "type": "apiKey", + "in": "header", + "name": "X-Security-Proof", + "description": "绑定用户、登录会话和 scope 的短期二次验证 Proof" }, "Combination222": { "group": [ { - "id": 573666 - }, - { - "id": 573668 + "id": 573667 } ], "type": "combination" @@ -5176,9 +5500,6 @@ "group": [ { "id": 573667 - }, - { - "id": 573668 } ], "type": "combination" @@ -5186,10 +5507,7 @@ "Combination223": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5198,9 +5516,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5208,10 +5523,7 @@ "Combination224": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5220,9 +5532,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5230,10 +5539,7 @@ "Combination225": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5242,9 +5548,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5252,10 +5555,7 @@ "Combination226": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5264,9 +5564,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5274,10 +5571,7 @@ "Combination227": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5286,9 +5580,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5296,10 +5587,7 @@ "Combination228": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5308,9 +5596,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5318,10 +5603,7 @@ "Combination229": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5330,9 +5612,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5340,10 +5619,7 @@ "Combination230": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5352,9 +5628,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5362,10 +5635,7 @@ "Combination231": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5374,9 +5644,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5384,10 +5651,7 @@ "Combination232": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5396,9 +5660,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5406,10 +5667,7 @@ "Combination233": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5418,9 +5676,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5428,10 +5683,7 @@ "Combination234": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5440,9 +5692,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5450,10 +5699,7 @@ "Combination235": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5462,9 +5708,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5472,10 +5715,7 @@ "Combination236": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5484,9 +5724,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5494,10 +5731,7 @@ "Combination237": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5506,9 +5740,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5516,10 +5747,7 @@ "Combination238": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5528,9 +5756,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5538,10 +5763,7 @@ "Combination239": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5550,9 +5772,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5560,10 +5779,7 @@ "Combination240": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5572,9 +5788,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5582,10 +5795,7 @@ "Combination241": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5594,9 +5804,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5604,10 +5811,7 @@ "Combination242": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5616,9 +5820,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5626,10 +5827,7 @@ "Combination243": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5638,9 +5836,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5648,10 +5843,7 @@ "Combination244": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5660,9 +5852,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5670,10 +5859,7 @@ "Combination245": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5682,9 +5868,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5692,10 +5875,7 @@ "Combination246": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5704,9 +5884,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5714,10 +5891,7 @@ "Combination247": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5726,9 +5900,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5736,10 +5907,7 @@ "Combination248": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5748,9 +5916,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5758,10 +5923,7 @@ "Combination249": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5770,9 +5932,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5780,10 +5939,7 @@ "Combination250": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5792,9 +5948,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5802,10 +5955,7 @@ "Combination251": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5814,9 +5964,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5824,10 +5971,7 @@ "Combination252": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5836,9 +5980,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5846,10 +5987,7 @@ "Combination253": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5858,9 +5996,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5868,10 +6003,7 @@ "Combination254": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5880,9 +6012,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5890,10 +6019,7 @@ "Combination255": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5902,9 +6028,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5912,10 +6035,7 @@ "Combination256": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5924,9 +6044,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5934,10 +6051,7 @@ "Combination257": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5946,9 +6060,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5956,10 +6067,7 @@ "Combination258": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5968,9 +6076,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5978,10 +6083,7 @@ "Combination259": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5990,9 +6092,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6000,10 +6099,7 @@ "Combination260": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6012,9 +6108,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6022,10 +6115,7 @@ "Combination261": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6034,9 +6124,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6044,10 +6131,7 @@ "Combination262": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6056,9 +6140,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6066,10 +6147,7 @@ "Combination263": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6078,9 +6156,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6088,10 +6163,7 @@ "Combination264": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6100,9 +6172,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6110,10 +6179,7 @@ "Combination265": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6122,9 +6188,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6132,10 +6195,7 @@ "Combination266": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6144,9 +6204,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6154,10 +6211,7 @@ "Combination267": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6166,9 +6220,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6176,10 +6227,7 @@ "Combination268": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6188,9 +6236,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6198,10 +6243,7 @@ "Combination269": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6210,9 +6252,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6220,10 +6259,7 @@ "Combination270": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6232,9 +6268,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6242,10 +6275,7 @@ "Combination271": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6254,9 +6284,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6264,10 +6291,7 @@ "Combination272": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6276,9 +6300,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6286,10 +6307,7 @@ "Combination273": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6298,9 +6316,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6308,10 +6323,7 @@ "Combination274": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6320,9 +6332,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6330,10 +6339,7 @@ "Combination275": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6342,9 +6348,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6352,10 +6355,7 @@ "Combination276": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6364,9 +6364,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6374,10 +6371,7 @@ "Combination277": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6386,9 +6380,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6396,10 +6387,7 @@ "Combination278": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6408,9 +6396,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6418,10 +6403,7 @@ "Combination279": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6430,9 +6412,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6440,10 +6419,7 @@ "Combination280": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6452,9 +6428,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6462,10 +6435,7 @@ "Combination281": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6474,9 +6444,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6484,10 +6451,7 @@ "Combination282": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6496,9 +6460,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6506,10 +6467,7 @@ "Combination283": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6518,9 +6476,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6528,10 +6483,7 @@ "Combination284": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6540,9 +6492,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6550,10 +6499,7 @@ "Combination285": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6562,9 +6508,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6572,10 +6515,7 @@ "Combination286": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6584,9 +6524,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6594,10 +6531,7 @@ "Combination287": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6606,9 +6540,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6616,10 +6547,7 @@ "Combination288": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6628,9 +6556,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6638,10 +6563,7 @@ "Combination289": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6650,9 +6572,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6660,10 +6579,7 @@ "Combination290": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6672,9 +6588,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6682,10 +6595,7 @@ "Combination291": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6694,9 +6604,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6704,10 +6611,7 @@ "Combination292": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6716,9 +6620,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6726,10 +6627,7 @@ "Combination293": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6738,9 +6636,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6748,10 +6643,7 @@ "Combination294": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6760,9 +6652,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6770,10 +6659,7 @@ "Combination295": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6782,9 +6668,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6792,10 +6675,7 @@ "Combination296": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6804,9 +6684,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6814,10 +6691,7 @@ "Combination297": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6826,9 +6700,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6836,10 +6707,7 @@ "Combination298": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6848,9 +6716,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6858,10 +6723,7 @@ "Combination299": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6870,9 +6732,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6880,10 +6739,7 @@ "Combination300": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6892,9 +6748,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6902,10 +6755,7 @@ "Combination301": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6914,9 +6764,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6924,10 +6771,7 @@ "Combination302": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6936,9 +6780,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6946,10 +6787,7 @@ "Combination303": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6958,9 +6796,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6968,10 +6803,7 @@ "Combination304": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6980,9 +6812,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6990,10 +6819,7 @@ "Combination305": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7002,9 +6828,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7012,10 +6835,7 @@ "Combination306": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7024,9 +6844,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7034,10 +6851,7 @@ "Combination307": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7046,9 +6860,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7056,10 +6867,7 @@ "Combination308": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7068,9 +6876,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7078,10 +6883,7 @@ "Combination309": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7090,9 +6892,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7100,10 +6899,7 @@ "Combination310": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7112,9 +6908,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7122,10 +6915,7 @@ "Combination311": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7134,9 +6924,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7144,10 +6931,7 @@ "Combination312": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7156,9 +6940,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7166,10 +6947,7 @@ "Combination313": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7178,9 +6956,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7188,10 +6963,7 @@ "Combination314": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7200,9 +6972,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7210,10 +6979,7 @@ "Combination315": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7222,9 +6988,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7232,10 +6995,7 @@ "Combination316": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7244,9 +7004,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7254,10 +7011,7 @@ "Combination317": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7266,9 +7020,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7276,10 +7027,7 @@ "Combination318": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7288,9 +7036,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7298,10 +7043,7 @@ "Combination319": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7310,9 +7052,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7320,10 +7059,7 @@ "Combination320": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7332,9 +7068,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7342,10 +7075,7 @@ "Combination321": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7354,9 +7084,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7364,10 +7091,7 @@ "Combination322": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7376,9 +7100,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7386,10 +7107,7 @@ "Combination323": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7398,9 +7116,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7408,10 +7123,7 @@ "Combination324": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7420,9 +7132,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7430,10 +7139,7 @@ "Combination325": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7442,9 +7148,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7452,10 +7155,7 @@ "Combination326": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7464,9 +7164,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7474,10 +7171,7 @@ "Combination327": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7486,9 +7180,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7496,10 +7187,7 @@ "Combination328": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7508,9 +7196,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7518,10 +7203,7 @@ "Combination329": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7530,9 +7212,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7540,10 +7219,7 @@ "Combination330": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7552,9 +7228,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7562,10 +7235,7 @@ "Combination331": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7574,9 +7244,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7584,10 +7251,7 @@ "Combination332": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7596,9 +7260,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7606,10 +7267,7 @@ "Combination333": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7618,9 +7276,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7628,10 +7283,7 @@ "Combination334": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7640,9 +7292,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7650,10 +7299,7 @@ "Combination335": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7662,9 +7308,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7672,10 +7315,7 @@ "Combination336": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7684,9 +7324,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7694,10 +7331,7 @@ "Combination337": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7706,9 +7340,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7716,10 +7347,7 @@ "Combination338": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7728,9 +7356,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7738,10 +7363,7 @@ "Combination339": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7750,9 +7372,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7760,10 +7379,7 @@ "Combination340": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7772,9 +7388,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7782,10 +7395,7 @@ "Combination341": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7794,9 +7404,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7804,10 +7411,7 @@ "Combination342": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7816,9 +7420,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" diff --git a/docs/openapi/relay.json b/docs/openapi/relay.json index 62a0b65b08..92a6239074 100644 --- a/docs/openapi/relay.json +++ b/docs/openapi/relay.json @@ -4607,27 +4607,24 @@ "type": "apiKey", "in": "cookie", "name": "session", - "description": "Session认证,通过登录接口获取" + "description": "已废弃:Gin session 不再用于面板鉴权" }, "AccessToken": { - "type": "apiKey", - "in": "header", - "name": "Authorization", - "description": "Access Token认证,格式: Bearer {access_token},通过 /api/user/token 接口生成" + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT or PAT", + "description": "面板短期 JWT 或 User.AccessToken PAT;不再要求 New-Api-User" }, "NewApiUser": { "type": "apiKey", "in": "header", "name": "New-Api-User", - "description": "用户ID请求头,必须与当前登录用户ID匹配,使用Session或AccessToken认证时必须提供" + "description": "已废弃且不再参与鉴权;PAT 客户端可以移除此请求头" }, "Combination": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4636,9 +4633,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4646,10 +4640,7 @@ "Combination2": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4658,9 +4649,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4668,10 +4656,7 @@ "Combination3": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4680,9 +4665,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4690,10 +4672,7 @@ "Combination4": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4702,9 +4681,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4712,10 +4688,7 @@ "Combination5": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4724,9 +4697,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4734,10 +4704,7 @@ "Combination6": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4746,9 +4713,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4756,10 +4720,7 @@ "Combination7": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4768,9 +4729,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4778,10 +4736,7 @@ "Combination8": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4790,9 +4745,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4800,10 +4752,7 @@ "Combination9": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4812,9 +4761,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4822,10 +4768,7 @@ "Combination10": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4834,9 +4777,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4844,10 +4784,7 @@ "Combination20": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4856,9 +4793,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4866,10 +4800,7 @@ "Combination21": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4878,9 +4809,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4888,10 +4816,7 @@ "Combination22": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4900,9 +4825,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4910,10 +4832,7 @@ "Combination23": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4922,9 +4841,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4932,10 +4848,7 @@ "Combination24": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4944,9 +4857,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4954,10 +4864,7 @@ "Combination25": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4966,9 +4873,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4976,10 +4880,7 @@ "Combination26": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -4988,9 +4889,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -4998,10 +4896,7 @@ "Combination27": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5010,9 +4905,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5020,10 +4912,7 @@ "Combination28": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5032,9 +4921,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5042,10 +4928,7 @@ "Combination29": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5054,9 +4937,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5064,10 +4944,7 @@ "Combination30": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5076,9 +4953,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5086,10 +4960,7 @@ "Combination31": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5098,9 +4969,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5108,10 +4976,7 @@ "Combination32": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5120,9 +4985,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5130,10 +4992,7 @@ "Combination33": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5142,9 +5001,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5152,10 +5008,7 @@ "Combination34": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5164,9 +5017,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5174,10 +5024,7 @@ "Combination35": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5186,9 +5033,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5196,10 +5040,7 @@ "Combination36": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5208,9 +5049,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5218,10 +5056,7 @@ "Combination37": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5230,9 +5065,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5240,10 +5072,7 @@ "Combination38": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5252,9 +5081,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5262,10 +5088,7 @@ "Combination39": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5274,9 +5097,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5284,10 +5104,7 @@ "Combination40": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5296,9 +5113,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5306,10 +5120,7 @@ "Combination41": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5318,9 +5129,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5328,10 +5136,7 @@ "Combination42": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5340,9 +5145,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5350,10 +5152,7 @@ "Combination43": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5362,9 +5161,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5372,10 +5168,7 @@ "Combination44": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5384,9 +5177,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5394,10 +5184,7 @@ "Combination45": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5406,9 +5193,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5416,10 +5200,7 @@ "Combination46": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5428,9 +5209,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5438,10 +5216,7 @@ "Combination47": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5450,9 +5225,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5460,10 +5232,7 @@ "Combination48": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5472,9 +5241,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5482,10 +5248,7 @@ "Combination49": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5494,9 +5257,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5504,10 +5264,7 @@ "Combination50": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5516,9 +5273,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5526,10 +5280,7 @@ "Combination51": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5538,9 +5289,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5548,10 +5296,7 @@ "Combination52": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5560,9 +5305,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5570,10 +5312,7 @@ "Combination53": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5582,9 +5321,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5592,10 +5328,7 @@ "Combination54": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5604,9 +5337,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5614,10 +5344,7 @@ "Combination55": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5626,9 +5353,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5636,10 +5360,7 @@ "Combination56": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5648,9 +5369,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5658,10 +5376,7 @@ "Combination57": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5670,9 +5385,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5680,10 +5392,7 @@ "Combination58": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5692,9 +5401,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5702,10 +5408,7 @@ "Combination59": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5714,9 +5417,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5724,10 +5424,7 @@ "Combination60": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5736,9 +5433,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5746,10 +5440,7 @@ "Combination61": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5758,9 +5449,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5768,10 +5456,7 @@ "Combination62": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5780,9 +5465,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5790,10 +5472,7 @@ "Combination63": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5802,9 +5481,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5812,10 +5488,7 @@ "Combination64": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5824,9 +5497,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5834,10 +5504,7 @@ "Combination65": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5846,9 +5513,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5856,10 +5520,7 @@ "Combination66": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5868,9 +5529,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5878,10 +5536,7 @@ "Combination67": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5890,9 +5545,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5900,10 +5552,7 @@ "Combination68": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5912,9 +5561,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5922,10 +5568,7 @@ "Combination69": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5934,9 +5577,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5944,10 +5584,7 @@ "Combination70": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5956,9 +5593,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5966,10 +5600,7 @@ "Combination71": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -5978,9 +5609,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -5988,10 +5616,7 @@ "Combination72": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6000,9 +5625,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6010,10 +5632,7 @@ "Combination73": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6022,9 +5641,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6032,10 +5648,7 @@ "Combination74": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6044,9 +5657,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6054,10 +5664,7 @@ "Combination75": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6066,9 +5673,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6076,10 +5680,7 @@ "Combination76": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6088,9 +5689,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6098,10 +5696,7 @@ "Combination77": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6110,9 +5705,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6120,10 +5712,7 @@ "Combination78": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6132,9 +5721,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6142,10 +5728,7 @@ "Combination79": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6154,9 +5737,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6164,10 +5744,7 @@ "Combination80": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6176,9 +5753,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6186,10 +5760,7 @@ "Combination81": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6198,9 +5769,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6208,10 +5776,7 @@ "Combination82": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6220,9 +5785,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6230,10 +5792,7 @@ "Combination83": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6242,9 +5801,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6252,10 +5808,7 @@ "Combination84": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6264,9 +5817,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6274,10 +5824,7 @@ "Combination85": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6286,9 +5833,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6296,10 +5840,7 @@ "Combination86": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6308,9 +5849,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6318,10 +5856,7 @@ "Combination87": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6330,9 +5865,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6340,10 +5872,7 @@ "Combination88": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6352,9 +5881,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6362,10 +5888,7 @@ "Combination89": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6374,9 +5897,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6384,10 +5904,7 @@ "Combination90": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6396,9 +5913,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6406,10 +5920,7 @@ "Combination91": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6418,9 +5929,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6428,10 +5936,7 @@ "Combination92": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6440,9 +5945,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6450,10 +5952,7 @@ "Combination93": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6462,9 +5961,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6472,10 +5968,7 @@ "Combination94": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6484,9 +5977,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6494,10 +5984,7 @@ "Combination95": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6506,9 +5993,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6516,10 +6000,7 @@ "Combination96": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6528,9 +6009,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6538,10 +6016,7 @@ "Combination97": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6550,9 +6025,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6560,10 +6032,7 @@ "Combination98": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6572,9 +6041,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6582,10 +6048,7 @@ "Combination99": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6594,9 +6057,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6604,10 +6064,7 @@ "Combination100": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6616,9 +6073,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6626,10 +6080,7 @@ "Combination101": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6638,9 +6089,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6648,10 +6096,7 @@ "Combination102": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6660,9 +6105,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6670,10 +6112,7 @@ "Combination103": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6682,9 +6121,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6692,10 +6128,7 @@ "Combination104": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6704,9 +6137,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6714,10 +6144,7 @@ "Combination105": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6726,9 +6153,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6736,10 +6160,7 @@ "Combination106": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6748,9 +6169,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6758,10 +6176,7 @@ "Combination107": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6770,9 +6185,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6780,10 +6192,7 @@ "Combination108": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6792,9 +6201,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6802,10 +6208,7 @@ "Combination109": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6814,9 +6217,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6824,10 +6224,7 @@ "Combination200": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6836,9 +6233,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6846,10 +6240,7 @@ "Combination201": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6858,9 +6249,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6868,10 +6256,7 @@ "Combination202": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6880,9 +6265,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6890,10 +6272,7 @@ "Combination203": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6902,9 +6281,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6912,10 +6288,7 @@ "Combination204": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6924,9 +6297,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6934,10 +6304,7 @@ "Combination205": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6946,9 +6313,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6956,10 +6320,7 @@ "Combination206": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6968,9 +6329,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -6978,10 +6336,7 @@ "Combination207": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -6990,9 +6345,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7000,10 +6352,7 @@ "Combination208": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7012,9 +6361,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7022,10 +6368,7 @@ "Combination209": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7034,9 +6377,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7044,10 +6384,7 @@ "Combination210": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7056,9 +6393,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7066,10 +6400,7 @@ "Combination211": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7078,9 +6409,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7088,10 +6416,7 @@ "Combination212": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7100,9 +6425,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7110,10 +6432,7 @@ "Combination213": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7122,9 +6441,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7132,10 +6448,7 @@ "Combination214": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7144,9 +6457,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7154,10 +6464,7 @@ "Combination215": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7166,9 +6473,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7176,10 +6480,7 @@ "Combination216": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7188,9 +6489,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7198,10 +6496,7 @@ "Combination217": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7210,9 +6505,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7220,10 +6512,7 @@ "Combination218": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7232,9 +6521,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7242,10 +6528,7 @@ "Combination219": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7254,9 +6537,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" @@ -7264,10 +6544,7 @@ "Combination220": { "group": [ { - "id": "SessionAuth" - }, - { - "id": "NewApiUser" + "id": "AccessToken" } ], "type": "combination" @@ -7276,9 +6553,6 @@ "group": [ { "id": "AccessToken" - }, - { - "id": "NewApiUser" } ], "type": "combination" diff --git a/electron/README.md b/electron/README.md index 88463b8aef..1cacd0c65f 100644 --- a/electron/README.md +++ b/electron/README.md @@ -16,7 +16,7 @@ cp ../new-api-macos ../new-api **Option B: Build from source (requires Go)** TODO -### 3. Electron Dependencies +### 2. Electron Dependencies ```bash cd electron npm install @@ -24,13 +24,21 @@ npm install ## Development -Run the app in development mode: +Start the backend, the frontend, and Electron in separate terminals: ```bash -npm start +# Repository root +go run main.go + +# Repository root +make dev-web + +# electron/ +npm run dev-app ``` This will: -- Start the Go backend on port 3000 +- Use the Go backend on port 3000 +- Use the Rsbuild frontend development server on port 5173 - Open an Electron window with DevTools enabled - Create a system tray icon (menu bar on macOS) - Store database in `../data/new-api.db` @@ -39,10 +47,10 @@ This will: ### Quick Build ```bash -# Ensure Go binary exists in parent directory -ls ../new-api # Should exist +# From electron/, build the frontend, Go binary, and desktop package +./build.sh -# Build for current platform +# Or package an existing binary for the current platform npm run build # Platform-specific builds diff --git a/electron/build.sh b/electron/build.sh index cef714328d..001ad587a1 100755 --- a/electron/build.sh +++ b/electron/build.sh @@ -6,7 +6,8 @@ echo "Building New API Electron App..." echo "Step 1: Building frontend..." cd ../web -DISABLE_ESLINT_PLUGIN='true' bun run build +bun install --frozen-lockfile +DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(git describe --tags --always) bun run build cd ../electron echo "Step 2: Building Go backend..." @@ -38,4 +39,4 @@ else npm run build fi -echo "Build complete! Check electron/dist/ for output." \ No newline at end of file +echo "Build complete! Check electron/dist/ for output." diff --git a/electron/main.js b/electron/main.js index 210a456585..2200f643c8 100644 --- a/electron/main.js +++ b/electron/main.js @@ -9,7 +9,7 @@ let serverProcess; let tray = null; let serverErrorLogs = []; const PORT = 3000; -const DEV_FRONTEND_PORT = 5173; // Vite dev server port +const DEV_FRONTEND_PORT = 5173; // Rsbuild dev server port // 保存日志到文件并打开 function saveAndOpenErrorLog() { @@ -235,7 +235,7 @@ function startServer() { console.log('Development mode: skipping server startup'); console.log('Please make sure you have started:'); console.log(' 1. Go backend: go run main.go (port 3000)'); - console.log(' 2. Frontend dev server: cd web && bun dev (port 5173)'); + console.log(' 2. Frontend dev server: make dev-web (port 5173)'); console.log(''); console.log('Checking if servers are running...'); @@ -248,7 +248,7 @@ function startServer() { .catch((err) => { console.error(`✗ Cannot connect to frontend dev server on port ${DEV_FRONTEND_PORT}`); console.error('Please make sure the frontend dev server is running:'); - console.error(' cd web && bun dev'); + console.error(' make dev-web'); reject(err); }); return; @@ -587,4 +587,4 @@ app.on('before-quit', (event) => { app.exit(); }); } -}); \ No newline at end of file +}); diff --git a/electron/package.json b/electron/package.json index 137785b241..7dc24c8d1c 100644 --- a/electron/package.json +++ b/electron/package.json @@ -60,10 +60,6 @@ "from": "../new-api", "to": "bin/new-api" }, - { - "from": "../web/dist", - "to": "web/dist" - }, { "from": "../LICENSE", "to": "licenses/LICENSE" diff --git a/go.mod b/go.mod index f441260020..98f291f645 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,6 @@ require ( github.com/casbin/casbin/v2 v2.135.0 github.com/gin-contrib/cors v1.7.2 github.com/gin-contrib/gzip v0.0.6 - github.com/gin-contrib/sessions v0.0.5 github.com/gin-contrib/static v0.0.1 github.com/gin-gonic/gin v1.9.1 github.com/glebarez/sqlite v1.9.0 @@ -78,11 +77,15 @@ require ( github.com/pierrec/lz4/v4 v4.1.22 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/segmentio/asm v1.2.0 // indirect + github.com/yuin/gopher-lua v1.1.1 // indirect go.opentelemetry.io/otel v1.34.0 // indirect go.opentelemetry.io/otel/trace v1.34.0 // indirect ) -require github.com/Azure/go-ntlmssp v0.1.1 +require ( + github.com/Azure/go-ntlmssp v0.1.1 + github.com/alicebob/miniredis/v2 v2.38.0 +) require ( github.com/DmitriyVTitov/size v1.5.0 // indirect @@ -114,9 +117,6 @@ require ( github.com/go-webauthn/x v0.1.25 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/google/go-tpm v0.9.5 // indirect - github.com/gorilla/context v1.1.1 // indirect - github.com/gorilla/securecookie v1.1.1 // indirect - github.com/gorilla/sessions v1.2.1 // indirect github.com/grafana/pyroscope-go/godeltaprof v0.1.9 // indirect github.com/icza/bitio v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect diff --git a/go.sum b/go.sum index e2faeb0d09..ca6bd091f8 100644 --- a/go.sum +++ b/go.sum @@ -697,6 +697,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= github.com/alexflint/go-filemutex v1.2.0/go.mod h1:mYyQSWvw9Tx2/H2n9qXPb52tTYfE0pZAWcBq5mK025c= +github.com/alicebob/miniredis/v2 v2.38.0 h1:nZAzCR+Lj+Vxk4ZXzm2NuKq2O33RXj1XxJ2e2uP9jiw= +github.com/alicebob/miniredis/v2 v2.38.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= @@ -1100,8 +1102,6 @@ github.com/gin-contrib/cors v1.7.2 h1:oLDHxdg8W/XDoN/8zamqk/Drgt4oVZDvaV0YmvVICQ github.com/gin-contrib/cors v1.7.2/go.mod h1:SUJVARKgQ40dmrzgXEVxj2m7Ig1v1qIboQkPDTQ9t2E= github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= -github.com/gin-contrib/sessions v0.0.5 h1:CATtfHmLMQrMNpJRgzjWXD7worTh7g7ritsQfmF+0jE= -github.com/gin-contrib/sessions v0.0.5/go.mod h1:vYAuaUPqie3WUSsft6HUlCjlwwoJQs97miaG2+7neKY= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-contrib/static v0.0.1 h1:JVxuvHPuUfkoul12N7dtQw7KRn/pSMq7Ue1Va9Swm1U= @@ -1359,18 +1359,12 @@ github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97Dwqy github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= -github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= -github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= -github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -2031,6 +2025,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= +github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= diff --git a/main.go b/main.go index 770ea156ba..548034a193 100644 --- a/main.go +++ b/main.go @@ -32,26 +32,18 @@ import ( "github.com/QuantumNous/new-api/setting/ratio_setting" "github.com/bytedance/gopkg/util/gopool" - "github.com/gin-contrib/sessions" - "github.com/gin-contrib/sessions/cookie" "github.com/gin-gonic/gin" "github.com/joho/godotenv" _ "net/http/pprof" ) -//go:embed web/default/dist +//go:embed web/dist var buildFS embed.FS -//go:embed web/default/dist/index.html +//go:embed web/dist/index.html var indexPage []byte -//go:embed web/classic/dist -var classicBuildFS embed.FS - -//go:embed web/classic/dist/index.html -var classicIndexPage []byte - func main() { startTime := time.Now() @@ -173,6 +165,10 @@ func main() { // Initialize HTTP server server := gin.New() + if err := configureTrustedProxies(server); err != nil { + common.FatalLog("failed to configure trusted proxies: " + err.Error()) + return + } server.Use(gin.CustomRecovery(func(c *gin.Context, err any) { common.SysLog(fmt.Sprintf("panic detected: %v", err)) c.JSON(http.StatusInternalServerError, gin.H{ @@ -188,26 +184,13 @@ func main() { server.Use(middleware.Version()) server.Use(middleware.I18n()) middleware.SetUpLogger(server) - // Initialize session store - store := cookie.NewStore([]byte(common.SessionSecret)) - store.Options(sessions.Options{ - Path: "/", - MaxAge: 2592000, // 30 days - HttpOnly: true, - Secure: common.SessionCookieSecure, - SameSite: http.SameSiteStrictMode, - }) - server.Use(sessions.Sessions("session", store)) - InjectUmamiAnalytics() InjectGoogleAnalytics() // 设置路由 - router.SetRouter(server, router.ThemeAssets{ - DefaultBuildFS: buildFS, - DefaultIndexPage: indexPage, - ClassicBuildFS: classicBuildFS, - ClassicIndexPage: classicIndexPage, + router.SetRouter(server, router.WebAssets{ + BuildFS: buildFS, + IndexPage: indexPage, }) var port = os.Getenv("PORT") if port == "" { @@ -266,7 +249,6 @@ func InjectUmamiAnalytics() { analyticsInject := []byte(analyticsInjectBuilder.String()) placeholder := []byte("\n") indexPage = bytes.ReplaceAll(indexPage, placeholder, analyticsInject) - classicIndexPage = bytes.ReplaceAll(classicIndexPage, placeholder, analyticsInject) } func InjectGoogleAnalytics() { @@ -290,7 +272,6 @@ func InjectGoogleAnalytics() { analyticsInject := []byte(analyticsInjectBuilder.String()) placeholder := []byte("\n") indexPage = bytes.ReplaceAll(indexPage, placeholder, analyticsInject) - classicIndexPage = bytes.ReplaceAll(classicIndexPage, placeholder, analyticsInject) } func InitResources() error { @@ -329,6 +310,11 @@ func InitResources() error { model.CheckSetup() // Initialize options, should after model.InitDB() + if common.IsMasterNode { + if err := model.MigrateRetiredFrontendOptions(); err != nil { + common.SysError("failed to migrate retired frontend options: " + err.Error()) + } + } model.InitOptionMap() // 清理旧的磁盘缓存文件 @@ -369,5 +355,7 @@ func InitResources() error { // Don't return error, custom OAuth is not critical } + service.StartAuthArtifactCleanup() + return nil } diff --git a/makefile b/makefile index 58c4ae4c66..bcbd02b8f7 100644 --- a/makefile +++ b/makefile @@ -1,8 +1,6 @@ -WEB_DIR = ./web/default -WEB_CLASSIC_DIR = ./web/classic +WEB_DIR = ./web API_DIR = . -DEV_WEB_DEFAULT_PORT ?= 5173 -DEV_WEB_CLASSIC_PORT ?= 5174 +DEV_WEB_PORT ?= 5173 DEV_COMPOSE_FILE = docker-compose.dev.yml DEV_POSTGRES_SERVICE = postgres DEV_API_SERVICE = new-api @@ -10,21 +8,16 @@ DEV_POSTGRES_DB = new-api DEV_POSTGRES_USER = root DEV_SQLITE_PATH ?= one-api.db -.PHONY: all build-web build-web-classic build-all-web start-api dev dev-api dev-api-rebuild dev-web dev-web-classic reset-setup +.PHONY: all build-web build-all-web start-api dev dev-api dev-api-rebuild dev-web reset-setup all: build-all-web start-api build-web: - @echo "Building default web..." - @cd ./web && bun install --frozen-lockfile - @cd $(WEB_DIR) && DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(cat ../../VERSION) bun run build + @echo "Building web frontend..." + @cd $(WEB_DIR) && bun install --frozen-lockfile + @cd $(WEB_DIR) && DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$$(cat ../VERSION) bun run build -build-web-classic: - @echo "Building classic web..." - @cd ./web && bun install --frozen-lockfile - @cd $(WEB_CLASSIC_DIR) && VITE_REACT_APP_VERSION=$(cat ../../VERSION) bun run build - -build-all-web: build-web build-web-classic +build-all-web: build-web start-api: @echo "Starting api dev server..." @@ -39,15 +32,10 @@ dev-api-rebuild: @docker compose -f $(DEV_COMPOSE_FILE) up -d --build $(DEV_API_SERVICE) dev-web: - @echo "Starting default web dev server..." - @echo "Default web: http://localhost:$(DEV_WEB_DEFAULT_PORT)" - @cd ./web && bun install --filter ./default - @cd $(WEB_DIR) && bun run dev -- --host 0.0.0.0 --port $(DEV_WEB_DEFAULT_PORT) - -dev-web-classic: - @echo "Starting classic web dev server..." - @cd ./web && bun install --filter ./classic - @cd $(WEB_CLASSIC_DIR) && bun run dev -- --host 0.0.0.0 --port $(DEV_WEB_CLASSIC_PORT) + @echo "Starting web frontend dev server..." + @echo "Web frontend: http://localhost:$(DEV_WEB_PORT)" + @cd $(WEB_DIR) && bun install + @cd $(WEB_DIR) && bun run dev -- --host 0.0.0.0 --port $(DEV_WEB_PORT) dev: dev-api dev-web diff --git a/middleware/audit.go b/middleware/audit.go index 71b5cc4385..851e48358a 100644 --- a/middleware/audit.go +++ b/middleware/audit.go @@ -93,7 +93,7 @@ var auditRouteActions = map[string]string{ "POST /api/subscription/admin/bind": "subscription.bind", // 日志 - "DELETE /api/log/": "log.clear", + "POST /api/system-task/log-cleanup": "log.cleanup_start", } // beginAdminAudit 在管理/root 写操作进入 handler 前包装 ResponseWriter, @@ -155,7 +155,7 @@ func finishAdminAudit(c *gin.Context, writer *auditResponseWriter) { opParams["route"] = route } - // content 为英文兜底文本(导出/经典前端用)。 + // content 为英文兜底文本(供导出等非本地化消费者使用)。 content := method + " " + route adminInfo := map[string]interface{}{ diff --git a/middleware/auth.go b/middleware/auth.go index 86abddc799..170f5fb369 100644 --- a/middleware/auth.go +++ b/middleware/auth.go @@ -5,7 +5,6 @@ import ( "fmt" "net" "net/http" - "strconv" "strings" "github.com/QuantumNous/new-api/common" @@ -18,11 +17,20 @@ import ( "github.com/QuantumNous/new-api/setting/ratio_setting" "github.com/QuantumNous/new-api/types" - "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" "gorm.io/gorm" ) +const authIdentityContextKey = "auth_identity" + +type dashboardCredentialKind int + +const ( + dashboardCredentialUnmatched dashboardCredentialKind = iota + dashboardCredentialInternal + dashboardCredentialPAT +) + func validUserInfo(username string, role int) bool { // check username is empty if strings.TrimSpace(username) == "" { @@ -35,124 +43,24 @@ func validUserInfo(username string, role int) bool { } func authHelper(c *gin.Context, minRole int) { - session := sessions.Default(c) - username := session.Get("username") - role := session.Get("role") - id := session.Get("id") - status := session.Get("status") - useAccessToken := false - if username == nil { - // Check access token - accessToken := c.Request.Header.Get("Authorization") - if accessToken == "" { - c.JSON(http.StatusUnauthorized, gin.H{ - "success": false, - "message": common.TranslateMessage(c, i18n.MsgAuthNotLoggedIn), - }) - c.Abort() - return - } - user, authErr := model.ValidateAccessToken(accessToken) - if authErr != nil { - if errors.Is(authErr, model.ErrDatabase) { - common.SysLog("ValidateAccessToken database error: " + authErr.Error()) - c.JSON(http.StatusInternalServerError, gin.H{ - "success": false, - "message": common.TranslateMessage(c, i18n.MsgDatabaseError), - }) - } else { - c.JSON(http.StatusOK, gin.H{ - "success": false, - "message": common.TranslateMessage(c, i18n.MsgAuthAccessTokenInvalid), - }) - } - c.Abort() - return - } - if user != nil && user.Username != "" { - if !validUserInfo(user.Username, user.Role) { - c.JSON(http.StatusOK, gin.H{ - "success": false, - "message": common.TranslateMessage(c, i18n.MsgAuthUserInfoInvalid), - }) - c.Abort() - return - } - // Token is valid - username = user.Username - role = user.Role - id = user.Id - status = user.Status - useAccessToken = true - } else { - c.JSON(http.StatusOK, gin.H{ - "success": false, - "message": common.TranslateMessage(c, i18n.MsgAuthAccessTokenInvalid), - }) - c.Abort() - return - } - } - // get header New-Api-User - apiUserIdStr := c.Request.Header.Get("New-Api-User") - if apiUserIdStr == "" { - c.JSON(http.StatusUnauthorized, gin.H{ - "success": false, - "message": common.TranslateMessage(c, i18n.MsgAuthUserIdNotProvided), - }) - c.Abort() - return - } - apiUserId, err := strconv.Atoi(apiUserIdStr) + user, identity, useAccessToken, err := authenticateDashboardRequest(c) if err != nil { - c.JSON(http.StatusUnauthorized, gin.H{ - "success": false, - "message": common.TranslateMessage(c, i18n.MsgAuthUserIdFormatError), - }) - c.Abort() - return - - } - if id != apiUserId { - c.JSON(http.StatusUnauthorized, gin.H{ - "success": false, - "message": common.TranslateMessage(c, i18n.MsgAuthUserIdMismatch), - }) - c.Abort() + writeDashboardAuthError(c, err) return } - if status.(int) == common.UserStatusDisabled { - c.JSON(http.StatusOK, gin.H{ - "success": false, - "message": common.TranslateMessage(c, i18n.MsgAuthUserBanned), - }) - c.Abort() + if user.Status != common.UserStatusEnabled { + c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"success": false, "code": "AUTH_USER_DISABLED", "message": common.TranslateMessage(c, i18n.MsgAuthUserBanned)}) return } - if role.(int) < minRole { - c.JSON(http.StatusOK, gin.H{ - "success": false, - "message": common.TranslateMessage(c, i18n.MsgAuthInsufficientPrivilege), - }) - c.Abort() + if user.Role < minRole { + c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"success": false, "code": "AUTH_INSUFFICIENT_PRIVILEGE", "message": common.TranslateMessage(c, i18n.MsgAuthInsufficientPrivilege)}) return } - if !validUserInfo(username.(string), role.(int)) { - c.JSON(http.StatusOK, gin.H{ - "success": false, - "message": common.TranslateMessage(c, i18n.MsgAuthUserInfoInvalid), - }) - c.Abort() + if !validUserInfo(user.Username, user.Role) { + c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"success": false, "code": "AUTH_USER_INVALID", "message": common.TranslateMessage(c, i18n.MsgAuthUserInfoInvalid)}) return } - // 防止不同newapi版本冲突,导致数据不通用 - c.Header("Auth-Version", "864b7076dbcd0a3c01b5520316720ebf") - c.Set("username", username) - c.Set("role", role) - c.Set("id", id) - c.Set("group", session.Get("group")) - c.Set("user_group", session.Get("group")) - c.Set("use_access_token", useAccessToken) + setDashboardAuthContext(c, user, identity, useAccessToken) // 管理/root 写操作审计兜底:内聚在鉴权链路里,保证任何经过 AdminAuth/RootAuth // 的写接口都会自动留痕(无需在路由上单独挂审计中间件,避免漏挂)。 @@ -169,10 +77,13 @@ func authHelper(c *gin.Context, minRole int) { func TryUserAuth() func(c *gin.Context) { return func(c *gin.Context) { - session := sessions.Default(c) - id := session.Get("id") - if id != nil { - c.Set("id", id) + user, identity, credentialKind, err := classifyDashboardCredential(c) + if err != nil { + writeDashboardAuthError(c, err) + return + } + if credentialKind != dashboardCredentialUnmatched { + setDashboardAuthContext(c, user, identity, credentialKind == dashboardCredentialPAT) } c.Next() } @@ -196,6 +107,122 @@ func RootAuth() func(c *gin.Context) { } } +// GetAuthIdentity returns a dashboard session identity. PAT-authenticated +// requests intentionally have no SessionID and cannot manage browser sessions. +func GetAuthIdentity(c *gin.Context) (service.AuthIdentity, bool) { + value, ok := c.Get(authIdentityContextKey) + if !ok { + return service.AuthIdentity{}, false + } + identity, ok := value.(service.AuthIdentity) + return identity, ok +} + +// GetSessionAuthIdentity returns only identities backed by a live dashboard +// session. PAT-authenticated requests intentionally fail this check. +func GetSessionAuthIdentity(c *gin.Context) (service.AuthIdentity, bool) { + identity, ok := GetAuthIdentity(c) + if !ok { + identity = service.AuthIdentity{ + UserID: c.GetInt("id"), + SessionID: c.GetString("session_id"), + UserAuthVersion: c.GetInt64("auth_version"), + SessionVersion: c.GetInt64("session_version"), + } + } + if identity.UserID <= 0 || identity.SessionID == "" || identity.UserAuthVersion <= 0 || identity.SessionVersion <= 0 { + return service.AuthIdentity{}, false + } + return identity, true +} + +func authenticateDashboardRequest(c *gin.Context) (*model.UserBase, service.AuthIdentity, bool, error) { + user, identity, credentialKind, err := classifyDashboardCredential(c) + if err != nil { + return nil, service.AuthIdentity{}, credentialKind == dashboardCredentialPAT, err + } + if credentialKind == dashboardCredentialUnmatched { + return nil, service.AuthIdentity{}, false, service.ErrAuthTokenInvalid + } + return user, identity, credentialKind == dashboardCredentialPAT, nil +} + +func classifyDashboardCredential(c *gin.Context) (*model.UserBase, service.AuthIdentity, dashboardCredentialKind, error) { + raw, ok := authorizationToken(c.GetHeader("Authorization")) + if !ok { + return nil, service.AuthIdentity{}, dashboardCredentialUnmatched, nil + } + identity, internal, err := service.ParseDashboardAccessToken(raw) + if internal { + if err != nil { + return nil, service.AuthIdentity{}, dashboardCredentialInternal, err + } + _, user, err := service.ValidateLoginSession(identity) + if err != nil { + return nil, service.AuthIdentity{}, dashboardCredentialInternal, err + } + return user, identity, dashboardCredentialInternal, nil + } + patUser, err := model.ValidateAccessToken(raw) + if err != nil { + return nil, service.AuthIdentity{}, dashboardCredentialPAT, err + } + if patUser == nil || patUser.Id <= 0 { + return nil, service.AuthIdentity{}, dashboardCredentialUnmatched, nil + } + user, err := model.GetUserCache(patUser.Id) + if err != nil { + return nil, service.AuthIdentity{}, dashboardCredentialPAT, err + } + return user, service.AuthIdentity{UserID: user.Id, UserAuthVersion: user.AuthVersion}, dashboardCredentialPAT, nil +} + +func authorizationToken(header string) (string, bool) { + header = strings.TrimSpace(header) + if header == "" { + return "", false + } + parts := strings.Fields(header) + if len(parts) == 2 && strings.EqualFold(parts[0], "Bearer") { + header = parts[1] + } else if len(parts) != 1 { + return "", false + } + return header, header != "" +} + +func setDashboardAuthContext(c *gin.Context, user *model.UserBase, identity service.AuthIdentity, useAccessToken bool) { + c.Header("Auth-Version", "864b7076dbcd0a3c01b5520316720ebf") + c.Set("username", user.Username) + c.Set("role", user.Role) + c.Set("id", user.Id) + c.Set("group", user.Group) + c.Set("user_group", user.Group) + c.Set("use_access_token", useAccessToken) + c.Set("session_id", identity.SessionID) + c.Set("auth_version", identity.UserAuthVersion) + c.Set("session_version", identity.SessionVersion) + c.Set(authIdentityContextKey, identity) + user.WriteContext(c) +} + +func writeDashboardAuthError(c *gin.Context, err error) { + if errors.Is(err, service.ErrAuthTokenExpired) { + c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"success": false, "code": "AUTH_TOKEN_EXPIRED", "message": common.TranslateMessage(c, i18n.MsgAuthNotLoggedIn)}) + return + } + if errors.Is(err, service.ErrLoginSessionRevoked) || errors.Is(err, gorm.ErrRecordNotFound) { + c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"success": false, "code": "AUTH_SESSION_REVOKED", "message": common.TranslateMessage(c, i18n.MsgAuthNotLoggedIn)}) + return + } + if errors.Is(err, service.ErrAuthTokenInvalid) { + c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"success": false, "code": "AUTH_UNAUTHORIZED", "message": common.TranslateMessage(c, i18n.MsgAuthAccessTokenInvalid)}) + return + } + common.SysLog("dashboard authentication error: " + err.Error()) + c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"success": false, "code": "AUTH_INTERNAL_ERROR", "message": common.TranslateMessage(c, i18n.MsgDatabaseError)}) +} + func RequirePermission(permission authz.Permission) func(c *gin.Context) { return func(c *gin.Context) { role := c.GetInt("role") @@ -220,16 +247,27 @@ func WssAuth(c *gin.Context) { // Used for endpoints that need to be accessible from both the dashboard and API clients. func TokenOrUserAuth() func(c *gin.Context) { return func(c *gin.Context) { - // Try session auth first (dashboard users) - session := sessions.Default(c) - if id := session.Get("id"); id != nil { - if status, ok := session.Get("status").(int); ok && status == common.UserStatusEnabled { - c.Set("id", id) - c.Next() + raw, ok := authorizationToken(c.GetHeader("Authorization")) + if ok { + identity, internal, err := service.ParseDashboardAccessToken(raw) + if !internal { + TokenAuth()(c) return } + if err != nil { + writeDashboardAuthError(c, err) + return + } + _, user, err := service.ValidateLoginSession(identity) + if err != nil { + writeDashboardAuthError(c, err) + return + } + setDashboardAuthContext(c, user, identity, false) + c.Next() + return } - // Fall back to token auth (API clients) + // Opaque credentials are relay API keys here, never dashboard PATs. TokenAuth()(c) } } diff --git a/middleware/auth_origin.go b/middleware/auth_origin.go new file mode 100644 index 0000000000..f45686bd76 --- /dev/null +++ b/middleware/auth_origin.go @@ -0,0 +1,76 @@ +package middleware + +import ( + "crypto/subtle" + "net/http" + "net/url" + "strings" + + "github.com/QuantumNous/new-api/common" + "github.com/gin-gonic/gin" +) + +// SessionCookieOriginGuard protects cookie-authenticated refresh/logout +// endpoints when secure cookie mode is enabled. In insecure local development +// mode it preserves the legacy behavior and intentionally performs no Origin +// validation. It never adds CORS response headers and must not be installed on +// relay routes. +func SessionCookieOriginGuard() gin.HandlerFunc { + return func(c *gin.Context) { + if !common.SessionCookieSecure { + c.Next() + return + } + origin, ok := requestBrowserOrigin(c.Request) + if !ok || !isAllowedSessionOrigin(c.Request, origin) { + c.AbortWithStatusJSON(http.StatusForbidden, gin.H{ + "success": false, + "code": "AUTH_ORIGIN_FORBIDDEN", + "message": "request origin is not allowed", + }) + return + } + c.Next() + } +} + +func requestBrowserOrigin(request *http.Request) (string, bool) { + originValues := request.Header.Values("Origin") + if len(originValues) > 1 { + return "", false + } + if len(originValues) == 1 { + if strings.Contains(originValues[0], ",") { + return "", false + } + origin, err := common.NormalizeOrigin(originValues[0]) + return origin, err == nil + } + refererValues := request.Header.Values("Referer") + if len(refererValues) != 1 { + return "", false + } + referer, err := url.Parse(strings.TrimSpace(refererValues[0])) + if err != nil || referer.Scheme == "" || referer.Host == "" || referer.User != nil { + return "", false + } + origin, err := common.NormalizeOrigin(referer.Scheme + "://" + referer.Host) + return origin, err == nil +} + +func isAllowedSessionOrigin(request *http.Request, origin string) bool { + requestScheme := "http" + if request.TLS != nil { + requestScheme = "https" + } + requestOrigin, err := common.NormalizeOrigin(requestScheme + "://" + request.Host) + if err == nil && subtle.ConstantTimeCompare([]byte(origin), []byte(requestOrigin)) == 1 { + return true + } + for _, trustedOrigin := range common.SessionCookieTrustedURLs { + if subtle.ConstantTimeCompare([]byte(origin), []byte(trustedOrigin)) == 1 { + return true + } + } + return false +} diff --git a/middleware/auth_origin_test.go b/middleware/auth_origin_test.go new file mode 100644 index 0000000000..81f1dec0f3 --- /dev/null +++ b/middleware/auth_origin_test.go @@ -0,0 +1,135 @@ +package middleware + +import ( + "net/http" + "net/http/httptest" + "testing" + + "github.com/QuantumNous/new-api/common" + "github.com/gin-gonic/gin" + "github.com/stretchr/testify/assert" +) + +func runOriginGuardRequest(t *testing.T, origin, referer string) *httptest.ResponseRecorder { + t.Helper() + gin.SetMode(gin.TestMode) + router := gin.New() + router.POST("/api/user/auth/refresh", SessionCookieOriginGuard(), func(c *gin.Context) { + c.Status(http.StatusNoContent) + }) + request := httptest.NewRequest(http.MethodPost, "https://panel.example.com/api/user/auth/refresh", nil) + request.Host = "panel.example.com" + request.Header.Set("Origin", origin) + if origin == "" { + request.Header.Del("Origin") + } + if referer != "" { + request.Header.Set("Referer", referer) + } + response := httptest.NewRecorder() + router.ServeHTTP(response, request) + return response +} + +func TestSessionCookieOriginGuard(t *testing.T) { + previousSecure := common.SessionCookieSecure + previousTrustedURLs := common.SessionCookieTrustedURLs + common.SessionCookieSecure = true + common.SessionCookieTrustedURLs = []string{"https://trusted.example.com"} + t.Cleanup(func() { + common.SessionCookieSecure = previousSecure + common.SessionCookieTrustedURLs = previousTrustedURLs + }) + + tests := []struct { + name string + origin string + referer string + expected int + }{ + {name: "same origin", origin: "https://panel.example.com", expected: http.StatusNoContent}, + {name: "trusted exact origin", origin: "https://trusted.example.com", expected: http.StatusNoContent}, + {name: "referer fallback", referer: "https://panel.example.com/profile", expected: http.StatusNoContent}, + {name: "missing both", expected: http.StatusForbidden}, + {name: "null origin", origin: "null", expected: http.StatusForbidden}, + {name: "suffix attack", origin: "https://trusted.example.com.evil.test", expected: http.StatusForbidden}, + {name: "scheme mismatch", origin: "http://panel.example.com", expected: http.StatusForbidden}, + {name: "path in origin", origin: "https://panel.example.com/profile", expected: http.StatusForbidden}, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + response := runOriginGuardRequest(t, test.origin, test.referer) + assert.Equal(t, test.expected, response.Code) + assert.Empty(t, response.Header().Get("Access-Control-Allow-Origin")) + }) + } +} + +func TestSessionCookieOriginGuardDevelopmentCompatibility(t *testing.T) { + previousSecure := common.SessionCookieSecure + previousTrustedURLs := common.SessionCookieTrustedURLs + t.Cleanup(func() { + common.SessionCookieSecure = previousSecure + common.SessionCookieTrustedURLs = previousTrustedURLs + }) + common.SessionCookieTrustedURLs = nil + + tests := []struct { + name string + secure bool + origin string + expected int + }{ + {name: "insecure mode allows mismatched development origins", origin: "http://localhost:3001", expected: http.StatusNoContent}, + {name: "insecure mode allows missing origin", expected: http.StatusNoContent}, + {name: "secure mode rejects mismatched development origins", secure: true, origin: "http://localhost:3001", expected: http.StatusForbidden}, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + common.SessionCookieSecure = test.secure + + gin.SetMode(gin.TestMode) + router := gin.New() + router.POST("/api/user/auth/refresh", SessionCookieOriginGuard(), func(c *gin.Context) { + c.Status(http.StatusNoContent) + }) + request := httptest.NewRequest(http.MethodPost, "http://localhost:3000/api/user/auth/refresh", nil) + request.Host = "localhost:3000" + if test.origin != "" { + request.Header.Set("Origin", test.origin) + } + response := httptest.NewRecorder() + router.ServeHTTP(response, request) + + assert.Equal(t, test.expected, response.Code) + assert.Empty(t, response.Header().Get("Access-Control-Allow-Origin")) + }) + } +} + +func TestSessionCookieOriginGuardDoesNotTrustForwardedProtoFromClient(t *testing.T) { + previousSecure := common.SessionCookieSecure + previousTrustedURLs := common.SessionCookieTrustedURLs + common.SessionCookieSecure = true + common.SessionCookieTrustedURLs = nil + t.Cleanup(func() { + common.SessionCookieSecure = previousSecure + common.SessionCookieTrustedURLs = previousTrustedURLs + }) + + gin.SetMode(gin.TestMode) + router := gin.New() + router.POST("/api/user/auth/refresh", SessionCookieOriginGuard(), func(c *gin.Context) { + c.Status(http.StatusNoContent) + }) + request := httptest.NewRequest(http.MethodPost, "http://panel.example.com/api/user/auth/refresh", nil) + request.Host = "panel.example.com" + request.Header.Set("Origin", "https://panel.example.com") + request.Header.Set("X-Forwarded-Proto", "https") + response := httptest.NewRecorder() + router.ServeHTTP(response, request) + + assert.Equal(t, http.StatusForbidden, response.Code) +} diff --git a/middleware/auth_test.go b/middleware/auth_test.go new file mode 100644 index 0000000000..db7fb343c4 --- /dev/null +++ b/middleware/auth_test.go @@ -0,0 +1,251 @@ +package middleware + +import ( + "crypto/hmac" + "crypto/sha256" + "errors" + "fmt" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/model" + "github.com/QuantumNous/new-api/service" + "github.com/gin-gonic/gin" + "github.com/glebarez/sqlite" + "github.com/golang-jwt/jwt/v5" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +func setupDashboardAuthMiddlewareTest(t *testing.T) { + t.Helper() + previousDB := model.DB + previousType := common.MainDatabaseType() + previousRedis := common.RedisEnabled + previousSecret := common.SessionSecret + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + require.NoError(t, err) + require.NoError(t, db.AutoMigrate(&model.User{}, &model.UserSession{})) + model.DB = db + common.SetMainDatabaseType(common.DatabaseTypeSQLite) + common.RedisEnabled = false + common.SessionSecret = "middleware-auth-test-secret" + t.Cleanup(func() { + model.DB = previousDB + common.SetMainDatabaseType(previousType) + common.RedisEnabled = previousRedis + common.SessionSecret = previousSecret + }) +} + +func issueExpiredDashboardAccessToken(t *testing.T, identity service.AuthIdentity) string { + t.Helper() + claims := jwt.MapClaims{ + "iss": "new-api", + "aud": []string{"new-api-dashboard"}, + "sub": fmt.Sprintf("%d", identity.UserID), + "token_use": "access", + "sid": identity.SessionID, + "uv": identity.UserAuthVersion, + "sv": identity.SessionVersion, + "exp": time.Now().Add(-time.Minute).Unix(), + "nbf": time.Now().Add(-2 * time.Minute).Unix(), + "iat": time.Now().Add(-2 * time.Minute).Unix(), + } + mac := hmac.New(sha256.New, []byte(common.SessionSecret)) + _, err := mac.Write([]byte("new-api/auth/access/v1")) + require.NoError(t, err) + token, err := jwt.NewWithClaims(jwt.SigningMethodHS256, claims).SignedString(mac.Sum(nil)) + require.NoError(t, err) + return token +} + +func tamperDashboardToken(token string) string { + tamperAt := len(token) - 2 + replacement := "x" + if token[tamperAt] == 'x' { + replacement = "y" + } + return token[:tamperAt] + replacement + token[tamperAt+1:] +} + +func createMiddlewarePATUser(t *testing.T, username, token string) *model.User { + t.Helper() + user := &model.User{ + Username: username, Password: "password-placeholder", Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, Group: "default", AccessToken: &token, AuthVersion: 1, + AffCode: "middleware-aff-" + username, + } + require.NoError(t, model.DB.Create(user).Error) + return user +} + +func TestUserAuthAllowsOpaqueDottedPAT(t *testing.T) { + setupDashboardAuthMiddlewareTest(t) + user := createMiddlewarePATUser(t, "dotted-pat-user", "opaque.key.with-dots") + router := gin.New() + router.GET("/protected", UserAuth(), func(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{"id": c.GetInt("id")}) + }) + request := httptest.NewRequest(http.MethodGet, "/protected", nil) + request.Header.Set("Authorization", "Bearer opaque.key.with-dots") + response := httptest.NewRecorder() + + router.ServeHTTP(response, request) + + assert.Equal(t, http.StatusOK, response.Code) + var body struct { + ID int `json:"id"` + } + require.NoError(t, common.Unmarshal(response.Body.Bytes(), &body)) + assert.Equal(t, user.Id, body.ID) +} + +func TestUserAuthNeverFallsBackForRecognizedInvalidInternalJWT(t *testing.T) { + setupDashboardAuthMiddlewareTest(t) + identity := service.AuthIdentity{UserID: 42, SessionID: "session-42", UserAuthVersion: 1, SessionVersion: 1} + token, _, err := service.IssueAccessToken(identity) + require.NoError(t, err) + tampered := tamperDashboardToken(token) + createMiddlewarePATUser(t, "jwt-fallback-user", tampered) + router := gin.New() + router.GET("/protected", UserAuth(), func(c *gin.Context) { + c.Status(http.StatusNoContent) + }) + request := httptest.NewRequest(http.MethodGet, "/protected", nil) + request.Header.Set("Authorization", "Bearer "+tampered) + response := httptest.NewRecorder() + + router.ServeHTTP(response, request) + + assert.Equal(t, http.StatusUnauthorized, response.Code) + assert.Contains(t, response.Body.String(), "AUTH_UNAUTHORIZED") +} + +func TestTryUserAuthCredentialClassification(t *testing.T) { + setupDashboardAuthMiddlewareTest(t) + gin.SetMode(gin.TestMode) + + patUser := createMiddlewarePATUser(t, "optional-pat-user", "optional.pat.with-dots") + internalUser := createMiddlewarePATUser(t, "optional-session-user", "unrelated-pat") + now := time.Now().Unix() + session := &model.UserSession{ + SID: "optional-auth-session", + UserID: internalUser.Id, + Version: 1, + UserAuthVersion: internalUser.AuthVersion, + Status: model.UserSessionStatusActive, + RefreshHash: "refresh-hash", + LoginMethod: "password", + LastActiveAt: now, + ExpiresAt: now + 3600, + } + require.NoError(t, model.CreateUserSession(session)) + identity := service.AuthIdentity{ + UserID: internalUser.Id, + SessionID: session.SID, + UserAuthVersion: session.UserAuthVersion, + SessionVersion: session.Version, + } + accessToken, _, err := service.IssueAccessToken(identity) + require.NoError(t, err) + securityProof, _, err := service.IssueSecurityProof(identity, "2fa", []string{"channel.key.read"}) + require.NoError(t, err) + externalToken, err := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{ + "iss": "external-issuer", + "aud": "external-audience", + "exp": time.Now().Add(time.Minute).Unix(), + }).SignedString([]byte("external-secret")) + require.NoError(t, err) + + router := gin.New() + router.GET("/optional", TryUserAuth(), func(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{ + "id": c.GetInt("id"), + "use_access_token": c.GetBool("use_access_token"), + }) + }) + + tests := []struct { + name string + token string + wantStatus int + wantUserID int + wantPAT bool + wantErrorCode string + }{ + {name: "no authorization header", wantStatus: http.StatusOK}, + {name: "opaque unmatched credential", token: "opaque-relay-key", wantStatus: http.StatusOK}, + {name: "dotted unmatched credential", token: "ordinary.key.with-dots", wantStatus: http.StatusOK}, + {name: "third party jwt", token: externalToken, wantStatus: http.StatusOK}, + {name: "valid pat", token: "optional.pat.with-dots", wantStatus: http.StatusOK, wantUserID: patUser.Id, wantPAT: true}, + {name: "valid internal access jwt", token: accessToken, wantStatus: http.StatusOK, wantUserID: internalUser.Id}, + {name: "expired internal access jwt", token: issueExpiredDashboardAccessToken(t, identity), wantStatus: http.StatusUnauthorized, wantErrorCode: "AUTH_TOKEN_EXPIRED"}, + {name: "tampered internal access jwt", token: tamperDashboardToken(accessToken), wantStatus: http.StatusUnauthorized, wantErrorCode: "AUTH_UNAUTHORIZED"}, + {name: "security proof used as access", token: securityProof, wantStatus: http.StatusUnauthorized, wantErrorCode: "AUTH_UNAUTHORIZED"}, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + request := httptest.NewRequest(http.MethodGet, "/optional", nil) + if test.token != "" { + request.Header.Set("Authorization", "Bearer "+test.token) + } + response := httptest.NewRecorder() + router.ServeHTTP(response, request) + assert.Equal(t, test.wantStatus, response.Code) + if test.wantErrorCode != "" { + assert.Contains(t, response.Body.String(), test.wantErrorCode) + return + } + var body struct { + ID int `json:"id"` + UseAccessToken bool `json:"use_access_token"` + } + require.NoError(t, common.Unmarshal(response.Body.Bytes(), &body)) + assert.Equal(t, test.wantUserID, body.ID) + assert.Equal(t, test.wantPAT, body.UseAccessToken) + }) + } + + requiredRouter := gin.New() + requiredRouter.GET("/required", UserAuth(), func(c *gin.Context) { c.Status(http.StatusNoContent) }) + requiredRequest := httptest.NewRequest(http.MethodGet, "/required", nil) + requiredRequest.Header.Set("Authorization", "Bearer ordinary-unmatched-key") + requiredResponse := httptest.NewRecorder() + requiredRouter.ServeHTTP(requiredResponse, requiredRequest) + assert.Equal(t, http.StatusUnauthorized, requiredResponse.Code, "required dashboard authentication must not adopt optional-auth fallback semantics") + + var patUserQueries int + forcedCacheError := errors.New("forced PAT user cache lookup failure") + const callbackName = "test:optional-auth-pat-user-cache-failure" + require.NoError(t, model.DB.Callback().Query().Before("gorm:query").Register(callbackName, func(tx *gorm.DB) { + if tx.Statement.Table != "users" { + return + } + patUserQueries++ + if patUserQueries == 2 { + tx.AddError(forcedCacheError) + } + })) + cacheFailureRequest := httptest.NewRequest(http.MethodGet, "/optional", nil) + cacheFailureRequest.Header.Set("Authorization", "Bearer optional.pat.with-dots") + cacheFailureResponse := httptest.NewRecorder() + router.ServeHTTP(cacheFailureResponse, cacheFailureRequest) + model.DB.Callback().Query().Remove(callbackName) + assert.Equal(t, http.StatusInternalServerError, cacheFailureResponse.Code) + assert.Contains(t, cacheFailureResponse.Body.String(), "AUTH_INTERNAL_ERROR") + + sqlDB, err := model.DB.DB() + require.NoError(t, err) + require.NoError(t, sqlDB.Close()) + databaseFailureRequest := httptest.NewRequest(http.MethodGet, "/optional", nil) + databaseFailureRequest.Header.Set("Authorization", "Bearer database-failure-key") + databaseFailureResponse := httptest.NewRecorder() + router.ServeHTTP(databaseFailureResponse, databaseFailureRequest) + assert.Equal(t, http.StatusInternalServerError, databaseFailureResponse.Code) + assert.Contains(t, databaseFailureResponse.Body.String(), "AUTH_INTERNAL_ERROR") +} diff --git a/middleware/email-verification-rate-limit.go b/middleware/email-verification-rate-limit.go index 470d7731cb..49081b55d4 100644 --- a/middleware/email-verification-rate-limit.go +++ b/middleware/email-verification-rate-limit.go @@ -1,10 +1,8 @@ package middleware import ( - "context" "fmt" "net/http" - "time" "github.com/QuantumNous/new-api/common" @@ -18,33 +16,24 @@ const ( ) func redisEmailVerificationRateLimiter(c *gin.Context) { - ctx := context.Background() - rdb := common.RDB - key := "emailVerification:" + EmailVerificationRateLimitMark + ":" + c.ClientIP() - - count, err := rdb.Incr(ctx, key).Result() + allowed, _, ttlSeconds, err := redisFixedWindowTake( + c.Request.Context(), + redisIPRateLimitKey(EmailVerificationRateLimitMark, c.ClientIP()), + EmailVerificationMaxRequests, + EmailVerificationDuration, + ) if err != nil { - // fallback memoryEmailVerificationRateLimiter(c) return } - - // 第一次设置键时设置过期时间 - if count == 1 { - _ = rdb.Expire(ctx, key, time.Duration(EmailVerificationDuration)*time.Second).Err() - } - - // 检查是否超出限制 - if count <= int64(EmailVerificationMaxRequests) { + if allowed { c.Next() return } - // 获取剩余等待时间 - ttl, err := rdb.TTL(ctx, key).Result() waitSeconds := int64(EmailVerificationDuration) - if err == nil && ttl > 0 { - waitSeconds = int64(ttl.Seconds()) + if ttlSeconds > 0 { + waitSeconds = ttlSeconds } c.JSON(http.StatusTooManyRequests, gin.H{ @@ -70,11 +59,13 @@ func memoryEmailVerificationRateLimiter(c *gin.Context) { } func EmailVerificationRateLimit() gin.HandlerFunc { + // Keep the fallback ready before requests arrive so a concurrent Redis + // outage cannot race the in-memory limiter's first initialization. + inMemoryRateLimiter.Init(common.RateLimitKeyExpirationDuration) return func(c *gin.Context) { if common.RedisEnabled { redisEmailVerificationRateLimiter(c) } else { - inMemoryRateLimiter.Init(common.RateLimitKeyExpirationDuration) memoryEmailVerificationRateLimiter(c) } } diff --git a/middleware/header_nav_test.go b/middleware/header_nav_test.go index d4c9c221ef..6ed0b0aa96 100644 --- a/middleware/header_nav_test.go +++ b/middleware/header_nav_test.go @@ -6,10 +6,12 @@ import ( "testing" "github.com/QuantumNous/new-api/common" - "github.com/gin-contrib/sessions" - "github.com/gin-contrib/sessions/cookie" + "github.com/QuantumNous/new-api/model" + "github.com/QuantumNous/new-api/service" "github.com/gin-gonic/gin" + "github.com/glebarez/sqlite" "github.com/stretchr/testify/require" + "gorm.io/gorm" ) func withHeaderNavModules(t *testing.T, raw string) { @@ -39,40 +41,39 @@ func performHeaderNavRequest(t *testing.T, handler gin.HandlerFunc, authenticate gin.SetMode(gin.TestMode) router := gin.New() - router.Use(sessions.Sessions("session", cookie.NewStore([]byte("header-nav-test")))) - router.GET("/login", func(c *gin.Context) { - session := sessions.Default(c) - session.Set("username", "tester") - session.Set("role", common.RoleCommonUser) - session.Set("id", 1) - session.Set("status", common.UserStatusEnabled) - session.Set("group", "default") - if err := session.Save(); err != nil { - c.JSON(http.StatusInternalServerError, gin.H{"success": false}) - return - } - c.Status(http.StatusNoContent) - }) router.GET("/api/test", handler, func(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"success": true}) }) - var cookies []*http.Cookie + var accessToken string if authenticated { - loginRecorder := httptest.NewRecorder() - loginRequest := httptest.NewRequest(http.MethodGet, "/login", nil) - router.ServeHTTP(loginRecorder, loginRequest) - require.Equal(t, http.StatusNoContent, loginRecorder.Code) - cookies = loginRecorder.Result().Cookies() + previousDB, previousRedis := model.DB, common.RedisEnabled + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + require.NoError(t, err) + require.NoError(t, db.AutoMigrate(&model.User{})) + model.DB = db + common.RedisEnabled = false + t.Cleanup(func() { + model.DB = previousDB + common.RedisEnabled = previousRedis + }) + accessToken = "header-nav-pat" + user := model.User{ + Username: "tester", + Password: "unused-password-hash", + Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, + Group: "default", + AuthVersion: 1, + } + user.SetAccessToken(accessToken) + require.NoError(t, db.Create(&user).Error) } recorder := httptest.NewRecorder() request := httptest.NewRequest(http.MethodGet, "/api/test", nil) if authenticated { - request.Header.Set("New-Api-User", "1") - for _, cookie := range cookies { - request.AddCookie(cookie) - } + request.Header.Set("Authorization", "Bearer "+accessToken) } router.ServeHTTP(recorder, request) return recorder @@ -165,3 +166,24 @@ func TestHeaderNavModulePublicOrUserAuthRequiresLoginForLegacyDisabledModule(t * require.Equal(t, http.StatusUnauthorized, recorder.Code) } + +func TestHeaderNavPublicRouteRejectsExpiredInternalAccessToken(t *testing.T) { + setupDashboardAuthMiddlewareTest(t) + withHeaderNavModules(t, "") + gin.SetMode(gin.TestMode) + + router := gin.New() + router.GET("/api/test", HeaderNavModuleAuth("pricing"), func(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{"success": true}) + }) + request := httptest.NewRequest(http.MethodGet, "/api/test", nil) + request.Header.Set("Authorization", "Bearer "+issueExpiredDashboardAccessToken(t, service.AuthIdentity{ + UserID: 1, SessionID: "expired-header-nav-session", UserAuthVersion: 1, SessionVersion: 1, + })) + response := httptest.NewRecorder() + + router.ServeHTTP(response, request) + + require.Equal(t, http.StatusUnauthorized, response.Code) + require.Contains(t, response.Body.String(), "AUTH_TOKEN_EXPIRED") +} diff --git a/middleware/model-rate-limit.go b/middleware/model-rate-limit.go index 80a3995df0..9f1d940396 100644 --- a/middleware/model-rate-limit.go +++ b/middleware/model-rate-limit.go @@ -19,6 +19,7 @@ import ( const ( ModelRequestRateLimitCountMark = "MRRL" ModelRequestRateLimitSuccessCountMark = "MRRLS" + modelRateLimitTimeFormat = "2006-01-02T15:04:05.000Z" ) // 检查Redis中的请求限制 @@ -41,13 +42,13 @@ func checkRedisRateLimit(ctx context.Context, rdb *redis.Client, key string, max // 检查时间窗口 oldTimeStr, _ := rdb.LIndex(ctx, key, -1).Result() - oldTime, err := time.Parse(timeFormat, oldTimeStr) + oldTime, err := time.Parse(modelRateLimitTimeFormat, oldTimeStr) if err != nil { return false, err } - nowTimeStr := time.Now().Format(timeFormat) - nowTime, err := time.Parse(timeFormat, nowTimeStr) + nowTimeStr := time.Now().UTC().Format(modelRateLimitTimeFormat) + nowTime, err := time.Parse(modelRateLimitTimeFormat, nowTimeStr) if err != nil { return false, err } @@ -68,7 +69,7 @@ func recordRedisRequest(ctx context.Context, rdb *redis.Client, key string, maxC return } - now := time.Now().Format(timeFormat) + now := time.Now().UTC().Format(modelRateLimitTimeFormat) rdb.LPush(ctx, key, now) rdb.LTrim(ctx, key, 0, int64(maxCount-1)) rdb.Expire(ctx, key, time.Duration(setting.ModelRequestRateLimitDurationMinutes)*time.Minute) diff --git a/middleware/model_rate_limit_test.go b/middleware/model_rate_limit_test.go new file mode 100644 index 0000000000..3e9923fdac --- /dev/null +++ b/middleware/model_rate_limit_test.go @@ -0,0 +1,34 @@ +package middleware + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestModelRedisRateLimitUsesUTCRegardlessOfLocalTimezone(t *testing.T) { + redisServer, redisClient := useRateLimitMiniRedis(t) + previousLocation := time.Local + time.Local = time.FixedZone("test-utc-plus-eight", 8*60*60) + t.Cleanup(func() { time.Local = previousLocation }) + + ctx := context.Background() + recordKey := "rateLimit:model-utc-record" + recordRedisRequest(ctx, redisClient, recordKey, 2) + recorded, err := redisClient.LIndex(ctx, recordKey, 0).Result() + require.NoError(t, err) + recordedAt, err := time.Parse(modelRateLimitTimeFormat, recorded) + require.NoError(t, err) + assert.WithinDuration(t, time.Now().UTC(), recordedAt, 2*time.Second) + + checkKey := "rateLimit:model-utc-check" + withinWindow := time.Now().UTC().Add(-30 * time.Second).Format(modelRateLimitTimeFormat) + _, err = redisServer.Push(checkKey, withinWindow, withinWindow) + require.NoError(t, err) + allowed, err := checkRedisRateLimit(ctx, redisClient, checkKey, 2, 60) + require.NoError(t, err) + assert.False(t, allowed, "an existing UTC timestamp inside the window must remain limited on a non-UTC host") +} diff --git a/middleware/rate-limit.go b/middleware/rate-limit.go index d8dd15d9c5..a6389161c2 100644 --- a/middleware/rate-limit.go +++ b/middleware/rate-limit.go @@ -2,15 +2,37 @@ package middleware import ( "context" + "errors" "fmt" "net/http" - "time" + "strconv" "github.com/QuantumNous/new-api/common" "github.com/gin-gonic/gin" ) -var timeFormat = "2006-01-02T15:04:05.000Z" +const redisRateLimitNamespace = "rateLimit:v2" + +// Redis rate limiting intentionally uses a fixed window. The single Lua script +// makes increment, expiry, and the limit decision atomic, while retaining the +// simple fixed-window behavior: traffic at a window boundary can burst up to +// twice the configured limit. Do not replace this with a sliding-window ZSET +// unless that externally visible behavior is intentionally changed. +const redisFixedWindowScript = ` +local count = redis.call('INCR', KEYS[1]) +if count == 1 then + redis.call('EXPIRE', KEYS[1], ARGV[2]) +end +local ttl = redis.call('TTL', KEYS[1]) +if ttl < 0 then + redis.call('EXPIRE', KEYS[1], ARGV[2]) + ttl = redis.call('TTL', KEYS[1]) +end +if count > tonumber(ARGV[1]) then + return {0, count, ttl} +end +return {1, count, ttl} +` var inMemoryRateLimiter common.InMemoryRateLimiter @@ -18,49 +40,87 @@ var defNext = func(c *gin.Context) { c.Next() } +func redisIPRateLimitKey(mark string, clientIP string) string { + return fmt.Sprintf("%s:ip:%s:%s", redisRateLimitNamespace, mark, clientIP) +} + +func redisUserRateLimitKey(mark string, userID int) string { + return fmt.Sprintf("%s:user:%s:%d", redisRateLimitNamespace, mark, userID) +} + +func redisReplyInteger(value interface{}) (int64, error) { + switch typed := value.(type) { + case int64: + return typed, nil + case string: + return strconv.ParseInt(typed, 10, 64) + case []byte: + return strconv.ParseInt(string(typed), 10, 64) + default: + return 0, fmt.Errorf("unexpected Redis integer reply type %T", value) + } +} + +func redisFixedWindowTake(ctx context.Context, key string, maxRequestNum int, duration int64) (bool, int64, int64, error) { + if common.RDB == nil { + return false, 0, 0, errors.New("Redis client is not initialized") + } + if key == "" { + return false, 0, 0, errors.New("rate limit key is empty") + } + if maxRequestNum <= 0 { + return false, 0, 0, errors.New("rate limit maximum must be positive") + } + if duration <= 0 { + return false, 0, 0, errors.New("rate limit duration must be positive") + } + + values, err := common.RDB.Eval( + ctx, + redisFixedWindowScript, + []string{key}, + maxRequestNum, + duration, + ).Slice() + if err != nil { + return false, 0, 0, err + } + if len(values) != 3 { + return false, 0, 0, fmt.Errorf("unexpected Redis rate limit reply length %d", len(values)) + } + + allowedValue, err := redisReplyInteger(values[0]) + if err != nil { + return false, 0, 0, err + } + count, err := redisReplyInteger(values[1]) + if err != nil { + return false, 0, 0, err + } + ttlSeconds, err := redisReplyInteger(values[2]) + if err != nil { + return false, 0, 0, err + } + + return allowedValue == 1, count, ttlSeconds, nil +} + func redisRateLimiter(c *gin.Context, maxRequestNum int, duration int64, mark string) { - ctx := context.Background() - rdb := common.RDB - key := "rateLimit:" + mark + c.ClientIP() - listLength, err := rdb.LLen(ctx, key).Result() + allowed, _, _, err := redisFixedWindowTake( + c.Request.Context(), + redisIPRateLimitKey(mark, c.ClientIP()), + maxRequestNum, + duration, + ) if err != nil { fmt.Println(err.Error()) c.Status(http.StatusInternalServerError) c.Abort() return } - if listLength < int64(maxRequestNum) { - rdb.LPush(ctx, key, time.Now().Format(timeFormat)) - rdb.Expire(ctx, key, common.RateLimitKeyExpirationDuration) - } else { - oldTimeStr, _ := rdb.LIndex(ctx, key, -1).Result() - oldTime, err := time.Parse(timeFormat, oldTimeStr) - if err != nil { - fmt.Println(err) - c.Status(http.StatusInternalServerError) - c.Abort() - return - } - nowTimeStr := time.Now().Format(timeFormat) - nowTime, err := time.Parse(timeFormat, nowTimeStr) - if err != nil { - fmt.Println(err) - c.Status(http.StatusInternalServerError) - c.Abort() - return - } - // time.Since will return negative number! - // See: https://stackoverflow.com/questions/50970900/why-is-time-since-returning-negative-durations-on-windows - if int64(nowTime.Sub(oldTime).Seconds()) < duration { - rdb.Expire(ctx, key, common.RateLimitKeyExpirationDuration) - c.Status(http.StatusTooManyRequests) - c.Abort() - return - } else { - rdb.LPush(ctx, key, time.Now().Format(timeFormat)) - rdb.LTrim(ctx, key, 0, int64(maxRequestNum-1)) - rdb.Expire(ctx, key, common.RateLimitKeyExpirationDuration) - } + if !allowed { + c.Status(http.StatusTooManyRequests) + c.Abort() } } @@ -78,12 +138,11 @@ func rateLimitFactory(maxRequestNum int, duration int64, mark string) func(c *gi return func(c *gin.Context) { redisRateLimiter(c, maxRequestNum, duration, mark) } - } else { - // It's safe to call multi times. - inMemoryRateLimiter.Init(common.RateLimitKeyExpirationDuration) - return func(c *gin.Context) { - memoryRateLimiter(c, maxRequestNum, duration, mark) - } + } + // It's safe to call multi times. + inMemoryRateLimiter.Init(common.RateLimitKeyExpirationDuration) + return func(c *gin.Context) { + memoryRateLimiter(c, maxRequestNum, duration, mark) } } @@ -122,26 +181,25 @@ func UploadRateLimit() func(c *gin.Context) { func userRateLimitFactory(maxRequestNum int, duration int64, mark string) func(c *gin.Context) { if common.RedisEnabled { return func(c *gin.Context) { - userId := c.GetInt("id") - if userId == 0 { + userID := c.GetInt("id") + if userID == 0 { c.Status(http.StatusUnauthorized) c.Abort() return } - key := fmt.Sprintf("rateLimit:%s:user:%d", mark, userId) - userRedisRateLimiter(c, maxRequestNum, duration, key) + userRedisRateLimiter(c, maxRequestNum, duration, redisUserRateLimitKey(mark, userID)) } } // It's safe to call multi times. inMemoryRateLimiter.Init(common.RateLimitKeyExpirationDuration) return func(c *gin.Context) { - userId := c.GetInt("id") - if userId == 0 { + userID := c.GetInt("id") + if userID == 0 { c.Status(http.StatusUnauthorized) c.Abort() return } - key := fmt.Sprintf("%s:user:%d", mark, userId) + key := fmt.Sprintf("%s:user:%d", mark, userID) if !inMemoryRateLimiter.Request(key, maxRequestNum, duration) { c.Status(http.StatusTooManyRequests) c.Abort() @@ -153,45 +211,16 @@ func userRateLimitFactory(maxRequestNum int, duration int64, mark string) func(c // userRedisRateLimiter is like redisRateLimiter but accepts a pre-built key // (to support user-ID-based keys). func userRedisRateLimiter(c *gin.Context, maxRequestNum int, duration int64, key string) { - ctx := context.Background() - rdb := common.RDB - listLength, err := rdb.LLen(ctx, key).Result() + allowed, _, _, err := redisFixedWindowTake(c.Request.Context(), key, maxRequestNum, duration) if err != nil { fmt.Println(err.Error()) c.Status(http.StatusInternalServerError) c.Abort() return } - if listLength < int64(maxRequestNum) { - rdb.LPush(ctx, key, time.Now().Format(timeFormat)) - rdb.Expire(ctx, key, common.RateLimitKeyExpirationDuration) - } else { - oldTimeStr, _ := rdb.LIndex(ctx, key, -1).Result() - oldTime, err := time.Parse(timeFormat, oldTimeStr) - if err != nil { - fmt.Println(err) - c.Status(http.StatusInternalServerError) - c.Abort() - return - } - nowTimeStr := time.Now().Format(timeFormat) - nowTime, err := time.Parse(timeFormat, nowTimeStr) - if err != nil { - fmt.Println(err) - c.Status(http.StatusInternalServerError) - c.Abort() - return - } - if int64(nowTime.Sub(oldTime).Seconds()) < duration { - rdb.Expire(ctx, key, common.RateLimitKeyExpirationDuration) - c.Status(http.StatusTooManyRequests) - c.Abort() - return - } else { - rdb.LPush(ctx, key, time.Now().Format(timeFormat)) - rdb.LTrim(ctx, key, 0, int64(maxRequestNum-1)) - rdb.Expire(ctx, key, common.RateLimitKeyExpirationDuration) - } + if !allowed { + c.Status(http.StatusTooManyRequests) + c.Abort() } } diff --git a/middleware/rate_limit_test.go b/middleware/rate_limit_test.go new file mode 100644 index 0000000000..b955753b24 --- /dev/null +++ b/middleware/rate_limit_test.go @@ -0,0 +1,223 @@ +package middleware + +import ( + "context" + "net/http" + "net/http/httptest" + "sync" + "sync/atomic" + "testing" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/alicebob/miniredis/v2" + "github.com/gin-gonic/gin" + "github.com/go-redis/redis/v8" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func useRateLimitMiniRedis(t *testing.T) (*miniredis.Miniredis, *redis.Client) { + t.Helper() + + previousRedisEnabled := common.RedisEnabled + previousRedisClient := common.RDB + redisServer := miniredis.RunT(t) + redisClient := redis.NewClient(&redis.Options{Addr: redisServer.Addr()}) + require.NoError(t, redisClient.Ping(context.Background()).Err()) + + common.RedisEnabled = true + common.RDB = redisClient + t.Cleanup(func() { + _ = redisClient.Close() + common.RedisEnabled = previousRedisEnabled + common.RDB = previousRedisClient + }) + + return redisServer, redisClient +} + +func performRateLimitRequest(router http.Handler, path string, remoteAddr string) *httptest.ResponseRecorder { + recorder := httptest.NewRecorder() + request := httptest.NewRequest(http.MethodGet, path, nil) + request.RemoteAddr = remoteAddr + router.ServeHTTP(recorder, request) + return recorder +} + +func TestRedisIPRateLimiterThresholdTTLAndNamespace(t *testing.T) { + gin.SetMode(gin.TestMode) + redisServer, _ := useRateLimitMiniRedis(t) + + router := gin.New() + require.NoError(t, router.SetTrustedProxies(nil)) + router.GET("/limited", rateLimitFactory(2, 37, "TEST"), func(c *gin.Context) { + c.Status(http.StatusNoContent) + }) + + remoteAddr := "192.0.2.10:12345" + legacyKey := "rateLimit:TEST192.0.2.10" + _, err := redisServer.Push(legacyKey, "legacy-list-entry") + require.NoError(t, err) + assert.Equal(t, http.StatusNoContent, performRateLimitRequest(router, "/limited", remoteAddr).Code) + assert.Equal(t, http.StatusNoContent, performRateLimitRequest(router, "/limited", remoteAddr).Code) + assert.Equal(t, http.StatusTooManyRequests, performRateLimitRequest(router, "/limited", remoteAddr).Code) + + key := redisIPRateLimitKey("TEST", "192.0.2.10") + count, err := redisServer.Get(key) + require.NoError(t, err) + assert.Equal(t, "3", count) + assert.Equal(t, 37*time.Second, redisServer.TTL(key)) + assert.True(t, redisServer.Exists(legacyKey), "the v2 counter must not touch an old list key") +} + +func TestRedisUserRateLimiterUsesSharedFixedWindow(t *testing.T) { + gin.SetMode(gin.TestMode) + redisServer, _ := useRateLimitMiniRedis(t) + + router := gin.New() + router.GET( + "/limited", + func(c *gin.Context) { c.Set("id", 42) }, + userRateLimitFactory(1, 23, "USER"), + func(c *gin.Context) { c.Status(http.StatusNoContent) }, + ) + + assert.Equal(t, http.StatusNoContent, performRateLimitRequest(router, "/limited", "192.0.2.20:12345").Code) + assert.Equal(t, http.StatusTooManyRequests, performRateLimitRequest(router, "/limited", "198.51.100.20:12345").Code) + + key := redisUserRateLimitKey("USER", 42) + assert.True(t, redisServer.Exists(key)) + assert.Equal(t, 23*time.Second, redisServer.TTL(key)) +} + +func TestRedisEmailVerificationRateLimiterPreservesResponseAndTTL(t *testing.T) { + gin.SetMode(gin.TestMode) + redisServer, _ := useRateLimitMiniRedis(t) + + router := gin.New() + require.NoError(t, router.SetTrustedProxies(nil)) + router.GET("/verify", EmailVerificationRateLimit(), func(c *gin.Context) { + c.Status(http.StatusNoContent) + }) + + remoteAddr := "192.0.2.30:12345" + assert.Equal(t, http.StatusNoContent, performRateLimitRequest(router, "/verify", remoteAddr).Code) + assert.Equal(t, http.StatusNoContent, performRateLimitRequest(router, "/verify", remoteAddr).Code) + response := performRateLimitRequest(router, "/verify", remoteAddr) + assert.Equal(t, http.StatusTooManyRequests, response.Code) + assert.JSONEq(t, `{"success":false,"message":"发送过于频繁,请等待 30 秒后再试"}`, response.Body.String()) + + key := redisIPRateLimitKey(EmailVerificationRateLimitMark, "192.0.2.30") + assert.True(t, redisServer.Exists(key)) + assert.Equal(t, time.Duration(EmailVerificationDuration)*time.Second, redisServer.TTL(key)) +} + +func TestRedisFixedWindowIsAtomicUnderConcurrency(t *testing.T) { + redisServer, _ := useRateLimitMiniRedis(t) + const ( + requestCount = 20 + maximumCount = 7 + duration = int64(41) + ) + key := redisIPRateLimitKey("CONCURRENT", "192.0.2.40") + + var allowedCount atomic.Int64 + errorsFound := make(chan error, requestCount) + var waitGroup sync.WaitGroup + waitGroup.Add(requestCount) + for range requestCount { + go func() { + defer waitGroup.Done() + allowed, _, _, err := redisFixedWindowTake(context.Background(), key, maximumCount, duration) + if err != nil { + errorsFound <- err + return + } + if allowed { + allowedCount.Add(1) + } + }() + } + waitGroup.Wait() + close(errorsFound) + for err := range errorsFound { + require.NoError(t, err) + } + + assert.Equal(t, int64(maximumCount), allowedCount.Load()) + count, err := redisServer.Get(key) + require.NoError(t, err) + assert.Equal(t, "20", count) + assert.Equal(t, time.Duration(duration)*time.Second, redisServer.TTL(key)) +} + +func TestRedisFixedWindowResetsAtBoundary(t *testing.T) { + redisServer, _ := useRateLimitMiniRedis(t) + const duration = int64(10) + key := redisIPRateLimitKey("BOUNDARY", "192.0.2.50") + + for range 2 { + allowed, _, _, err := redisFixedWindowTake(context.Background(), key, 2, duration) + require.NoError(t, err) + assert.True(t, allowed) + } + allowed, _, _, err := redisFixedWindowTake(context.Background(), key, 2, duration) + require.NoError(t, err) + assert.False(t, allowed) + + // This reset is intentional fixed-window behavior. A client can consume one + // full allowance immediately before and another immediately after a boundary. + redisServer.FastForward(time.Duration(duration) * time.Second) + for range 2 { + allowed, _, _, err = redisFixedWindowTake(context.Background(), key, 2, duration) + require.NoError(t, err) + assert.True(t, allowed) + } +} + +func TestRedisFixedWindowRepairsCounterWithoutTTL(t *testing.T) { + redisServer, _ := useRateLimitMiniRedis(t) + const duration = int64(29) + key := redisIPRateLimitKey("MISSING-TTL", "192.0.2.51") + redisServer.Set(key, "5") + + allowed, count, ttl, err := redisFixedWindowTake(context.Background(), key, 3, duration) + require.NoError(t, err) + assert.False(t, allowed) + assert.Equal(t, int64(6), count) + assert.Equal(t, duration, ttl) + assert.Equal(t, time.Duration(duration)*time.Second, redisServer.TTL(key)) + + redisServer.FastForward(time.Duration(duration) * time.Second) + assert.False(t, redisServer.Exists(key), "a recovered counter must not remain permanently rate-limited") +} + +func TestRedisFailurePolicies(t *testing.T) { + gin.SetMode(gin.TestMode) + _, redisClient := useRateLimitMiniRedis(t) + require.NoError(t, redisClient.Close()) + + router := gin.New() + require.NoError(t, router.SetTrustedProxies(nil)) + router.GET("/ip", rateLimitFactory(1, 30, "FAIL-IP"), func(c *gin.Context) { + c.Status(http.StatusNoContent) + }) + router.GET( + "/user", + func(c *gin.Context) { c.Set("id", 7) }, + userRateLimitFactory(1, 30, "FAIL-USER"), + func(c *gin.Context) { c.Status(http.StatusNoContent) }, + ) + router.GET("/email", EmailVerificationRateLimit(), func(c *gin.Context) { + c.Status(http.StatusNoContent) + }) + + ipResponse := performRateLimitRequest(router, "/ip", "192.0.2.60:12345") + assert.Equal(t, http.StatusInternalServerError, ipResponse.Code) + assert.Empty(t, ipResponse.Body.String()) + userResponse := performRateLimitRequest(router, "/user", "192.0.2.61:12345") + assert.Equal(t, http.StatusInternalServerError, userResponse.Code) + assert.Empty(t, userResponse.Body.String()) + assert.Equal(t, http.StatusNoContent, performRateLimitRequest(router, "/email", "192.0.2.62:12345").Code) +} diff --git a/middleware/secure_verification.go b/middleware/secure_verification.go index b218f6b1bb..53c47c8859 100644 --- a/middleware/secure_verification.go +++ b/middleware/secure_verification.go @@ -1,133 +1,60 @@ package middleware import ( + "errors" "net/http" - "time" + "strings" - "github.com/gin-contrib/sessions" + "github.com/QuantumNous/new-api/service" "github.com/gin-gonic/gin" ) -const ( - // SecureVerificationSessionKey 安全验证的 session key(与 controller 保持一致) - SecureVerificationSessionKey = "secure_verified_at" - secureVerificationMethodSessionKey = "secure_verified_method" - // SecureVerificationTimeout 验证有效期(秒) - SecureVerificationTimeout = 300 // 5分钟 -) - -// SecureVerificationRequired 安全验证中间件 -// 检查用户是否在有效时间内通过了安全验证 -// 如果未验证或验证已过期,返回 401 错误 +// SecureVerificationRequired protects channel key disclosure. Other sensitive +// operations validate their narrower proof scopes in their controller. func SecureVerificationRequired() gin.HandlerFunc { return func(c *gin.Context) { - // 检查用户是否已登录 - userId := c.GetInt("id") - if userId == 0 { - c.JSON(http.StatusUnauthorized, gin.H{ - "success": false, - "message": "未登录", - }) - c.Abort() + if !RequireSecurityProof(c, "channel.key.read", []string{"2fa", "passkey"}) { return } - - // 检查 session 中的验证时间戳 - session := sessions.Default(c) - verifiedAtRaw := session.Get(SecureVerificationSessionKey) - - if verifiedAtRaw == nil { - c.JSON(http.StatusForbidden, gin.H{ - "success": false, - "message": "需要安全验证", - "code": "VERIFICATION_REQUIRED", - }) - c.Abort() - return - } - - verifiedAt, ok := verifiedAtRaw.(int64) - if !ok { - // session 数据格式错误 - clearSecureVerificationSession(session) - c.JSON(http.StatusForbidden, gin.H{ - "success": false, - "message": "验证状态异常,请重新验证", - "code": "VERIFICATION_INVALID", - }) - c.Abort() - return - } - - // 检查验证是否过期 - elapsed := time.Now().Unix() - verifiedAt - if elapsed >= SecureVerificationTimeout { - // 验证已过期,清除 session - clearSecureVerificationSession(session) - c.JSON(http.StatusForbidden, gin.H{ - "success": false, - "message": "验证已过期,请重新验证", - "code": "VERIFICATION_EXPIRED", - }) - c.Abort() - return - } - - c.Next() - } -} - -func clearSecureVerificationSession(session sessions.Session) { - session.Delete(SecureVerificationSessionKey) - session.Delete(secureVerificationMethodSessionKey) - _ = session.Save() -} - -// OptionalSecureVerification 可选的安全验证中间件 -// 如果用户已验证,则在 context 中设置标记,但不阻止请求继续 -// 用于某些需要区分是否已验证的场景 -func OptionalSecureVerification() gin.HandlerFunc { - return func(c *gin.Context) { - userId := c.GetInt("id") - if userId == 0 { - c.Set("secure_verified", false) - c.Next() - return - } - - session := sessions.Default(c) - verifiedAtRaw := session.Get(SecureVerificationSessionKey) - - if verifiedAtRaw == nil { - c.Set("secure_verified", false) - c.Next() - return - } - - verifiedAt, ok := verifiedAtRaw.(int64) - if !ok { - c.Set("secure_verified", false) - c.Next() - return - } - - elapsed := time.Now().Unix() - verifiedAt - if elapsed >= SecureVerificationTimeout { - clearSecureVerificationSession(session) - c.Set("secure_verified", false) - c.Next() - return - } - c.Set("secure_verified", true) - c.Set("secure_verified_at", verifiedAt) c.Next() } } -// ClearSecureVerification 清除安全验证状态 -// 用于用户登出或需要强制重新验证的场景 -func ClearSecureVerification(c *gin.Context) { - session := sessions.Default(c) - clearSecureVerificationSession(session) +// RequireSecurityProof validates a proof against the authenticated dashboard +// session and writes the shared proof error contract on failure. +func RequireSecurityProof(c *gin.Context, requiredScope string, allowedMethods []string) bool { + identity, ok := GetSessionAuthIdentity(c) + if !ok { + securityProofError(c, "SECURITY_PROOF_INVALID", "安全验证状态无效") + return false + } + raw := strings.TrimSpace(c.GetHeader("X-Security-Proof")) + if raw == "" { + securityProofError(c, "SECURITY_PROOF_REQUIRED", "需要安全验证") + return false + } + if _, err := service.VerifySecurityProof(raw, identity, requiredScope, allowedMethods); err != nil { + switch { + case errors.Is(err, service.ErrAuthTokenExpired): + securityProofError(c, "SECURITY_PROOF_EXPIRED", "安全验证已过期") + case errors.Is(err, service.ErrProofScope): + securityProofError(c, "SECURITY_PROOF_SCOPE_MISMATCH", "安全验证范围不匹配") + case errors.Is(err, service.ErrProofMethod): + securityProofError(c, "SECURITY_PROOF_METHOD_MISMATCH", "安全验证方式不匹配") + default: + securityProofError(c, "SECURITY_PROOF_INVALID", "安全验证状态无效") + } + return false + } + return true +} + +func securityProofError(c *gin.Context, code, message string) { + c.JSON(http.StatusForbidden, gin.H{ + "success": false, + "message": message, + "code": code, + }) + c.Abort() } diff --git a/middleware/turnstile-check.go b/middleware/turnstile-check.go index af87fad442..6d7f1eeb73 100644 --- a/middleware/turnstile-check.go +++ b/middleware/turnstile-check.go @@ -1,12 +1,10 @@ package middleware import ( - "encoding/json" "net/http" "net/url" "github.com/QuantumNous/new-api/common" - "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" ) @@ -17,12 +15,6 @@ type turnstileCheckResponse struct { func TurnstileCheck() gin.HandlerFunc { return func(c *gin.Context) { if common.TurnstileCheckEnabled { - session := sessions.Default(c) - turnstileChecked := session.Get("turnstile") - if turnstileChecked != nil { - c.Next() - return - } response := c.Query("turnstile") if response == "" { c.JSON(http.StatusOK, gin.H{ @@ -48,7 +40,7 @@ func TurnstileCheck() gin.HandlerFunc { } defer rawRes.Body.Close() var res turnstileCheckResponse - err = json.NewDecoder(rawRes.Body).Decode(&res) + err = common.DecodeJson(rawRes.Body, &res) if err != nil { common.SysLog(err.Error()) c.JSON(http.StatusOK, gin.H{ @@ -66,15 +58,6 @@ func TurnstileCheck() gin.HandlerFunc { c.Abort() return } - session.Set("turnstile", true) - err = session.Save() - if err != nil { - c.JSON(http.StatusOK, gin.H{ - "message": "无法保存会话信息,请重试", - "success": false, - }) - return - } } c.Next() } diff --git a/model/auth_flow.go b/model/auth_flow.go new file mode 100644 index 0000000000..96bb72065a --- /dev/null +++ b/model/auth_flow.go @@ -0,0 +1,236 @@ +package model + +import ( + "crypto/rand" + "encoding/base64" + "errors" + "fmt" + "strings" + "time" + + "github.com/QuantumNous/new-api/common" + + "gorm.io/gorm" + "gorm.io/gorm/clause" +) + +const ( + AuthFlowPurposeOAuth = "oauth" + AuthFlowPurposeTwoFALogin = "2fa_login" + AuthFlowPurposePasskeyLogin = "passkey_login" + AuthFlowPurposePasskeyRegister = "passkey_register" + AuthFlowPurposePasskeyStepUp = "passkey_step_up" + AuthFlowPurposeTelegramBind = "telegram_bind" + AuthFlowPurposeTelegramAssertion = "telegram_assertion" + AuthFlowIntentLogin = "login" + AuthFlowIntentBind = "bind" + AuthFlowTokenBytes = 32 + AuthFlowDefaultCleanupRetention = 24 * time.Hour +) + +var ( + ErrAuthFlowInvalid = errors.New("auth flow is invalid") + ErrAuthFlowExpired = errors.New("auth flow has expired") + ErrAuthFlowConsumed = errors.New("auth flow has already been consumed") +) + +// AuthFlow stores one-time, short-lived state for authentication ceremonies. +// TokenHash is an HMAC of the opaque token; the token itself is never persisted. +type AuthFlow struct { + Id int64 `json:"id" gorm:"primaryKey"` + TokenHash string `json:"-" gorm:"type:char(64);not null;uniqueIndex"` + Purpose string `json:"purpose" gorm:"type:varchar(32);not null;index:idx_auth_flow_purpose_expiry"` + Provider string `json:"provider,omitempty" gorm:"type:varchar(64)"` + Intent string `json:"intent,omitempty" gorm:"type:varchar(16)"` + UserId int `json:"user_id,omitempty" gorm:"index"` + SessionId string `json:"session_id,omitempty" gorm:"type:varchar(64);index"` + Payload string `json:"-" gorm:"type:text"` + CreatedAt time.Time `json:"created_at"` + ExpiresAt time.Time `json:"expires_at" gorm:"not null;index:idx_auth_flow_purpose_expiry"` + ConsumedAt *time.Time `json:"consumed_at,omitempty" gorm:"index"` +} + +func (AuthFlow) TableName() string { + return "auth_flows" +} + +type AuthFlowCreate struct { + Purpose string + Provider string + Intent string + UserId int + SessionId string + Payload string + ExpiresAt time.Time +} + +type AuthFlowMatch struct { + Purpose string + Provider string + Intent string + UserId int + SessionId string +} + +func applyAuthFlowMatch(query *gorm.DB, token string, match AuthFlowMatch) *gorm.DB { + query = query.Where("token_hash = ? AND purpose = ?", authFlowTokenHash(token), match.Purpose) + if match.Provider != "" { + query = query.Where("provider = ?", match.Provider) + } + if match.Intent != "" { + query = query.Where("intent = ?", match.Intent) + } + if match.UserId != 0 { + query = query.Where("user_id = ?", match.UserId) + } + if match.SessionId != "" { + query = query.Where("session_id = ?", match.SessionId) + } + return query +} + +func authFlowTokenHash(token string) string { + return common.GenerateHMACWithKey([]byte("auth-flow-v1:"+common.SessionSecret), token) +} + +func CreateAuthFlow(input AuthFlowCreate) (string, *AuthFlow, error) { + if strings.TrimSpace(input.Purpose) == "" || input.ExpiresAt.IsZero() || !input.ExpiresAt.After(time.Now()) { + return "", nil, ErrAuthFlowInvalid + } + random := make([]byte, AuthFlowTokenBytes) + if _, err := rand.Read(random); err != nil { + return "", nil, fmt.Errorf("generate auth flow token: %w", err) + } + token := base64.RawURLEncoding.EncodeToString(random) + flow := &AuthFlow{ + TokenHash: authFlowTokenHash(token), + Purpose: input.Purpose, + Provider: input.Provider, + Intent: input.Intent, + UserId: input.UserId, + SessionId: input.SessionId, + Payload: input.Payload, + ExpiresAt: input.ExpiresAt, + } + if err := DB.Create(flow).Error; err != nil { + return "", nil, err + } + return token, flow, nil +} + +// ClaimExternalAuthAssertion records a signed provider assertion as consumed. +// The assertion is HMACed before storage and the unique token_hash index makes +// replay rejection atomic on SQLite, MySQL and PostgreSQL. +func ClaimExternalAuthAssertion(purpose, assertion string, expiresAt time.Time) error { + return DB.Transaction(func(tx *gorm.DB) error { + return ClaimExternalAuthAssertionWithTx(tx, purpose, assertion, expiresAt) + }) +} + +// ClaimExternalAuthAssertionWithTx records a provider assertion in the +// caller's transaction so replay protection can commit atomically with the +// authentication flow and its resulting state change. +func ClaimExternalAuthAssertionWithTx(tx *gorm.DB, purpose, assertion string, expiresAt time.Time) error { + purpose = strings.TrimSpace(purpose) + assertion = strings.TrimSpace(assertion) + now := time.Now() + if tx == nil || purpose == "" || assertion == "" || !expiresAt.After(now) { + return ErrAuthFlowInvalid + } + flow := AuthFlow{ + TokenHash: authFlowTokenHash("external:" + purpose + ":" + assertion), + Purpose: purpose, + ExpiresAt: expiresAt, + ConsumedAt: &now, + } + result := tx.Clauses(clause.OnConflict{ + Columns: []clause.Column{{Name: "token_hash"}}, + DoNothing: true, + }).Create(&flow) + if result.Error != nil { + return result.Error + } + if result.RowsAffected != 1 { + return ErrAuthFlowConsumed + } + return nil +} + +// GetAuthFlow validates a flow without consuming it. Callers must still use +// ConsumeAuthFlow with all identity-bound fields before performing the action. +func GetAuthFlow(token string, match AuthFlowMatch) (*AuthFlow, error) { + if token == "" || match.Purpose == "" { + return nil, ErrAuthFlowInvalid + } + var flow AuthFlow + if err := applyAuthFlowMatch(DB, token, match).First(&flow).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return nil, ErrAuthFlowInvalid + } + return nil, err + } + if flow.ConsumedAt != nil { + return nil, ErrAuthFlowConsumed + } + if !flow.ExpiresAt.After(time.Now()) { + return nil, ErrAuthFlowExpired + } + return &flow, nil +} + +// ConsumeAuthFlow atomically validates and consumes a flow. Optional match +// fields are enforced when non-zero so tokens cannot cross purposes or users. +func ConsumeAuthFlow(token string, match AuthFlowMatch) (*AuthFlow, error) { + return ConsumeAuthFlowWithAction(token, match, nil) +} + +// ConsumeAuthFlowWithAction consumes a flow and runs action in the same +// database transaction. An action failure rolls the consumption back. +func ConsumeAuthFlowWithAction(token string, match AuthFlowMatch, action func(tx *gorm.DB, flow *AuthFlow) error) (*AuthFlow, error) { + if token == "" || match.Purpose == "" { + return nil, ErrAuthFlowInvalid + } + var consumed AuthFlow + err := DB.Transaction(func(tx *gorm.DB) error { + query := applyAuthFlowMatch(lockForUpdate(tx), token, match) + if err := query.First(&consumed).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return ErrAuthFlowInvalid + } + return err + } + if consumed.ConsumedAt != nil { + return ErrAuthFlowConsumed + } + now := time.Now() + if !consumed.ExpiresAt.After(now) { + return ErrAuthFlowExpired + } + result := tx.Model(&AuthFlow{}). + Where("id = ? AND consumed_at IS NULL AND expires_at > ?", consumed.Id, now). + Update("consumed_at", now) + if result.Error != nil { + return result.Error + } + if result.RowsAffected != 1 { + return ErrAuthFlowConsumed + } + consumed.ConsumedAt = &now + if action != nil { + if err := action(tx, &consumed); err != nil { + return err + } + } + return nil + }) + if err != nil { + return nil, err + } + return &consumed, nil +} + +func DeleteExpiredAuthFlows(now time.Time) error { + cutoff := now.Add(-AuthFlowDefaultCleanupRetention) + return DB.Where("expires_at < ? OR (consumed_at IS NOT NULL AND consumed_at < ?)", cutoff, cutoff). + Delete(&AuthFlow{}).Error +} diff --git a/model/auth_flow_test.go b/model/auth_flow_test.go new file mode 100644 index 0000000000..d8b19b179f --- /dev/null +++ b/model/auth_flow_test.go @@ -0,0 +1,109 @@ +package model + +import ( + "errors" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +func TestAuthFlowIsBoundAndConsumedOnce(t *testing.T) { + truncateTables(t) + + token, created, err := CreateAuthFlow(AuthFlowCreate{ + Purpose: AuthFlowPurposeOAuth, + Provider: "github", + Intent: AuthFlowIntentBind, + UserId: 42, + SessionId: "session-a", + Payload: `{"affiliate_code":"invite"}`, + ExpiresAt: time.Now().Add(time.Minute), + }) + require.NoError(t, err) + require.NotEmpty(t, token) + assert.NotEqual(t, token, created.TokenHash) + + _, err = ConsumeAuthFlow(token, AuthFlowMatch{ + Purpose: AuthFlowPurposeOAuth, + Provider: "github", + Intent: AuthFlowIntentBind, + UserId: 99, + SessionId: "session-a", + }) + assert.ErrorIs(t, err, ErrAuthFlowInvalid) + + peeked, err := GetAuthFlow(token, AuthFlowMatch{Purpose: AuthFlowPurposeOAuth, Provider: "github"}) + require.NoError(t, err) + assert.Nil(t, peeked.ConsumedAt) + + consumed, err := ConsumeAuthFlow(token, AuthFlowMatch{ + Purpose: AuthFlowPurposeOAuth, + Provider: "github", + Intent: AuthFlowIntentBind, + UserId: 42, + SessionId: "session-a", + }) + require.NoError(t, err) + require.NotNil(t, consumed.ConsumedAt) + + _, err = ConsumeAuthFlow(token, AuthFlowMatch{Purpose: AuthFlowPurposeOAuth}) + assert.ErrorIs(t, err, ErrAuthFlowConsumed) +} + +func TestAuthFlowExpiryIsEnforced(t *testing.T) { + truncateTables(t) + + token, flow, err := CreateAuthFlow(AuthFlowCreate{ + Purpose: AuthFlowPurposeTwoFALogin, + UserId: 7, + ExpiresAt: time.Now().Add(time.Minute), + }) + require.NoError(t, err) + require.NoError(t, DB.Model(&AuthFlow{}).Where("id = ?", flow.Id).Update("expires_at", time.Now().Add(-time.Second)).Error) + + _, err = GetAuthFlow(token, AuthFlowMatch{Purpose: AuthFlowPurposeTwoFALogin}) + assert.True(t, errors.Is(err, ErrAuthFlowExpired)) + _, err = ConsumeAuthFlow(token, AuthFlowMatch{Purpose: AuthFlowPurposeTwoFALogin}) + assert.True(t, errors.Is(err, ErrAuthFlowExpired)) +} + +func TestExternalAuthAssertionCanOnlyBeClaimedOnce(t *testing.T) { + truncateTables(t) + expiresAt := time.Now().Add(time.Minute) + + require.NoError(t, ClaimExternalAuthAssertion(AuthFlowPurposeTelegramAssertion, "signed-assertion", expiresAt)) + err := ClaimExternalAuthAssertion(AuthFlowPurposeTelegramAssertion, "signed-assertion", expiresAt) + assert.ErrorIs(t, err, ErrAuthFlowConsumed) + + require.NoError(t, ClaimExternalAuthAssertion(AuthFlowPurposeTelegramAssertion, "different-assertion", expiresAt)) +} + +func TestConsumeAuthFlowWithActionRollsBackTogether(t *testing.T) { + truncateTables(t) + token, _, err := CreateAuthFlow(AuthFlowCreate{ + Purpose: AuthFlowPurposeTelegramBind, + UserId: 42, + SessionId: "session-a", + ExpiresAt: time.Now().Add(time.Minute), + }) + require.NoError(t, err) + actionErr := errors.New("binding failed") + + _, err = ConsumeAuthFlowWithAction(token, AuthFlowMatch{ + Purpose: AuthFlowPurposeTelegramBind, UserId: 42, SessionId: "session-a", + }, func(tx *gorm.DB, _ *AuthFlow) error { + if err := ClaimExternalAuthAssertionWithTx(tx, AuthFlowPurposeTelegramAssertion, "assertion-a", time.Now().Add(time.Minute)); err != nil { + return err + } + return actionErr + }) + assert.ErrorIs(t, err, actionErr) + + flow, err := GetAuthFlow(token, AuthFlowMatch{Purpose: AuthFlowPurposeTelegramBind}) + require.NoError(t, err) + assert.Nil(t, flow.ConsumedAt) + require.NoError(t, ClaimExternalAuthAssertion(AuthFlowPurposeTelegramAssertion, "assertion-a", time.Now().Add(time.Minute))) +} diff --git a/model/errors.go b/model/errors.go index 7f53a03de6..187daa6567 100644 --- a/model/errors.go +++ b/model/errors.go @@ -27,3 +27,4 @@ var ErrRedeemFailed = errors.New("redeem.failed") // 2FA errors var ErrTwoFANotEnabled = errors.New("2fa not enabled") +var ErrTwoFAAlreadyEnabled = errors.New("2fa already enabled") diff --git a/model/external_identity_claim.go b/model/external_identity_claim.go new file mode 100644 index 0000000000..7c5ee1f49a --- /dev/null +++ b/model/external_identity_claim.go @@ -0,0 +1,103 @@ +package model + +import ( + "errors" + "fmt" + "strings" + "time" + + "gorm.io/gorm" + "gorm.io/gorm/clause" +) + +const ExternalIdentityProviderTelegram = "telegram" + +var ErrExternalIdentityAlreadyClaimed = errors.New("external identity is already claimed") + +// ExternalIdentityClaim is the durable ownership record for an identity issued +// by an external provider. The two unique indexes make both the provider +// subject and the user's provider slot single-owner without relying on a +// check-then-update sequence. +type ExternalIdentityClaim struct { + Id int64 `json:"id" gorm:"primaryKey"` + Provider string `json:"provider" gorm:"type:varchar(32);not null;uniqueIndex:idx_external_identity_subject,priority:1;uniqueIndex:idx_external_identity_user,priority:1"` + Subject string `json:"subject" gorm:"type:varchar(128);not null;uniqueIndex:idx_external_identity_subject,priority:2"` + UserId int `json:"user_id" gorm:"not null;index;uniqueIndex:idx_external_identity_user,priority:2"` + CreatedAt time.Time `json:"created_at"` +} + +func (ExternalIdentityClaim) TableName() string { + return "external_identity_claims" +} + +// ClaimExternalIdentityWithTx atomically claims a provider subject for one +// user. Repeating the exact mapping is idempotent; every competing subject or +// user is rejected. Ownership is read back instead of trusting RowsAffected, +// whose duplicate-key semantics differ between supported databases. +func ClaimExternalIdentityWithTx(tx *gorm.DB, provider, subject string, userId int) error { + provider = strings.TrimSpace(provider) + subject = strings.TrimSpace(subject) + if tx == nil || provider == "" || subject == "" || userId == 0 { + return errors.New("external identity claim is invalid") + } + + claim := ExternalIdentityClaim{Provider: provider, Subject: subject, UserId: userId} + result := tx.Clauses(clause.OnConflict{DoNothing: true}).Create(&claim) + if result.Error != nil { + return result.Error + } + var subjectOwner ExternalIdentityClaim + if err := tx.Where("provider = ? AND subject = ?", provider, subject).First(&subjectOwner).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return ErrExternalIdentityAlreadyClaimed + } + return err + } + if subjectOwner.UserId != userId { + return ErrExternalIdentityAlreadyClaimed + } + + var userClaim ExternalIdentityClaim + if err := tx.Where("provider = ? AND user_id = ?", provider, userId).First(&userClaim).Error; err != nil { + return err + } + if userClaim.Subject != subject { + return ErrExternalIdentityAlreadyClaimed + } + return nil +} + +func ReleaseExternalIdentityWithTx(tx *gorm.DB, provider string, userId int) error { + provider = strings.TrimSpace(provider) + if tx == nil || provider == "" || userId == 0 { + return errors.New("external identity release is invalid") + } + return tx.Where("provider = ? AND user_id = ?", provider, userId). + Delete(&ExternalIdentityClaim{}).Error +} + +func releaseAllExternalIdentitiesWithTx(tx *gorm.DB, userId int) error { + if tx == nil || userId == 0 { + return errors.New("external identity release is invalid") + } + return tx.Where("user_id = ?", userId).Delete(&ExternalIdentityClaim{}).Error +} + +// InitializeExternalIdentityClaims imports legacy Telegram bindings after the +// claim table is migrated. Existing duplicate ownership fails migration rather +// than preserving an ambiguous login identity. +func InitializeExternalIdentityClaims() error { + var users []User + if err := DB.Unscoped().Select("id", "telegram_id"). + Where("telegram_id <> ?", "").Find(&users).Error; err != nil { + return err + } + return DB.Transaction(func(tx *gorm.DB) error { + for _, user := range users { + if err := ClaimExternalIdentityWithTx(tx, ExternalIdentityProviderTelegram, user.TelegramId, user.Id); err != nil { + return fmt.Errorf("backfill Telegram identity for user %d: %w", user.Id, err) + } + } + return nil + }) +} diff --git a/model/external_identity_claim_test.go b/model/external_identity_claim_test.go new file mode 100644 index 0000000000..b428628da7 --- /dev/null +++ b/model/external_identity_claim_test.go @@ -0,0 +1,91 @@ +package model + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +func TestExternalIdentityClaimEnforcesSingleOwnerAtomically(t *testing.T) { + truncateTables(t) + + first := User{Username: "telegram-owner-one", Password: "password", AffCode: "telegram-owner-one"} + second := User{Username: "telegram-owner-two", Password: "password", AffCode: "telegram-owner-two"} + require.NoError(t, DB.Create(&first).Error) + require.NoError(t, DB.Create(&second).Error) + + require.NoError(t, DB.Transaction(func(tx *gorm.DB) error { + return ClaimExternalIdentityWithTx(tx, ExternalIdentityProviderTelegram, "telegram-123", first.Id) + })) + err := DB.Transaction(func(tx *gorm.DB) error { + return ClaimExternalIdentityWithTx(tx, ExternalIdentityProviderTelegram, "telegram-123", second.Id) + }) + assert.ErrorIs(t, err, ErrExternalIdentityAlreadyClaimed) + + err = DB.Transaction(func(tx *gorm.DB) error { + return ClaimExternalIdentityWithTx(tx, ExternalIdentityProviderTelegram, "telegram-456", first.Id) + }) + assert.ErrorIs(t, err, ErrExternalIdentityAlreadyClaimed) + + var claims []ExternalIdentityClaim + require.NoError(t, DB.Find(&claims).Error) + require.Len(t, claims, 1) + assert.Equal(t, first.Id, claims[0].UserId) + assert.Equal(t, "telegram-123", claims[0].Subject) + + require.NoError(t, DB.Transaction(func(tx *gorm.DB) error { + return ReleaseExternalIdentityWithTx(tx, ExternalIdentityProviderTelegram, first.Id) + })) + require.NoError(t, DB.Transaction(func(tx *gorm.DB) error { + return ClaimExternalIdentityWithTx(tx, ExternalIdentityProviderTelegram, "telegram-123", second.Id) + })) +} + +func TestClearTelegramBindingReleasesIdentityClaim(t *testing.T) { + truncateTables(t) + + user := User{Username: "telegram-unbind", Password: "password", TelegramId: "telegram-unbind-id"} + require.NoError(t, DB.Create(&user).Error) + require.NoError(t, DB.Transaction(func(tx *gorm.DB) error { + return ClaimExternalIdentityWithTx(tx, ExternalIdentityProviderTelegram, user.TelegramId, user.Id) + })) + + require.NoError(t, user.ClearBinding(ExternalIdentityProviderTelegram)) + assert.Empty(t, user.TelegramId) + + var count int64 + require.NoError(t, DB.Model(&ExternalIdentityClaim{}).Where("user_id = ?", user.Id).Count(&count).Error) + assert.Zero(t, count) +} + +func TestInitializeExternalIdentityClaimsIsIdempotent(t *testing.T) { + truncateTables(t) + + user := User{Username: "telegram-legacy", Password: "password", TelegramId: "telegram-legacy-id"} + require.NoError(t, DB.Create(&user).Error) + require.NoError(t, InitializeExternalIdentityClaims()) + require.NoError(t, InitializeExternalIdentityClaims()) + + var claim ExternalIdentityClaim + require.NoError(t, DB.Where("provider = ? AND subject = ?", ExternalIdentityProviderTelegram, user.TelegramId). + First(&claim).Error) + assert.Equal(t, user.Id, claim.UserId) +} + +func TestInitializeExternalIdentityClaimsRejectsAmbiguousLegacyBindings(t *testing.T) { + truncateTables(t) + + first := User{Username: "telegram-legacy-one", Password: "password", TelegramId: "duplicate-telegram-id", AffCode: "telegram-legacy-one"} + second := User{Username: "telegram-legacy-two", Password: "password", TelegramId: "duplicate-telegram-id", AffCode: "telegram-legacy-two"} + require.NoError(t, DB.Create(&first).Error) + require.NoError(t, DB.Create(&second).Error) + + err := InitializeExternalIdentityClaims() + assert.ErrorIs(t, err, ErrExternalIdentityAlreadyClaimed) + + var count int64 + require.NoError(t, DB.Model(&ExternalIdentityClaim{}).Count(&count).Error) + assert.Zero(t, count) +} diff --git a/model/frontend_option_migration.go b/model/frontend_option_migration.go new file mode 100644 index 0000000000..e8ac9f27e1 --- /dev/null +++ b/model/frontend_option_migration.go @@ -0,0 +1,239 @@ +package model + +import ( + "errors" + "fmt" + "strings" + + "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/setting/console_setting" + "gorm.io/gorm" +) + +const retiredThemeOptionKey = "theme.frontend" + +type legacyOptionTransform func(string) (string, error) + +// MigrateRetiredFrontendOptions normalizes options that belonged to the +// removed dashboard frontend. Each legacy console setting is migrated in its +// own transaction so one malformed value cannot block the other settings. +func MigrateRetiredFrontendOptions() error { + if DB == nil { + return errors.New("database is not initialized") + } + + var migrationErrors []error + if err := normalizeRetiredThemeOption(); err != nil { + migrationErrors = append(migrationErrors, fmt.Errorf("normalize %s: %w", retiredThemeOptionKey, err)) + } + + migrations := []struct { + source string + target string + transform legacyOptionTransform + }{ + {source: "ApiInfo", target: "console_setting.api_info", transform: transformLegacyAPIInfo}, + {source: "Announcements", target: "console_setting.announcements", transform: transformLegacyAnnouncements}, + {source: "FAQ", target: "console_setting.faq", transform: transformLegacyFAQ}, + } + for _, migration := range migrations { + if err := migrateLegacyOption(migration.source, migration.target, migration.transform); err != nil { + migrationErrors = append(migrationErrors, err) + } + } + if err := migrateLegacyUptimeOptions(); err != nil { + migrationErrors = append(migrationErrors, err) + } + return errors.Join(migrationErrors...) +} + +func normalizeRetiredThemeOption() error { + return DB.Transaction(func(tx *gorm.DB) error { + var option Option + err := tx.Where(&Option{Key: retiredThemeOptionKey}).First(&option).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + return tx.Create(&Option{Key: retiredThemeOptionKey, Value: "default"}).Error + } + if err != nil { + return err + } + if option.Value == "default" { + return nil + } + return tx.Model(&option).Update("value", "default").Error + }) +} + +func migrateLegacyOption(sourceKey, targetKey string, transform legacyOptionTransform) error { + return DB.Transaction(func(tx *gorm.DB) error { + var source Option + if err := tx.Where(&Option{Key: sourceKey}).First(&source).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return nil + } + return fmt.Errorf("read legacy option %s: %w", sourceKey, err) + } + + var target Option + err := tx.Where(&Option{Key: targetKey}).First(&target).Error + if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { + return fmt.Errorf("read target option %s: %w", targetKey, err) + } + if err == nil { + return tx.Delete(&source).Error + } + + value, transformErr := transform(source.Value) + if transformErr != nil { + common.SysError(fmt.Sprintf("legacy option %s was not migrated: %v", sourceKey, transformErr)) + return nil + } + if errors.Is(err, gorm.ErrRecordNotFound) { + target = Option{Key: targetKey} + } + target.Value = value + if err := tx.Save(&target).Error; err != nil { + return fmt.Errorf("write target option %s: %w", targetKey, err) + } + if err := tx.Delete(&source).Error; err != nil { + return fmt.Errorf("delete legacy option %s: %w", sourceKey, err) + } + return nil + }) +} + +func transformLegacyAPIInfo(value string) (string, error) { + if strings.TrimSpace(value) == "" { + return "", errors.New("value is empty") + } + var items []map[string]any + if err := common.UnmarshalJsonStr(value, &items); err != nil { + return "", err + } + if len(items) > 50 { + items = items[:50] + } + encoded, err := common.Marshal(items) + if err != nil { + return "", err + } + result := string(encoded) + if err := console_setting.ValidateConsoleSettings(result, "ApiInfo"); err != nil { + return "", err + } + return result, nil +} + +func transformLegacyAnnouncements(value string) (string, error) { + if strings.TrimSpace(value) == "" { + return "", errors.New("value is empty") + } + if err := console_setting.ValidateConsoleSettings(value, "Announcements"); err != nil { + return "", err + } + return value, nil +} + +func transformLegacyFAQ(value string) (string, error) { + if strings.TrimSpace(value) == "" { + return "", errors.New("value is empty") + } + var legacyItems []map[string]any + if err := common.UnmarshalJsonStr(value, &legacyItems); err != nil { + return "", err + } + items := make([]map[string]any, 0, len(legacyItems)) + for index, item := range legacyItems { + question, _ := item["question"].(string) + if strings.TrimSpace(question) == "" { + question, _ = item["title"].(string) + } + answer, _ := item["answer"].(string) + if strings.TrimSpace(answer) == "" { + answer, _ = item["content"].(string) + } + if strings.TrimSpace(question) == "" || strings.TrimSpace(answer) == "" { + return "", fmt.Errorf("FAQ entry %d is missing a question or answer", index) + } + items = append(items, map[string]any{"question": question, "answer": answer}) + } + if len(items) > 50 { + items = items[:50] + } + encoded, err := common.Marshal(items) + if err != nil { + return "", err + } + result := string(encoded) + if err := console_setting.ValidateConsoleSettings(result, "FAQ"); err != nil { + return "", err + } + return result, nil +} + +func migrateLegacyUptimeOptions() error { + return DB.Transaction(func(tx *gorm.DB) error { + var urlOption Option + urlErr := tx.Where(&Option{Key: "UptimeKumaUrl"}).First(&urlOption).Error + if urlErr != nil && !errors.Is(urlErr, gorm.ErrRecordNotFound) { + return fmt.Errorf("read legacy option UptimeKumaUrl: %w", urlErr) + } + var slugOption Option + slugErr := tx.Where(&Option{Key: "UptimeKumaSlug"}).First(&slugOption).Error + if slugErr != nil && !errors.Is(slugErr, gorm.ErrRecordNotFound) { + return fmt.Errorf("read legacy option UptimeKumaSlug: %w", slugErr) + } + if errors.Is(urlErr, gorm.ErrRecordNotFound) && errors.Is(slugErr, gorm.ErrRecordNotFound) { + return nil + } + + var target Option + targetErr := tx.Where(&Option{Key: "console_setting.uptime_kuma_groups"}).First(&target).Error + if targetErr != nil && !errors.Is(targetErr, gorm.ErrRecordNotFound) { + return fmt.Errorf("read target option console_setting.uptime_kuma_groups: %w", targetErr) + } + if targetErr == nil { + if urlErr == nil { + if err := tx.Delete(&urlOption).Error; err != nil { + return err + } + } + if slugErr == nil { + return tx.Delete(&slugOption).Error + } + return nil + } + + if urlErr != nil || slugErr != nil || strings.TrimSpace(urlOption.Value) == "" || strings.TrimSpace(slugOption.Value) == "" { + common.SysError("legacy Uptime Kuma options were not migrated: both URL and slug are required") + return nil + } + groups := []map[string]any{{ + "id": 1, + "categoryName": "old", + "url": urlOption.Value, + "slug": slugOption.Value, + "description": "", + }} + encoded, err := common.Marshal(groups) + if err != nil { + return err + } + value := string(encoded) + if err := console_setting.ValidateConsoleSettings(value, "UptimeKumaGroups"); err != nil { + common.SysError(fmt.Sprintf("legacy Uptime Kuma options were not migrated: %v", err)) + return nil + } + if errors.Is(targetErr, gorm.ErrRecordNotFound) { + target = Option{Key: "console_setting.uptime_kuma_groups"} + } + target.Value = value + if err := tx.Save(&target).Error; err != nil { + return fmt.Errorf("write target option console_setting.uptime_kuma_groups: %w", err) + } + if err := tx.Delete(&urlOption).Error; err != nil { + return err + } + return tx.Delete(&slugOption).Error + }) +} diff --git a/model/frontend_option_migration_test.go b/model/frontend_option_migration_test.go new file mode 100644 index 0000000000..130c1b116d --- /dev/null +++ b/model/frontend_option_migration_test.go @@ -0,0 +1,180 @@ +package model + +import ( + "fmt" + "testing" + + "github.com/QuantumNous/new-api/common" + "github.com/glebarez/sqlite" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +func useFrontendOptionMigrationDB(t *testing.T) *gorm.DB { + t.Helper() + previousDB := DB + previousType := common.MainDatabaseType() + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + require.NoError(t, err) + require.NoError(t, db.AutoMigrate(&Option{})) + DB = db + common.SetMainDatabaseType(common.DatabaseTypeSQLite) + t.Cleanup(func() { + DB = previousDB + common.SetMainDatabaseType(previousType) + }) + return db +} + +func requireOptionValue(t *testing.T, db *gorm.DB, key string) string { + t.Helper() + var option Option + require.NoError(t, db.Where(&Option{Key: key}).First(&option).Error) + return option.Value +} + +func requireOptionMissing(t *testing.T, db *gorm.DB, key string) { + t.Helper() + var option Option + assert.ErrorIs(t, db.Where(&Option{Key: key}).First(&option).Error, gorm.ErrRecordNotFound) +} + +func TestMigrateRetiredFrontendOptionsMigratesValidValuesIdempotently(t *testing.T) { + db := useFrontendOptionMigrationDB(t) + legacy := []Option{ + {Key: retiredThemeOptionKey, Value: "classic"}, + {Key: "ApiInfo", Value: `[{"url":"https://api.example.com","route":"primary","description":"API","color":"blue"}]`}, + {Key: "Announcements", Value: `[{"content":"maintenance","publishDate":"2026-07-20T00:00:00Z","type":"warning"}]`}, + {Key: "FAQ", Value: `[{"title":"Question","content":"Answer"}]`}, + {Key: "UptimeKumaUrl", Value: "https://status.example.com"}, + {Key: "UptimeKumaSlug", Value: "status"}, + } + require.NoError(t, db.Create(&legacy).Error) + + require.NoError(t, MigrateRetiredFrontendOptions()) + assert.Equal(t, "default", requireOptionValue(t, db, retiredThemeOptionKey)) + assert.JSONEq(t, legacy[1].Value, requireOptionValue(t, db, "console_setting.api_info")) + assert.Equal(t, legacy[2].Value, requireOptionValue(t, db, "console_setting.announcements")) + assert.JSONEq(t, `[{"question":"Question","answer":"Answer"}]`, requireOptionValue(t, db, "console_setting.faq")) + assert.JSONEq(t, `[{ + "id":1,"categoryName":"old","url":"https://status.example.com","slug":"status","description":"" + }]`, requireOptionValue(t, db, "console_setting.uptime_kuma_groups")) + for _, key := range []string{"ApiInfo", "Announcements", "FAQ", "UptimeKumaUrl", "UptimeKumaSlug"} { + requireOptionMissing(t, db, key) + } + + before, err := AllOption() + require.NoError(t, err) + require.NoError(t, MigrateRetiredFrontendOptions()) + after, err := AllOption() + require.NoError(t, err) + assert.ElementsMatch(t, before, after) +} + +func TestLegacyConsoleListMigrationCapsAPIInfoAndFAQ(t *testing.T) { + apiInfo := make([]map[string]any, 51) + faq := make([]map[string]any, 51) + for i := range apiInfo { + apiInfo[i] = map[string]any{ + "url": fmt.Sprintf("https://api-%d.example.com", i), + "route": fmt.Sprintf("route-%d", i), + "description": "API", + "color": "blue", + } + faq[i] = map[string]any{"title": fmt.Sprintf("Question %d", i), "content": "Answer"} + } + apiBytes, err := common.Marshal(apiInfo) + require.NoError(t, err) + faqBytes, err := common.Marshal(faq) + require.NoError(t, err) + + migratedAPI, err := transformLegacyAPIInfo(string(apiBytes)) + require.NoError(t, err) + migratedFAQ, err := transformLegacyFAQ(string(faqBytes)) + require.NoError(t, err) + var apiResult []map[string]any + require.NoError(t, common.UnmarshalJsonStr(migratedAPI, &apiResult)) + var faqResult []map[string]any + require.NoError(t, common.UnmarshalJsonStr(migratedFAQ, &faqResult)) + assert.Len(t, apiResult, 50) + assert.Len(t, faqResult, 50) +} + +func TestMigrateRetiredFrontendOptionsPreservesMalformedValuesAndContinues(t *testing.T) { + db := useFrontendOptionMigrationDB(t) + legacy := []Option{ + {Key: "ApiInfo", Value: `{invalid`}, + {Key: "FAQ", Value: `[{"question":"Question","answer":"Answer"}]`}, + {Key: "UptimeKumaUrl", Value: "https://status.example.com"}, + } + require.NoError(t, db.Create(&legacy).Error) + + require.NoError(t, MigrateRetiredFrontendOptions()) + assert.Equal(t, `{invalid`, requireOptionValue(t, db, "ApiInfo")) + requireOptionMissing(t, db, "console_setting.api_info") + requireOptionMissing(t, db, "FAQ") + assert.JSONEq(t, legacy[1].Value, requireOptionValue(t, db, "console_setting.faq")) + assert.Equal(t, "https://status.example.com", requireOptionValue(t, db, "UptimeKumaUrl")) + requireOptionMissing(t, db, "console_setting.uptime_kuma_groups") +} + +func TestMigrateRetiredFrontendOptionsPreservesMixedInvalidFAQ(t *testing.T) { + db := useFrontendOptionMigrationDB(t) + legacyFAQ := `[{"question":"Valid question","answer":"Valid answer"},{"question":"Missing answer"}]` + require.NoError(t, db.Create(&Option{Key: "FAQ", Value: legacyFAQ}).Error) + + require.NoError(t, MigrateRetiredFrontendOptions()) + assert.Equal(t, legacyFAQ, requireOptionValue(t, db, "FAQ")) + requireOptionMissing(t, db, "console_setting.faq") +} + +func TestMigrateRetiredFrontendOptionsKeepsAuthoritativeTargets(t *testing.T) { + db := useFrontendOptionMigrationDB(t) + options := []Option{ + {Key: "ApiInfo", Value: `{invalid`}, + {Key: "console_setting.api_info", Value: `[{"url":"https://new.example.com"}]`}, + {Key: "UptimeKumaUrl", Value: "https://old.example.com"}, + {Key: "UptimeKumaSlug", Value: "old"}, + {Key: "console_setting.uptime_kuma_groups", Value: `[{"url":"https://new.example.com"}]`}, + } + require.NoError(t, db.Create(&options).Error) + + require.NoError(t, MigrateRetiredFrontendOptions()) + assert.Equal(t, options[1].Value, requireOptionValue(t, db, "console_setting.api_info")) + assert.Equal(t, options[4].Value, requireOptionValue(t, db, "console_setting.uptime_kuma_groups")) + for _, key := range []string{"ApiInfo", "UptimeKumaUrl", "UptimeKumaSlug"} { + requireOptionMissing(t, db, key) + } +} + +func TestMigrateRetiredFrontendOptionsKeepsEmptyAuthoritativeTargets(t *testing.T) { + db := useFrontendOptionMigrationDB(t) + options := []Option{ + {Key: "ApiInfo", Value: `[{"url":"https://old.example.com"}]`}, + {Key: "console_setting.api_info", Value: ""}, + {Key: "UptimeKumaUrl", Value: "https://old.example.com"}, + {Key: "UptimeKumaSlug", Value: "old"}, + {Key: "console_setting.uptime_kuma_groups", Value: ""}, + } + require.NoError(t, db.Create(&options).Error) + + require.NoError(t, MigrateRetiredFrontendOptions()) + assert.Empty(t, requireOptionValue(t, db, "console_setting.api_info")) + assert.Empty(t, requireOptionValue(t, db, "console_setting.uptime_kuma_groups")) + for _, key := range []string{"ApiInfo", "UptimeKumaUrl", "UptimeKumaSlug"} { + requireOptionMissing(t, db, key) + } +} + +func TestRetiredThemeOptionIsPersistedButNotPublished(t *testing.T) { + db := useFrontendOptionMigrationDB(t) + previousMap := common.OptionMap + t.Cleanup(func() { common.OptionMap = previousMap }) + common.OptionMap = map[string]string{} + + require.NoError(t, UpdateOption(retiredThemeOptionKey, "default")) + assert.Equal(t, "default", requireOptionValue(t, db, retiredThemeOptionKey)) + _, published := common.OptionMap[retiredThemeOptionKey] + assert.False(t, published) +} diff --git a/model/log.go b/model/log.go index 506bd504b6..401d53c435 100644 --- a/model/log.go +++ b/model/log.go @@ -198,7 +198,7 @@ func buildOpField(action string, params map[string]interface{}) map[string]inter // RecordLoginLog 记录用户登录成功的审计日志(type=LogTypeLogin)。 // username 由调用方传入(登录流程已持有用户对象),避免额外的数据库查询。 -// content 为英文兜底文本(用于导出/经典前端);action+params 供前端本地化渲染。 +// content 为英文兜底文本(用于导出);action+params 供前端本地化渲染。 // extra 可携带 login_method、user_agent 等附加信息(普通用户可见)。 func RecordLoginLog(userId int, username string, content string, ip string, action string, params map[string]interface{}, extra map[string]interface{}) { other := map[string]interface{}{} @@ -222,7 +222,7 @@ func RecordLoginLog(userId int, username string, content string, ip string, acti // RecordOperationAuditLog 记录管理/高危操作审计日志(type=LogTypeManage)。 // logUserId 为日志归属者,管理审计日志应归属实际操作者;目标资源/用户放入 -// action params。username 内部按 logUserId 查询。content 为英文兜底文本(导出/经典前端用)。 +// action params。username 内部按 logUserId 查询。content 为英文兜底文本(供导出使用)。 // action+params 写入 Other.op,供前端本地化渲染(普通用户可见,不含敏感信息)。 // adminInfo 存放操作者身份(写入 Other.admin_info,普通用户查询时剥离); // auditInfo 存放路由/方法/结果等中间件兜底信息(写入 Other.audit_info,普通用户查询时剥离)。 @@ -735,30 +735,3 @@ func DeleteOldLogBatch(ctx context.Context, targetTimestamp int64, limit int) (i } return result.RowsAffected, nil } - -func DeleteOldLog(ctx context.Context, targetTimestamp int64, limit int) (int64, error) { - if limit <= 0 { - limit = 100 - } - - var total int64 = 0 - - for { - if nil != ctx.Err() { - return total, ctx.Err() - } - - rowsAffected, err := DeleteOldLogBatch(ctx, targetTimestamp, limit) - if nil != err { - return total, err - } - - total += rowsAffected - - if rowsAffected < int64(limit) { - break - } - } - - return total, nil -} diff --git a/model/main.go b/model/main.go index 76f98a59c3..ac63d1f59c 100644 --- a/model/main.go +++ b/model/main.go @@ -272,6 +272,9 @@ func migrateDB() error { &Channel{}, &Token{}, &User{}, + &UserSession{}, + &AuthFlow{}, + &ExternalIdentityClaim{}, &PasskeyCredential{}, &Option{}, &Redemption{}, @@ -303,6 +306,12 @@ func migrateDB() error { if err != nil { return err } + if err := InitializeUserAuthVersions(); err != nil { + return err + } + if err := InitializeExternalIdentityClaims(); err != nil { + return err + } if common.UsingMainDatabase(common.DatabaseTypeSQLite) { if err := ensureSubscriptionPlanTableSQLite(); err != nil { return err @@ -326,6 +335,9 @@ func migrateDBFast() error { {&Channel{}, "Channel"}, {&Token{}, "Token"}, {&User{}, "User"}, + {&UserSession{}, "UserSession"}, + {&AuthFlow{}, "AuthFlow"}, + {&ExternalIdentityClaim{}, "ExternalIdentityClaim"}, {&PasskeyCredential{}, "PasskeyCredential"}, {&Option{}, "Option"}, {&Redemption{}, "Redemption"}, @@ -375,6 +387,12 @@ func migrateDBFast() error { return err } } + if err := InitializeUserAuthVersions(); err != nil { + return err + } + if err := InitializeExternalIdentityClaims(); err != nil { + return err + } if common.UsingMainDatabase(common.DatabaseTypeSQLite) { if err := ensureSubscriptionPlanTableSQLite(); err != nil { return err diff --git a/model/option.go b/model/option.go index 8e8587f271..89a233ec57 100644 --- a/model/option.go +++ b/model/option.go @@ -254,6 +254,12 @@ func UpdateOptionsBulk(values map[string]string) error { } func updateOptionMap(key string, value string) (err error) { + if key == retiredThemeOptionKey { + common.OptionMapRWMutex.Lock() + delete(common.OptionMap, key) + common.OptionMapRWMutex.Unlock() + return nil + } common.OptionMapRWMutex.Lock() defer common.OptionMapRWMutex.Unlock() common.OptionMap[key] = value @@ -606,8 +612,6 @@ func handleConfigUpdate(key, value string) bool { } else if configName == "billing_setting" { InvalidatePricingCache() ratio_setting.InvalidateExposedDataCache() - } else if configName == "theme" { - system_setting.UpdateAndSyncTheme() } return true // 已处理 diff --git a/model/passkey.go b/model/passkey.go index 5d2595cf8a..5bb24d4045 100644 --- a/model/passkey.go +++ b/model/passkey.go @@ -2,7 +2,6 @@ package model import ( "encoding/base64" - "encoding/json" "errors" "fmt" "strings" @@ -46,7 +45,7 @@ func (p *PasskeyCredential) TransportList() []protocol.AuthenticatorTransport { return nil } var transports []string - if err := json.Unmarshal([]byte(p.Transports), &transports); err != nil { + if err := common.Unmarshal([]byte(p.Transports), &transports); err != nil { return nil } result := make([]protocol.AuthenticatorTransport, 0, len(transports)) @@ -65,7 +64,7 @@ func (p *PasskeyCredential) SetTransports(list []protocol.AuthenticatorTransport for i, transport := range list { stringList[i] = string(transport) } - encoded, err := json.Marshal(stringList) + encoded, err := common.Marshal(stringList) if err != nil { return } @@ -121,24 +120,6 @@ func NewPasskeyCredentialFromWebAuthn(userID int, credential *webauthn.Credentia return passkey } -func (p *PasskeyCredential) ApplyValidatedCredential(credential *webauthn.Credential) { - if credential == nil || p == nil { - return - } - p.CredentialID = base64.StdEncoding.EncodeToString(credential.ID) - p.PublicKey = base64.StdEncoding.EncodeToString(credential.PublicKey) - p.AttestationType = credential.AttestationType - p.AAGUID = base64.StdEncoding.EncodeToString(credential.Authenticator.AAGUID) - p.SignCount = credential.Authenticator.SignCount - p.CloneWarning = credential.Authenticator.CloneWarning - p.UserPresent = credential.Flags.UserPresent - p.UserVerified = credential.Flags.UserVerified - p.BackupEligible = credential.Flags.BackupEligible - p.BackupState = credential.Flags.BackupState - p.Attachment = string(credential.Authenticator.Attachment) - p.SetTransports(credential.Transport) -} - func GetPasskeyByUserID(userID int) (*PasskeyCredential, error) { if userID == 0 { common.SysLog("GetPasskeyByUserID: empty user ID") @@ -177,34 +158,88 @@ func GetPasskeyByCredentialID(credentialID []byte) (*PasskeyCredential, error) { return &credential, nil } -func UpsertPasskeyCredential(credential *PasskeyCredential) error { - if credential == nil { - common.SysLog("UpsertPasskeyCredential: nil credential provided") +// UpdatePasskeyAssertionState persists only fields produced by a successful +// assertion. Registration identity (credential ID, public key, AAGUID, +// transports and attestation metadata) is immutable on this path. +func UpdatePasskeyAssertionState(userID int, credential *webauthn.Credential, lastUsedAt time.Time) error { + if userID <= 0 || credential == nil || len(credential.ID) == 0 || lastUsedAt.IsZero() { return fmt.Errorf("Passkey 保存失败,请重试") } - return DB.Transaction(func(tx *gorm.DB) error { - // 使用Unscoped()进行硬删除,避免唯一索引冲突 - if err := tx.Unscoped().Where("user_id = ?", credential.UserID).Delete(&PasskeyCredential{}).Error; err != nil { - common.SysLog(fmt.Sprintf("UpsertPasskeyCredential: failed to delete existing credential for user %d: %v", credential.UserID, err)) - return fmt.Errorf("Passkey 保存失败,请重试") - } - if err := tx.Create(credential).Error; err != nil { - common.SysLog(fmt.Sprintf("UpsertPasskeyCredential: failed to create credential for user %d: %v", credential.UserID, err)) - return fmt.Errorf("Passkey 保存失败,请重试") - } - return nil - }) -} - -func DeletePasskeyByUserID(userID int) error { - if userID == 0 { - common.SysLog("DeletePasskeyByUserID: empty user ID") - return fmt.Errorf("删除失败,请重试") + credentialID := base64.StdEncoding.EncodeToString(credential.ID) + result := DB.Model(&PasskeyCredential{}). + Where("user_id = ? AND credential_id = ?", userID, credentialID). + Updates(map[string]interface{}{ + "sign_count": credential.Authenticator.SignCount, + "clone_warning": credential.Authenticator.CloneWarning, + "user_present": credential.Flags.UserPresent, + "user_verified": credential.Flags.UserVerified, + "backup_eligible": credential.Flags.BackupEligible, + "backup_state": credential.Flags.BackupState, + "last_used_at": lastUsedAt, + }) + if result.Error != nil { + return result.Error } - // 使用Unscoped()进行硬删除,避免唯一索引冲突 - if err := DB.Unscoped().Where("user_id = ?", userID).Delete(&PasskeyCredential{}).Error; err != nil { - common.SysLog(fmt.Sprintf("DeletePasskeyByUserID: failed to delete passkey for user %d: %v", userID, err)) - return fmt.Errorf("删除失败,请重试") + if result.RowsAffected != 1 { + return ErrPasskeyNotFound } return nil } + +func upsertPasskeyCredentialWithTx(tx *gorm.DB, credential *PasskeyCredential) error { + if err := tx.Unscoped().Where("user_id = ?", credential.UserID).Delete(&PasskeyCredential{}).Error; err != nil { + common.SysLog(fmt.Sprintf("UpsertPasskeyCredential: failed to delete existing credential for user %d: %v", credential.UserID, err)) + return fmt.Errorf("Passkey 保存失败,请重试") + } + if err := tx.Create(credential).Error; err != nil { + common.SysLog(fmt.Sprintf("UpsertPasskeyCredential: failed to create credential for user %d: %v", credential.UserID, err)) + return fmt.Errorf("Passkey 保存失败,请重试") + } + return nil +} + +// UpsertPasskeyCredentialWithAuthVersion is reserved for enrollment changes; +// assertion sign-count updates must use UpdatePasskeyAssertionState. +func UpsertPasskeyCredentialWithAuthVersion(credential *PasskeyCredential) error { + if credential == nil || credential.UserID <= 0 { + return fmt.Errorf("Passkey 保存失败,请重试") + } + if err := DB.Transaction(func(tx *gorm.DB) error { + if _, err := IncrementUserAuthVersionWithTx(tx, credential.UserID); err != nil { + return err + } + return upsertPasskeyCredentialWithTx(tx, credential) + }); err != nil { + return err + } + return PublishUserAuthCache(credential.UserID) +} + +func DeletePasskeyByUserIDWithAuthVersion(userID int) error { + if userID == 0 { + return fmt.Errorf("删除失败,请重试") + } + if err := DB.Transaction(func(tx *gorm.DB) error { + var credential PasskeyCredential + if err := lockForUpdate(tx).Where("user_id = ?", userID).First(&credential).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return ErrPasskeyNotFound + } + return err + } + if _, err := IncrementUserAuthVersionWithTx(tx, userID); err != nil { + return err + } + result := tx.Unscoped().Delete(&credential) + if result.Error != nil { + return result.Error + } + if result.RowsAffected != 1 { + return ErrPasskeyNotFound + } + return nil + }); err != nil { + return err + } + return PublishUserAuthCache(userID) +} diff --git a/model/subscription.go b/model/subscription.go index 642c7b0355..497fea147a 100644 --- a/model/subscription.go +++ b/model/subscription.go @@ -431,7 +431,7 @@ func getUserGroupByIdTx(tx *gorm.DB, userId int) (string, error) { tx = DB } var group string - if err := tx.Model(&User{}).Where("id = ?", userId).Select(commonGroupCol).Find(&group).Error; err != nil { + if err := lockForUpdate(tx).Model(&User{}).Where("id = ?", userId).Select(commonGroupCol).Find(&group).Error; err != nil { return "", err } return group, nil @@ -557,6 +557,12 @@ func CreateUserSubscriptionFromPlanTx(tx *gorm.DB, userId int, plan *Subscriptio return sub, nil } +func refreshSubscriptionUserGroupCache(userId int, operation string) { + if err := RefreshUserGroupCache(userId); err != nil { + common.SysError(fmt.Sprintf("failed to refresh user group cache after %s for user %d: %v", operation, userId, err)) + } +} + // Complete a subscription order (idempotent). Creates a UserSubscription snapshot from the plan. // expectedPaymentProvider guards against cross-gateway callback attacks (empty skips the check). // actualPaymentMethod updates the order's PaymentMethod to reflect the real payment type used (empty skips update). @@ -594,11 +600,13 @@ func CompleteSubscriptionOrder(tradeNo string, providerPayload string, expectedP if !plan.Enabled { // still allow completion for already purchased orders } - upgradeGroup = strings.TrimSpace(plan.UpgradeGroup) - _, err = CreateUserSubscriptionFromPlanTx(tx, order.UserId, plan, "order") + subscription, err := CreateUserSubscriptionFromPlanTx(tx, order.UserId, plan, "order") if err != nil { return err } + if subscription.PrevUserGroup != "" { + upgradeGroup = strings.TrimSpace(subscription.UpgradeGroup) + } if err := upsertSubscriptionTopUpTx(tx, &order); err != nil { return err } @@ -623,7 +631,7 @@ func CompleteSubscriptionOrder(tradeNo string, providerPayload string, expectedP return err } if upgradeGroup != "" && logUserId > 0 { - _ = UpdateUserGroupCache(logUserId, upgradeGroup) + refreshSubscriptionUserGroupCache(logUserId, "subscription payment completion") } if logUserId > 0 { msg := fmt.Sprintf("订阅购买成功,套餐: %s,支付金额: %.2f,支付方式: %s", logPlanTitle, logMoney, logPaymentMethod) @@ -702,15 +710,19 @@ func AdminBindSubscription(userId int, planId int, sourceNote string) (string, e if err != nil { return "", err } + groupChanged := false err = DB.Transaction(func(tx *gorm.DB) error { - _, err := CreateUserSubscriptionFromPlanTx(tx, userId, plan, "admin") + subscription, err := CreateUserSubscriptionFromPlanTx(tx, userId, plan, "admin") + if err == nil { + groupChanged = subscription.PrevUserGroup != "" + } return err }) if err != nil { return "", err } - if strings.TrimSpace(plan.UpgradeGroup) != "" { - _ = UpdateUserGroupCache(userId, plan.UpgradeGroup) + if groupChanged { + refreshSubscriptionUserGroupCache(userId, "admin subscription creation") return fmt.Sprintf("用户分组将升级到 %s", plan.UpgradeGroup), nil } return "", nil @@ -774,7 +786,8 @@ func PurchaseSubscriptionWithBalance(userId int, planId int) error { } } - if _, err := CreateUserSubscriptionFromPlanTx(tx, userId, plan, PaymentMethodBalance); err != nil { + subscription, err := CreateUserSubscriptionFromPlanTx(tx, userId, plan, PaymentMethodBalance) + if err != nil { return err } @@ -799,7 +812,9 @@ func PurchaseSubscriptionWithBalance(userId int, planId int) error { logPlanTitle = plan.Title logMoney = plan.PriceAmount chargedQuota = requiredQuota - upgradeGroup = strings.TrimSpace(plan.UpgradeGroup) + if subscription.PrevUserGroup != "" { + upgradeGroup = strings.TrimSpace(subscription.UpgradeGroup) + } return nil }) if err != nil { @@ -812,7 +827,7 @@ func PurchaseSubscriptionWithBalance(userId int, planId int) error { } } if upgradeGroup != "" { - _ = UpdateUserGroupCache(userId, upgradeGroup) + refreshSubscriptionUserGroupCache(userId, "subscription balance purchase") } msg := fmt.Sprintf("使用余额购买订阅成功,套餐: %s,支付金额: %.2f,扣除额度: %d", logPlanTitle, logMoney, chargedQuota) RecordLog(userId, LogTypeTopup, msg) @@ -935,7 +950,7 @@ func AdminInvalidateUserSubscription(userSubscriptionId int) (string, error) { return "", err } if cacheGroup != "" && userId > 0 { - _ = UpdateUserGroupCache(userId, cacheGroup) + refreshSubscriptionUserGroupCache(userId, "admin subscription update") } if downgradeGroup != "" { return fmt.Sprintf("用户分组将回退到 %s", downgradeGroup), nil @@ -976,7 +991,7 @@ func AdminDeleteUserSubscription(userSubscriptionId int) (string, error) { return "", err } if cacheGroup != "" && userId > 0 { - _ = UpdateUserGroupCache(userId, cacheGroup) + refreshSubscriptionUserGroupCache(userId, "admin subscription deletion") } if downgradeGroup != "" { return fmt.Sprintf("用户分组将回退到 %s", downgradeGroup), nil @@ -1203,7 +1218,7 @@ func ExpireDueSubscriptions(limit int) (int, error) { return expiredCount, err } if cacheGroup != "" { - _ = UpdateUserGroupCache(userId, cacheGroup) + refreshSubscriptionUserGroupCache(userId, "subscription expiration") } } return expiredCount, nil diff --git a/model/subscription_auth_test.go b/model/subscription_auth_test.go new file mode 100644 index 0000000000..d9848c9715 --- /dev/null +++ b/model/subscription_auth_test.go @@ -0,0 +1,150 @@ +package model + +import ( + "context" + "errors" + "fmt" + "net" + "strings" + "testing" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/glebarez/sqlite" + "github.com/go-redis/redis/v8" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +func TestSubscriptionGroupTransitionsPreserveAuthVersionAndSessions(t *testing.T) { + truncateTables(t) + useUserCacheMiniRedis(t) + now := time.Now().Unix() + user := User{ + Username: "subscription-auth-user", + Password: "unused-password-hash", + Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, + Group: "default", + AuthVersion: 1, + } + require.NoError(t, DB.Create(&user).Error) + require.NoError(t, CreateUserSession(&UserSession{ + SID: "subscription-auth-session", + UserID: user.Id, + Version: 1, + UserAuthVersion: 1, + Status: UserSessionStatusActive, + RefreshHash: "refresh-hash", + LoginMethod: "password", + LastActiveAt: now, + ExpiresAt: now + 3600, + })) + require.NoError(t, populateUserCache(user)) + plan := &SubscriptionPlan{ + Title: "Upgraded", + DurationUnit: SubscriptionDurationMonth, + DurationValue: 1, + TotalAmount: 100, + UpgradeGroup: "pro", + Enabled: true, + } + require.NoError(t, DB.Create(plan).Error) + + subscription, err := CreateUserSubscriptionFromPlanTx(DB, user.Id, plan, "test") + require.NoError(t, err) + require.Equal(t, "default", subscription.PrevUserGroup) + require.NoError(t, RefreshUserGroupCache(user.Id)) + + var updated User + require.NoError(t, DB.First(&updated, user.Id).Error) + assert.Equal(t, "pro", updated.Group) + assert.EqualValues(t, 1, updated.AuthVersion) + var session UserSession + require.NoError(t, DB.First(&session, "sid = ?", "subscription-auth-session").Error) + assert.Equal(t, UserSessionStatusActive, session.Status) + cached, err := GetUserCache(user.Id) + require.NoError(t, err) + assert.Equal(t, "pro", cached.Group) + assert.EqualValues(t, 1, cached.AuthVersion) + + require.NoError(t, DB.Transaction(func(tx *gorm.DB) error { + target, err := downgradeUserGroupForSubscriptionTx(tx, subscription, now+1) + assert.Equal(t, "default", target) + return err + })) + require.NoError(t, RefreshUserGroupCache(user.Id)) + require.NoError(t, DB.First(&updated, user.Id).Error) + assert.Equal(t, "default", updated.Group) + assert.EqualValues(t, 1, updated.AuthVersion) + require.NoError(t, DB.First(&session, "sid = ?", "subscription-auth-session").Error) + assert.Equal(t, UserSessionStatusActive, session.Status) + cached, err = GetUserCache(user.Id) + require.NoError(t, err) + assert.Equal(t, "default", cached.Group) +} + +func TestSubscriptionGroupCacheRefreshFailureDoesNotChangeCommittedResult(t *testing.T) { + previousDB, previousLogDB := DB, LOG_DB + previousMainDatabaseType, previousLogDatabaseType := common.MainDatabaseType(), common.LogDatabaseType() + common.SetDatabaseTypes(common.DatabaseTypeSQLite, common.DatabaseTypeSQLite) + dsn := fmt.Sprintf("file:%s?mode=memory&cache=shared", strings.ReplaceAll(t.Name(), "/", "_")) + db, err := gorm.Open(sqlite.Open(dsn), &gorm.Config{}) + require.NoError(t, err) + DB, LOG_DB = db, db + require.NoError(t, db.AutoMigrate(&User{}, &SubscriptionPlan{}, &UserSubscription{})) + sqlDB, err := db.DB() + require.NoError(t, err) + sqlDB.SetMaxOpenConns(4) + t.Cleanup(func() { + DB, LOG_DB = previousDB, previousLogDB + common.SetDatabaseTypes(previousMainDatabaseType, previousLogDatabaseType) + _ = sqlDB.Close() + }) + + user := User{ + Username: "subscription-cache-failure", + Password: "unused-password-hash", + Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, + Group: "default", + AuthVersion: 1, + } + require.NoError(t, DB.Create(&user).Error) + plan := &SubscriptionPlan{ + Title: "Cache failure plan", + DurationUnit: SubscriptionDurationMonth, + DurationValue: 1, + TotalAmount: 100, + UpgradeGroup: "pro", + Enabled: true, + } + require.NoError(t, DB.Create(plan).Error) + InvalidateSubscriptionPlanCache(plan.Id) + + oldRedisEnabled, oldRDB := common.RedisEnabled, common.RDB + common.RedisEnabled = true + common.RDB = redis.NewClient(&redis.Options{ + Dialer: func(context.Context, string, string) (net.Conn, error) { + return nil, errors.New("forced redis failure") + }, + MaxRetries: -1, + }) + t.Cleanup(func() { + _ = common.RDB.Close() + common.RedisEnabled, common.RDB = oldRedisEnabled, oldRDB + }) + + message, err := AdminBindSubscription(user.Id, plan.Id, "test") + require.NoError(t, err) + assert.Contains(t, message, "pro") + + var updated User + require.NoError(t, DB.First(&updated, user.Id).Error) + assert.Equal(t, "pro", updated.Group) + assert.EqualValues(t, 1, updated.AuthVersion) + var subscription UserSubscription + require.NoError(t, DB.Where("user_id = ?", user.Id).First(&subscription).Error) + assert.Equal(t, "active", subscription.Status) +} diff --git a/model/task_cas_test.go b/model/task_cas_test.go index 91ca28fce8..a53804d3ba 100644 --- a/model/task_cas_test.go +++ b/model/task_cas_test.go @@ -37,6 +37,9 @@ func TestMain(m *testing.M) { if err := db.AutoMigrate( &Task{}, &User{}, + &UserSession{}, + &AuthFlow{}, + &ExternalIdentityClaim{}, &Token{}, &PasskeyCredential{}, &TwoFA{}, @@ -65,6 +68,9 @@ func truncateTables(t *testing.T) { t.Helper() t.Cleanup(func() { DB.Exec("DELETE FROM tasks") + DB.Exec("DELETE FROM auth_flows") + DB.Exec("DELETE FROM external_identity_claims") + DB.Exec("DELETE FROM user_sessions") DB.Exec("DELETE FROM passkey_credentials") DB.Exec("DELETE FROM two_fa_backup_codes") DB.Exec("DELETE FROM two_fas") diff --git a/model/twofa.go b/model/twofa.go index 1887bfe568..9f2f1f1b84 100644 --- a/model/twofa.go +++ b/model/twofa.go @@ -62,8 +62,12 @@ func IsTwoFAEnabled(userId int) (bool, error) { return twoFA != nil && twoFA.IsEnabled, nil } -// CreateTwoFA 创建2FA设置 -func (t *TwoFA) Create() error { +// CreatePendingTwoFASetup stores a disabled factor while the user completes +// enrollment. Enabling a factor must use EnableWithAuthVersion. +func (t *TwoFA) CreatePendingTwoFASetup() error { + if t == nil || t.UserId <= 0 || t.IsEnabled { + return errors.New("无效的2FA待验证设置") + } // 检查用户是否已存在2FA设置 existing, err := GetTwoFAByUserId(t.UserId) if err != nil { @@ -85,29 +89,35 @@ func (t *TwoFA) Create() error { return DB.Create(t).Error } -// Update 更新2FA设置 -func (t *TwoFA) Update() error { +func (t *TwoFA) updateUsageState() error { if t.Id == 0 { return errors.New("2FA记录ID不能为空") } - return DB.Save(t).Error + return DB.Model(&TwoFA{}).Where("id = ?", t.Id).Updates(map[string]interface{}{ + "failed_attempts": t.FailedAttempts, + "locked_until": t.LockedUntil, + "last_used_at": t.LastUsedAt, + }).Error } -// Delete 删除2FA设置 -func (t *TwoFA) Delete() error { - if t.Id == 0 { +// DeletePendingTwoFASetup removes only an unverified setup. Enabled factors +// must use DisableTwoFAWithAuthVersion. +func (t *TwoFA) DeletePendingTwoFASetup() error { + if t == nil || t.Id == 0 || t.UserId <= 0 { return errors.New("2FA记录ID不能为空") } - // 使用事务确保原子性 return DB.Transaction(func(tx *gorm.DB) error { - // 同时删除相关的备用码记录(硬删除) + var pending TwoFA + if err := lockForUpdate(tx). + Where("id = ? AND user_id = ? AND is_enabled = ?", t.Id, t.UserId, false). + First(&pending).Error; err != nil { + return err + } if err := tx.Unscoped().Where("user_id = ?", t.UserId).Delete(&TwoFABackupCode{}).Error; err != nil { return err } - - // 硬删除2FA记录 - return tx.Unscoped().Delete(t).Error + return tx.Unscoped().Delete(&pending).Error }) } @@ -115,7 +125,7 @@ func (t *TwoFA) Delete() error { func (t *TwoFA) ResetFailedAttempts() error { t.FailedAttempts = 0 t.LockedUntil = nil - return t.Update() + return t.updateUsageState() } // IncrementFailedAttempts 增加失败尝试次数 @@ -174,36 +184,55 @@ func (t *TwoFA) IsLocked() bool { return time.Now().Before(*t.LockedUntil) } -// CreateBackupCodes 创建备用码 -func CreateBackupCodes(userId int, codes []string) error { +// CreatePendingTwoFASetupBackupCodes stores recovery codes for an unverified +// setup. Regeneration for an enabled factor must advance auth_version. +func CreatePendingTwoFASetupBackupCodes(userId int, codes []string) error { return DB.Transaction(func(tx *gorm.DB) error { - // 先删除现有的备用码 - if err := tx.Where("user_id = ?", userId).Delete(&TwoFABackupCode{}).Error; err != nil { + var pending TwoFA + if err := lockForUpdate(tx).Where("user_id = ? AND is_enabled = ?", userId, false).First(&pending).Error; err != nil { return err } - - // 创建新的备用码记录 - for _, code := range codes { - hashedCode, err := common.HashBackupCode(code) - if err != nil { - return err - } - - backupCode := TwoFABackupCode{ - UserId: userId, - CodeHash: hashedCode, - IsUsed: false, - } - - if err := tx.Create(&backupCode).Error; err != nil { - return err - } - } - - return nil + return replaceBackupCodesWithTx(tx, userId, codes) }) } +func replaceBackupCodesWithTx(tx *gorm.DB, userId int, codes []string) error { + if err := tx.Where("user_id = ?", userId).Delete(&TwoFABackupCode{}).Error; err != nil { + return err + } + for _, code := range codes { + hashedCode, err := common.HashBackupCode(code) + if err != nil { + return err + } + if err := tx.Create(&TwoFABackupCode{UserId: userId, CodeHash: hashedCode, IsUsed: false}).Error; err != nil { + return err + } + } + return nil +} + +// ReplaceBackupCodesWithAuthVersion atomically replaces the factor's recovery +// credentials and advances the user's authentication version. +func ReplaceBackupCodesWithAuthVersion(userId int, codes []string) error { + if err := DB.Transaction(func(tx *gorm.DB) error { + var enabled TwoFA + if err := lockForUpdate(tx).Where("user_id = ? AND is_enabled = ?", userId, true).First(&enabled).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return ErrTwoFANotEnabled + } + return err + } + if _, err := IncrementUserAuthVersionWithTx(tx, userId); err != nil { + return err + } + return replaceBackupCodesWithTx(tx, userId, codes) + }); err != nil { + return err + } + return PublishUserAuthCache(userId) +} + // ValidateBackupCode 验证并使用备用码 func ValidateBackupCode(userId int, code string) (bool, error) { if !common.ValidateBackupCode(code) { @@ -245,26 +274,63 @@ func GetUnusedBackupCodeCount(userId int) (int, error) { return int(count), err } -// DisableTwoFA 禁用用户的2FA -func DisableTwoFA(userId int) error { - twoFA, err := GetTwoFAByUserId(userId) - if err != nil { +// DisableTwoFAWithAuthVersion atomically removes the factor and invalidates +// every access token issued against the previous security configuration. +func DisableTwoFAWithAuthVersion(userId int) error { + if err := DB.Transaction(func(tx *gorm.DB) error { + var twoFA TwoFA + if err := lockForUpdate(tx).Where("user_id = ? AND is_enabled = ?", userId, true).First(&twoFA).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return ErrTwoFANotEnabled + } + return err + } + if _, err := IncrementUserAuthVersionWithTx(tx, userId); err != nil { + return err + } + if err := tx.Unscoped().Where("user_id = ?", userId).Delete(&TwoFABackupCode{}).Error; err != nil { + return err + } + return tx.Unscoped().Delete(&twoFA).Error + }); err != nil { return err } - if twoFA == nil { - return ErrTwoFANotEnabled - } - - // 删除2FA设置和备用码 - return twoFA.Delete() + return PublishUserAuthCache(userId) } -// EnableTwoFA 启用2FA -func (t *TwoFA) Enable() error { +// EnableWithAuthVersion atomically enables this factor and advances the user +// authentication version so pre-enrollment sessions cannot remain valid. +func (t *TwoFA) EnableWithAuthVersion() error { + if t == nil || t.Id == 0 || t.UserId == 0 { + return errors.New("2FA记录ID不能为空") + } + if err := DB.Transaction(func(tx *gorm.DB) error { + var pending TwoFA + if err := lockForUpdate(tx).Where("id = ? AND user_id = ? AND is_enabled = ?", t.Id, t.UserId, false).First(&pending).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return ErrTwoFAAlreadyEnabled + } + return err + } + if _, err := IncrementUserAuthVersionWithTx(tx, t.UserId); err != nil { + return err + } + result := tx.Model(&pending). + Updates(map[string]interface{}{"is_enabled": true, "failed_attempts": 0, "locked_until": nil}) + if result.Error != nil { + return result.Error + } + if result.RowsAffected != 1 { + return ErrTwoFAAlreadyEnabled + } + return nil + }); err != nil { + return err + } t.IsEnabled = true t.FailedAttempts = 0 t.LockedUntil = nil - return t.Update() + return PublishUserAuthCache(t.UserId) } // ValidateTOTPAndUpdateUsage 验证TOTP并更新使用记录 @@ -289,7 +355,7 @@ func (t *TwoFA) ValidateTOTPAndUpdateUsage(code string) (bool, error) { t.LockedUntil = nil t.LastUsedAt = &now - if err := t.Update(); err != nil { + if err := t.updateUsageState(); err != nil { common.SysLog("更新2FA使用记录失败: " + err.Error()) } @@ -323,7 +389,7 @@ func (t *TwoFA) ValidateBackupCodeAndUpdateUsage(code string) (bool, error) { t.LockedUntil = nil t.LastUsedAt = &now - if err := t.Update(); err != nil { + if err := t.updateUsageState(); err != nil { common.SysLog("更新2FA使用记录失败: " + err.Error()) } diff --git a/model/user.go b/model/user.go index 3a33c82f69..75531a26c9 100644 --- a/model/user.go +++ b/model/user.go @@ -108,18 +108,22 @@ type User struct { StripeCustomer string `json:"stripe_customer" gorm:"type:varchar(64);column:stripe_customer;index"` CreatedAt int64 `json:"created_at" gorm:"autoCreateTime;column:created_at"` LastLoginAt int64 `json:"last_login_at" gorm:"default:0;column:last_login_at"` + AuthVersion int64 `json:"-" gorm:"type:bigint;not null;default:1;column:auth_version"` AdminPermissions map[string]map[string]bool `json:"admin_permissions,omitempty" gorm:"-:all"` } func (user *User) ToBaseUser() *UserBase { cache := &UserBase{ - Id: user.Id, - Group: user.Group, - Quota: user.Quota, - Status: user.Status, - Username: user.Username, - Setting: user.Setting, - Email: user.Email, + Id: user.Id, + Group: user.Group, + Quota: user.Quota, + Status: user.Status, + Role: user.Role, + Username: user.Username, + Setting: user.Setting, + Email: user.Email, + AuthVersion: user.AuthVersion, + CacheSchema: userCacheSchemaVersion, } return cache } @@ -699,10 +703,23 @@ func (user *User) FinalizeOAuthUserCreation(inviterId int) { } func (user *User) Update(updatePassword bool) error { - if err := user.UpdateWithTx(DB, updatePassword); err != nil { + var previousAuthVersion int64 + if err := DB.Model(&User{}).Where("id = ?", user.Id).Select("auth_version").Find(&previousAuthVersion).Error; err != nil { return err } - return updateUserCache(*user) + if err := DB.Transaction(func(tx *gorm.DB) error { + return user.UpdateWithTx(tx, updatePassword) + }); err != nil { + return err + } + if err := updateUserCache(*user); err != nil { + return err + } + if user.AuthVersion > previousAuthVersion { + _, err := RevokeAllUserSessions(user.Id, "user_security_changed") + return err + } + return nil } func (user *User) UpdateWithTx(tx *gorm.DB, updatePassword bool) error { @@ -718,17 +735,43 @@ func (user *User) UpdateWithTx(tx *gorm.DB, updatePassword bool) error { if err = tx.First(¤t, user.Id).Error; err != nil { return err } - if err = tx.Model(¤t).Omit("quota", "used_quota", "request_count").Updates(newUser).Error; err != nil { + // Updates(struct) ignores zero values. Match that behavior when deciding + // whether this request actually changes authentication-sensitive state; + // partial self-profile updates intentionally leave role/status/group empty. + authChanged := (updatePassword && current.Password != newUser.Password) || + (newUser.Role != 0 && current.Role != newUser.Role) || + (newUser.Status != 0 && current.Status != newUser.Status) || + (newUser.Group != "" && current.Group != newUser.Group) + if authChanged { + newUser.AuthVersion, err = IncrementUserAuthVersionWithTx(tx, user.Id) + if err != nil { + return err + } + } + if err = tx.Model(¤t).Omit("quota", "used_quota", "request_count", "auth_version").Updates(newUser).Error; err != nil { return err } return tx.First(user, user.Id).Error } func (user *User) Edit(updatePassword bool) error { - if err := user.EditWithTx(DB, updatePassword); err != nil { + var previousAuthVersion int64 + if err := DB.Model(&User{}).Where("id = ?", user.Id).Select("auth_version").Find(&previousAuthVersion).Error; err != nil { return err } - return updateUserCache(*user) + if err := DB.Transaction(func(tx *gorm.DB) error { + return user.EditWithTx(tx, updatePassword) + }); err != nil { + return err + } + if err := updateUserCache(*user); err != nil { + return err + } + if user.AuthVersion > previousAuthVersion { + _, err := RevokeAllUserSessions(user.Id, "user_security_changed") + return err + } + return nil } func (user *User) EditWithTx(tx *gorm.DB, updatePassword bool) error { @@ -755,6 +798,13 @@ func (user *User) EditWithTx(tx *gorm.DB, updatePassword bool) error { if err = tx.First(¤t, user.Id).Error; err != nil { return err } + authChanged := (updatePassword && current.Password != newUser.Password) || current.Group != newUser.Group + if authChanged { + newUser.AuthVersion, err = IncrementUserAuthVersionWithTx(tx, user.Id) + if err != nil { + return err + } + } if err = tx.Model(¤t).Updates(updates).Error; err != nil { return err } @@ -781,7 +831,15 @@ func (user *User) ClearBinding(bindingType string) error { return errors.New("invalid binding type") } - if err := DB.Model(&User{}).Where("id = ?", user.Id).Update(column, "").Error; err != nil { + if err := DB.Transaction(func(tx *gorm.DB) error { + if err := tx.Model(&User{}).Where("id = ?", user.Id).Update(column, "").Error; err != nil { + return err + } + if bindingType == ExternalIdentityProviderTelegram { + return ReleaseExternalIdentityWithTx(tx, ExternalIdentityProviderTelegram, user.Id) + } + return nil + }); err != nil { return err } @@ -796,11 +854,23 @@ func (user *User) Delete() error { if user.Id == 0 { return errors.New("id 为空!") } - if err := DB.Delete(user).Error; err != nil { + var nextAuthVersion int64 + if err := DB.Transaction(func(tx *gorm.DB) error { + var err error + nextAuthVersion, err = IncrementUserAuthVersionWithTx(tx, user.Id) + if err != nil { + return err + } + return tx.Delete(user).Error + }); err != nil { + return err + } + if err := publishCommittedUserAuthVersion(user.Id, nextAuthVersion); err != nil { + return err + } + if _, err := RevokeAllUserSessions(user.Id, "user_deleted"); err != nil { return err } - - // 清除缓存 return invalidateUserCache(user.Id) } @@ -809,7 +879,13 @@ func (user *User) HardDelete() error { return errors.New("id 为空!") } var tokens []Token + var deletedAuthVersion int64 err := DB.Transaction(func(tx *gorm.DB) error { + var err error + deletedAuthVersion, err = IncrementUserAuthVersionWithTx(tx, user.Id) + if err != nil { + return err + } if common.RedisEnabled { if err := tx.Unscoped().Select("id", commonKeyCol).Where("user_id = ?", user.Id).Find(&tokens).Error; err != nil { return err @@ -823,6 +899,9 @@ func (user *User) HardDelete() error { if err != nil { return err } + if err := publishCommittedUserAuthVersion(user.Id, deletedAuthVersion); err != nil { + common.SysError(fmt.Sprintf("failed to publish auth tombstone after hard deleting user %d: %v", user.Id, err)) + } if err := invalidateTokensCache(tokens); err != nil { common.SysError(fmt.Sprintf("failed to invalidate token cache after hard deleting user %d: %v", user.Id, err)) } @@ -833,9 +912,14 @@ func (user *User) HardDelete() error { } func deleteUserAuthenticationData(tx *gorm.DB, userId int) error { + if err := releaseAllExternalIdentitiesWithTx(tx, userId); err != nil { + return err + } for _, authenticationData := range []any{ &TwoFABackupCode{}, &TwoFA{}, + &UserSession{}, + &AuthFlow{}, &PasskeyCredential{}, &Token{}, } { @@ -997,7 +1081,18 @@ func ResetUserPasswordByEmail(email string, password string) error { if err != nil { return err } - err = DB.Model(&User{}).Where("id = ?", user.Id).Update("password", hashedPassword).Error + if err = DB.Transaction(func(tx *gorm.DB) error { + if _, err := IncrementUserAuthVersionWithTx(tx, user.Id); err != nil { + return err + } + return tx.Model(&User{}).Where("id = ?", user.Id).Update("password", hashedPassword).Error + }); err != nil { + return err + } + if err := PublishUserAuthCache(user.Id); err != nil { + return err + } + _, err = RevokeAllUserSessions(user.Id, "password_reset") return err } @@ -1074,7 +1169,7 @@ func GetUserGroup(id int, fromDB bool) (group string, err error) { // Update Redis cache asynchronously on successful DB read if shouldUpdateRedis(fromDB, err) { gopool.Go(func() { - if err := updateUserGroupCache(id, group); err != nil { + if err := RefreshUserGroupCache(id); err != nil { common.SysLog("failed to update user group cache: " + err.Error()) } }) diff --git a/model/user_auth_cache.go b/model/user_auth_cache.go new file mode 100644 index 0000000000..d2cdc8a7cc --- /dev/null +++ b/model/user_auth_cache.go @@ -0,0 +1,283 @@ +package model + +import ( + "context" + "errors" + "fmt" + "strconv" + + "github.com/QuantumNous/new-api/common" + + "gorm.io/gorm" +) + +// User auth cache fencing uses three Redis keys per user: the cached user +// hash, a short-lived pending fence published before a restrictive database +// transaction, and a monotonic committed version floor published after +// commit. Cache writes below either floor are rejected, readers below the +// effective floor fall back to the database, and the pending fence outlives +// every user-hash TTL so a rolled-back transaction heals without allowing a +// stale snapshot to re-authorize the user. + +var ErrUserAuthCachePending = errors.New("user authentication state update is pending") + +var ErrUserAuthVersionConflict = errors.New("user authentication version update conflicted") + +func getUserAuthFenceKey(userId int) string { + return fmt.Sprintf("auth:user:fence:%d", userId) +} + +func getUserAuthVersionKey(userId int) string { + return fmt.Sprintf("auth:user:version:%d", userId) +} + +// A pending fence only covers the interval between publishing the next +// version and the surrounding database transaction reaching a decision. Its +// TTL must outlive every user hash that could have been populated before the +// fence, while still allowing an automatically rolled-back transaction to +// recover without an operator repairing Redis. +func userAuthFenceTTLSeconds() int { + cacheTTL := userCacheTTLSeconds() + extra := cacheTTL + if extra < 60 { + extra = 60 + } + return cacheTTL + extra +} + +func writeUserCache(user *UserBase, includeQuota bool) error { + if user == nil || user.Id <= 0 || !common.RedisEnabled { + return nil + } + user.CacheSchema = userCacheSchemaVersion + if user.AuthVersion <= 0 { + return fmt.Errorf("invalid user auth version") + } + includeQuotaArg := "0" + if includeQuota { + includeQuotaArg = "1" + } + ttl := userCacheTTLSeconds() + const script = ` +local incoming = tonumber(ARGV[1]) +local pending = tonumber(redis.call('GET', KEYS[2]) or '0') +local committed = tonumber(redis.call('GET', KEYS[3]) or '0') +local current = tonumber(redis.call('HGET', KEYS[1], 'AuthVersion') or '0') +if pending > incoming or committed > incoming or current > incoming then + return 0 +end +if committed < incoming then + redis.call('SET', KEYS[3], ARGV[1]) +end +if pending > 0 and pending <= incoming then + redis.call('DEL', KEYS[2]) +end +if ARGV[10] == '0' and redis.call('EXISTS', KEYS[1]) == 0 then + return 1 +end +redis.call('HSET', KEYS[1], + 'Id', ARGV[2], 'Group', ARGV[3], 'Email', ARGV[4], + 'Status', ARGV[5], 'Role', ARGV[6], 'Username', ARGV[7], + 'Setting', ARGV[8], 'AuthVersion', ARGV[1], 'CacheSchema', ARGV[9]) +if ARGV[10] == '1' and redis.call('HEXISTS', KEYS[1], 'Quota') == 0 then + redis.call('HSET', KEYS[1], 'Quota', ARGV[11]) +end +redis.call('EXPIRE', KEYS[1], ARGV[12]) +return 1` + result, err := common.RDB.Eval(context.Background(), script, + []string{getUserCacheKey(user.Id), getUserAuthFenceKey(user.Id), getUserAuthVersionKey(user.Id)}, + user.AuthVersion, user.Id, user.Group, user.Email, user.Status, user.Role, + user.Username, user.Setting, user.CacheSchema, includeQuotaArg, user.Quota, ttl, + ).Int() + if err != nil { + return err + } + if result == 0 { + return ErrUserAuthCachePending + } + return nil +} + +func getUserAuthVersionFloor(userId int) (int64, error) { + if !common.RedisEnabled { + return 0, nil + } + values, err := common.RDB.MGet(context.Background(), getUserAuthFenceKey(userId), getUserAuthVersionKey(userId)).Result() + if err != nil { + return 0, err + } + var floor int64 + for _, value := range values { + if value == nil { + continue + } + parsed, err := strconv.ParseInt(fmt.Sprint(value), 10, 64) + if err != nil { + return 0, err + } + if parsed > floor { + floor = parsed + } + } + return floor, nil +} + +// SetUserAuthVersionFence publishes a fail-closed version before a restrictive +// database update. Pending fences expire only after every pre-existing user +// hash must have expired; a committed update is promoted separately to a +// permanent monotonic version floor. +func SetUserAuthVersionFence(userId int, authVersion int64) error { + if !common.RedisEnabled { + return nil + } + if userId <= 0 || authVersion <= 0 { + return fmt.Errorf("invalid user auth fence") + } + const script = ` +local current = tonumber(redis.call('GET', KEYS[1]) or '0') +local incoming = tonumber(ARGV[1]) +if current < incoming then + redis.call('SET', KEYS[1], ARGV[1], 'EX', ARGV[2]) +elseif current == incoming then + redis.call('EXPIRE', KEYS[1], ARGV[2]) +elseif redis.call('TTL', KEYS[1]) < 0 then + redis.call('EXPIRE', KEYS[1], ARGV[2]) +end +return 1` + return common.RDB.Eval(context.Background(), script, []string{getUserAuthFenceKey(userId)}, authVersion, userAuthFenceTTLSeconds()).Err() +} + +// publishCommittedUserAuthVersion records the durable lower bound used to +// reject an arbitrarily delayed cache fill after a committed security change. +// It also removes this transaction's now-obsolete pending fence. +func publishCommittedUserAuthVersion(userId int, authVersion int64) error { + if !common.RedisEnabled { + return nil + } + if userId <= 0 || authVersion <= 0 { + return fmt.Errorf("invalid committed user auth version") + } + const script = ` +local incoming = tonumber(ARGV[1]) +local committed = tonumber(redis.call('GET', KEYS[1]) or '0') +local pending = tonumber(redis.call('GET', KEYS[2]) or '0') +if committed < incoming then + redis.call('SET', KEYS[1], ARGV[1]) +end +if pending > 0 and pending <= incoming then + redis.call('DEL', KEYS[2]) +end +return 1` + return common.RDB.Eval(context.Background(), script, + []string{getUserAuthVersionKey(userId), getUserAuthFenceKey(userId)}, authVersion, + ).Err() +} + +// IncrementUserAuthVersionWithTx locks the user, publishes the next deny +// fence, then persists the version in the caller's transaction. Unscoped is +// intentional so the same fail-closed path also covers hard deletion of an +// already soft-deleted user. +func IncrementUserAuthVersionWithTx(tx *gorm.DB, userId int) (int64, error) { + if tx == nil || userId <= 0 { + return 0, fmt.Errorf("invalid user auth version update") + } + for range 3 { + var user User + if err := lockForUpdate(tx.Unscoped()).Select("id", "auth_version").Where("id = ?", userId).First(&user).Error; err != nil { + return 0, err + } + current := user.AuthVersion + if current < 1 { + current = 1 + } + next := current + 1 + if err := SetUserAuthVersionFence(userId, next); err != nil { + return 0, err + } + result := tx.Unscoped().Model(&User{}). + Where("id = ? AND auth_version = ?", userId, user.AuthVersion). + Update("auth_version", next) + if result.Error != nil { + return 0, result.Error + } + if result.RowsAffected == 1 { + return next, nil + } + } + return 0, ErrUserAuthVersionConflict +} + +// BumpUserAuthVersion is the transaction-owning variant used by password, +// role, status and security-factor changes outside another transaction. +func BumpUserAuthVersion(userId int) (int64, error) { + var next int64 + if err := DB.Transaction(func(tx *gorm.DB) error { + var err error + next, err = IncrementUserAuthVersionWithTx(tx, userId) + return err + }); err != nil { + return 0, err + } + if err := PublishUserAuthCache(userId); err != nil { + return next, err + } + return next, nil +} + +// PublishUserAuthCache refreshes the current database state after a successful +// auth-sensitive transaction without touching the cached quota field. +func PublishUserAuthCache(userId int) error { + user, err := GetUserById(userId, false) + if err != nil { + return err + } + return updateUserCache(*user) +} + +// InitializeUserAuthVersions must run after AutoMigrate when upgrading an +// existing database. It is idempotent and portable across all supported DBs. +func InitializeUserAuthVersions() error { + return DB.Model(&User{}).Where("auth_version IS NULL OR auth_version < ?", 1).Update("auth_version", 1).Error +} + +func updateUserCacheFieldAtVersion(userId int, field string, value interface{}, authVersion int64) error { + if !common.RedisEnabled { + return nil + } + if userId <= 0 || authVersion <= 0 { + return fmt.Errorf("invalid user auth version") + } + const script = ` +local incoming = tonumber(ARGV[1]) +local pending = tonumber(redis.call('GET', KEYS[2]) or '0') +local committed = tonumber(redis.call('GET', KEYS[3]) or '0') +local current = tonumber(redis.call('HGET', KEYS[1], 'AuthVersion') or '0') +if pending > incoming or committed > incoming or current > incoming then + return 0 +end +if committed < incoming then + redis.call('SET', KEYS[3], ARGV[1]) +end +if pending > 0 and pending <= incoming then + redis.call('DEL', KEYS[2]) +end +if redis.call('EXISTS', KEYS[1]) == 0 then + return 1 +end +if current ~= incoming then + return 1 +end +redis.call('HSET', KEYS[1], ARGV[2], ARGV[3], 'CacheSchema', ARGV[4]) +return 1` + result, err := common.RDB.Eval(context.Background(), script, + []string{getUserCacheKey(userId), getUserAuthFenceKey(userId), getUserAuthVersionKey(userId)}, + authVersion, field, value, userCacheSchemaVersion, + ).Int() + if err != nil { + return err + } + if result == 0 { + return ErrUserAuthCachePending + } + return nil +} diff --git a/model/user_authentication_test.go b/model/user_authentication_test.go index c285e02387..179232798d 100644 --- a/model/user_authentication_test.go +++ b/model/user_authentication_test.go @@ -2,38 +2,48 @@ package model import ( "context" + "encoding/base64" "errors" "net" "sync" - "sync/atomic" "testing" + "time" "github.com/QuantumNous/new-api/common" "github.com/go-redis/redis/v8" + "github.com/go-webauthn/webauthn/webauthn" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gorm.io/gorm" ) -func TestHardDeleteUserPurgesAuthenticationDataWhenRedisFails(t *testing.T) { +func TestHardDeleteUserFailsClosedWhenAuthFenceCannotPublish(t *testing.T) { truncateTables(t) - user := User{Username: "hard-delete-user", Password: "password"} + user := User{Username: "hard-delete-user", Password: "password", TelegramId: "hard-delete-telegram"} require.NoError(t, DB.Create(&user).Error) + require.NoError(t, DB.Transaction(func(tx *gorm.DB) error { + return ClaimExternalIdentityWithTx(tx, ExternalIdentityProviderTelegram, user.TelegramId, user.Id) + })) require.NoError(t, DB.Create(&Token{UserId: user.Id, Key: "hard-delete-token"}).Error) require.NoError(t, DB.Create(&TwoFA{UserId: user.Id, Secret: "secret", IsEnabled: true}).Error) require.NoError(t, DB.Create(&TwoFABackupCode{UserId: user.Id, CodeHash: "hash"}).Error) require.NoError(t, DB.Create(&PasskeyCredential{UserID: user.Id, CredentialID: "credential", PublicKey: "public-key"}).Error) require.NoError(t, DB.Create(&UserOAuthBinding{UserId: user.Id, ProviderId: 1, ProviderUserId: "provider-user"}).Error) + require.NoError(t, DB.Create(&UserSession{ + SID: "hard-delete-session", UserID: user.Id, Version: 1, UserAuthVersion: 1, + Status: UserSessionStatusActive, RefreshHash: "refresh-hash", LoginMethod: "password", + LastActiveAt: 1, ExpiresAt: 2, + }).Error) + require.NoError(t, DB.Create(&AuthFlow{ + TokenHash: "hard-delete-auth-flow", Purpose: AuthFlowPurposeTwoFALogin, + UserId: user.Id, ExpiresAt: time.Now().Add(time.Minute), + }).Error) oldRedisEnabled, oldRDB := common.RedisEnabled, common.RDB common.RedisEnabled = true - var cacheInvalidatedAfterCommit atomic.Bool common.RDB = redis.NewClient(&redis.Options{ Dialer: func(context.Context, string, string) (net.Conn, error) { - var count int64 - if err := DB.Unscoped().Model(&User{}).Where("id = ?", user.Id).Count(&count).Error; err == nil && count == 0 { - cacheInvalidatedAfterCommit.Store(true) - } return nil, errors.New("forced redis failure") }, MaxRetries: -1, @@ -43,8 +53,58 @@ func TestHardDeleteUserPurgesAuthenticationDataWhenRedisFails(t *testing.T) { common.RedisEnabled, common.RDB = oldRedisEnabled, oldRDB }) + require.Error(t, HardDeleteUserById(user.Id)) + + var count int64 + require.NoError(t, DB.Unscoped().Model(&User{}).Where("id = ?", user.Id).Count(&count).Error) + assert.EqualValues(t, 1, count) + for _, record := range []any{ + &Token{}, + &TwoFA{}, + &TwoFABackupCode{}, + &PasskeyCredential{}, + &UserOAuthBinding{}, + &UserSession{}, + &AuthFlow{}, + &ExternalIdentityClaim{}, + } { + require.NoError(t, DB.Unscoped().Model(record).Where("user_id = ?", user.Id).Count(&count).Error) + assert.EqualValues(t, 1, count) + } +} + +func TestHardDeleteUserPublishesTombstoneAndPurgesAuthenticationData(t *testing.T) { + truncateTables(t) + server := useUserCacheMiniRedis(t) + + user := User{ + Username: "hard-delete-success", Password: "password", AuthVersion: 1, + TelegramId: "hard-delete-success-telegram", + } + require.NoError(t, DB.Create(&user).Error) + require.NoError(t, DB.Transaction(func(tx *gorm.DB) error { + return ClaimExternalIdentityWithTx(tx, ExternalIdentityProviderTelegram, user.TelegramId, user.Id) + })) + require.NoError(t, DB.Create(&Token{UserId: user.Id, Key: "hard-delete-success-token"}).Error) + require.NoError(t, DB.Create(&TwoFA{UserId: user.Id, Secret: "secret", IsEnabled: true}).Error) + require.NoError(t, DB.Create(&TwoFABackupCode{UserId: user.Id, CodeHash: "hash"}).Error) + require.NoError(t, DB.Create(&PasskeyCredential{UserID: user.Id, CredentialID: "credential-success", PublicKey: "public-key"}).Error) + require.NoError(t, DB.Create(&UserOAuthBinding{UserId: user.Id, ProviderId: 1, ProviderUserId: "provider-user-success"}).Error) + require.NoError(t, DB.Create(&UserSession{ + SID: "hard-delete-success-session", UserID: user.Id, Version: 1, UserAuthVersion: 1, + Status: UserSessionStatusActive, RefreshHash: "refresh-hash", LoginMethod: "password", + LastActiveAt: 1, ExpiresAt: 2, + }).Error) + require.NoError(t, DB.Create(&AuthFlow{ + TokenHash: "hard-delete-success-flow", Purpose: AuthFlowPurposeTwoFALogin, + UserId: user.Id, ExpiresAt: time.Now().Add(time.Minute), + }).Error) + require.NoError(t, populateUserCache(user)) + // Administrative hard deletion commonly targets an already soft-deleted + // user; the shared version increment must therefore query unscoped. + require.NoError(t, DB.Delete(&user).Error) + require.NoError(t, HardDeleteUserById(user.Id)) - assert.True(t, cacheInvalidatedAfterCommit.Load()) var count int64 require.NoError(t, DB.Unscoped().Model(&User{}).Where("id = ?", user.Id).Count(&count).Error) @@ -55,10 +115,18 @@ func TestHardDeleteUserPurgesAuthenticationDataWhenRedisFails(t *testing.T) { &TwoFABackupCode{}, &PasskeyCredential{}, &UserOAuthBinding{}, + &UserSession{}, + &AuthFlow{}, + &ExternalIdentityClaim{}, } { require.NoError(t, DB.Unscoped().Model(record).Where("user_id = ?", user.Id).Count(&count).Error) assert.Zero(t, count) } + assert.False(t, server.Exists(getUserAuthFenceKey(user.Id))) + committed, err := common.RDB.Get(t.Context(), getUserAuthVersionKey(user.Id)).Result() + require.NoError(t, err) + assert.Equal(t, "2", committed) + assert.False(t, server.Exists(getUserCacheKey(user.Id))) } func TestIncrementFailedAttemptsCountsConcurrentFailures(t *testing.T) { @@ -94,7 +162,10 @@ func TestValidateBackupCodeCanOnlySucceedOnce(t *testing.T) { truncateTables(t) const code = "ABCD-1234" - require.NoError(t, CreateBackupCodes(123, []string{code})) + user := User{Id: 123, Username: "backup-code-user", Password: "password", AuthVersion: 1} + require.NoError(t, DB.Create(&user).Error) + require.NoError(t, DB.Create(&TwoFA{UserId: user.Id, Secret: "secret", IsEnabled: false}).Error) + require.NoError(t, CreatePendingTwoFASetupBackupCodes(user.Id, []string{code})) const attempts = 2 results := make(chan bool, attempts) @@ -128,3 +199,117 @@ func TestValidateBackupCodeCanOnlySucceedOnce(t *testing.T) { require.NoError(t, err) assert.Zero(t, remaining) } + +func TestPendingTwoFASetupAPIsRejectEnabledFactor(t *testing.T) { + truncateTables(t) + + user := User{Username: "enabled-twofa-guard", Password: "password", AuthVersion: 1} + require.NoError(t, DB.Create(&user).Error) + twoFA := TwoFA{UserId: user.Id, Secret: "secret", IsEnabled: true} + require.NoError(t, DB.Create(&twoFA).Error) + + require.Error(t, CreatePendingTwoFASetupBackupCodes(user.Id, []string{"ABCD-1234"})) + require.Error(t, twoFA.DeletePendingTwoFASetup()) + + var stored TwoFA + require.NoError(t, DB.First(&stored, twoFA.Id).Error) + assert.True(t, stored.IsEnabled) + var backupCodeCount int64 + require.NoError(t, DB.Model(&TwoFABackupCode{}).Where("user_id = ?", user.Id).Count(&backupCodeCount).Error) + assert.Zero(t, backupCodeCount) +} + +func TestSecurityFactorMutationsAdvanceUserAuthVersion(t *testing.T) { + truncateTables(t) + + user := User{ + Username: "security-factor-version-user", + Password: "password", + Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, + Group: "default", + AuthVersion: 1, + } + require.NoError(t, DB.Create(&user).Error) + twoFA := TwoFA{UserId: user.Id, Secret: "secret", IsEnabled: false} + require.NoError(t, DB.Create(&twoFA).Error) + + require.NoError(t, twoFA.EnableWithAuthVersion()) + assertUserAuthVersion(t, user.Id, 2) + assert.ErrorIs(t, twoFA.EnableWithAuthVersion(), ErrTwoFAAlreadyEnabled) + assertUserAuthVersion(t, user.Id, 2) + require.NoError(t, ReplaceBackupCodesWithAuthVersion(user.Id, []string{"ABCD-1234"})) + assertUserAuthVersion(t, user.Id, 3) + require.NoError(t, DisableTwoFAWithAuthVersion(user.Id)) + assertUserAuthVersion(t, user.Id, 4) + + credential := &PasskeyCredential{UserID: user.Id, CredentialID: "credential-id", PublicKey: "public-key"} + require.NoError(t, UpsertPasskeyCredentialWithAuthVersion(credential)) + assertUserAuthVersion(t, user.Id, 5) + require.NoError(t, DeletePasskeyByUserIDWithAuthVersion(user.Id)) + assertUserAuthVersion(t, user.Id, 6) +} + +func TestUpdatePasskeyAssertionStateCannotRewriteRegistrationIdentity(t *testing.T) { + truncateTables(t) + + user := User{Username: "passkey-assertion-state", Password: "password", AuthVersion: 1} + require.NoError(t, DB.Create(&user).Error) + credentialID := []byte("stable-credential-id") + stored := PasskeyCredential{ + UserID: user.Id, + CredentialID: base64.StdEncoding.EncodeToString(credentialID), + PublicKey: "original-public-key", + AttestationType: "packed", + AAGUID: "original-aaguid", + SignCount: 1, + Transports: `["usb"]`, + Attachment: "platform", + } + require.NoError(t, DB.Create(&stored).Error) + usedAt := time.Now().UTC().Truncate(time.Second) + validated := &webauthn.Credential{ + ID: credentialID, + PublicKey: []byte("replacement-public-key"), + AttestationType: "none", + Flags: webauthn.CredentialFlags{ + UserPresent: true, + UserVerified: true, + BackupEligible: true, + BackupState: true, + }, + Authenticator: webauthn.Authenticator{ + AAGUID: []byte("replacement-aaguid"), + SignCount: 8, + CloneWarning: true, + }, + } + require.NoError(t, UpdatePasskeyAssertionState(user.Id, validated, usedAt)) + + var updated PasskeyCredential + require.NoError(t, DB.First(&updated, stored.ID).Error) + assert.Equal(t, stored.CredentialID, updated.CredentialID) + assert.Equal(t, stored.PublicKey, updated.PublicKey) + assert.Equal(t, stored.AttestationType, updated.AttestationType) + assert.Equal(t, stored.AAGUID, updated.AAGUID) + assert.Equal(t, stored.Transports, updated.Transports) + assert.Equal(t, stored.Attachment, updated.Attachment) + assert.EqualValues(t, 8, updated.SignCount) + assert.True(t, updated.CloneWarning) + assert.True(t, updated.UserPresent) + assert.True(t, updated.UserVerified) + assert.True(t, updated.BackupEligible) + assert.True(t, updated.BackupState) + require.NotNil(t, updated.LastUsedAt) + assert.Equal(t, usedAt.Unix(), updated.LastUsedAt.Unix()) + + validated.ID = []byte("another-credential") + assert.ErrorIs(t, UpdatePasskeyAssertionState(user.Id, validated, usedAt), ErrPasskeyNotFound) +} + +func assertUserAuthVersion(t *testing.T, userID int, expected int64) { + t.Helper() + var version int64 + require.NoError(t, DB.Model(&User{}).Where("id = ?", userID).Select("auth_version").Scan(&version).Error) + assert.Equal(t, expected, version) +} diff --git a/model/user_cache.go b/model/user_cache.go index 2a246c84d0..2ca84f4022 100644 --- a/model/user_cache.go +++ b/model/user_cache.go @@ -1,27 +1,29 @@ package model import ( + "errors" "fmt" - "time" "github.com/QuantumNous/new-api/common" "github.com/QuantumNous/new-api/constant" "github.com/QuantumNous/new-api/dto" "github.com/gin-gonic/gin" - - "github.com/bytedance/gopkg/util/gopool" ) -// UserBase struct remains the same as it represents the cached data structure +const userCacheSchemaVersion = 2 + type UserBase struct { - Id int `json:"id"` - Group string `json:"group"` - Email string `json:"email"` - Quota int `json:"quota"` - Status int `json:"status"` - Username string `json:"username"` - Setting string `json:"setting"` + Id int `json:"id"` + Group string `json:"group"` + Email string `json:"email"` + Quota int `json:"quota"` + Status int `json:"status"` + Role int `json:"role"` + Username string `json:"username"` + Setting string `json:"setting"` + AuthVersion int64 `json:"-"` + CacheSchema int `json:"-"` } func (user *UserBase) WriteContext(c *gin.Context) { @@ -49,6 +51,14 @@ func getUserCacheKey(userId int) string { return fmt.Sprintf("user:%d", userId) } +func userCacheTTLSeconds() int { + ttl := common.RedisKeyCacheSeconds() + if ttl <= 0 { + return 60 + } + return ttl +} + // invalidateUserCache clears user cache func invalidateUserCache(userId int) error { if !common.RedisEnabled { @@ -67,12 +77,7 @@ func populateUserCache(user User) error { if !common.RedisEnabled { return nil } - - return common.RedisHSetObj( - getUserCacheKey(user.Id), - user.ToBaseUser(), - time.Duration(common.RedisKeyCacheSeconds())*time.Second, - ) + return writeUserCache(user.ToBaseUser(), true) } // updateUserCache refreshes non-quota user cache fields. @@ -82,61 +87,37 @@ func updateUserCache(user User) error { if !common.RedisEnabled { return nil } - if err := updateUserGroupCache(user.Id, user.Group); err != nil { - return err - } - if err := updateUserEmailCache(user.Id, user.Email); err != nil { - return err - } - if err := updateUserStatusCache(user.Id, user.Status == common.UserStatusEnabled); err != nil { - return err - } - if err := updateUserNameCache(user.Id, user.Username); err != nil { - return err - } - return updateUserSettingCache(user.Id, user.Setting) + return writeUserCache(user.ToBaseUser(), false) } // GetUserCache gets complete user cache from hash -func GetUserCache(userId int) (userCache *UserBase, err error) { - var user *User - var fromDB bool - defer func() { - // Update Redis cache asynchronously on successful DB read - if shouldUpdateRedis(fromDB, err) && user != nil { - gopool.Go(func() { - if err := populateUserCache(*user); err != nil { - common.SysLog("failed to update user status cache: " + err.Error()) - } - }) - } - }() - +func GetUserCache(userId int) (*UserBase, error) { // Try getting from Redis first - userCache, err = cacheGetUserBase(userId) + userCache, err := cacheGetUserBase(userId) if err == nil { return userCache, nil } - // If Redis fails, get from DB - fromDB = true - user, err = GetUserById(userId, false) + // Redis misses and read failures both fall back to the shared database. A + // version fence newer than the database is the one exception: allowing that + // snapshot would re-authorize a user while a restrictive update is pending. + user, err := GetUserById(userId, false) if err != nil { - return nil, err // Return nil and error if DB lookup fails + return nil, err } - - // Create cache object from user data - userCache = &UserBase{ - Id: user.Id, - Group: user.Group, - Quota: user.Quota, - Status: user.Status, - Username: user.Username, - Setting: user.Setting, - Email: user.Email, + if common.RedisEnabled { + floor, floorErr := getUserAuthVersionFloor(userId) + if floorErr == nil && floor > user.AuthVersion { + return nil, ErrUserAuthCachePending + } + if err := populateUserCache(*user); err != nil { + if errors.Is(err, ErrUserAuthCachePending) { + return nil, err + } + common.SysLog("failed to synchronously populate user cache: " + err.Error()) + } } - - return userCache, nil + return user.ToBaseUser(), nil } func cacheGetUserBase(userId int) (*UserBase, error) { @@ -149,6 +130,16 @@ func cacheGetUserBase(userId int) (*UserBase, error) { if err != nil { return nil, err } + if userCache.Id != userId || userCache.CacheSchema != userCacheSchemaVersion || userCache.AuthVersion <= 0 { + return nil, fmt.Errorf("user cache schema is stale") + } + floor, err := getUserAuthVersionFloor(userId) + if err != nil { + return nil, err + } + if floor > userCache.AuthVersion { + return nil, ErrUserAuthCachePending + } return &userCache, nil } @@ -207,14 +198,11 @@ func getUserSettingCache(userId int) (dto.UserSetting, error) { // New functions for individual field updates func updateUserStatusCache(userId int, status bool) error { - if !common.RedisEnabled { - return nil - } statusInt := common.UserStatusEnabled if !status { statusInt = common.UserStatusDisabled } - return common.RedisHSetField(getUserCacheKey(userId), "Status", fmt.Sprintf("%d", statusInt)) + return updateUserCacheField(userId, "Status", statusInt) } func updateUserQuotaCache(userId int, quota int) error { @@ -224,36 +212,74 @@ func updateUserQuotaCache(userId int, quota int) error { return common.RedisHSetField(getUserCacheKey(userId), "Quota", fmt.Sprintf("%d", quota)) } -func updateUserGroupCache(userId int, group string) error { +// RefreshUserGroupCache writes the database-authoritative group into an +// existing user hash without changing the user's authentication version. +func RefreshUserGroupCache(userId int) error { if !common.RedisEnabled { return nil } - return common.RedisHSetField(getUserCacheKey(userId), "Group", group) -} + if userId <= 0 { + return fmt.Errorf("invalid user id") + } + var authoritative User + if err := DB.Select("id", "auth_version", commonGroupCol).Where("id = ?", userId).First(&authoritative).Error; err != nil { + return err + } + // Group transitions intentionally keep the same authentication version. A + // refresh that read the previous group can therefore arrive after a newer + // refresh and still pass the auth-version fence. Re-read after every write + // and repair the cache when the authoritative group changed in between. + for range 3 { + if err := updateUserCacheFieldAtVersion(userId, "Group", authoritative.Group, authoritative.AuthVersion); err != nil { + return err + } -func UpdateUserGroupCache(userId int, group string) error { - return updateUserGroupCache(userId, group) + var verified User + if err := DB.Select("id", "auth_version", commonGroupCol).Where("id = ?", userId).First(&verified).Error; err != nil { + return err + } + if verified.AuthVersion == authoritative.AuthVersion && verified.Group == authoritative.Group { + return nil + } + authoritative = verified + } + + // Preserve the freshest snapshot observed even when the row was too busy to + // stabilize within the bounded retries. Returning an error lets best-effort + // callers emit an operation-specific warning. + if err := updateUserCacheFieldAtVersion(userId, "Group", authoritative.Group, authoritative.AuthVersion); err != nil { + return err + } + return fmt.Errorf("user group changed repeatedly during cache refresh") } func updateUserEmailCache(userId int, email string) error { - if !common.RedisEnabled { - return nil - } - return common.RedisHSetField(getUserCacheKey(userId), "Email", email) + return updateUserCacheField(userId, "Email", email) } func updateUserNameCache(userId int, username string) error { - if !common.RedisEnabled { - return nil - } - return common.RedisHSetField(getUserCacheKey(userId), "Username", username) + return updateUserCacheField(userId, "Username", username) } func updateUserSettingCache(userId int, setting string) error { + return updateUserCacheField(userId, "Setting", setting) +} + +// updateUserCacheField prevents individual cache refreshes from bypassing the +// auth-version fence. It intentionally does nothing when the complete hash is +// absent; the next GetUserCache call will repopulate it from the database. +func updateUserCacheField(userId int, field string, value interface{}) error { if !common.RedisEnabled { return nil } - return common.RedisHSetField(getUserCacheKey(userId), "Setting", setting) + var user User + if err := DB.Select("id", "auth_version").Where("id = ?", userId).First(&user).Error; err != nil { + return err + } + if user.AuthVersion <= 0 { + return fmt.Errorf("invalid user auth version") + } + return updateUserCacheFieldAtVersion(userId, field, value, user.AuthVersion) } // GetUserLanguage returns the user's language preference from cache diff --git a/model/user_cache_auth_version_test.go b/model/user_cache_auth_version_test.go new file mode 100644 index 0000000000..769db103ca --- /dev/null +++ b/model/user_cache_auth_version_test.go @@ -0,0 +1,223 @@ +package model + +import ( + "errors" + "sync/atomic" + "testing" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/alicebob/miniredis/v2" + "github.com/go-redis/redis/v8" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +func useUserCacheMiniRedis(t *testing.T) *miniredis.Miniredis { + t.Helper() + server := miniredis.RunT(t) + oldRedisEnabled := common.RedisEnabled + oldRDB := common.RDB + oldSyncFrequency := common.SyncFrequency + common.RedisEnabled = true + common.SyncFrequency = 2 + common.RDB = redis.NewClient(&redis.Options{Addr: server.Addr()}) + t.Cleanup(func() { + _ = common.RDB.Close() + common.RedisEnabled = oldRedisEnabled + common.RDB = oldRDB + common.SyncFrequency = oldSyncFrequency + }) + return server +} + +func TestUserAuthFenceRollbackExpiresAndRecovers(t *testing.T) { + truncateTables(t) + server := useUserCacheMiniRedis(t) + + user := User{ + Username: "auth-fence-rollback", + Password: "password", + Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, + Group: "default", + AuthVersion: 1, + } + require.NoError(t, DB.Create(&user).Error) + require.NoError(t, populateUserCache(user)) + + tx := DB.Begin() + require.NoError(t, tx.Error) + next, err := IncrementUserAuthVersionWithTx(tx, user.Id) + require.NoError(t, err) + assert.EqualValues(t, 2, next) + + _, err = cacheGetUserBase(user.Id) + assert.ErrorIs(t, err, ErrUserAuthCachePending) + cacheTTL, err := common.RDB.TTL(t.Context(), getUserCacheKey(user.Id)).Result() + require.NoError(t, err) + fenceTTL, err := common.RDB.TTL(t.Context(), getUserAuthFenceKey(user.Id)).Result() + require.NoError(t, err) + assert.Greater(t, fenceTTL, cacheTTL) + require.NoError(t, tx.Rollback().Error) + + server.FastForward(time.Duration(userAuthFenceTTLSeconds()+1) * time.Second) + assert.False(t, server.Exists(getUserAuthFenceKey(user.Id))) + committed, err := common.RDB.Get(t.Context(), getUserAuthVersionKey(user.Id)).Result() + require.NoError(t, err) + assert.Equal(t, "1", committed) + + cached, err := GetUserCache(user.Id) + require.NoError(t, err) + assert.EqualValues(t, 1, cached.AuthVersion) +} + +func TestPendingUserAuthFenceRejectsStaleCacheWrite(t *testing.T) { + server := useUserCacheMiniRedis(t) + const userID = 4201 + require.NoError(t, SetUserAuthVersionFence(userID, 2)) + + err := writeUserCache(&UserBase{ + Id: userID, Group: "default", Username: "stale", AuthVersion: 1, + }, true) + + assert.ErrorIs(t, err, ErrUserAuthCachePending) + assert.False(t, server.Exists(getUserCacheKey(userID))) +} + +func TestUserAuthFieldUpdateRejectsVersionMismatch(t *testing.T) { + useUserCacheMiniRedis(t) + const userID = 4202 + require.NoError(t, writeUserCache(&UserBase{ + Id: userID, Group: "current", Username: "cached", AuthVersion: 3, + }, true)) + + err := updateUserCacheFieldAtVersion(userID, "Group", "stale", 2) + + assert.ErrorIs(t, err, ErrUserAuthCachePending) + group, err := common.RDB.HGet(t.Context(), getUserCacheKey(userID), "Group").Result() + require.NoError(t, err) + assert.Equal(t, "current", group) +} + +func TestRefreshUserGroupCacheRepairsDelayedSameVersionWrite(t *testing.T) { + truncateTables(t) + useUserCacheMiniRedis(t) + + user := User{ + Username: "delayed-group-refresh", + Password: "password", + Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, + Group: "default", + AuthVersion: 1, + } + require.NoError(t, DB.Create(&user).Error) + require.NoError(t, populateUserCache(user)) + + firstSnapshotRead := make(chan struct{}) + releaseDelayedRefresh := make(chan struct{}) + var intercepted atomic.Bool + const callbackName = "test:block_delayed_group_refresh" + require.NoError(t, DB.Callback().Query().After("gorm:query").Register(callbackName, func(*gorm.DB) { + if intercepted.CompareAndSwap(false, true) { + close(firstSnapshotRead) + <-releaseDelayedRefresh + } + })) + t.Cleanup(func() { + _ = DB.Callback().Query().Remove(callbackName) + }) + + delayedResult := make(chan error, 1) + go func() { + delayedResult <- RefreshUserGroupCache(user.Id) + }() + <-firstSnapshotRead + + require.NoError(t, DB.Model(&User{}).Where("id = ?", user.Id).Update("group", "pro").Error) + require.NoError(t, RefreshUserGroupCache(user.Id)) + cached, err := cacheGetUserBase(user.Id) + require.NoError(t, err) + assert.Equal(t, "pro", cached.Group) + assert.EqualValues(t, 1, cached.AuthVersion) + + close(releaseDelayedRefresh) + require.NoError(t, <-delayedResult) + cached, err = cacheGetUserBase(user.Id) + require.NoError(t, err) + assert.Equal(t, "pro", cached.Group) + assert.EqualValues(t, 1, cached.AuthVersion) +} + +func TestCommittedUserAuthVersionPermanentlyRejectsDelayedCacheFill(t *testing.T) { + truncateTables(t) + server := useUserCacheMiniRedis(t) + + user := User{ + Username: "auth-fence-commit", + Password: "password", + Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, + Group: "default", + AuthVersion: 1, + } + require.NoError(t, DB.Create(&user).Error) + require.NoError(t, populateUserCache(user)) + stale := *user.ToBaseUser() + + require.NoError(t, DB.Transaction(func(tx *gorm.DB) error { + _, err := IncrementUserAuthVersionWithTx(tx, user.Id) + return err + })) + require.NoError(t, PublishUserAuthCache(user.Id)) + assert.False(t, server.Exists(getUserAuthFenceKey(user.Id))) + committed, err := common.RDB.Get(t.Context(), getUserAuthVersionKey(user.Id)).Result() + require.NoError(t, err) + assert.Equal(t, "2", committed) + + server.FastForward(time.Duration(userAuthFenceTTLSeconds()+1) * time.Second) + require.NoError(t, common.RedisDelKey(getUserCacheKey(user.Id))) + err = writeUserCache(&stale, true) + assert.True(t, errors.Is(err, ErrUserAuthCachePending)) + committed, err = common.RDB.Get(t.Context(), getUserAuthVersionKey(user.Id)).Result() + require.NoError(t, err) + assert.Equal(t, "2", committed) +} + +func TestUserAuthVersionFenceAndCommittedFloorAreMonotonic(t *testing.T) { + truncateTables(t) + server := useUserCacheMiniRedis(t) + + const userID = 4101 + require.NoError(t, SetUserAuthVersionFence(userID, 5)) + require.NoError(t, SetUserAuthVersionFence(userID, 3)) + pending, err := common.RDB.Get(t.Context(), getUserAuthFenceKey(userID)).Result() + require.NoError(t, err) + assert.Equal(t, "5", pending) + floor, err := getUserAuthVersionFloor(userID) + require.NoError(t, err) + assert.EqualValues(t, 5, floor) + + // Committing an older transaction must neither clear a newer pending fence + // nor lower the effective deny floor. + require.NoError(t, publishCommittedUserAuthVersion(userID, 3)) + pending, err = common.RDB.Get(t.Context(), getUserAuthFenceKey(userID)).Result() + require.NoError(t, err) + assert.Equal(t, "5", pending) + floor, err = getUserAuthVersionFloor(userID) + require.NoError(t, err) + assert.EqualValues(t, 5, floor) + + require.NoError(t, publishCommittedUserAuthVersion(userID, 5)) + assert.False(t, server.Exists(getUserAuthFenceKey(userID))) + committed, err := common.RDB.Get(t.Context(), getUserAuthVersionKey(userID)).Result() + require.NoError(t, err) + assert.Equal(t, "5", committed) + + require.NoError(t, publishCommittedUserAuthVersion(userID, 4)) + committed, err = common.RDB.Get(t.Context(), getUserAuthVersionKey(userID)).Result() + require.NoError(t, err) + assert.Equal(t, "5", committed) +} diff --git a/model/user_session.go b/model/user_session.go new file mode 100644 index 0000000000..69162d2e75 --- /dev/null +++ b/model/user_session.go @@ -0,0 +1,870 @@ +package model + +import ( + "context" + "crypto/hmac" + "errors" + "fmt" + "strings" + "time" + + "github.com/QuantumNous/new-api/common" + + "gorm.io/gorm" +) + +const ( + UserSessionStatusActive = "active" + UserSessionStatusRevoking = "revoking" + UserSessionStatusRevoked = "revoked" + + userSessionCacheSchema = 1 + userSessionListLimit = 100 + userSessionRevokeBatchSize = 500 + userSessionCleanupScanLimit = 1000 + userSessionCleanupBatchSize = 500 +) + +var ( + ErrUserSessionInvalid = errors.New("user session is invalid") + ErrUserSessionInactive = errors.New("user session is inactive") + ErrUserSessionRefreshInvalid = errors.New("user session refresh token is invalid") + ErrUserSessionRefreshRace = errors.New("user session refresh is already in progress") + ErrUserSessionRefreshReuse = errors.New("user session refresh token was reused") + ErrUserSessionLimit = errors.New("active user session limit reached") + ErrUserSessionIssuanceLimit = errors.New("user session issuance limit reached") + errUserSessionCacheObservationStale = errors.New("user session cache observation is stale") +) + +// UserSession is the server-side control plane for short-lived access JWTs. +// RefreshHash values are HMAC digests supplied by the service layer; opaque +// refresh secrets are never persisted. +type UserSession struct { + SID string `json:"sid" gorm:"column:sid;type:varchar(64);primaryKey"` + UserID int `json:"user_id" gorm:"column:user_id;not null;index:idx_user_sessions_user_status_expiry,priority:1;index:idx_user_sessions_user_created,priority:1"` + Version int64 `json:"version" gorm:"type:bigint;not null;default:1"` + UserAuthVersion int64 `json:"user_auth_version" gorm:"type:bigint;not null"` + Status string `json:"status" gorm:"type:varchar(16);not null;index:idx_user_sessions_user_status_expiry,priority:2;index:idx_user_sessions_status_revoked,priority:1"` + RefreshHash string `json:"-" gorm:"type:char(64);not null"` + PreviousRefreshHash string `json:"-" gorm:"type:varchar(64)"` + PreviousValidUntil int64 `json:"-" gorm:"type:bigint;not null;default:0"` + LoginMethod string `json:"login_method" gorm:"type:varchar(32);not null"` + IP string `json:"ip" gorm:"type:varchar(64)"` + UserAgent string `json:"user_agent" gorm:"type:text"` + CreatedAt int64 `json:"created_at" gorm:"autoCreateTime;column:created_at;index:idx_user_sessions_user_created,priority:2"` + LastActiveAt int64 `json:"last_active_at" gorm:"type:bigint;not null;column:last_active_at"` + ExpiresAt int64 `json:"expires_at" gorm:"type:bigint;not null;column:expires_at;index:idx_user_sessions_user_status_expiry,priority:3;index:idx_user_sessions_expires_at"` + RevokedAt int64 `json:"revoked_at,omitempty" gorm:"type:bigint;not null;default:0;column:revoked_at;index:idx_user_sessions_status_revoked,priority:2"` + RevokedReason string `json:"revoked_reason,omitempty" gorm:"type:varchar(64);column:revoked_reason"` +} + +func (UserSession) TableName() string { + return "user_sessions" +} + +func (session *UserSession) AfterFind(_ *gorm.DB) error { + session.PreviousRefreshHash = strings.TrimSpace(session.PreviousRefreshHash) + return nil +} + +type userSessionCacheEntry struct { + SID string + UserID int + Version int64 + UserAuthVersion int64 + Status string + LoginMethod string + IP string + UserAgent string + CreatedAt int64 + LastActiveAt int64 + ExpiresAt int64 + RevokedAt int64 + RevokedReason string + CacheSchema int +} + +func (session *UserSession) cacheEntry() *userSessionCacheEntry { + return &userSessionCacheEntry{ + SID: session.SID, + UserID: session.UserID, + Version: session.Version, + UserAuthVersion: session.UserAuthVersion, + Status: session.Status, + LoginMethod: session.LoginMethod, + IP: session.IP, + UserAgent: session.UserAgent, + CreatedAt: session.CreatedAt, + LastActiveAt: session.LastActiveAt, + ExpiresAt: session.ExpiresAt, + RevokedAt: session.RevokedAt, + RevokedReason: session.RevokedReason, + CacheSchema: userSessionCacheSchema, + } +} + +func (entry *userSessionCacheEntry) session() *UserSession { + return &UserSession{ + SID: entry.SID, + UserID: entry.UserID, + Version: entry.Version, + UserAuthVersion: entry.UserAuthVersion, + Status: entry.Status, + LoginMethod: entry.LoginMethod, + IP: entry.IP, + UserAgent: entry.UserAgent, + CreatedAt: entry.CreatedAt, + LastActiveAt: entry.LastActiveAt, + ExpiresAt: entry.ExpiresAt, + RevokedAt: entry.RevokedAt, + RevokedReason: entry.RevokedReason, + } +} + +func userSessionCacheKey(sid string) string { + digest := common.GenerateHMACWithKey([]byte("user-session-cache-v1:"+common.SessionSecret), sid) + return "auth:session:" + digest +} + +func userSessionCacheDeadline() time.Time { + return time.Now().Add(time.Duration(userCacheTTLSeconds()) * time.Second) +} + +func CreateUserSession(session *UserSession) error { + now := time.Now().Unix() + if session == nil || session.SID == "" || session.UserID <= 0 || session.UserAuthVersion <= 0 || session.RefreshHash == "" || session.ExpiresAt <= now { + return ErrUserSessionInvalid + } + if session.Version <= 0 { + session.Version = 1 + } + if session.Status == "" { + session.Status = UserSessionStatusActive + } + if session.Status != UserSessionStatusActive || session.RevokedAt != 0 { + return ErrUserSessionInvalid + } + if session.LastActiveAt == 0 { + session.LastActiveAt = now + } + if session.CreatedAt == 0 { + session.CreatedAt = now + } + cacheDeadline := userSessionCacheDeadline() + if err := DB.Create(session).Error; err != nil { + return err + } + if err := writeUserSessionCache(session.cacheEntry(), cacheDeadline); err != nil { + if errors.Is(err, errUserSessionCacheObservationStale) { + return confirmUserSessionActiveSnapshot(session) + } + if errors.Is(err, ErrUserSessionInactive) { + return err + } + common.SysLog("failed to populate newly created user session cache: " + err.Error()) + } + return nil +} + +func CountActiveUserSessions(userID int, now int64) (int64, error) { + if userID <= 0 { + return 0, ErrUserSessionInvalid + } + if now <= 0 { + now = time.Now().Unix() + } + var count int64 + err := DB.Model(&UserSession{}). + Where("user_id = ? AND status = ? AND expires_at > ?", userID, UserSessionStatusActive, now). + Count(&count).Error + return count, err +} + +// CountUserSessionsCreatedSince counts every issued row, regardless of its +// current status or expiry. userID zero selects the global count. +func CountUserSessionsCreatedSince(userID int, createdAfter int64) (int64, error) { + if userID < 0 || createdAfter <= 0 { + return 0, ErrUserSessionInvalid + } + query := DB.Model(&UserSession{}).Where("created_at > ?", createdAfter) + if userID > 0 { + query = query.Where("user_id = ?", userID) + } + var count int64 + err := query.Count(&count).Error + return count, err +} + +func GetUserSessionBySID(sid string) (*UserSession, error) { + if sid == "" { + return nil, ErrUserSessionInvalid + } + var session UserSession + if err := DB.Where("sid = ?", sid).First(&session).Error; err != nil { + return nil, err + } + return &session, nil +} + +// GetUserSessionCached validates cached state first and falls back to the +// database on a miss or Redis read failure. A deny tombstone never falls back. +func GetUserSessionCached(sid string) (*UserSession, error) { + if sid == "" { + return nil, ErrUserSessionInvalid + } + if common.RedisEnabled { + entry, err := getUserSessionCache(sid) + if err == nil { + return entry.session(), nil + } + if errors.Is(err, ErrUserSessionInactive) { + return nil, err + } + } + + cacheDeadline := userSessionCacheDeadline() + session, err := GetUserSessionBySID(sid) + if err != nil { + return nil, err + } + now := time.Now().Unix() + if session.Status != UserSessionStatusActive || session.RevokedAt != 0 || session.ExpiresAt <= now { + if common.RedisEnabled { + entry := session.cacheEntry() + entry.Status = UserSessionStatusRevoked + _ = writeUserSessionCache(entry, time.Time{}) + } + return nil, ErrUserSessionInactive + } + if common.RedisEnabled { + if err := writeUserSessionCache(session.cacheEntry(), cacheDeadline); err != nil { + if errors.Is(err, errUserSessionCacheObservationStale) { + if confirmErr := confirmUserSessionActiveSnapshot(session); confirmErr != nil { + return nil, confirmErr + } + return session, nil + } + if errors.Is(err, ErrUserSessionInactive) { + return nil, err + } + common.SysLog("failed to synchronously populate user session cache: " + err.Error()) + } + } + return session, nil +} + +func getUserSessionCache(sid string) (*userSessionCacheEntry, error) { + var entry userSessionCacheEntry + if err := common.RedisHGetObj(userSessionCacheKey(sid), &entry); err != nil { + return nil, err + } + if entry.CacheSchema != userSessionCacheSchema || entry.SID != sid || entry.UserID <= 0 || entry.Version <= 0 || entry.UserAuthVersion <= 0 { + return nil, fmt.Errorf("user session cache schema is stale") + } + if entry.Status != UserSessionStatusActive || entry.RevokedAt != 0 || entry.ExpiresAt <= time.Now().Unix() { + return nil, ErrUserSessionInactive + } + return &entry, nil +} + +// writeUserSessionCache writes a bounded Session snapshot. Active snapshots +// must carry a deadline captured immediately before their authoritative +// database read or mutation. Delayed fills inherit the unspent portion of that +// window, so a stale active snapshot cannot outlive a short deny tombstone and +// reactivate a revoked Session after the tombstone expires. Deny states pass a +// zero deadline because their TTL starts when they are published. +func writeUserSessionCache(entry *userSessionCacheEntry, cacheDeadline time.Time) error { + if entry == nil || !common.RedisEnabled { + return nil + } + now := time.Now() + sessionExpiresAt := time.Unix(entry.ExpiresAt, 0) + sessionTTL := sessionExpiresAt.Sub(now) + var redisExpiration int64 + if entry.Status == UserSessionStatusActive { + if cacheDeadline.IsZero() { + return ErrUserSessionInvalid + } + cacheTTL := cacheDeadline.Sub(now) + if cacheTTL <= 0 { + return errUserSessionCacheObservationStale + } + if sessionTTL <= 0 { + return ErrUserSessionInactive + } + cacheExpiresAt := cacheDeadline + if sessionExpiresAt.Before(cacheExpiresAt) { + cacheExpiresAt = sessionExpiresAt + } + if cacheExpiresAt.Sub(now) < time.Millisecond { + return errUserSessionCacheObservationStale + } + redisExpiration = cacheExpiresAt.UnixMilli() + } else { + ttl := min(sessionTTL, time.Duration(userCacheTTLSeconds())*time.Second) + if ttl <= 0 { + ttl = time.Second + } + redisExpiration = ttl.Milliseconds() + if redisExpiration <= 0 { + redisExpiration = 1 + } + } + entry.CacheSchema = userSessionCacheSchema + const script = ` +local current_status = redis.call('HGET', KEYS[1], 'Status') +local current_version = tonumber(redis.call('HGET', KEYS[1], 'Version') or '0') +if ARGV[5] == 'active' and (current_status == 'revoking' or current_status == 'revoked') then + return 0 +end +if current_version > tonumber(ARGV[3]) then + return 0 +end +redis.call('HSET', KEYS[1], + 'SID', ARGV[1], 'UserID', ARGV[2], 'Version', ARGV[3], + 'UserAuthVersion', ARGV[4], 'Status', ARGV[5], + 'LoginMethod', ARGV[6], 'IP', ARGV[7], 'UserAgent', ARGV[8], + 'CreatedAt', ARGV[9], 'LastActiveAt', ARGV[10], 'ExpiresAt', ARGV[11], + 'RevokedAt', ARGV[12], 'RevokedReason', ARGV[13], 'CacheSchema', ARGV[14]) +if ARGV[5] == 'active' then + redis.call('PEXPIREAT', KEYS[1], ARGV[15]) +else + redis.call('PEXPIRE', KEYS[1], ARGV[15]) +end +return 1` + result, err := common.RDB.Eval(context.Background(), script, []string{userSessionCacheKey(entry.SID)}, + entry.SID, entry.UserID, entry.Version, entry.UserAuthVersion, entry.Status, + entry.LoginMethod, entry.IP, entry.UserAgent, entry.CreatedAt, entry.LastActiveAt, + entry.ExpiresAt, entry.RevokedAt, entry.RevokedReason, entry.CacheSchema, redisExpiration, + ).Int() + if err != nil { + return err + } + if result == 0 { + return ErrUserSessionInactive + } + if entry.Status == UserSessionStatusActive { + completedAt := time.Now() + if !completedAt.Before(cacheDeadline) { + return errUserSessionCacheObservationStale + } + if !completedAt.Before(sessionExpiresAt) { + return ErrUserSessionInactive + } + } + return nil +} + +func confirmUserSessionActiveSnapshot(session *UserSession) error { + if session == nil || session.SID == "" || session.UserID <= 0 || session.Version <= 0 || session.UserAuthVersion <= 0 { + return ErrUserSessionInvalid + } + var count int64 + err := DB.Model(&UserSession{}). + Where( + "sid = ? AND user_id = ? AND status = ? AND revoked_at = ? AND expires_at > ? AND version = ? AND user_auth_version = ?", + session.SID, + session.UserID, + UserSessionStatusActive, + 0, + time.Now().Unix(), + session.Version, + session.UserAuthVersion, + ). + Count(&count).Error + if err != nil { + return err + } + if count != 1 { + return ErrUserSessionInactive + } + return nil +} + +func writeUserSessionDenyFence(session *UserSession, status string, now int64, reason string) error { + if !common.RedisEnabled { + return nil + } + entry := session.cacheEntry() + entry.Status = status + entry.RevokedAt = now + entry.RevokedReason = reason + return writeUserSessionCache(entry, time.Time{}) +} + +func ListActiveUserSessions(userID int, currentSID string, now int64) ([]UserSession, error) { + if userID <= 0 { + return nil, ErrUserSessionInvalid + } + if now <= 0 { + now = time.Now().Unix() + } + var authVersion int64 + if err := DB.Model(&User{}).Where("id = ?", userID).Select("auth_version").Find(&authVersion).Error; err != nil { + return nil, err + } + if authVersion <= 0 { + return nil, ErrUserSessionInvalid + } + sessions := make([]UserSession, 0, userSessionListLimit) + if currentSID != "" { + var current []UserSession + if err := DB.Where( + "user_id = ? AND user_auth_version = ? AND status = ? AND expires_at > ? AND sid = ?", + userID, + authVersion, + UserSessionStatusActive, + now, + currentSID, + ).Limit(1).Find(¤t).Error; err != nil { + return nil, err + } + if len(current) == 1 { + sessions = append(sessions, current[0]) + } + } + remainingLimit := userSessionListLimit - len(sessions) + + otherQuery := DB.Where( + "user_id = ? AND user_auth_version = ? AND status = ? AND expires_at > ?", + userID, + authVersion, + UserSessionStatusActive, + now, + ) + if currentSID != "" { + otherQuery = otherQuery.Where("sid <> ?", currentSID) + } + var others []UserSession + if err := otherQuery.Order("last_active_at DESC").Order("created_at DESC").Limit(remainingLimit).Find(&others).Error; err != nil { + return nil, err + } + sessions = append(sessions, others...) + return sessions, nil +} + +// RotateUserSessionRefresh atomically rotates HMAC digests. The UPDATE itself +// is a compare-and-swap so SQLite, where lockForUpdate is intentionally a +// no-op, has the same single-winner behavior as MySQL and PostgreSQL. Only a +// recognized previous digest outside its grace window is treated as reuse; +// an unknown secret never revokes the victim session. +func RotateUserSessionRefresh(userID int, sid, presentedHash, nextHash string, now int64, grace time.Duration) (*UserSession, error) { + if userID <= 0 || sid == "" || presentedHash == "" || nextHash == "" || hmac.Equal([]byte(presentedHash), []byte(nextHash)) { + return nil, ErrUserSessionInvalid + } + if now <= 0 { + now = time.Now().Unix() + } + graceSeconds := int64(grace / time.Second) + if graceSeconds < 0 { + return nil, ErrUserSessionInvalid + } + for range 3 { + cacheDeadline := userSessionCacheDeadline() + var session UserSession + if err := DB.Where("sid = ? AND user_id = ?", sid, userID).First(&session).Error; err != nil { + return nil, err + } + if session.Status != UserSessionStatusActive || session.RevokedAt != 0 || session.ExpiresAt <= now { + return nil, ErrUserSessionInactive + } + + if hmac.Equal([]byte(session.RefreshHash), []byte(presentedHash)) { + result := DB.Model(&UserSession{}). + Where("sid = ? AND user_id = ? AND status = ? AND revoked_at = ? AND expires_at > ? AND refresh_hash = ?", + sid, userID, UserSessionStatusActive, 0, now, presentedHash). + Updates(map[string]interface{}{ + "previous_refresh_hash": session.RefreshHash, + "previous_valid_until": now + graceSeconds, + "refresh_hash": nextHash, + "last_active_at": now, + }) + if result.Error != nil { + return nil, result.Error + } + if result.RowsAffected == 0 { + continue + } + session.PreviousRefreshHash = session.RefreshHash + session.PreviousValidUntil = now + graceSeconds + session.RefreshHash = nextHash + session.LastActiveAt = now + if err := writeUserSessionCache(session.cacheEntry(), cacheDeadline); err != nil { + if errors.Is(err, errUserSessionCacheObservationStale) { + if confirmErr := confirmUserSessionActiveSnapshot(&session); confirmErr != nil { + return nil, confirmErr + } + } else if errors.Is(err, ErrUserSessionInactive) { + return nil, err + } else { + common.SysLog("failed to update rotated user session cache: " + err.Error()) + } + } + return &session, nil + } + + if session.PreviousRefreshHash == "" || !hmac.Equal([]byte(session.PreviousRefreshHash), []byte(presentedHash)) { + return nil, ErrUserSessionRefreshInvalid + } + if now <= session.PreviousValidUntil { + return &session, ErrUserSessionRefreshRace + } + + // Once a known previous token is replayed outside the grace window the + // whole token family is compromised. Publish the deny fence first, then + // revoke the active row regardless of a concurrent refresh rotation. + if err := writeUserSessionDenyFence(&session, UserSessionStatusRevoking, now, "refresh_reuse"); err != nil { + return nil, err + } + result := DB.Model(&UserSession{}). + Where("sid = ? AND user_id = ? AND status = ? AND revoked_at = ? AND expires_at > ?", + sid, userID, UserSessionStatusActive, 0, now). + Updates(map[string]interface{}{ + "status": UserSessionStatusRevoked, + "revoked_at": now, + "revoked_reason": "refresh_reuse", + }) + if result.Error != nil { + return nil, result.Error + } + if result.RowsAffected == 0 { + return nil, ErrUserSessionInactive + } + session.Status = UserSessionStatusRevoked + session.RevokedAt = now + session.RevokedReason = "refresh_reuse" + if err := writeUserSessionCache(session.cacheEntry(), time.Time{}); err != nil { + common.SysLog("failed to cache refresh-reuse session revoke: " + err.Error()) + } + return nil, ErrUserSessionRefreshReuse + } + return nil, ErrUserSessionRefreshInvalid +} + +func RevokeUserSession(userID int, sid, reason string) (bool, error) { + if userID <= 0 || sid == "" { + return false, ErrUserSessionInvalid + } + now := time.Now().Unix() + var candidate UserSession + if err := DB.Where("sid = ? AND user_id = ?", sid, userID).First(&candidate).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return false, nil + } + return false, err + } + if candidate.Status != UserSessionStatusActive || candidate.RevokedAt != 0 || candidate.ExpiresAt <= now { + return false, nil + } + if err := writeUserSessionDenyFence(&candidate, UserSessionStatusRevoking, now, reason); err != nil { + return false, err + } + + var revoked bool + err := DB.Transaction(func(tx *gorm.DB) error { + var current UserSession + if err := lockForUpdate(tx).Where("sid = ? AND user_id = ?", sid, userID).First(¤t).Error; err != nil { + return err + } + if current.Status != UserSessionStatusActive || current.RevokedAt != 0 || current.ExpiresAt <= now { + return nil + } + result := tx.Model(&UserSession{}).Where("sid = ? AND status = ?", sid, UserSessionStatusActive).Updates(map[string]interface{}{ + "status": UserSessionStatusRevoked, + "revoked_at": now, + "revoked_reason": reason, + }) + if result.Error != nil { + return result.Error + } + revoked = result.RowsAffected == 1 + return nil + }) + if err != nil { + return false, err + } + if revoked { + candidate.Status = UserSessionStatusRevoked + candidate.RevokedAt = now + candidate.RevokedReason = reason + if err := writeUserSessionCache(candidate.cacheEntry(), time.Time{}); err != nil { + common.SysLog("failed to finalize user session revoke tombstone: " + err.Error()) + } + } + return revoked, nil +} + +// RevokeUserSessionByRefreshHash is used when logout is authenticated only by +// the HttpOnly refresh cookie. Possession of a SID alone is insufficient. The +// immediately previous digest is accepted only inside the refresh race window. +func RevokeUserSessionByRefreshHash(sid, presentedHash, reason string) (bool, error) { + if sid == "" || presentedHash == "" { + return false, ErrUserSessionInvalid + } + now := time.Now().Unix() + var session UserSession + var revoked bool + err := DB.Transaction(func(tx *gorm.DB) error { + if err := lockForUpdate(tx).Where("sid = ?", sid).First(&session).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return nil + } + return err + } + if session.Status != UserSessionStatusActive || session.RevokedAt != 0 || session.ExpiresAt <= now { + return nil + } + validCurrent := hmac.Equal([]byte(session.RefreshHash), []byte(presentedHash)) + validPrevious := session.PreviousRefreshHash != "" && now <= session.PreviousValidUntil && + hmac.Equal([]byte(session.PreviousRefreshHash), []byte(presentedHash)) + if !validCurrent && !validPrevious { + return nil + } + if err := writeUserSessionDenyFence(&session, UserSessionStatusRevoking, now, reason); err != nil { + return err + } + result := tx.Model(&UserSession{}).Where("sid = ? AND status = ?", sid, UserSessionStatusActive).Updates(map[string]interface{}{ + "status": UserSessionStatusRevoked, + "revoked_at": now, + "revoked_reason": reason, + }) + if result.Error != nil { + return result.Error + } + revoked = result.RowsAffected == 1 + if revoked { + session.Status = UserSessionStatusRevoked + session.RevokedAt = now + session.RevokedReason = reason + } + return nil + }) + if err != nil { + return false, err + } + if revoked { + if err := writeUserSessionCache(session.cacheEntry(), time.Time{}); err != nil { + common.SysLog("failed to finalize refresh-authenticated session revoke tombstone: " + err.Error()) + } + } + return revoked, nil +} + +// AdvanceUserSessionAuthVersion preserves one browser session across a +// user-level security-version change. Both old access JWTs and concurrent +// updates are invalidated by advancing the per-session version as well. +func AdvanceUserSessionAuthVersion(userID int, sid string, expectedSessionVersion, expectedUserAuthVersion, nextUserAuthVersion int64) (*UserSession, error) { + if userID <= 0 || sid == "" || expectedSessionVersion <= 0 || expectedUserAuthVersion <= 0 || nextUserAuthVersion <= expectedUserAuthVersion { + return nil, ErrUserSessionInvalid + } + cacheDeadline := userSessionCacheDeadline() + now := time.Now().Unix() + var session UserSession + err := DB.Transaction(func(tx *gorm.DB) error { + if err := lockForUpdate(tx).Where("sid = ? AND user_id = ?", sid, userID).First(&session).Error; err != nil { + return err + } + if session.Status != UserSessionStatusActive || session.ExpiresAt <= now || + session.Version != expectedSessionVersion || session.UserAuthVersion != expectedUserAuthVersion { + return ErrUserSessionInactive + } + session.Version++ + session.UserAuthVersion = nextUserAuthVersion + session.LastActiveAt = now + result := tx.Model(&UserSession{}). + Where("sid = ? AND status = ? AND version = ? AND user_auth_version = ?", sid, UserSessionStatusActive, expectedSessionVersion, expectedUserAuthVersion). + Updates(map[string]interface{}{ + "version": session.Version, + "user_auth_version": session.UserAuthVersion, + "last_active_at": session.LastActiveAt, + }) + if result.Error != nil { + return result.Error + } + if result.RowsAffected != 1 { + return ErrUserSessionInactive + } + return nil + }) + if err != nil { + return nil, err + } + if err := writeUserSessionCache(session.cacheEntry(), cacheDeadline); err != nil { + if errors.Is(err, errUserSessionCacheObservationStale) { + if confirmErr := confirmUserSessionActiveSnapshot(&session); confirmErr != nil { + return nil, confirmErr + } + } else { + return nil, err + } + } + return &session, nil +} + +func RevokeOtherUserSessions(userID int, currentSID, reason string) (int64, error) { + return revokeUserSessions(userID, currentSID, reason) +} + +func RevokeAllUserSessions(userID int, reason string) (int64, error) { + return revokeUserSessions(userID, "", reason) +} + +func revokeUserSessions(userID int, excludedSID, reason string) (int64, error) { + if userID <= 0 { + return 0, ErrUserSessionInvalid + } + now := time.Now().Unix() + var totalAffected int64 + for { + query := DB.Where("user_id = ? AND status = ? AND expires_at > ?", userID, UserSessionStatusActive, now) + if excludedSID != "" { + query = query.Where("sid <> ?", excludedSID) + } + var candidates []UserSession + if err := query.Order("sid").Limit(userSessionRevokeBatchSize).Find(&candidates).Error; err != nil { + return totalAffected, err + } + if len(candidates) == 0 { + return totalAffected, nil + } + for i := range candidates { + if err := writeUserSessionDenyFence(&candidates[i], UserSessionStatusRevoking, now, reason); err != nil { + return totalAffected, err + } + } + + sids := make([]string, 0, len(candidates)) + for i := range candidates { + sids = append(sids, candidates[i].SID) + } + var affected int64 + var revoked []UserSession + err := DB.Transaction(func(tx *gorm.DB) error { + if err := lockForUpdate(tx).Where("sid IN ? AND status = ?", sids, UserSessionStatusActive).Find(&revoked).Error; err != nil { + return err + } + if len(revoked) == 0 { + return nil + } + lockedSIDs := make([]string, 0, len(revoked)) + for i := range revoked { + lockedSIDs = append(lockedSIDs, revoked[i].SID) + } + result := tx.Model(&UserSession{}).Where("sid IN ? AND status = ?", lockedSIDs, UserSessionStatusActive).Updates(map[string]interface{}{ + "status": UserSessionStatusRevoked, + "revoked_at": now, + "revoked_reason": reason, + }) + affected = result.RowsAffected + return result.Error + }) + if err != nil { + return totalAffected, err + } + totalAffected += affected + for i := range revoked { + revoked[i].Status = UserSessionStatusRevoked + revoked[i].RevokedAt = now + revoked[i].RevokedReason = reason + if err := writeUserSessionCache(revoked[i].cacheEntry(), time.Time{}); err != nil { + common.SysLog("failed to finalize bulk user session revoke tombstone: " + err.Error()) + } + } + } +} + +func DeleteExpiredUserSessions(now int64) error { + if now <= 0 { + now = time.Now().Unix() + } + if common.UserSessionRevokedRetentionDays <= 0 || common.UserSessionIssuanceWindowSeconds <= 0 { + return ErrUserSessionInvalid + } + issuanceCutoff := now - common.UserSessionIssuanceWindowSeconds + revokedBefore := now - int64(common.UserSessionRevokedRetentionDays)*24*60*60 + return deleteExpiredUserSessionsBefore(now, issuanceCutoff, revokedBefore) +} + +func DeleteOldRevokedUserSessions(now int64) error { + if now <= 0 { + now = time.Now().Unix() + } + if common.UserSessionRevokedRetentionDays <= 0 || common.UserSessionIssuanceWindowSeconds <= 0 { + return ErrUserSessionInvalid + } + issuanceCutoff := now - common.UserSessionIssuanceWindowSeconds + revokedBefore := now - int64(common.UserSessionRevokedRetentionDays)*24*60*60 + return deleteRevokedUserSessionsBefore(revokedBefore, issuanceCutoff) +} + +func deleteExpiredUserSessionsBefore(expiredBefore, issuanceCutoff, revokedBefore int64) error { + for { + var sids []string + if err := DB.Model(&UserSession{}). + Where( + "expires_at < ? AND created_at <= ? AND (status <> ? OR revoked_at <= 0 OR revoked_at < ?)", + expiredBefore, + issuanceCutoff, + UserSessionStatusRevoked, + revokedBefore, + ). + Order("expires_at").Limit(userSessionCleanupScanLimit).Pluck("sid", &sids).Error; err != nil { + return err + } + if len(sids) == 0 { + return nil + } + for start := 0; start < len(sids); start += userSessionCleanupBatchSize { + end := start + userSessionCleanupBatchSize + if end > len(sids) { + end = len(sids) + } + if err := DB.Where("sid IN ?", sids[start:end]). + Where( + "expires_at < ? AND created_at <= ? AND (status <> ? OR revoked_at <= 0 OR revoked_at < ?)", + expiredBefore, + issuanceCutoff, + UserSessionStatusRevoked, + revokedBefore, + ). + Delete(&UserSession{}).Error; err != nil { + return err + } + } + } +} + +func deleteRevokedUserSessionsBefore(revokedBefore, issuanceCutoff int64) error { + for { + var sids []string + if err := DB.Model(&UserSession{}). + Where( + "status = ? AND revoked_at > 0 AND revoked_at < ? AND created_at <= ?", + UserSessionStatusRevoked, + revokedBefore, + issuanceCutoff, + ). + Order("revoked_at").Limit(userSessionCleanupScanLimit).Pluck("sid", &sids).Error; err != nil { + return err + } + if len(sids) == 0 { + return nil + } + for start := 0; start < len(sids); start += userSessionCleanupBatchSize { + end := start + userSessionCleanupBatchSize + if end > len(sids) { + end = len(sids) + } + if err := DB.Where("sid IN ?", sids[start:end]). + Where( + "status = ? AND revoked_at > 0 AND revoked_at < ? AND created_at <= ?", + UserSessionStatusRevoked, + revokedBefore, + issuanceCutoff, + ). + Delete(&UserSession{}).Error; err != nil { + return err + } + } + } +} diff --git a/model/user_session_migration_test.go b/model/user_session_migration_test.go new file mode 100644 index 0000000000..ab0545c1f3 --- /dev/null +++ b/model/user_session_migration_test.go @@ -0,0 +1,154 @@ +package model + +import ( + "context" + "fmt" + "os" + "strings" + "sync" + "testing" + "time" + + "github.com/glebarez/sqlite" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/driver/mysql" + "gorm.io/driver/postgres" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type previousRefreshHashMigrationLegacy struct { + SID string `gorm:"column:sid;type:varchar(64);primaryKey"` + PreviousRefreshHash string `gorm:"column:previous_refresh_hash;type:char(64)"` +} + +type previousRefreshHashMigrationTarget struct { + SID string `gorm:"column:sid;type:varchar(64);primaryKey"` + PreviousRefreshHash string `gorm:"column:previous_refresh_hash;type:varchar(64)"` +} + +type migrationSQLRecorder struct { + mu sync.Mutex + statements []string +} + +func (recorder *migrationSQLRecorder) LogMode(logger.LogLevel) logger.Interface { return recorder } +func (recorder *migrationSQLRecorder) Info(context.Context, string, ...any) {} +func (recorder *migrationSQLRecorder) Warn(context.Context, string, ...any) {} +func (recorder *migrationSQLRecorder) Error(context.Context, string, ...any) {} + +func (recorder *migrationSQLRecorder) Trace(_ context.Context, _ time.Time, sql func() (string, int64), _ error) { + statement, _ := sql() + recorder.mu.Lock() + recorder.statements = append(recorder.statements, statement) + recorder.mu.Unlock() +} + +func (recorder *migrationSQLRecorder) reset() { + recorder.mu.Lock() + recorder.statements = nil + recorder.mu.Unlock() +} + +func (recorder *migrationSQLRecorder) schemaMutations() []string { + recorder.mu.Lock() + defer recorder.mu.Unlock() + mutations := make([]string, 0) + for _, statement := range recorder.statements { + normalized := strings.ToUpper(strings.TrimSpace(statement)) + if strings.HasPrefix(normalized, "ALTER TABLE") || + strings.HasPrefix(normalized, "CREATE TABLE") || + strings.HasPrefix(normalized, "DROP TABLE") || + strings.HasPrefix(normalized, "RENAME TABLE") { + mutations = append(mutations, statement) + } + } + return mutations +} + +func TestUserSessionPreviousRefreshHashSchemaUsesNullableVarchar(t *testing.T) { + statement := &gorm.Statement{DB: DB} + require.NoError(t, statement.Parse(&UserSession{})) + field := statement.Schema.LookUpField("PreviousRefreshHash") + require.NotNil(t, field) + assert.Equal(t, "varchar(64)", field.TagSettings["TYPE"]) + assert.False(t, field.NotNull) +} + +func testPreviousRefreshHashMigration(t *testing.T, db *gorm.DB, recorder *migrationSQLRecorder, dialect string) { + t.Helper() + tableName := fmt.Sprintf("user_session_previous_hash_migration_%d", time.Now().UnixNano()) + t.Cleanup(func() { _ = db.Migrator().DropTable(tableName) }) + + require.NoError(t, db.Table(tableName).AutoMigrate(&previousRefreshHashMigrationLegacy{})) + digest := strings.Repeat("a", 60) + require.NoError(t, db.Table(tableName).Create(&previousRefreshHashMigrationLegacy{ + SID: "legacy-session", + PreviousRefreshHash: digest, + }).Error) + + require.NoError(t, db.Table(tableName).AutoMigrate(&previousRefreshHashMigrationTarget{})) + var session UserSession + require.NoError(t, db.Table(tableName). + Select("sid", "previous_refresh_hash"). + Where("sid = ?", "legacy-session"). + First(&session).Error) + assert.Equal(t, digest, session.PreviousRefreshHash, "legacy CHAR padding must be normalized on database reads") + + columnTypes, err := db.Table(tableName).Migrator().ColumnTypes(&previousRefreshHashMigrationTarget{}) + require.NoError(t, err) + var previousHashColumnFound bool + for _, columnType := range columnTypes { + if !strings.EqualFold(columnType.Name(), "previous_refresh_hash") { + continue + } + previousHashColumnFound = true + nullable, ok := columnType.Nullable() + require.True(t, ok) + if dialect != "sqlite" { + assert.True(t, nullable) + } + assert.Contains(t, strings.ToUpper(columnType.DatabaseTypeName()), "VARCHAR") + } + assert.True(t, previousHashColumnFound) + + recorder.reset() + require.NoError(t, db.Table(tableName).AutoMigrate(&previousRefreshHashMigrationTarget{})) + assert.Empty(t, recorder.schemaMutations(), "a second migration must not repeat type-changing DDL") +} + +func TestUserSessionPreviousRefreshHashMigrationSQLite(t *testing.T) { + recorder := &migrationSQLRecorder{} + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{Logger: recorder}) + require.NoError(t, err) + testPreviousRefreshHashMigration(t, db, recorder, "sqlite") +} + +func TestUserSessionPreviousRefreshHashMigrationConfiguredDatabases(t *testing.T) { + tests := []struct { + name string + env string + dialector func(string) gorm.Dialector + }{ + {name: "mysql", env: "TEST_MYSQL_DSN", dialector: func(dsn string) gorm.Dialector { return mysql.Open(dsn) }}, + {name: "postgres", env: "TEST_POSTGRES_DSN", dialector: func(dsn string) gorm.Dialector { + return postgres.New(postgres.Config{DSN: dsn, PreferSimpleProtocol: true}) + }}, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + dsn := strings.TrimSpace(os.Getenv(test.env)) + if dsn == "" { + t.Skip(test.env + " is not configured") + } + recorder := &migrationSQLRecorder{} + db, err := gorm.Open(test.dialector(dsn), &gorm.Config{Logger: recorder}) + require.NoError(t, err) + sqlDB, err := db.DB() + require.NoError(t, err) + t.Cleanup(func() { _ = sqlDB.Close() }) + testPreviousRefreshHashMigration(t, db, recorder, test.name) + }) + } +} diff --git a/model/user_session_test.go b/model/user_session_test.go new file mode 100644 index 0000000000..e9e4e1b21d --- /dev/null +++ b/model/user_session_test.go @@ -0,0 +1,655 @@ +package model + +import ( + "context" + "errors" + "fmt" + "strings" + "testing" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/alicebob/miniredis/v2" + "github.com/go-redis/redis/v8" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +type setMiniRedisTimeOnEvalHook struct { + server *miniredis.Miniredis + at time.Time +} + +func (hook setMiniRedisTimeOnEvalHook) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error) { + if cmd.Name() == "eval" { + hook.server.SetTime(hook.at) + } + return ctx, nil +} + +func (setMiniRedisTimeOnEvalHook) AfterProcess(context.Context, redis.Cmder) error { + return nil +} + +func (setMiniRedisTimeOnEvalHook) BeforeProcessPipeline(ctx context.Context, _ []redis.Cmder) (context.Context, error) { + return ctx, nil +} + +func (setMiniRedisTimeOnEvalHook) AfterProcessPipeline(context.Context, []redis.Cmder) error { + return nil +} + +func setupUserSessionTest(t *testing.T) { + t.Helper() + require.NoError(t, DB.AutoMigrate(&User{}, &UserSession{})) + require.NoError(t, DB.Exec("DELETE FROM user_sessions").Error) + oldRedisEnabled := common.RedisEnabled + oldActiveLimit := common.UserSessionActiveLimit + oldIssuanceLimit := common.UserSessionIssuanceLimit + oldIssuanceWindow := common.UserSessionIssuanceWindowSeconds + oldRevokedRetention := common.UserSessionRevokedRetentionDays + common.RedisEnabled = false + common.UserSessionActiveLimit = common.DefaultUserSessionActiveLimit + common.UserSessionIssuanceLimit = common.DefaultUserSessionIssuanceLimit + common.UserSessionIssuanceWindowSeconds = int64(common.DefaultUserSessionIssuanceWindowSeconds) + common.UserSessionRevokedRetentionDays = common.DefaultUserSessionRevokedRetentionDays + t.Cleanup(func() { + common.RedisEnabled = oldRedisEnabled + common.UserSessionActiveLimit = oldActiveLimit + common.UserSessionIssuanceLimit = oldIssuanceLimit + common.UserSessionIssuanceWindowSeconds = oldIssuanceWindow + common.UserSessionRevokedRetentionDays = oldRevokedRetention + }) +} + +func createUserSessionTestUser(t *testing.T, userID int, authVersion int64) { + t.Helper() + user := User{ + Id: userID, + Username: fmt.Sprintf("user-session-%d", userID), + Password: "unused", + Status: common.UserStatusEnabled, + Role: common.RoleCommonUser, + Group: "default", + AffCode: fmt.Sprintf("session-aff-%d", userID), + AuthVersion: authVersion, + } + require.NoError(t, DB.Create(&user).Error) + t.Cleanup(func() { _ = DB.Unscoped().Delete(&User{}, userID).Error }) +} + +func newTestUserSession(sid string, userID int, now int64) *UserSession { + return &UserSession{ + SID: sid, + UserID: userID, + Version: 1, + UserAuthVersion: 1, + Status: UserSessionStatusActive, + RefreshHash: fmt.Sprintf("current-%s", sid), + LoginMethod: "password", + IP: "127.0.0.1", + UserAgent: "model-test", + CreatedAt: now, + LastActiveAt: now, + ExpiresAt: now + int64((30*24*time.Hour)/time.Second), + } +} + +func TestUserSessionCacheTTLUsesShortCacheWindow(t *testing.T) { + setupUserSessionTest(t) + server := useUserCacheMiniRedis(t) + now := time.Now().Unix() + tests := []struct { + name string + status string + expiresAt int64 + wantMaxTTL time.Duration + }{ + {name: "active", status: UserSessionStatusActive, expiresAt: now + 300, wantMaxTTL: 2 * time.Second}, + {name: "revoking", status: UserSessionStatusRevoking, expiresAt: now + 300, wantMaxTTL: 2 * time.Second}, + {name: "revoked", status: UserSessionStatusRevoked, expiresAt: now + 300, wantMaxTTL: 2 * time.Second}, + {name: "already expired", status: UserSessionStatusRevoked, expiresAt: now - 1, wantMaxTTL: time.Second}, + } + + for index, test := range tests { + sid := fmt.Sprintf("short-cache-ttl-%d", index) + entry := newTestUserSession(sid, 1100+index, now).cacheEntry() + entry.Status = test.status + entry.ExpiresAt = test.expiresAt + if test.status != UserSessionStatusActive { + entry.RevokedAt = now + } + + cacheDeadline := time.Time{} + if test.status == UserSessionStatusActive { + cacheDeadline = userSessionCacheDeadline() + } + require.NoError(t, writeUserSessionCache(entry, cacheDeadline), test.name) + ttl := server.TTL(userSessionCacheKey(sid)) + assert.Positive(t, ttl, test.name) + assert.LessOrEqual(t, ttl, test.wantMaxTTL, test.name) + } + + initialTTL := server.TTL(userSessionCacheKey("short-cache-ttl-0")) + server.FastForward(time.Second) + _, err := getUserSessionCache("short-cache-ttl-0") + require.NoError(t, err) + remainingTTL := server.TTL(userSessionCacheKey("short-cache-ttl-0")) + assert.Positive(t, remainingTTL) + assert.LessOrEqual(t, remainingTTL, initialTTL-time.Second, "cache reads must not renew the bounded TTL") + + common.SyncFrequency = 10 + nearExpiry := newTestUserSession("short-cache-ttl-near-expiry", 1199, now).cacheEntry() + nearExpiry.ExpiresAt = time.Now().Add(2 * time.Second).Unix() + nearExpiryDeadline := userSessionCacheDeadline() + remainingLifetime := time.Until(time.Unix(nearExpiry.ExpiresAt, 0)) + require.NoError(t, writeUserSessionCache(nearExpiry, nearExpiryDeadline)) + nearExpiryTTL := server.TTL(userSessionCacheKey(nearExpiry.SID)) + assert.Positive(t, nearExpiryTTL) + assert.LessOrEqual(t, nearExpiryTTL, remainingLifetime, "cache TTL must not exceed the Session remaining lifetime") + + common.SyncFrequency = 0 + fallback := newTestUserSession("short-cache-ttl-fallback", 1200, now).cacheEntry() + fallback.ExpiresAt = now + 300 + require.NoError(t, writeUserSessionCache(fallback, userSessionCacheDeadline())) + fallbackTTL := server.TTL(userSessionCacheKey(fallback.SID)) + assert.Greater(t, fallbackTTL, 59*time.Second) + assert.LessOrEqual(t, fallbackTTL, 60*time.Second, "non-positive cache frequency must use the existing 60-second fallback") +} + +func TestStaleActiveSessionCacheFillCannotRestartWindowAfterDenyExpires(t *testing.T) { + setupUserSessionTest(t) + server := useUserCacheMiniRedis(t) + now := time.Now().Unix() + active := newTestUserSession("stale-active-cache-fill", 1201, now).cacheEntry() + denied := *active + denied.Status = UserSessionStatusRevoked + denied.RevokedAt = now + denied.RevokedReason = "test-revoke" + + require.NoError(t, writeUserSessionCache(&denied, time.Time{})) + cacheKey := userSessionCacheKey(active.SID) + assert.True(t, server.Exists(cacheKey)) + server.FastForward(3 * time.Second) + assert.False(t, server.Exists(cacheKey), "the short deny tombstone must have expired in this race setup") + + err := writeUserSessionCache(active, time.Now().Add(-time.Millisecond)) + assert.ErrorIs(t, err, errUserSessionCacheObservationStale) + assert.False(t, server.Exists(cacheKey), "a delayed pre-revoke active snapshot must not restart a fresh cache window") +} + +func TestActiveSessionCacheFillUsesRemainingObservationWindow(t *testing.T) { + setupUserSessionTest(t) + server := useUserCacheMiniRedis(t) + now := time.Now().Unix() + entry := newTestUserSession("bounded-active-cache-fill", 1202, now).cacheEntry() + deadline := time.Now().Add(1500 * time.Millisecond) + + require.NoError(t, writeUserSessionCache(entry, deadline)) + ttl := server.TTL(userSessionCacheKey(entry.SID)) + assert.Positive(t, ttl) + assert.LessOrEqual(t, ttl, 1500*time.Millisecond, "a delayed fill must inherit only the unused observation window") +} + +func TestSessionCacheLuaUsesAbsoluteActiveAndRelativeDenyExpiry(t *testing.T) { + setupUserSessionTest(t) + server := useUserCacheMiniRedis(t) + now := time.Now().Unix() + deadline := time.Now().Add(10 * time.Second) + common.RDB.AddHook(setMiniRedisTimeOnEvalHook{server: server, at: deadline.Add(time.Second)}) + + active := newTestUserSession("delayed-active-cache-eval", 1203, now).cacheEntry() + require.NoError(t, writeUserSessionCache(active, deadline)) + assert.False(t, server.Exists(userSessionCacheKey(active.SID)), "an active fill executed after its absolute deadline must not recreate the cache") + + denied := newTestUserSession("delayed-deny-cache-eval", 1204, now).cacheEntry() + denied.Status = UserSessionStatusRevoked + denied.RevokedAt = now + denied.RevokedReason = "test-revoke" + require.NoError(t, writeUserSessionCache(denied, time.Time{})) + denyTTL := server.TTL(userSessionCacheKey(denied.SID)) + assert.Positive(t, denyTTL) + assert.LessOrEqual(t, denyTTL, 2*time.Second, "a delayed deny publication must receive a full relative short TTL at Redis execution") +} + +func TestUserSessionCreateListAndRevokeOne(t *testing.T) { + setupUserSessionTest(t) + now := time.Now().Unix() + user := User{Id: 1001, Username: "session-list-user", Password: "password", AuthVersion: 1} + require.NoError(t, DB.Create(&user).Error) + t.Cleanup(func() { _ = DB.Unscoped().Delete(&User{}, user.Id).Error }) + first := newTestUserSession("session-one", 1001, now) + second := newTestUserSession("session-two", 1001, now+1) + require.NoError(t, CreateUserSession(first)) + require.NoError(t, CreateUserSession(second)) + + sessions, err := ListActiveUserSessions(1001, first.SID, now) + require.NoError(t, err) + require.Len(t, sessions, 2) + assert.Equal(t, first.SID, sessions[0].SID) + + revoked, err := RevokeUserSession(1001, first.SID, "user_revoked") + require.NoError(t, err) + assert.True(t, revoked) + revoked, err = RevokeUserSession(1001, first.SID, "duplicate") + require.NoError(t, err) + assert.False(t, revoked) + + _, err = GetUserSessionCached(first.SID) + assert.ErrorIs(t, err, ErrUserSessionInactive) + active, err := GetUserSessionCached(second.SID) + require.NoError(t, err) + assert.Equal(t, second.SID, active.SID) +} + +func TestRotateUserSessionRefreshRaceAndReuse(t *testing.T) { + setupUserSessionTest(t) + now := time.Now().Unix() + createUserSessionTestUser(t, 1002, 1) + session := newTestUserSession("rotate-session", 1002, now) + require.NoError(t, CreateUserSession(session)) + + rotated, err := RotateUserSessionRefresh(1002, session.SID, session.RefreshHash, "next-hash", now+10, 30*time.Second) + require.NoError(t, err) + assert.Equal(t, "next-hash", rotated.RefreshHash) + assert.Equal(t, session.RefreshHash, rotated.PreviousRefreshHash) + assert.Equal(t, now+40, rotated.PreviousValidUntil) + + _, err = RotateUserSessionRefresh(1002, session.SID, session.RefreshHash, "unused-hash", now+20, 30*time.Second) + assert.ErrorIs(t, err, ErrUserSessionRefreshRace) + _, err = RotateUserSessionRefresh(1002, session.SID, "unknown-hash", "unused-hash", now+20, 30*time.Second) + assert.ErrorIs(t, err, ErrUserSessionRefreshInvalid) + stored, getErr := GetUserSessionBySID(session.SID) + require.NoError(t, getErr) + assert.Equal(t, UserSessionStatusActive, stored.Status) + + _, err = RotateUserSessionRefresh(1002, session.SID, session.RefreshHash, "unused-hash", now+41, 30*time.Second) + assert.ErrorIs(t, err, ErrUserSessionRefreshReuse) + stored, getErr = GetUserSessionBySID(session.SID) + require.NoError(t, getErr) + assert.Equal(t, UserSessionStatusRevoked, stored.Status) + assert.Equal(t, "refresh_reuse", stored.RevokedReason) +} + +func TestUserSessionPreviousRefreshHashNormalizesLegacyPadding(t *testing.T) { + setupUserSessionTest(t) + now := time.Now().Unix() + createUserSessionTestUser(t, 1010, 1) + digest := strings.Repeat("a", 64) + + blank := newTestUserSession("legacy-blank-previous-hash", 1010, now) + blank.PreviousRefreshHash = strings.Repeat(" ", 64) + blank.PreviousValidUntil = now + 60 + require.NoError(t, DB.Create(blank).Error) + loadedBlank, err := GetUserSessionBySID(blank.SID) + require.NoError(t, err) + assert.Empty(t, loadedBlank.PreviousRefreshHash) + + valid := newTestUserSession("legacy-valid-previous-hash", 1010, now) + valid.RefreshHash = strings.Repeat("b", 64) + valid.PreviousRefreshHash = digest + valid.PreviousValidUntil = now + 60 + require.NoError(t, DB.Create(valid).Error) + loadedValid, err := GetUserSessionBySID(valid.SID) + require.NoError(t, err) + assert.Equal(t, digest, loadedValid.PreviousRefreshHash) + + require.NoError(t, DB.Model(&UserSession{}).Where("sid = ?", valid.SID). + Updates(map[string]any{ + "previous_refresh_hash": digest + " ", + "previous_valid_until": now + 60, + }).Error) + _, err = RotateUserSessionRefresh(valid.UserID, valid.SID, digest, strings.Repeat("c", 64), now+1, 30*time.Second) + assert.ErrorIs(t, err, ErrUserSessionRefreshRace) + + revoked, err := RevokeUserSessionByRefreshHash(valid.SID, digest, "legacy-padded-refresh-logout") + require.NoError(t, err) + assert.True(t, revoked, "refresh-cookie logout must accept a legacy CHAR-padded previous digest inside its grace window") +} + +func TestUserSessionCacheExcludesRefreshDigests(t *testing.T) { + setupUserSessionTest(t) + useUserCacheMiniRedis(t) + now := time.Now().Unix() + session := newTestUserSession("cache-without-refresh-digests", 1011, now) + session.PreviousRefreshHash = strings.Repeat("a", 64) + session.PreviousValidUntil = now + 30 + require.NoError(t, writeUserSessionCache(session.cacheEntry(), userSessionCacheDeadline())) + + cacheKey := userSessionCacheKey(session.SID) + fields, err := common.RDB.HGetAll(context.Background(), cacheKey).Result() + require.NoError(t, err) + assert.NotContains(t, fields, "RefreshHash") + assert.NotContains(t, fields, "PreviousRefreshHash") + assert.NotContains(t, fields, "PreviousValidUntil") + + require.NoError(t, common.RDB.HSet(context.Background(), cacheKey, + "RefreshHash", strings.Repeat("b", 64), + "PreviousRefreshHash", strings.Repeat("c", 64)+" ", + "PreviousValidUntil", now+30, + ).Err()) + entry, err := getUserSessionCache(session.SID) + require.NoError(t, err) + cachedSession := entry.session() + assert.Empty(t, cachedSession.RefreshHash) + assert.Empty(t, cachedSession.PreviousRefreshHash) + assert.Zero(t, cachedSession.PreviousValidUntil) +} + +func TestRevokeOtherUserSessionsKeepsCurrent(t *testing.T) { + setupUserSessionTest(t) + now := time.Now().Unix() + createUserSessionTestUser(t, 1003, 1) + createUserSessionTestUser(t, 1004, 1) + for _, sid := range []string{"current-session", "other-one", "other-two"} { + session := newTestUserSession(sid, 1003, now) + if sid == "other-one" { + session.UserAuthVersion = 99 + } + require.NoError(t, CreateUserSession(session)) + } + require.NoError(t, CreateUserSession(newTestUserSession("different-user", 1004, now))) + + count, err := RevokeOtherUserSessions(1003, "current-session", "revoke_others") + require.NoError(t, err) + assert.Equal(t, int64(2), count) + + current, err := GetUserSessionCached("current-session") + require.NoError(t, err) + assert.Equal(t, UserSessionStatusActive, current.Status) + _, err = GetUserSessionCached("other-one") + assert.True(t, errors.Is(err, ErrUserSessionInactive)) + stale, err := GetUserSessionBySID("other-one") + require.NoError(t, err) + assert.Equal(t, UserSessionStatusRevoked, stale.Status, "revocation must include active sessions from stale auth versions") + different, err := GetUserSessionCached("different-user") + require.NoError(t, err) + assert.Equal(t, 1004, different.UserID) +} + +func TestRevokeUserSessionByRefreshHashRequiresSecret(t *testing.T) { + setupUserSessionTest(t) + now := time.Now().Unix() + createUserSessionTestUser(t, 1005, 1) + session := newTestUserSession("refresh-logout-session", 1005, now) + require.NoError(t, CreateUserSession(session)) + + revoked, err := RevokeUserSessionByRefreshHash(session.SID, "wrong-hash", "logout") + require.NoError(t, err) + assert.False(t, revoked) + active, err := GetUserSessionCached(session.SID) + require.NoError(t, err) + assert.Equal(t, UserSessionStatusActive, active.Status) + + revoked, err = RevokeUserSessionByRefreshHash(session.SID, session.RefreshHash, "logout") + require.NoError(t, err) + assert.True(t, revoked) + _, err = GetUserSessionCached(session.SID) + assert.ErrorIs(t, err, ErrUserSessionInactive) +} + +func TestUserSessionGrowthCountsUseBroadActiveAndStrictIssuancePredicates(t *testing.T) { + setupUserSessionTest(t) + now := time.Now().Unix() + createUserSessionTestUser(t, 1006, 7) + rows := []UserSession{ + *newTestUserSession("count-current-version", 1006, now-10), + *newTestUserSession("count-stale-version", 1006, now-9), + *newTestUserSession("count-expired", 1006, now-8), + *newTestUserSession("count-revoked", 1006, now-7), + *newTestUserSession("count-cutoff", 1006, now-3600), + } + rows[0].UserAuthVersion = 7 + rows[1].UserAuthVersion = 2 + rows[2].UserAuthVersion = 7 + rows[2].ExpiresAt = now + rows[3].UserAuthVersion = 7 + rows[3].Status = UserSessionStatusRevoked + rows[3].RevokedAt = now - 1 + rows[4].UserAuthVersion = 7 + rows[4].CreatedAt = now - 3600 + rows[4].ExpiresAt = now + require.NoError(t, DB.Create(&rows).Error) + + activeCount, err := CountActiveUserSessions(1006, now) + require.NoError(t, err) + assert.Equal(t, int64(2), activeCount, "active count includes stale auth versions but excludes expired and revoked rows") + + issuedCount, err := CountUserSessionsCreatedSince(1006, now-3600) + require.NoError(t, err) + assert.Equal(t, int64(4), issuedCount, "issuance count includes every status and uses a strict cutoff") + globalCount, err := CountUserSessionsCreatedSince(0, now-3600) + require.NoError(t, err) + assert.Equal(t, issuedCount, globalCount) +} + +func TestListActiveUserSessionsKeepsCurrentAndBoundsOtherSessions(t *testing.T) { + setupUserSessionTest(t) + now := time.Now().Unix() + createUserSessionTestUser(t, 1007, 7) + current := newTestUserSession("list-current", 1007, now-1000) + current.UserAuthVersion = 7 + rows := make([]UserSession, 0, 107) + rows = append(rows, *current) + for i := 0; i < 105; i++ { + session := newTestUserSession(fmt.Sprintf("list-other-%03d", i), 1007, now-int64(i)) + session.UserAuthVersion = 7 + rows = append(rows, *session) + } + stale := newTestUserSession("list-stale-auth-version", 1007, now+1) + stale.UserAuthVersion = 6 + rows = append(rows, *stale) + require.NoError(t, DB.CreateInBatches(rows, 100).Error) + + sessions, err := ListActiveUserSessions(1007, current.SID, now) + require.NoError(t, err) + require.Len(t, sessions, 100) + assert.Equal(t, current.SID, sessions[0].SID) + for _, session := range sessions { + assert.Equal(t, int64(7), session.UserAuthVersion) + assert.NotEqual(t, stale.SID, session.SID) + } + + sessionsWithoutCurrent, err := ListActiveUserSessions(1007, "missing-current", now) + require.NoError(t, err) + assert.Len(t, sessionsWithoutCurrent, userSessionListLimit, "a missing current SID must not reduce the total list limit") +} + +func TestRevokeUserSessionsReturnsCumulativeProgressAndSupportsRetry(t *testing.T) { + setupUserSessionTest(t) + now := time.Now().Unix() + createUserSessionTestUser(t, 1008, 1) + rows := make([]UserSession, 0, userSessionRevokeBatchSize+1) + for i := 0; i < userSessionRevokeBatchSize+1; i++ { + rows = append(rows, *newTestUserSession(fmt.Sprintf("batch-revoke-%03d", i), 1008, now)) + } + require.NoError(t, DB.CreateInBatches(rows, 100).Error) + + forcedErr := errors.New("forced second revoke batch failure") + callbackName := "test:fail_second_user_session_revoke_batch" + updateCalls := 0 + callbackRegistered := true + require.NoError(t, DB.Callback().Update().Before("gorm:update").Register(callbackName, func(tx *gorm.DB) { + if tx.Statement != nil && tx.Statement.Table == "user_sessions" { + updateCalls++ + if updateCalls == 2 { + tx.AddError(forcedErr) + } + } + })) + t.Cleanup(func() { + if callbackRegistered { + _ = DB.Callback().Update().Remove(callbackName) + } + }) + + affected, err := RevokeAllUserSessions(1008, "batch-test") + assert.ErrorIs(t, err, forcedErr) + assert.Equal(t, int64(userSessionRevokeBatchSize), affected) + require.NoError(t, DB.Callback().Update().Remove(callbackName)) + callbackRegistered = false + + retried, err := RevokeAllUserSessions(1008, "batch-test-retry") + require.NoError(t, err) + assert.Equal(t, int64(1), retried) + var activeCount int64 + require.NoError(t, DB.Model(&UserSession{}).Where("user_id = ? AND status = ?", 1008, UserSessionStatusActive).Count(&activeCount).Error) + assert.Zero(t, activeCount) +} + +func TestDeleteExpiredUserSessionsLoopsInChunksAndRechecksPredicate(t *testing.T) { + setupUserSessionTest(t) + now := time.Now().Unix() + common.UserSessionRevokedRetentionDays = 7 + common.UserSessionIssuanceWindowSeconds = 3600 + oldCreatedAt := now - 7200 + rows := make([]UserSession, 0, userSessionCleanupScanLimit+5) + race := newTestUserSession("cleanup-race", 1009, now-1000) + race.CreatedAt = oldCreatedAt + race.ExpiresAt = now - 1000 + rows = append(rows, *race) + for i := 0; i < userSessionCleanupScanLimit+1; i++ { + session := newTestUserSession(fmt.Sprintf("cleanup-expired-%04d", i), 1009, now-100) + session.CreatedAt = oldCreatedAt - int64(i) + session.ExpiresAt = now - 100 + rows = append(rows, *session) + } + oldRevoked := newTestUserSession("cleanup-old-revoked", 1009, now-10) + oldRevoked.CreatedAt = oldCreatedAt + oldRevoked.Status = UserSessionStatusRevoked + oldRevoked.RevokedAt = now - int64(8*24*time.Hour/time.Second) + rows = append(rows, *oldRevoked) + recentRevoked := newTestUserSession("cleanup-recent-revoked", 1009, now-9) + recentRevoked.CreatedAt = oldCreatedAt + recentRevoked.Status = UserSessionStatusRevoked + recentRevoked.RevokedAt = now - int64(6*24*time.Hour/time.Second) + recentRevoked.ExpiresAt = now - 100 + rows = append(rows, *recentRevoked) + recentIssuedExpired := newTestUserSession("cleanup-recent-issued-expired", 1009, now-1800) + recentIssuedExpired.ExpiresAt = now - 100 + rows = append(rows, *recentIssuedExpired) + expiryBoundary := newTestUserSession("cleanup-expiry-boundary", 1009, now-7) + expiryBoundary.CreatedAt = oldCreatedAt + expiryBoundary.ExpiresAt = now + rows = append(rows, *expiryBoundary) + revokedBoundary := newTestUserSession("cleanup-revoked-boundary", 1009, now-6) + revokedBoundary.CreatedAt = oldCreatedAt + revokedBoundary.Status = UserSessionStatusRevoked + revokedBoundary.RevokedAt = now - int64(7*24*time.Hour/time.Second) + rows = append(rows, *revokedBoundary) + live := newTestUserSession("cleanup-live", 1009, now-8) + rows = append(rows, *live) + require.NoError(t, DB.CreateInBatches(rows, 100).Error) + + callbackName := "test:recheck_user_session_cleanup_predicate" + deleteCalls := 0 + mutated := false + require.NoError(t, DB.Callback().Delete().Before("gorm:delete").Register(callbackName, func(tx *gorm.DB) { + if tx.Statement == nil || tx.Statement.Table != "user_sessions" { + return + } + deleteCalls++ + if !mutated { + mutated = true + tx.Exec("UPDATE user_sessions SET expires_at = ? WHERE sid = ?", now+3600, race.SID) + } + })) + t.Cleanup(func() { _ = DB.Callback().Delete().Remove(callbackName) }) + + require.NoError(t, DeleteExpiredUserSessions(now)) + require.NoError(t, DeleteOldRevokedUserSessions(now)) + assert.Equal(t, 4, deleteCalls, "expired and retained-revoked scans each delete in bounded chunks") + var remaining []UserSession + require.NoError(t, DB.Order("sid").Find(&remaining).Error) + require.Len(t, remaining, 6) + remainingSIDs := make([]string, 0, len(remaining)) + for _, session := range remaining { + remainingSIDs = append(remainingSIDs, session.SID) + } + assert.ElementsMatch(t, []string{ + race.SID, + recentRevoked.SID, + recentIssuedExpired.SID, + expiryBoundary.SID, + revokedBoundary.SID, + live.SID, + }, remainingSIDs) +} + +func TestUserSessionGrowthQueryIndexesExist(t *testing.T) { + setupUserSessionTest(t) + migrator := DB.Migrator() + assert.True(t, migrator.HasIndex(&UserSession{}, "idx_user_sessions_expires_at")) + assert.True(t, migrator.HasIndex(&UserSession{}, "idx_user_sessions_user_created")) + assert.True(t, migrator.HasIndex(&UserSession{}, "idx_user_sessions_status_revoked")) +} + +func TestUserBaseIncludesAuthorizationFields(t *testing.T) { + user := User{ + Id: 42, + Username: "cache-user", + Role: common.RoleAdminUser, + Status: common.UserStatusEnabled, + Group: "vip", + Quota: 123, + AuthVersion: 7, + } + base := user.ToBaseUser() + assert.Equal(t, user.Role, base.Role) + assert.Equal(t, user.AuthVersion, base.AuthVersion) + assert.Equal(t, userCacheSchemaVersion, base.CacheSchema) + assert.Equal(t, user.Quota, base.Quota) +} + +func TestUserUpdateBumpsAuthVersionOnlyForAuthorizationChanges(t *testing.T) { + setupUserSessionTest(t) + user := &User{ + Username: "auth-version-user", + Password: "hashed-placeholder", + Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, + Group: "default", + } + require.NoError(t, DB.Create(user).Error) + t.Cleanup(func() { _ = DB.Unscoped().Delete(&User{}, user.Id).Error }) + assert.Equal(t, int64(1), user.AuthVersion) + + user.DisplayName = "profile-only" + require.NoError(t, user.Update(false)) + assert.Equal(t, int64(1), user.AuthVersion) + + user.Group = "vip" + require.NoError(t, user.Update(false)) + assert.Equal(t, int64(2), user.AuthVersion) + + user.Role = common.RoleAdminUser + require.NoError(t, user.Update(false)) + assert.Equal(t, int64(3), user.AuthVersion) +} + +func TestPasswordResetBumpsAuthVersionAndRevokesSessions(t *testing.T) { + setupUserSessionTest(t) + now := time.Now().Unix() + user := &User{ + Username: "password-reset-user", + Password: "old-hash", + Email: "password-reset@example.com", + Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, + Group: "default", + } + require.NoError(t, DB.Create(user).Error) + t.Cleanup(func() { _ = DB.Unscoped().Delete(&User{}, user.Id).Error }) + session := newTestUserSession("password-reset-session", user.Id, now) + require.NoError(t, CreateUserSession(session)) + + require.NoError(t, ResetUserPasswordByEmail(user.Email, "new-password")) + var stored User + require.NoError(t, DB.First(&stored, user.Id).Error) + assert.Equal(t, int64(2), stored.AuthVersion) + storedSession, err := GetUserSessionBySID(session.SID) + require.NoError(t, err) + assert.Equal(t, UserSessionStatusRevoked, storedSession.Status) + assert.Equal(t, "password_reset", storedSession.RevokedReason) +} diff --git a/router/api-router.go b/router/api-router.go index 83f9259b21..80fd65178c 100644 --- a/router/api-router.go +++ b/router/api-router.go @@ -43,15 +43,16 @@ func SetApiRouter(router *gin.Engine) { apiRouter.GET("/reset_password", middleware.CriticalRateLimit(), middleware.TurnstileCheck(), controller.SendPasswordResetEmail) apiRouter.POST("/user/reset", middleware.CriticalRateLimit(), anonymousRequestBodyLimit, controller.ResetPassword) // OAuth routes - specific routes must come before :provider wildcard - apiRouter.GET("/oauth/state", middleware.CriticalRateLimit(), controller.GenerateOAuthCode) - apiRouter.POST("/oauth/email/bind", middleware.CriticalRateLimit(), anonymousRequestBodyLimit, controller.EmailBind) + apiRouter.POST("/oauth/state", middleware.CriticalRateLimit(), middleware.DisableCache(), middleware.TryUserAuth(), anonymousRequestBodyLimit, controller.GenerateOAuthCode) + apiRouter.POST("/oauth/email/bind", middleware.UserAuth(), middleware.CriticalRateLimit(), controller.EmailBind) // Non-standard OAuth (WeChat, Telegram) - keep original routes - apiRouter.GET("/oauth/wechat", middleware.CriticalRateLimit(), controller.WeChatAuth) - apiRouter.POST("/oauth/wechat/bind", middleware.CriticalRateLimit(), anonymousRequestBodyLimit, controller.WeChatBind) - apiRouter.GET("/oauth/telegram/login", middleware.CriticalRateLimit(), controller.TelegramLogin) - apiRouter.GET("/oauth/telegram/bind", middleware.CriticalRateLimit(), controller.TelegramBind) + apiRouter.GET("/oauth/wechat", middleware.CriticalRateLimit(), middleware.DisableCache(), controller.WeChatAuth) + apiRouter.POST("/oauth/wechat/bind", middleware.UserAuth(), middleware.CriticalRateLimit(), controller.WeChatBind) + apiRouter.GET("/oauth/telegram/login", middleware.CriticalRateLimit(), middleware.DisableCache(), controller.TelegramLogin) + apiRouter.POST("/oauth/telegram/bind/start", middleware.UserAuth(), middleware.CriticalRateLimit(), middleware.DisableCache(), controller.TelegramBindStart) + apiRouter.GET("/oauth/telegram/bind/:flow_token", middleware.CriticalRateLimit(), middleware.DisableCache(), controller.TelegramBind) // Standard OAuth providers (GitHub, Discord, OIDC, LinuxDO) - unified route - apiRouter.GET("/oauth/:provider", middleware.CriticalRateLimit(), controller.HandleOAuth) + apiRouter.GET("/oauth/:provider", middleware.CriticalRateLimit(), middleware.DisableCache(), middleware.TryUserAuth(), controller.HandleOAuth) apiRouter.GET("/ratio_config", middleware.CriticalRateLimit(), controller.GetRatioConfig) apiRouter.POST("/stripe/webhook", anonymousRequestBodyLimit, controller.StripeWebhook) @@ -62,17 +63,18 @@ func SetApiRouter(router *gin.Engine) { apiRouter.POST("/waffo-pancake/webhook/:env", anonymousRequestBodyLimit, controller.WaffoPancakeWebhook) // Universal secure verification routes - apiRouter.POST("/verify", middleware.UserAuth(), middleware.CriticalRateLimit(), controller.UniversalVerify) + apiRouter.POST("/verify", middleware.UserAuth(), middleware.CriticalRateLimit(), middleware.DisableCache(), controller.UniversalVerify) userRoute := apiRouter.Group("/user") { + userRoute.POST("/auth/refresh", middleware.SessionCookieOriginGuard(), middleware.CriticalRateLimit(), middleware.DisableCache(), controller.RefreshAuth) + userRoute.POST("/auth/logout", middleware.SessionCookieOriginGuard(), middleware.CriticalRateLimit(), middleware.DisableCache(), controller.AuthLogout) userRoute.POST("/register", middleware.CriticalRateLimit(), anonymousRequestBodyLimit, middleware.TurnstileCheck(), controller.Register) - userRoute.POST("/login", middleware.CriticalRateLimit(), anonymousRequestBodyLimit, middleware.TurnstileCheck(), controller.Login) - userRoute.POST("/login/2fa", middleware.CriticalRateLimit(), anonymousRequestBodyLimit, controller.Verify2FALogin) - userRoute.POST("/passkey/login/begin", middleware.CriticalRateLimit(), anonymousRequestBodyLimit, controller.PasskeyLoginBegin) - userRoute.POST("/passkey/login/finish", middleware.CriticalRateLimit(), anonymousRequestBodyLimit, controller.PasskeyLoginFinish) + userRoute.POST("/login", middleware.CriticalRateLimit(), middleware.DisableCache(), anonymousRequestBodyLimit, middleware.TurnstileCheck(), controller.Login) + userRoute.POST("/login/2fa", middleware.CriticalRateLimit(), middleware.DisableCache(), anonymousRequestBodyLimit, controller.Verify2FALogin) + userRoute.POST("/passkey/login/begin", middleware.CriticalRateLimit(), middleware.DisableCache(), anonymousRequestBodyLimit, controller.PasskeyLoginBegin) + userRoute.POST("/passkey/login/finish", middleware.CriticalRateLimit(), middleware.DisableCache(), anonymousRequestBodyLimit, controller.PasskeyLoginFinish) //userRoute.POST("/tokenlog", middleware.CriticalRateLimit(), controller.TokenLog) - userRoute.GET("/logout", controller.Logout) userRoute.POST("/epay/notify", anonymousRequestBodyLimit, controller.EpayNotify) userRoute.GET("/epay/notify", controller.EpayNotify) userRoute.GET("/groups", controller.GetUserGroups) @@ -80,18 +82,21 @@ func SetApiRouter(router *gin.Engine) { selfRoute := userRoute.Group("/") selfRoute.Use(middleware.UserAuth()) { + selfRoute.GET("/sessions", middleware.DisableCache(), controller.GetLoginSessions) + selfRoute.DELETE("/sessions/:sid", middleware.DisableCache(), controller.DeleteLoginSession) + selfRoute.POST("/sessions/revoke-others", middleware.DisableCache(), controller.RevokeOtherLoginSessions) selfRoute.GET("/self/groups", controller.GetUserGroups) selfRoute.GET("/self", controller.GetSelf) selfRoute.GET("/models", controller.GetUserModels) - selfRoute.PUT("/self", middleware.CriticalRateLimit(), controller.UpdateSelf) + selfRoute.PUT("/self", middleware.CriticalRateLimit(), middleware.DisableCache(), controller.UpdateSelf) selfRoute.DELETE("/self", controller.DeleteSelf) - selfRoute.GET("/token", controller.GenerateAccessToken) + selfRoute.GET("/token", middleware.DisableCache(), controller.GenerateAccessToken) selfRoute.GET("/passkey", controller.PasskeyStatus) - selfRoute.POST("/passkey/register/begin", controller.PasskeyRegisterBegin) - selfRoute.POST("/passkey/register/finish", controller.PasskeyRegisterFinish) - selfRoute.POST("/passkey/verify/begin", controller.PasskeyVerifyBegin) - selfRoute.POST("/passkey/verify/finish", controller.PasskeyVerifyFinish) - selfRoute.DELETE("/passkey", controller.PasskeyDelete) + selfRoute.POST("/passkey/register/begin", middleware.DisableCache(), controller.PasskeyRegisterBegin) + selfRoute.POST("/passkey/register/finish", middleware.DisableCache(), controller.PasskeyRegisterFinish) + selfRoute.POST("/passkey/verify/begin", middleware.DisableCache(), controller.PasskeyVerifyBegin) + selfRoute.POST("/passkey/verify/finish", middleware.DisableCache(), controller.PasskeyVerifyFinish) + selfRoute.DELETE("/passkey", middleware.DisableCache(), controller.PasskeyDelete) selfRoute.GET("/aff", controller.GetAffCode) selfRoute.GET("/topup/info", controller.GetTopUpInfo) selfRoute.GET("/topup/self", controller.GetUserTopUps) @@ -110,10 +115,10 @@ func SetApiRouter(router *gin.Engine) { // 2FA routes selfRoute.GET("/2fa/status", controller.Get2FAStatus) - selfRoute.POST("/2fa/setup", controller.Setup2FA) - selfRoute.POST("/2fa/enable", controller.Enable2FA) - selfRoute.POST("/2fa/disable", controller.Disable2FA) - selfRoute.POST("/2fa/backup_codes", controller.RegenerateBackupCodes) + selfRoute.POST("/2fa/setup", middleware.DisableCache(), controller.Setup2FA) + selfRoute.POST("/2fa/enable", middleware.DisableCache(), controller.Enable2FA) + selfRoute.POST("/2fa/disable", middleware.DisableCache(), controller.Disable2FA) + selfRoute.POST("/2fa/backup_codes", middleware.DisableCache(), controller.RegenerateBackupCodes) // Check-in routes selfRoute.GET("/checkin", controller.GetCheckinStatus) @@ -192,7 +197,6 @@ func SetApiRouter(router *gin.Engine) { optionRoute.GET("/channel_affinity_cache", controller.GetChannelAffinityCacheStats) optionRoute.DELETE("/channel_affinity_cache", controller.ClearChannelAffinityCache) optionRoute.POST("/rest_model_ratio", controller.ResetModelRatio) - optionRoute.POST("/migrate_console_setting", controller.MigrateConsoleSetting) // 用于迁移检测的旧键,下个版本会删除 optionRoute.GET("/waffo-pancake/catalog", controller.ListWaffoPancakeCatalog) optionRoute.POST("/waffo-pancake/pair", controller.CreateWaffoPancakePair) optionRoute.POST("/waffo-pancake/save", controller.SaveWaffoPancake) @@ -266,9 +270,6 @@ func SetApiRouter(router *gin.Engine) { } logRoute := apiRouter.Group("/log") logRoute.GET("/", middleware.AdminAuth(), controller.GetAllLogs) - // Legacy synchronous direct-delete route used only by the classic frontend. - // TODO: remove once the classic frontend is removed; the default frontend uses /system-task/log-cleanup. - logRoute.DELETE("/", middleware.RootAuth(), controller.DeleteHistoryLogs) logRoute.GET("/stat", middleware.AdminAuth(), controller.GetLogsStat) logRoute.GET("/self/stat", middleware.UserAuth(), controller.GetLogsSelfStat) logRoute.GET("/channel_affinity_usage_cache", middleware.AdminAuth(), controller.GetChannelAffinityUsageCacheStats) diff --git a/router/main.go b/router/main.go index d3769bd591..6eeeeb8850 100644 --- a/router/main.go +++ b/router/main.go @@ -12,7 +12,7 @@ import ( "github.com/gin-gonic/gin" ) -func SetRouter(router *gin.Engine, assets ThemeAssets) { +func SetRouter(router *gin.Engine, assets WebAssets) { SetApiRouter(router) SetDashboardRouter(router) SetRelayRouter(router) diff --git a/router/retired_frontend_routes_test.go b/router/retired_frontend_routes_test.go new file mode 100644 index 0000000000..89514a644a --- /dev/null +++ b/router/retired_frontend_routes_test.go @@ -0,0 +1,26 @@ +package router + +import ( + "net/http" + "testing" + + "github.com/gin-gonic/gin" + "github.com/stretchr/testify/assert" +) + +func TestRetiredFrontendAPIRoutes(t *testing.T) { + gin.SetMode(gin.TestMode) + engine := gin.New() + SetApiRouter(engine) + + routes := make(map[string]struct{}, len(engine.Routes())) + for _, route := range engine.Routes() { + routes[route.Method+" "+route.Path] = struct{}{} + } + _, hasAsyncCleanup := routes[http.MethodPost+" /api/system-task/log-cleanup"] + _, hasDirectDelete := routes[http.MethodDelete+" /api/log/"] + _, hasConsoleMigration := routes[http.MethodPost+" /api/option/migrate_console_setting"] + assert.True(t, hasAsyncCleanup) + assert.False(t, hasDirectDelete) + assert.False(t, hasConsoleMigration) +} diff --git a/router/web-router.go b/router/web-router.go index 0d475e90d5..83c91d8fe1 100644 --- a/router/web-router.go +++ b/router/web-router.go @@ -13,23 +13,19 @@ import ( "github.com/gin-gonic/gin" ) -// ThemeAssets holds the embedded frontend assets for both themes. -type ThemeAssets struct { - DefaultBuildFS embed.FS - DefaultIndexPage []byte - ClassicBuildFS embed.FS - ClassicIndexPage []byte +// WebAssets holds the embedded dashboard frontend assets. +type WebAssets struct { + BuildFS embed.FS + IndexPage []byte } -func SetWebRouter(router *gin.Engine, assets ThemeAssets) { - defaultFS := common.EmbedFolder(assets.DefaultBuildFS, "web/default/dist") - classicFS := common.EmbedFolder(assets.ClassicBuildFS, "web/classic/dist") - themeFS := common.NewThemeAwareFS(defaultFS, classicFS) +func SetWebRouter(router *gin.Engine, assets WebAssets) { + frontendFS := common.EmbedFolder(assets.BuildFS, "web/dist") router.Use(gzip.Gzip(gzip.DefaultCompression)) router.Use(middleware.GlobalWebRateLimit()) router.Use(middleware.Cache()) - router.Use(static.Serve("/", themeFS)) + router.Use(static.Serve("/", frontendFS)) router.NoRoute(func(c *gin.Context) { c.Set(middleware.RouteTagKey, "web") if strings.HasPrefix(c.Request.RequestURI, "/v1") || strings.HasPrefix(c.Request.RequestURI, "/api") || strings.HasPrefix(c.Request.RequestURI, "/assets") { @@ -37,10 +33,6 @@ func SetWebRouter(router *gin.Engine, assets ThemeAssets) { return } c.Header("Cache-Control", "no-cache") - if common.GetTheme() == "classic" { - c.Data(http.StatusOK, "text/html; charset=utf-8", assets.ClassicIndexPage) - } else { - c.Data(http.StatusOK, "text/html; charset=utf-8", assets.DefaultIndexPage) - } + c.Data(http.StatusOK, "text/html; charset=utf-8", assets.IndexPage) }) } diff --git a/service/auth_cleanup.go b/service/auth_cleanup.go new file mode 100644 index 0000000000..1042275400 --- /dev/null +++ b/service/auth_cleanup.go @@ -0,0 +1,51 @@ +package service + +import ( + "fmt" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/model" +) + +const authArtifactCleanupInterval = time.Hour + +// StartAuthArtifactCleanup removes expired dashboard Sessions and old +// one-time authentication flows. Only the master instance performs cleanup. +func StartAuthArtifactCleanup() { + if !common.IsMasterNode { + return + } + go func() { + cleanupAuthArtifacts() + ticker := time.NewTicker(authArtifactCleanupInterval) + defer ticker.Stop() + for range ticker.C { + cleanupAuthArtifacts() + } + }() +} + +func cleanupAuthArtifacts() { + now := time.Now() + count, err := model.CountUserSessionsCreatedSince(0, now.Add(-time.Hour).Unix()) + if err != nil { + common.SysError("failed to count hourly user session issuance: " + err.Error()) + } else if count > int64(common.UserSessionHourlyAlertThreshold) { + common.SysError(fmt.Sprintf( + "hourly user session issuance exceeded alert threshold: count=%d threshold=%d window_seconds=%d", + count, + common.UserSessionHourlyAlertThreshold, + int64(time.Hour/time.Second), + )) + } + if err := model.DeleteExpiredUserSessions(now.Unix()); err != nil { + common.SysError("failed to delete expired user sessions: " + err.Error()) + } + if err := model.DeleteOldRevokedUserSessions(now.Unix()); err != nil { + common.SysError("failed to delete old revoked user sessions: " + err.Error()) + } + if err := model.DeleteExpiredAuthFlows(now); err != nil { + common.SysError("failed to delete expired authentication flows: " + err.Error()) + } +} diff --git a/service/auth_session.go b/service/auth_session.go new file mode 100644 index 0000000000..ffe0cb731a --- /dev/null +++ b/service/auth_session.go @@ -0,0 +1,418 @@ +package service + +import ( + "errors" + "fmt" + "net/http" + "strings" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/model" + "github.com/gin-gonic/gin" + "github.com/google/uuid" +) + +const RefreshCookieName = "new_api_refresh" + +var ( + ErrLoginSessionInvalid = errors.New("login session is invalid") + ErrLoginSessionRevoked = errors.New("login session is revoked") + ErrLoginSessionMismatch = errors.New("login session does not match the expected session") + ErrRefreshTokenInvalid = errors.New("refresh token is invalid") + ErrRefreshRace = errors.New("refresh token was already rotated") +) + +type LoginSessionView struct { + SID string `json:"sid"` + Current bool `json:"current"` + LoginMethod string `json:"login_method"` + IP string `json:"ip"` + UserAgent string `json:"user_agent"` + CreatedAt int64 `json:"created_at"` + LastActiveAt int64 `json:"last_active_at"` + ExpiresAt int64 `json:"expires_at"` +} + +type AuthBundle struct { + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + AccessExpiresAt int64 `json:"access_expires_at"` + Session LoginSessionView `json:"session"` + RefreshToken string `json:"-"` +} + +func CreateLoginSession(userID int, loginMethod, ip, userAgent string) (*AuthBundle, error) { + return createLoginSession(userID, 0, loginMethod, ip, userAgent) +} + +func CreateLoginSessionAtAuthVersion(userID int, expectedAuthVersion int64, loginMethod, ip, userAgent string) (*AuthBundle, error) { + if expectedAuthVersion <= 0 { + return nil, ErrLoginSessionInvalid + } + return createLoginSession(userID, expectedAuthVersion, loginMethod, ip, userAgent) +} + +func createLoginSession(userID int, expectedAuthVersion int64, loginMethod, ip, userAgent string) (*AuthBundle, error) { + user, err := model.GetUserCache(userID) + if err != nil { + return nil, err + } + if user.Status != common.UserStatusEnabled || user.AuthVersion <= 0 { + return nil, ErrLoginSessionInvalid + } + if expectedAuthVersion > 0 && user.AuthVersion != expectedAuthVersion { + return nil, ErrLoginSessionRevoked + } + now := time.Now().Unix() + activeCount, err := model.CountActiveUserSessions(userID, now) + if err != nil { + return nil, err + } + if activeCount >= int64(common.UserSessionActiveLimit) { + return nil, model.ErrUserSessionLimit + } + issuanceCount, err := model.CountUserSessionsCreatedSince(userID, now-common.UserSessionIssuanceWindowSeconds) + if err != nil { + return nil, err + } + if issuanceCount >= int64(common.UserSessionIssuanceLimit) { + return nil, model.ErrUserSessionIssuanceLimit + } + refreshSecret, err := common.GenerateRandomCharsKey(64) + if err != nil { + return nil, err + } + session := &model.UserSession{ + SID: uuid.NewString(), + UserID: userID, + Version: 1, + UserAuthVersion: user.AuthVersion, + Status: model.UserSessionStatusActive, + RefreshHash: hashRefreshSecret(refreshSecret), + LoginMethod: strings.TrimSpace(loginMethod), + IP: truncateAuthMetadata(ip, 64), + UserAgent: truncateAuthMetadata(userAgent, 512), + CreatedAt: now, + LastActiveAt: now, + ExpiresAt: time.Unix(now, 0).Add(LoginSessionTTL).Unix(), + } + if session.LoginMethod == "" { + session.LoginMethod = "unknown" + } + if err := model.CreateUserSession(session); err != nil { + return nil, err + } + bundle, err := issueAuthBundle(session, session.SID+"."+refreshSecret, true) + if err != nil { + _, _ = model.RevokeUserSession(userID, session.SID, "token_issue_failed") + return nil, err + } + return bundle, nil +} + +func ValidateLoginSession(identity AuthIdentity) (*model.UserSession, *model.UserBase, error) { + session, err := model.GetUserSessionCached(identity.SessionID) + if err != nil { + if errors.Is(err, model.ErrUserSessionInactive) { + return nil, nil, ErrLoginSessionRevoked + } + return nil, nil, err + } + now := time.Now().Unix() + if session.UserID != identity.UserID || session.Status != model.UserSessionStatusActive || session.RevokedAt != 0 || session.ExpiresAt <= now || session.Version != identity.SessionVersion || session.UserAuthVersion != identity.UserAuthVersion { + return nil, nil, ErrLoginSessionRevoked + } + user, err := model.GetUserCache(identity.UserID) + if err != nil { + return nil, nil, err + } + if user.Status != common.UserStatusEnabled || user.AuthVersion != identity.UserAuthVersion { + return nil, nil, ErrLoginSessionRevoked + } + return session, user, nil +} + +// ValidateSessionReference validates a server-side flow bound to an existing +// dashboard session without requiring an access token on the callback request. +func ValidateSessionReference(userID int, sid string) (AuthIdentity, error) { + if userID <= 0 || strings.TrimSpace(sid) == "" { + return AuthIdentity{}, ErrLoginSessionInvalid + } + session, err := model.GetUserSessionCached(sid) + if err != nil { + return AuthIdentity{}, err + } + identity := AuthIdentity{ + UserID: userID, + SessionID: sid, + UserAuthVersion: session.UserAuthVersion, + SessionVersion: session.Version, + } + if _, _, err := ValidateLoginSession(identity); err != nil { + return AuthIdentity{}, err + } + return identity, nil +} + +// AdvanceCurrentSessionSecurity increments the user's global auth version, +// preserves only the current browser session at a new session version and +// returns a replacement access token. Call after a successful 2FA/passkey +// security-setting mutation that did not already advance AuthVersion. +func AdvanceCurrentSessionSecurity(identity AuthIdentity, reason string) (*AuthBundle, error) { + nextUserAuthVersion, err := model.BumpUserAuthVersion(identity.UserID) + if err != nil { + return nil, err + } + return advanceCurrentSessionToVersion(identity, nextUserAuthVersion, reason) +} + +// AdvanceCurrentSessionToUserVersion is used when the security mutation and +// AuthVersion increment were committed in the same transaction (for example, +// a password change). +func AdvanceCurrentSessionToUserVersion(identity AuthIdentity, reason string) (*AuthBundle, error) { + user, err := model.GetUserCache(identity.UserID) + if err != nil { + return nil, err + } + if user.Status != common.UserStatusEnabled || user.AuthVersion <= identity.UserAuthVersion { + return nil, ErrLoginSessionRevoked + } + return advanceCurrentSessionToVersion(identity, user.AuthVersion, reason) +} + +func advanceCurrentSessionToVersion(identity AuthIdentity, nextUserAuthVersion int64, reason string) (*AuthBundle, error) { + session, err := model.AdvanceUserSessionAuthVersion( + identity.UserID, + identity.SessionID, + identity.SessionVersion, + identity.UserAuthVersion, + nextUserAuthVersion, + ) + if err != nil { + return nil, err + } + if _, err := model.RevokeOtherUserSessions(identity.UserID, identity.SessionID, reason); err != nil { + return nil, err + } + return issueAuthBundle(session, "", true) +} + +func RefreshLoginSession(rawRefreshToken, expectedSID, ip, userAgent string) (*AuthBundle, *model.User, error) { + sid, secret, ok := splitRefreshToken(rawRefreshToken) + if !ok { + return nil, nil, ErrRefreshTokenInvalid + } + if expectedSID = strings.TrimSpace(expectedSID); expectedSID != "" && expectedSID != sid { + return nil, nil, ErrLoginSessionMismatch + } + session, err := model.GetUserSessionCached(sid) + if err != nil { + if errors.Is(err, model.ErrUserSessionInactive) { + return nil, nil, ErrLoginSessionRevoked + } + return nil, nil, ErrRefreshTokenInvalid + } + if session.Status != model.UserSessionStatusActive || session.RevokedAt != 0 || session.ExpiresAt <= time.Now().Unix() { + return nil, nil, ErrLoginSessionRevoked + } + userCache, err := model.GetUserCache(session.UserID) + if err != nil { + return nil, nil, err + } + currentUser, err := model.GetUserById(session.UserID, false) + if err != nil { + return nil, nil, err + } + if userCache.Status != common.UserStatusEnabled || userCache.AuthVersion != session.UserAuthVersion || + currentUser.Status != common.UserStatusEnabled || currentUser.AuthVersion != session.UserAuthVersion { + _, _ = model.RevokeUserSession(session.UserID, session.SID, "user_security_changed") + return nil, nil, ErrLoginSessionRevoked + } + nextSecret := deriveNextRefreshSecret(sid, secret) + rotated, err := model.RotateUserSessionRefresh(session.UserID, sid, hashRefreshSecret(secret), hashRefreshSecret(nextSecret), time.Now().Unix(), RefreshReplayWindow) + if err != nil { + if errors.Is(err, model.ErrUserSessionRefreshRace) && rotated != nil && + hashRefreshSecret(nextSecret) == rotated.RefreshHash { + bundle, issueErr := issueAuthBundle(rotated, sid+"."+nextSecret, true) + if issueErr != nil { + return nil, nil, issueErr + } + return bundle, currentUser, nil + } + if errors.Is(err, model.ErrUserSessionRefreshReuse) { + return nil, nil, ErrLoginSessionRevoked + } + if errors.Is(err, model.ErrUserSessionRefreshInvalid) { + return nil, nil, ErrRefreshTokenInvalid + } + if errors.Is(err, model.ErrUserSessionRefreshRace) { + return nil, nil, ErrRefreshRace + } + return nil, nil, err + } + rotated.IP = truncateAuthMetadata(ip, 64) + rotated.UserAgent = truncateAuthMetadata(userAgent, 512) + bundle, err := issueAuthBundle(rotated, sid+"."+nextSecret, true) + if err != nil { + return nil, nil, err + } + return bundle, currentUser, nil +} + +func RevokeByRefreshToken(rawRefreshToken, expectedSID, reason string) error { + sid, secret, ok := splitRefreshToken(rawRefreshToken) + if !ok { + return nil + } + if expectedSID = strings.TrimSpace(expectedSID); expectedSID != "" && expectedSID != sid { + return ErrLoginSessionMismatch + } + _, err := model.RevokeUserSessionByRefreshHash(sid, hashRefreshSecret(secret), reason) + return err +} + +func RefreshTokenSID(rawRefreshToken string) (string, bool) { + sid, _, ok := splitRefreshToken(rawRefreshToken) + return sid, ok +} + +func ListLoginSessions(userID int, currentSID string) ([]LoginSessionView, error) { + sessions, err := model.ListActiveUserSessions(userID, currentSID, time.Now().Unix()) + if err != nil { + return nil, err + } + views := make([]LoginSessionView, 0, len(sessions)) + for i := range sessions { + views = append(views, sessionView(&sessions[i], sessions[i].SID == currentSID)) + } + return views, nil +} + +func WriteRefreshCookie(c *gin.Context, rawToken string) { + expiresAt := time.Now().Add(LoginSessionTTL) + if sid, _, ok := splitRefreshToken(rawToken); ok { + if session, err := model.GetUserSessionCached(sid); err == nil && session.ExpiresAt > time.Now().Unix() { + expiresAt = time.Unix(session.ExpiresAt, 0) + } + } + maxAge := int(time.Until(expiresAt) / time.Second) + if maxAge < 1 { + maxAge = 1 + } + http.SetCookie(c.Writer, &http.Cookie{ + Name: RefreshCookieName, + Value: rawToken, + Path: "/api/user/auth", + MaxAge: maxAge, + Expires: expiresAt, + HttpOnly: true, + Secure: common.SessionCookieSecure, + SameSite: http.SameSiteStrictMode, + }) +} + +func ClearRefreshCookie(c *gin.Context) { + http.SetCookie(c.Writer, &http.Cookie{ + Name: RefreshCookieName, + Value: "", + Path: "/api/user/auth", + MaxAge: -1, + Expires: time.Unix(1, 0), + HttpOnly: true, + Secure: common.SessionCookieSecure, + SameSite: http.SameSiteStrictMode, + }) +} + +func issueAuthBundle(session *model.UserSession, rawRefreshToken string, current bool) (*AuthBundle, error) { + identity := AuthIdentity{ + UserID: session.UserID, + SessionID: session.SID, + UserAuthVersion: session.UserAuthVersion, + SessionVersion: session.Version, + } + accessToken, accessExpiresAt, err := IssueAccessToken(identity) + if err != nil { + return nil, err + } + return &AuthBundle{ + AccessToken: accessToken, + TokenType: "Bearer", + AccessExpiresAt: accessExpiresAt, + Session: sessionView(session, current), + RefreshToken: rawRefreshToken, + }, nil +} + +func sessionView(session *model.UserSession, current bool) LoginSessionView { + return LoginSessionView{ + SID: session.SID, + Current: current, + LoginMethod: session.LoginMethod, + IP: session.IP, + UserAgent: session.UserAgent, + CreatedAt: session.CreatedAt, + LastActiveAt: session.LastActiveAt, + ExpiresAt: session.ExpiresAt, + } +} + +func splitRefreshToken(raw string) (string, string, bool) { + sid, secret, ok := strings.Cut(strings.TrimSpace(raw), ".") + if !ok || sid == "" || secret == "" || strings.Contains(secret, ".") { + return "", "", false + } + if _, err := uuid.Parse(sid); err != nil { + return "", "", false + } + return sid, secret, true +} + +func hashRefreshSecret(secret string) string { + return common.GenerateHMACWithKey(authSigningKey("refresh"), secret) +} + +func deriveNextRefreshSecret(sid, currentSecret string) string { + return common.GenerateHMACWithKey(authSigningKey("refresh-rotate"), sid+"."+currentSecret) +} + +func truncateAuthMetadata(value string, max int) string { + value = strings.TrimSpace(value) + if len(value) <= max { + return value + } + return value[:max] +} + +func authSessionErrorCode(err error) (int, string) { + switch { + case errors.Is(err, model.ErrUserSessionLimit): + return http.StatusConflict, "AUTH_SESSION_LIMIT" + case errors.Is(err, model.ErrUserSessionIssuanceLimit): + return http.StatusTooManyRequests, "AUTH_SESSION_ISSUANCE_LIMIT" + case errors.Is(err, ErrLoginSessionMismatch): + return http.StatusConflict, "AUTH_SESSION_MISMATCH" + case errors.Is(err, ErrRefreshRace): + return http.StatusConflict, "AUTH_REFRESH_RACE" + case errors.Is(err, ErrAuthTokenExpired): + return http.StatusUnauthorized, "AUTH_TOKEN_EXPIRED" + case errors.Is(err, ErrLoginSessionRevoked): + return http.StatusUnauthorized, "AUTH_SESSION_REVOKED" + case errors.Is(err, ErrRefreshTokenInvalid), errors.Is(err, ErrAuthTokenInvalid): + return http.StatusUnauthorized, "AUTH_UNAUTHORIZED" + default: + return http.StatusInternalServerError, "AUTH_INTERNAL_ERROR" + } +} + +func AuthSessionErrorCode(err error) (int, string) { + return authSessionErrorCode(err) +} + +func FormatAuthError(err error) string { + if err == nil { + return "" + } + return fmt.Sprintf("authentication failed: %v", err) +} diff --git a/service/auth_session_test.go b/service/auth_session_test.go new file mode 100644 index 0000000000..5342ff4fcd --- /dev/null +++ b/service/auth_session_test.go @@ -0,0 +1,431 @@ +package service + +import ( + "bytes" + "errors" + "fmt" + "strings" + "testing" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/model" + "github.com/alicebob/miniredis/v2" + "github.com/gin-gonic/gin" + "github.com/glebarez/sqlite" + "github.com/go-redis/redis/v8" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" +) + +func setupAuthSessionTestDB(t *testing.T) *model.User { + t.Helper() + previousDB, previousRedis := model.DB, common.RedisEnabled + previousActiveLimit := common.UserSessionActiveLimit + previousIssuanceLimit := common.UserSessionIssuanceLimit + previousIssuanceWindow := common.UserSessionIssuanceWindowSeconds + previousRevokedRetention := common.UserSessionRevokedRetentionDays + previousAlertThreshold := common.UserSessionHourlyAlertThreshold + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + require.NoError(t, err) + sqlDB, err := db.DB() + require.NoError(t, err) + sqlDB.SetMaxOpenConns(1) + require.NoError(t, db.AutoMigrate(&model.User{}, &model.UserSession{}, &model.AuthFlow{})) + model.DB = db + common.RedisEnabled = false + common.UserSessionActiveLimit = common.DefaultUserSessionActiveLimit + common.UserSessionIssuanceLimit = common.DefaultUserSessionIssuanceLimit + common.UserSessionIssuanceWindowSeconds = int64(common.DefaultUserSessionIssuanceWindowSeconds) + common.UserSessionRevokedRetentionDays = common.DefaultUserSessionRevokedRetentionDays + common.UserSessionHourlyAlertThreshold = common.DefaultUserSessionHourlyAlertThreshold + t.Cleanup(func() { + model.DB = previousDB + common.RedisEnabled = previousRedis + common.UserSessionActiveLimit = previousActiveLimit + common.UserSessionIssuanceLimit = previousIssuanceLimit + common.UserSessionIssuanceWindowSeconds = previousIssuanceWindow + common.UserSessionRevokedRetentionDays = previousRevokedRetention + common.UserSessionHourlyAlertThreshold = previousAlertThreshold + _ = sqlDB.Close() + }) + user := &model.User{ + Username: "session-user", + Password: "unused-password-hash", + Role: common.RoleCommonUser, + Status: common.UserStatusEnabled, + Group: "default", + AuthVersion: 1, + } + require.NoError(t, db.Create(user).Error) + return user +} + +func useIndependentAuthSessionRedis(t *testing.T) (*miniredis.Miniredis, *redis.Client, *miniredis.Miniredis, *redis.Client) { + t.Helper() + previousRedisEnabled := common.RedisEnabled + previousRDB := common.RDB + previousSyncFrequency := common.SyncFrequency + serverA := miniredis.RunT(t) + serverB := miniredis.RunT(t) + clientA := redis.NewClient(&redis.Options{Addr: serverA.Addr()}) + clientB := redis.NewClient(&redis.Options{Addr: serverB.Addr()}) + common.RedisEnabled = true + common.SyncFrequency = 2 + common.RDB = clientA + t.Cleanup(func() { + _ = clientA.Close() + _ = clientB.Close() + common.RedisEnabled = previousRedisEnabled + common.RDB = previousRDB + common.SyncFrequency = previousSyncFrequency + }) + return serverA, clientA, serverB, clientB +} + +func cachedLoginSessionKey(t *testing.T, server *miniredis.Miniredis) string { + t.Helper() + for _, key := range server.Keys() { + if strings.HasPrefix(key, "auth:session:") { + return key + } + } + require.FailNow(t, "login session was not cached") + return "" +} + +func TestCreateLoginSessionEnforcesActiveLimitAcrossAuthVersions(t *testing.T) { + useTestSessionSecret(t) + user := setupAuthSessionTestDB(t) + common.UserSessionActiveLimit = 50 + common.UserSessionIssuanceLimit = 100 + now := time.Now().Unix() + rows := make([]model.UserSession, 0, 49) + for i := 0; i < 49; i++ { + authVersion := user.AuthVersion + if i == 0 { + authVersion++ + } + rows = append(rows, model.UserSession{ + SID: fmt.Sprintf("active-limit-%02d", i), + UserID: user.Id, + Version: 1, + UserAuthVersion: authVersion, + Status: model.UserSessionStatusActive, + RefreshHash: fmt.Sprintf("hash-%02d", i), + LoginMethod: "password", + CreatedAt: now - int64(i), + LastActiveAt: now - int64(i), + ExpiresAt: now + 3600, + }) + } + require.NoError(t, model.DB.Create(&rows).Error) + + _, err := CreateLoginSession(user.Id, "password", "127.0.0.1", "test-agent") + require.NoError(t, err, "49 active sessions must allow creation of the 50th") + + _, err = CreateLoginSession(user.Id, "password", "127.0.0.1", "test-agent") + assert.ErrorIs(t, err, model.ErrUserSessionLimit) + var count int64 + require.NoError(t, model.DB.Model(&model.UserSession{}).Count(&count).Error) + assert.Equal(t, int64(50), count) +} + +func TestCreateLoginSessionEnforcesIssuanceLimitAcrossAllStatuses(t *testing.T) { + useTestSessionSecret(t) + user := setupAuthSessionTestDB(t) + common.UserSessionActiveLimit = 10 + common.UserSessionIssuanceLimit = 3 + common.UserSessionIssuanceWindowSeconds = 60 + now := time.Now().Unix() + rows := []model.UserSession{ + { + SID: "issuance-limit-revoked", UserID: user.Id, Version: 1, UserAuthVersion: user.AuthVersion + 1, + Status: model.UserSessionStatusRevoked, RefreshHash: "hash-revoked", LoginMethod: "password", + CreatedAt: now - 2, LastActiveAt: now - 2, ExpiresAt: now + 3600, RevokedAt: now - 1, + }, + { + SID: "issuance-limit-expired", UserID: user.Id, Version: 1, UserAuthVersion: user.AuthVersion, + Status: model.UserSessionStatusActive, RefreshHash: "hash-expired", LoginMethod: "password", + CreatedAt: now - 1, LastActiveAt: now - 1, ExpiresAt: now - 1, + }, + { + SID: "issuance-outside-effective-window", UserID: user.Id, Version: 1, UserAuthVersion: user.AuthVersion, + Status: model.UserSessionStatusRevoked, RefreshHash: "hash-outside", LoginMethod: "password", + CreatedAt: now - 61, LastActiveAt: now - 61, ExpiresAt: now + 3600, RevokedAt: now - 60, + }, + } + require.NoError(t, model.DB.Create(&rows).Error) + + _, err := CreateLoginSession(user.Id, "password", "127.0.0.1", "test-agent") + require.NoError(t, err, "rows outside the effective issuance window must not consume the limit") + + _, err = CreateLoginSession(user.Id, "password", "127.0.0.1", "test-agent") + assert.ErrorIs(t, err, model.ErrUserSessionIssuanceLimit) + var count int64 + require.NoError(t, model.DB.Model(&model.UserSession{}).Count(&count).Error) + assert.Equal(t, int64(4), count) +} + +func TestPasswordResetDoesNotClearSessionIssuanceHistory(t *testing.T) { + useTestSessionSecret(t) + user := setupAuthSessionTestDB(t) + common.UserSessionActiveLimit = 50 + common.UserSessionIssuanceLimit = 1 + email := "session-reset@example.com" + require.NoError(t, model.DB.Model(user).Update("email", email).Error) + + _, err := CreateLoginSession(user.Id, "password", "127.0.0.1", "test-agent") + require.NoError(t, err) + require.NoError(t, model.ResetUserPasswordByEmail(email, "new-password")) + + _, err = CreateLoginSession(user.Id, "password", "127.0.0.1", "test-agent") + assert.ErrorIs(t, err, model.ErrUserSessionIssuanceLimit) +} + +func TestCreateLoginSessionFailsClosedWhenLimitCountFails(t *testing.T) { + useTestSessionSecret(t) + user := setupAuthSessionTestDB(t) + forcedErr := errors.New("forced session count failure") + callbackName := "test:fail_user_session_limit_count" + callbackRegistered := true + require.NoError(t, model.DB.Callback().Query().Before("gorm:query").Register(callbackName, func(tx *gorm.DB) { + if tx.Statement != nil && tx.Statement.Table == "user_sessions" { + tx.AddError(forcedErr) + } + })) + t.Cleanup(func() { + if callbackRegistered { + _ = model.DB.Callback().Query().Remove(callbackName) + } + }) + + _, err := CreateLoginSession(user.Id, "password", "127.0.0.1", "test-agent") + assert.ErrorIs(t, err, forcedErr) + require.NoError(t, model.DB.Callback().Query().Remove(callbackName)) + callbackRegistered = false + var count int64 + require.NoError(t, model.DB.Model(&model.UserSession{}).Count(&count).Error) + assert.Zero(t, count) +} + +func TestCleanupAuthArtifactsAlertsBeforeDeletingHourlyIssuance(t *testing.T) { + setupAuthSessionTestDB(t) + common.UserSessionHourlyAlertThreshold = 2 + common.UserSessionIssuanceWindowSeconds = 1 + now := time.Now() + boundaryRows := make([]model.UserSession, 0, 2) + for i := 0; i < 2; i++ { + boundaryRows = append(boundaryRows, model.UserSession{ + SID: "hourly-boundary-" + string(rune('a'+i)), UserID: 1, Version: 1, UserAuthVersion: 1, + Status: model.UserSessionStatusActive, RefreshHash: "hash", LoginMethod: "password", + CreatedAt: now.Add(-2 * time.Second).Unix(), LastActiveAt: now.Add(-time.Hour).Unix(), ExpiresAt: now.Add(-time.Minute).Unix(), + }) + } + require.NoError(t, model.DB.Create(&boundaryRows).Error) + + var logBuffer bytes.Buffer + common.LogWriterMu.Lock() + previousErrorWriter := gin.DefaultErrorWriter + gin.DefaultErrorWriter = &logBuffer + common.LogWriterMu.Unlock() + t.Cleanup(func() { + common.LogWriterMu.Lock() + gin.DefaultErrorWriter = previousErrorWriter + common.LogWriterMu.Unlock() + }) + + cleanupAuthArtifacts() + assert.Empty(t, logBuffer.String(), "the hourly alert uses a strict greater-than threshold") + var count int64 + require.NoError(t, model.DB.Model(&model.UserSession{}).Count(&count).Error) + assert.Zero(t, count) + + exceededRows := make([]model.UserSession, 0, 3) + for i := 0; i < 3; i++ { + exceededRows = append(exceededRows, model.UserSession{ + SID: "hourly-exceeded-" + string(rune('a'+i)), UserID: 1, Version: 1, UserAuthVersion: 1, + Status: model.UserSessionStatusActive, RefreshHash: "hash", LoginMethod: "password", + CreatedAt: now.Add(-2 * time.Second).Unix(), LastActiveAt: now.Add(-time.Hour).Unix(), ExpiresAt: now.Add(-time.Minute).Unix(), + }) + } + require.NoError(t, model.DB.Create(&exceededRows).Error) + logBuffer.Reset() + cleanupAuthArtifacts() + assert.Contains(t, logBuffer.String(), "hourly user session issuance exceeded alert threshold") + require.NoError(t, model.DB.Model(&model.UserSession{}).Count(&count).Error) + assert.Zero(t, count, "alerting must happen before expired rows are deleted") +} + +func TestCleanupAuthArtifactsRemovesOnlyExpiredRecords(t *testing.T) { + setupAuthSessionTestDB(t) + now := time.Now() + oldExpiry := now.Add(-25 * time.Hour) + require.NoError(t, model.DB.Create(&model.UserSession{ + SID: "expired-session", UserID: 1, Version: 1, UserAuthVersion: 1, + Status: model.UserSessionStatusActive, RefreshHash: "hash", LoginMethod: "password", + CreatedAt: oldExpiry.Unix(), LastActiveAt: oldExpiry.Unix(), ExpiresAt: oldExpiry.Unix(), + }).Error) + require.NoError(t, model.DB.Create(&model.AuthFlow{ + TokenHash: "expired-flow", Purpose: model.AuthFlowPurposeTwoFALogin, + ExpiresAt: oldExpiry, + }).Error) + require.NoError(t, model.DB.Create(&model.AuthFlow{ + TokenHash: "recent-flow", Purpose: model.AuthFlowPurposeTwoFALogin, + ExpiresAt: now.Add(time.Minute), + }).Error) + + cleanupAuthArtifacts() + + var sessionCount int64 + require.NoError(t, model.DB.Model(&model.UserSession{}).Count(&sessionCount).Error) + assert.Zero(t, sessionCount) + var flows []model.AuthFlow + require.NoError(t, model.DB.Find(&flows).Error) + require.Len(t, flows, 1) + assert.Equal(t, "recent-flow", flows[0].TokenHash) +} + +func TestCleanupAuthArtifactsContinuesWithRevokedCleanupAfterExpiredBatchFailure(t *testing.T) { + setupAuthSessionTestDB(t) + now := time.Now() + oldCreatedAt := now.Add(-8 * 24 * time.Hour).Unix() + require.NoError(t, model.DB.Create(&[]model.UserSession{ + { + SID: "failed-expired-cleanup", UserID: 1, Version: 1, UserAuthVersion: 1, + Status: model.UserSessionStatusActive, RefreshHash: "hash-expired", LoginMethod: "password", + CreatedAt: oldCreatedAt, LastActiveAt: oldCreatedAt, ExpiresAt: now.Add(-time.Minute).Unix(), + }, + { + SID: "independent-revoked-cleanup", UserID: 1, Version: 1, UserAuthVersion: 1, + Status: model.UserSessionStatusRevoked, RefreshHash: "hash-revoked", LoginMethod: "password", + CreatedAt: oldCreatedAt, LastActiveAt: oldCreatedAt, ExpiresAt: now.Add(time.Hour).Unix(), + RevokedAt: now.Add(-8 * 24 * time.Hour).Unix(), + }, + }).Error) + + forcedErr := errors.New("forced expired cleanup failure") + callbackName := "test:fail_first_user_session_cleanup_batch" + failedFirstDelete := false + require.NoError(t, model.DB.Callback().Delete().Before("gorm:delete").Register(callbackName, func(tx *gorm.DB) { + if tx.Statement != nil && tx.Statement.Table == "user_sessions" && !failedFirstDelete { + failedFirstDelete = true + tx.AddError(forcedErr) + } + })) + t.Cleanup(func() { _ = model.DB.Callback().Delete().Remove(callbackName) }) + + cleanupAuthArtifacts() + + var expired model.UserSession + require.NoError(t, model.DB.First(&expired, "sid = ?", "failed-expired-cleanup").Error) + var revoked model.UserSession + assert.ErrorIs(t, model.DB.First(&revoked, "sid = ?", "independent-revoked-cleanup").Error, gorm.ErrRecordNotFound) +} + +func TestLoginSessionCreateRefreshAndRevoke(t *testing.T) { + useTestSessionSecret(t) + user := setupAuthSessionTestDB(t) + + bundle, err := CreateLoginSession(user.Id, "password", "127.0.0.1", "test-agent") + require.NoError(t, err) + assert.NotEmpty(t, bundle.RefreshToken) + identity, err := ParseAccessToken(bundle.AccessToken) + require.NoError(t, err) + _, cachedUser, err := ValidateLoginSession(identity) + require.NoError(t, err) + assert.Equal(t, user.Id, cachedUser.Id) + require.NoError(t, RevokeByRefreshToken(bundle.Session.SID+".wrong-refresh-secret", "", "logout")) + _, _, err = ValidateLoginSession(identity) + require.NoError(t, err, "a caller that only knows sid must not be able to revoke the session") + + refreshed, _, err := RefreshLoginSession(bundle.RefreshToken, bundle.Session.SID, "127.0.0.2", "test-agent-2") + require.NoError(t, err) + assert.NotEqual(t, bundle.RefreshToken, refreshed.RefreshToken) + recovered, _, err := RefreshLoginSession(bundle.RefreshToken, bundle.Session.SID, "127.0.0.2", "test-agent-2") + require.NoError(t, err) + assert.Equal(t, refreshed.RefreshToken, recovered.RefreshToken, "a concurrent refresh must recover the winner's rotated token") + + _, _, err = RefreshLoginSession(refreshed.RefreshToken, "different-session", "127.0.0.2", "test-agent-2") + assert.ErrorIs(t, err, ErrLoginSessionMismatch) + + require.NoError(t, RevokeByRefreshToken(refreshed.RefreshToken, refreshed.Session.SID, "logout")) + _, _, err = ValidateLoginSession(identity) + assert.True(t, errors.Is(err, ErrLoginSessionRevoked)) +} + +func TestIndependentRedisSessionRevokeConvergesAfterCacheTTL(t *testing.T) { + useTestSessionSecret(t) + user := setupAuthSessionTestDB(t) + _, clientA, serverB, clientB := useIndependentAuthSessionRedis(t) + + common.RDB = clientA + bundle, err := CreateLoginSession(user.Id, "password", "127.0.0.1", "node-a") + require.NoError(t, err) + identity, err := ParseAccessToken(bundle.AccessToken) + require.NoError(t, err) + + common.RDB = clientB + _, _, err = ValidateLoginSession(identity) + require.NoError(t, err) + assert.NotEmpty(t, cachedLoginSessionKey(t, serverB), "node B must hold its own session cache entry") + + common.RDB = clientA + require.NoError(t, RevokeByRefreshToken(bundle.RefreshToken, bundle.Session.SID, "logout")) + + serverB.FastForward(3 * time.Second) + common.RDB = clientB + _, _, err = ValidateLoginSession(identity) + assert.ErrorIs(t, err, ErrLoginSessionRevoked) +} + +func TestIndependentRedisAuthVersionAdvanceConvergesAfterCacheTTL(t *testing.T) { + useTestSessionSecret(t) + user := setupAuthSessionTestDB(t) + _, clientA, serverB, clientB := useIndependentAuthSessionRedis(t) + + common.RDB = clientA + bundle, err := CreateLoginSession(user.Id, "password", "127.0.0.1", "node-a") + require.NoError(t, err) + oldIdentity, err := ParseAccessToken(bundle.AccessToken) + require.NoError(t, err) + + common.RDB = clientB + _, _, err = ValidateLoginSession(oldIdentity) + require.NoError(t, err) + cacheKey := cachedLoginSessionKey(t, serverB) + version := serverB.HGet(cacheKey, "Version") + assert.Equal(t, "1", version, "node B must hold the pre-rotation session version") + + common.RDB = clientA + rotated, err := AdvanceCurrentSessionSecurity(oldIdentity, "security_update") + require.NoError(t, err) + newIdentity, err := ParseAccessToken(rotated.AccessToken) + require.NoError(t, err) + assert.Greater(t, newIdentity.SessionVersion, oldIdentity.SessionVersion) + assert.Greater(t, newIdentity.UserAuthVersion, oldIdentity.UserAuthVersion) + + serverB.FastForward(3 * time.Second) + common.RDB = clientB + _, _, err = ValidateLoginSession(newIdentity) + require.NoError(t, err) + _, _, err = ValidateLoginSession(oldIdentity) + assert.ErrorIs(t, err, ErrLoginSessionRevoked) +} + +func TestUserAuthVersionInvalidatesExistingSession(t *testing.T) { + useTestSessionSecret(t) + user := setupAuthSessionTestDB(t) + bundle, err := CreateLoginSession(user.Id, "password", "127.0.0.1", "test-agent") + require.NoError(t, err) + identity, err := ParseAccessToken(bundle.AccessToken) + require.NoError(t, err) + + _, err = model.BumpUserAuthVersion(user.Id) + require.NoError(t, err) + _, _, err = ValidateLoginSession(identity) + assert.ErrorIs(t, err, ErrLoginSessionRevoked) + _, err = CreateLoginSessionAtAuthVersion(user.Id, identity.UserAuthVersion, "2fa", "127.0.0.1", "test-agent") + assert.ErrorIs(t, err, ErrLoginSessionRevoked, "a pending 2FA flow must not survive an auth-version change") +} diff --git a/service/auth_token.go b/service/auth_token.go new file mode 100644 index 0000000000..309e8dd086 --- /dev/null +++ b/service/auth_token.go @@ -0,0 +1,216 @@ +package service + +import ( + "crypto/hmac" + "crypto/sha256" + "errors" + "fmt" + "strconv" + "strings" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/golang-jwt/jwt/v5" + "github.com/google/uuid" +) + +const ( + AccessTokenTTL = 15 * time.Minute + SecurityProofTTL = 5 * time.Minute + LoginSessionTTL = 30 * 24 * time.Hour + RefreshReplayWindow = 30 * time.Second + accessTokenUse = "access" + securityProofTokenUse = "security_proof" + authTokenIssuer = "new-api" + authTokenAudience = "new-api-dashboard" +) + +var ( + ErrAuthTokenInvalid = errors.New("authentication token is invalid") + ErrAuthTokenExpired = errors.New("authentication token has expired") + ErrProofScope = errors.New("security proof scope mismatch") + ErrProofMethod = errors.New("security proof method mismatch") +) + +// AuthIdentity is the server-validated identity attached to dashboard requests. +// Role, status and group are deliberately loaded from the user cache instead of JWT claims. +type AuthIdentity struct { + UserID int + SessionID string + UserAuthVersion int64 + SessionVersion int64 +} + +type authClaims struct { + TokenUse string `json:"token_use"` + SessionID string `json:"sid"` + UserAuthVersion int64 `json:"uv"` + SessionVersion int64 `json:"sv"` + Method string `json:"method,omitempty"` + Scopes []string `json:"scopes,omitempty"` + jwt.RegisteredClaims +} + +func authSigningKey(purpose string) []byte { + mac := hmac.New(sha256.New, []byte(common.SessionSecret)) + _, _ = mac.Write([]byte("new-api/auth/" + purpose + "/v1")) + return mac.Sum(nil) +} + +func IssueAccessToken(identity AuthIdentity) (string, int64, error) { + if identity.UserID <= 0 || identity.SessionID == "" || identity.UserAuthVersion <= 0 || identity.SessionVersion <= 0 { + return "", 0, ErrAuthTokenInvalid + } + now := time.Now() + expiresAt := now.Add(AccessTokenTTL) + claims := authClaims{ + TokenUse: accessTokenUse, + SessionID: identity.SessionID, + UserAuthVersion: identity.UserAuthVersion, + SessionVersion: identity.SessionVersion, + RegisteredClaims: jwt.RegisteredClaims{ + Issuer: authTokenIssuer, + Subject: strconv.Itoa(identity.UserID), + Audience: jwt.ClaimStrings{authTokenAudience}, + ExpiresAt: jwt.NewNumericDate(expiresAt), + NotBefore: jwt.NewNumericDate(now.Add(-5 * time.Second)), + IssuedAt: jwt.NewNumericDate(now), + ID: uuid.NewString(), + }, + } + signed, err := jwt.NewWithClaims(jwt.SigningMethodHS256, claims).SignedString(authSigningKey(accessTokenUse)) + return signed, expiresAt.Unix(), err +} + +func ParseAccessToken(raw string) (AuthIdentity, error) { + claims, err := parseAuthClaims(raw, accessTokenUse, authSigningKey(accessTokenUse)) + if err != nil { + return AuthIdentity{}, err + } + userID, err := strconv.Atoi(claims.Subject) + if err != nil || userID <= 0 || claims.SessionID == "" || claims.UserAuthVersion <= 0 || claims.SessionVersion <= 0 { + return AuthIdentity{}, ErrAuthTokenInvalid + } + return AuthIdentity{ + UserID: userID, + SessionID: claims.SessionID, + UserAuthVersion: claims.UserAuthVersion, + SessionVersion: claims.SessionVersion, + }, nil +} + +// ParseDashboardAccessToken distinguishes new-api dashboard JWTs from opaque +// credentials. A token carrying the dashboard issuer, audience and a known +// token use is always treated as internal, even when its signature, lifetime +// or requested purpose is invalid, so it can never fall through to PAT or +// relay-token authentication. +func ParseDashboardAccessToken(raw string) (identity AuthIdentity, internal bool, err error) { + raw = strings.TrimSpace(raw) + if raw == "" { + return AuthIdentity{}, false, nil + } + claims := &authClaims{} + parsed, _, parseErr := jwt.NewParser().ParseUnverified(raw, claims) + if parseErr != nil || parsed == nil { + return AuthIdentity{}, false, nil + } + audienceMatches := false + for _, audience := range claims.Audience { + if audience == authTokenAudience { + audienceMatches = true + break + } + } + knownTokenUse := claims.TokenUse == accessTokenUse || claims.TokenUse == securityProofTokenUse + if claims.Issuer != authTokenIssuer || !audienceMatches || !knownTokenUse { + return AuthIdentity{}, false, nil + } + identity, err = ParseAccessToken(raw) + return identity, true, err +} + +func IssueSecurityProof(identity AuthIdentity, method string, scopes []string) (string, int64, error) { + method = strings.TrimSpace(method) + if identity.UserID <= 0 || identity.SessionID == "" || identity.UserAuthVersion <= 0 || identity.SessionVersion <= 0 || method == "" || len(scopes) == 0 { + return "", 0, ErrAuthTokenInvalid + } + now := time.Now() + expiresAt := now.Add(SecurityProofTTL) + claims := authClaims{ + TokenUse: securityProofTokenUse, + SessionID: identity.SessionID, + UserAuthVersion: identity.UserAuthVersion, + SessionVersion: identity.SessionVersion, + Method: method, + Scopes: append([]string(nil), scopes...), + RegisteredClaims: jwt.RegisteredClaims{ + Issuer: authTokenIssuer, + Subject: strconv.Itoa(identity.UserID), + Audience: jwt.ClaimStrings{authTokenAudience}, + ExpiresAt: jwt.NewNumericDate(expiresAt), + NotBefore: jwt.NewNumericDate(now.Add(-5 * time.Second)), + IssuedAt: jwt.NewNumericDate(now), + ID: uuid.NewString(), + }, + } + signed, err := jwt.NewWithClaims(jwt.SigningMethodHS256, claims).SignedString(authSigningKey(securityProofTokenUse)) + return signed, expiresAt.Unix(), err +} + +func VerifySecurityProof(raw string, identity AuthIdentity, requiredScope string, allowedMethods []string) (string, error) { + claims, err := parseAuthClaims(raw, securityProofTokenUse, authSigningKey(securityProofTokenUse)) + if err != nil { + return "", err + } + userID, err := strconv.Atoi(claims.Subject) + if err != nil || userID != identity.UserID || claims.SessionID != identity.SessionID || claims.UserAuthVersion != identity.UserAuthVersion || claims.SessionVersion != identity.SessionVersion { + return "", ErrAuthTokenInvalid + } + methodAllowed := len(allowedMethods) == 0 + for _, method := range allowedMethods { + if hmac.Equal([]byte(claims.Method), []byte(method)) { + methodAllowed = true + break + } + } + if !methodAllowed { + return "", ErrProofMethod + } + if requiredScope != "" { + found := false + for _, scope := range claims.Scopes { + if hmac.Equal([]byte(scope), []byte(requiredScope)) { + found = true + break + } + } + if !found { + return "", ErrProofScope + } + } + return claims.Method, nil +} + +func parseAuthClaims(raw, expectedUse string, key []byte) (*authClaims, error) { + raw = strings.TrimSpace(raw) + if raw == "" { + return nil, ErrAuthTokenInvalid + } + claims := &authClaims{} + parsed, err := jwt.ParseWithClaims(raw, claims, func(token *jwt.Token) (any, error) { + if token.Method.Alg() != jwt.SigningMethodHS256.Alg() { + return nil, fmt.Errorf("%w: unexpected signing method", ErrAuthTokenInvalid) + } + return key, nil + }, jwt.WithValidMethods([]string{jwt.SigningMethodHS256.Alg()}), jwt.WithIssuer(authTokenIssuer), jwt.WithAudience(authTokenAudience), jwt.WithExpirationRequired(), jwt.WithIssuedAt(), jwt.WithLeeway(5*time.Second)) + if err != nil { + if errors.Is(err, jwt.ErrTokenExpired) { + return nil, ErrAuthTokenExpired + } + return nil, fmt.Errorf("%w: %v", ErrAuthTokenInvalid, err) + } + if !parsed.Valid || claims.TokenUse != expectedUse || claims.ID == "" || claims.IssuedAt == nil || claims.NotBefore == nil { + return nil, ErrAuthTokenInvalid + } + return claims, nil +} diff --git a/service/auth_token_test.go b/service/auth_token_test.go new file mode 100644 index 0000000000..e99573576a --- /dev/null +++ b/service/auth_token_test.go @@ -0,0 +1,140 @@ +package service + +import ( + "errors" + "testing" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/golang-jwt/jwt/v5" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func useTestSessionSecret(t *testing.T) { + t.Helper() + previous := common.SessionSecret + common.SessionSecret = "test-session-secret-with-sufficient-entropy" + t.Cleanup(func() { common.SessionSecret = previous }) +} + +func TestAccessTokenRoundTripAndPurposeIsolation(t *testing.T) { + useTestSessionSecret(t) + identity := AuthIdentity{UserID: 42, SessionID: "session-1", UserAuthVersion: 3, SessionVersion: 2} + + token, expiresAt, err := IssueAccessToken(identity) + require.NoError(t, err) + assert.Positive(t, expiresAt) + + parsed, err := ParseAccessToken(token) + require.NoError(t, err) + assert.Equal(t, identity, parsed) + + proof, _, err := IssueSecurityProof(identity, "2fa", []string{"channel.key.read"}) + require.NoError(t, err) + _, err = ParseAccessToken(proof) + assert.ErrorIs(t, err, ErrAuthTokenInvalid) +} + +func TestAccessTokenRejectsTampering(t *testing.T) { + useTestSessionSecret(t) + identity := AuthIdentity{UserID: 42, SessionID: "session-1", UserAuthVersion: 1, SessionVersion: 1} + token, _, err := IssueAccessToken(identity) + require.NoError(t, err) + + tamperAt := len(token) - 2 + replacement := "x" + if token[tamperAt] == 'x' { + replacement = "y" + } + tampered := token[:tamperAt] + replacement + token[tamperAt+1:] + _, err = ParseAccessToken(tampered) + assert.ErrorIs(t, err, ErrAuthTokenInvalid) + + _, internal, err := ParseDashboardAccessToken(tampered) + assert.True(t, internal) + assert.ErrorIs(t, err, ErrAuthTokenInvalid) +} + +func TestDashboardAccessTokenClassification(t *testing.T) { + useTestSessionSecret(t) + + identity, internal, err := ParseDashboardAccessToken("opaque.key.with-dots") + require.NoError(t, err) + assert.False(t, internal) + assert.Empty(t, identity) + + external := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{ + "iss": "external-issuer", + "aud": authTokenAudience, + "exp": time.Now().Add(time.Minute).Unix(), + }) + externalRaw, err := external.SignedString([]byte("external-secret")) + require.NoError(t, err) + _, internal, err = ParseDashboardAccessToken(externalRaw) + require.NoError(t, err) + assert.False(t, internal) + + unknownUse := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{ + "iss": authTokenIssuer, + "aud": authTokenAudience, + "token_use": "third_party", + "exp": time.Now().Add(time.Minute).Unix(), + }) + unknownUseRaw, err := unknownUse.SignedString([]byte("external-secret")) + require.NoError(t, err) + _, internal, err = ParseDashboardAccessToken(unknownUseRaw) + require.NoError(t, err) + assert.False(t, internal) + + proof, _, err := IssueSecurityProof(AuthIdentity{ + UserID: 42, SessionID: "session-1", UserAuthVersion: 1, SessionVersion: 1, + }, "2fa", []string{"channel.key.read"}) + require.NoError(t, err) + _, internal, err = ParseDashboardAccessToken(proof) + assert.True(t, internal) + assert.ErrorIs(t, err, ErrAuthTokenInvalid) + + expiredClaims := authClaims{ + TokenUse: accessTokenUse, + SessionID: "expired-session", + UserAuthVersion: 1, + SessionVersion: 1, + RegisteredClaims: jwt.RegisteredClaims{ + Issuer: authTokenIssuer, + Subject: "42", + Audience: jwt.ClaimStrings{authTokenAudience}, + ExpiresAt: jwt.NewNumericDate(time.Now().Add(-time.Minute)), + NotBefore: jwt.NewNumericDate(time.Now().Add(-2 * time.Minute)), + IssuedAt: jwt.NewNumericDate(time.Now().Add(-2 * time.Minute)), + ID: "expired-token", + }, + } + expired, err := jwt.NewWithClaims(jwt.SigningMethodHS256, expiredClaims).SignedString(authSigningKey(accessTokenUse)) + require.NoError(t, err) + _, internal, err = ParseDashboardAccessToken(expired) + assert.True(t, internal) + assert.ErrorIs(t, err, ErrAuthTokenExpired) +} + +func TestSecurityProofBindsIdentityMethodAndScope(t *testing.T) { + useTestSessionSecret(t) + identity := AuthIdentity{UserID: 42, SessionID: "session-1", UserAuthVersion: 3, SessionVersion: 2} + proof, _, err := IssueSecurityProof(identity, "2fa", []string{"channel.key.read"}) + require.NoError(t, err) + + method, err := VerifySecurityProof(proof, identity, "channel.key.read", []string{"2fa", "passkey"}) + require.NoError(t, err) + assert.Equal(t, "2fa", method) + + _, err = VerifySecurityProof(proof, identity, "passkey.delete", []string{"2fa"}) + assert.ErrorIs(t, err, ErrProofScope) + + _, err = VerifySecurityProof(proof, identity, "channel.key.read", []string{"passkey"}) + assert.ErrorIs(t, err, ErrProofMethod) + + otherSession := identity + otherSession.SessionID = "session-2" + _, err = VerifySecurityProof(proof, otherSession, "channel.key.read", []string{"2fa"}) + assert.True(t, errors.Is(err, ErrAuthTokenInvalid)) +} diff --git a/service/passkey/service.go b/service/passkey/service.go index 4d29d1aefa..243eae3f63 100644 --- a/service/passkey/service.go +++ b/service/passkey/service.go @@ -16,12 +16,6 @@ import ( webauthn "github.com/go-webauthn/webauthn/webauthn" ) -const ( - RegistrationSessionKey = "passkey_registration_session" - LoginSessionKey = "passkey_login_session" - VerifySessionKey = "passkey_verify_session" -) - // BuildWebAuthn constructs a WebAuthn instance using the current passkey settings and request context. func BuildWebAuthn(r *http.Request) (*webauthn.WebAuthn, error) { settings := system_setting.GetPasskeySettings() diff --git a/service/passkey/session.go b/service/passkey/session.go index 15e6193269..3753f5158e 100644 --- a/service/passkey/session.go +++ b/service/passkey/session.go @@ -1,50 +1,61 @@ package passkey import ( - "encoding/json" "errors" + "time" + + "github.com/QuantumNous/new-api/common" + "github.com/QuantumNous/new-api/model" - "github.com/gin-contrib/sessions" - "github.com/gin-gonic/gin" webauthn "github.com/go-webauthn/webauthn/webauthn" ) var errSessionNotFound = errors.New("Passkey 会话不存在或已过期") -func SaveSessionData(c *gin.Context, key string, data *webauthn.SessionData) error { - session := sessions.Default(c) - if data == nil { - session.Delete(key) - return session.Save() - } - payload, err := json.Marshal(data) - if err != nil { - return err - } - session.Set(key, string(payload)) - return session.Save() +const passkeyFlowTTL = 5 * time.Minute + +type flowPayload struct { + SessionData webauthn.SessionData `json:"session_data"` + Scope string `json:"scope,omitempty"` } -func PopSessionData(c *gin.Context, key string) (*webauthn.SessionData, error) { - session := sessions.Default(c) - raw := session.Get(key) - if raw == nil { - return nil, errSessionNotFound +func CreateSessionDataFlow(purpose string, userID int, sessionID, scope string, data *webauthn.SessionData) (string, int64, error) { + if data == nil { + return "", 0, errors.New("Passkey 会话数据不能为空") } - session.Delete(key) - _ = session.Save() - var data webauthn.SessionData - switch value := raw.(type) { - case string: - if err := json.Unmarshal([]byte(value), &data); err != nil { - return nil, err - } - case []byte: - if err := json.Unmarshal(value, &data); err != nil { - return nil, err - } - default: - return nil, errors.New("Passkey 会话格式无效") + payload, err := common.Marshal(flowPayload{SessionData: *data, Scope: scope}) + if err != nil { + return "", 0, err } - return &data, nil + expiresAt := time.Now().Add(passkeyFlowTTL) + token, _, err := model.CreateAuthFlow(model.AuthFlowCreate{ + Purpose: purpose, + UserId: userID, + SessionId: sessionID, + Payload: string(payload), + ExpiresAt: expiresAt, + }) + if err != nil { + return "", 0, err + } + return token, expiresAt.Unix(), nil +} + +func PopSessionDataFlow(token, purpose string, userID int, sessionID string) (*webauthn.SessionData, string, error) { + flow, err := model.ConsumeAuthFlow(token, model.AuthFlowMatch{ + Purpose: purpose, + UserId: userID, + SessionId: sessionID, + }) + if err != nil { + if errors.Is(err, model.ErrAuthFlowInvalid) || errors.Is(err, model.ErrAuthFlowExpired) || errors.Is(err, model.ErrAuthFlowConsumed) { + return nil, "", errSessionNotFound + } + return nil, "", err + } + var payload flowPayload + if err := common.UnmarshalJsonStr(flow.Payload, &payload); err != nil { + return nil, "", err + } + return &payload.SessionData, payload.Scope, nil } diff --git a/service/quota.go b/service/quota.go index e5d4ec7e23..84ef22b94d 100644 --- a/service/quota.go +++ b/service/quota.go @@ -470,7 +470,7 @@ func checkAndSendQuotaNotify(relayInfo *relaycommon.RelayInfo, quota int, preCon } if quotaTooLow { prompt := "您的额度即将用尽" - topUpLink := PaymentReturnURL("/console/topup") + topUpLink := PaymentReturnURL("/wallet") // 根据通知方式生成不同的内容格式 var content string @@ -524,7 +524,7 @@ func checkAndSendSubscriptionQuotaNotify(relayInfo *relaycommon.RelayInfo) { } prompt := "您的订阅额度即将用尽" - topUpLink := PaymentReturnURL("/console/topup") + topUpLink := PaymentReturnURL("/wallet") var content string var values []interface{} diff --git a/service/return_path.go b/service/return_path.go index c99e1fd340..21b736d269 100644 --- a/service/return_path.go +++ b/service/return_path.go @@ -3,11 +3,10 @@ package service import ( "strings" - "github.com/QuantumNous/new-api/common" "github.com/QuantumNous/new-api/setting/system_setting" ) func PaymentReturnURL(suffix string) string { base := strings.TrimRight(system_setting.ServerAddress, "/") - return base + common.ThemeAwarePath(suffix) + return base + suffix } diff --git a/service/return_path_test.go b/service/return_path_test.go new file mode 100644 index 0000000000..6039a171c0 --- /dev/null +++ b/service/return_path_test.go @@ -0,0 +1,16 @@ +package service + +import ( + "testing" + + "github.com/QuantumNous/new-api/setting/system_setting" + "github.com/stretchr/testify/assert" +) + +func TestPaymentReturnURLUsesSuppliedDefaultDashboardPath(t *testing.T) { + previousAddress := system_setting.ServerAddress + system_setting.ServerAddress = "https://dashboard.example.com/" + t.Cleanup(func() { system_setting.ServerAddress = previousAddress }) + + assert.Equal(t, "https://dashboard.example.com/wallet", PaymentReturnURL("/wallet")) +} diff --git a/setting/system_setting/theme.go b/setting/system_setting/theme.go deleted file mode 100644 index 44dfc14294..0000000000 --- a/setting/system_setting/theme.go +++ /dev/null @@ -1,32 +0,0 @@ -package system_setting - -import ( - "github.com/QuantumNous/new-api/common" - "github.com/QuantumNous/new-api/setting/config" -) - -type ThemeSettings struct { - Frontend string `json:"frontend"` -} - -var themeSettings = ThemeSettings{ - Frontend: "classic", -} - -func init() { - config.GlobalConfig.Register("theme", &themeSettings) - syncThemeToCommon() -} - -func syncThemeToCommon() { - common.SetTheme(themeSettings.Frontend) -} - -func GetThemeSettings() *ThemeSettings { - return &themeSettings -} - -// UpdateAndSyncTheme syncs the theme config to common after DB load. -func UpdateAndSyncTheme() { - syncThemeToCommon() -} diff --git a/trusted_proxies.go b/trusted_proxies.go new file mode 100644 index 0000000000..f4b338a6cf --- /dev/null +++ b/trusted_proxies.go @@ -0,0 +1,51 @@ +package main + +import ( + "errors" + "fmt" + "log" + "os" + "strings" + + "github.com/gin-gonic/gin" +) + +var defaultTrustedProxyCIDRs = []string{ + "127.0.0.0/8", + "::1", + "10.0.0.0/8", + "172.16.0.0/12", + "192.168.0.0/16", + "fc00::/7", +} + +func configureTrustedProxies(engine *gin.Engine) error { + rawTrustedProxies := strings.TrimSpace(os.Getenv("TRUSTED_PROXIES")) + if rawTrustedProxies == "" { + log.Print("WARNING: TRUSTED_PROXIES is unset or blank; trusting loopback, RFC 1918, and IPv6 ULA proxy addresses for compatibility. Set TRUSTED_PROXIES=none to trust no proxies, or configure explicit proxy IPs/CIDRs to replace these defaults.") + return engine.SetTrustedProxies(defaultTrustedProxyCIDRs) + } + if strings.EqualFold(rawTrustedProxies, "none") { + return engine.SetTrustedProxies(nil) + } + + parts := strings.Split(rawTrustedProxies, ",") + trustedProxies := make([]string, 0, len(parts)) + for _, part := range parts { + trustedProxy := strings.TrimSpace(part) + if trustedProxy == "" { + continue + } + if strings.EqualFold(trustedProxy, "none") { + return errors.New("TRUSTED_PROXIES=none must be used alone") + } + trustedProxies = append(trustedProxies, trustedProxy) + } + if len(trustedProxies) == 0 { + return errors.New("TRUSTED_PROXIES does not contain an IP address or CIDR") + } + if err := engine.SetTrustedProxies(trustedProxies); err != nil { + return fmt.Errorf("invalid TRUSTED_PROXIES: %w", err) + } + return nil +} diff --git a/trusted_proxies_test.go b/trusted_proxies_test.go new file mode 100644 index 0000000000..642b566e83 --- /dev/null +++ b/trusted_proxies_test.go @@ -0,0 +1,127 @@ +package main + +import ( + "net/http" + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func requestClientIP(router http.Handler, remoteAddr string, forwardedFor string) string { + recorder := httptest.NewRecorder() + request := httptest.NewRequest(http.MethodGet, "/client-ip", nil) + request.RemoteAddr = remoteAddr + if forwardedFor != "" { + request.Header.Set("X-Forwarded-For", forwardedFor) + } + router.ServeHTTP(recorder, request) + return recorder.Body.String() +} + +func newClientIPRouter() *gin.Engine { + router := gin.New() + router.GET("/client-ip", func(c *gin.Context) { + c.String(http.StatusOK, c.ClientIP()) + }) + return router +} + +func TestConfigureTrustedProxiesDefaultsToLoopbackAndPrivateNetworks(t *testing.T) { + gin.SetMode(gin.TestMode) + t.Setenv("TRUSTED_PROXIES", "") + router := newClientIPRouter() + require.NoError(t, configureTrustedProxies(router)) + + testCases := []struct { + name string + remoteAddr string + }{ + {name: "IPv4 loopback", remoteAddr: "127.0.0.1:12345"}, + {name: "IPv6 loopback", remoteAddr: "[::1]:12345"}, + {name: "10 private network", remoteAddr: "10.20.30.40:12345"}, + {name: "172 private network", remoteAddr: "172.20.0.2:12345"}, + {name: "192 private network", remoteAddr: "192.168.10.2:12345"}, + {name: "IPv6 unique local network", remoteAddr: "[fd12:3456::2]:12345"}, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + clientIP := requestClientIP(router, testCase.remoteAddr, "203.0.113.10") + assert.Equal(t, "203.0.113.10", clientIP) + }) + } +} + +func TestConfigureTrustedProxiesDefaultRejectsPublicPeerHeaders(t *testing.T) { + gin.SetMode(gin.TestMode) + t.Setenv("TRUSTED_PROXIES", " \t ") + router := newClientIPRouter() + require.NoError(t, configureTrustedProxies(router)) + + clientIP := requestClientIP(router, "198.51.100.10:12345", "203.0.113.10") + assert.Equal(t, "198.51.100.10", clientIP, "a public peer must not make a spoofed X-Forwarded-For authoritative") +} + +func TestConfigureTrustedProxiesDefaultStopsAtPublicClientInForwardedChain(t *testing.T) { + gin.SetMode(gin.TestMode) + t.Setenv("TRUSTED_PROXIES", "") + router := newClientIPRouter() + require.NoError(t, configureTrustedProxies(router)) + + clientIP := requestClientIP(router, "172.20.0.2:12345", "192.0.2.99, 203.0.113.10") + assert.Equal(t, "203.0.113.10", clientIP, "the first public hop from the trusted proxy must win over a client-supplied prefix") +} + +func TestConfigureTrustedProxiesNoneDisablesForwardedHeaders(t *testing.T) { + gin.SetMode(gin.TestMode) + t.Setenv("TRUSTED_PROXIES", " NoNe ") + router := newClientIPRouter() + require.NoError(t, configureTrustedProxies(router)) + + clientIP := requestClientIP(router, "127.0.0.1:12345", "203.0.113.10") + assert.Equal(t, "127.0.0.1", clientIP) +} + +func TestConfigureTrustedProxiesAcceptsTrimmedIPsAndCIDRs(t *testing.T) { + gin.SetMode(gin.TestMode) + t.Setenv("TRUSTED_PROXIES", " 192.0.2.0/24, 198.51.100.30 ") + router := newClientIPRouter() + require.NoError(t, configureTrustedProxies(router)) + + trustedClientIP := requestClientIP(router, "192.0.2.10:12345", "203.0.113.20") + assert.Equal(t, "203.0.113.20", trustedClientIP) + + trustedExactIP := requestClientIP(router, "198.51.100.30:12345", "203.0.113.21") + assert.Equal(t, "203.0.113.21", trustedExactIP) + + untrustedClientIP := requestClientIP(router, "198.51.100.20:12345", "203.0.113.22") + assert.Equal(t, "198.51.100.20", untrustedClientIP) + + defaultProxyIP := requestClientIP(router, "127.0.0.1:12345", "203.0.113.23") + assert.Equal(t, "127.0.0.1", defaultProxyIP, "an explicit list must replace, not extend, the compatibility defaults") +} + +func TestConfigureTrustedProxiesRejectsInvalidConfiguration(t *testing.T) { + gin.SetMode(gin.TestMode) + testCases := []struct { + name string + value string + }{ + {name: "no entries", value: ", ,"}, + {name: "invalid entry", value: "not-an-ip"}, + {name: "mixed valid and invalid entries", value: "127.0.0.1, not-an-ip"}, + {name: "none mixed with valid entry", value: "none,127.0.0.1"}, + {name: "valid entry mixed with none", value: "127.0.0.1,NONE"}, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + t.Setenv("TRUSTED_PROXIES", testCase.value) + router := newClientIPRouter() + assert.Error(t, configureTrustedProxies(router)) + }) + } +} diff --git a/web/default/.gitignore b/web/.gitignore similarity index 100% rename from web/default/.gitignore rename to web/.gitignore diff --git a/web/default/.node-version b/web/.node-version similarity index 100% rename from web/default/.node-version rename to web/.node-version diff --git a/web/default/.npmrc b/web/.npmrc similarity index 100% rename from web/default/.npmrc rename to web/.npmrc diff --git a/web/default/.oxfmtrc.json b/web/.oxfmtrc.json similarity index 100% rename from web/default/.oxfmtrc.json rename to web/.oxfmtrc.json diff --git a/web/default/.oxlintrc.json b/web/.oxlintrc.json similarity index 100% rename from web/default/.oxlintrc.json rename to web/.oxlintrc.json diff --git a/web/default/AGENTS.md b/web/AGENTS.md similarity index 99% rename from web/default/AGENTS.md rename to web/AGENTS.md index 4af5e86bfe..c026263fd1 100644 --- a/web/default/AGENTS.md +++ b/web/AGENTS.md @@ -64,7 +64,7 @@ - **专有名词**:品牌、产品、技术术语等可保留英文(如 API、React、TypeScript);若有约定俗成的译法则使用翻译。 - **翻译键**:使用有层级、语义清晰的键名,如 `dashboard.overview.title`,并保持命名一致。 -- **枚举与文案(常量中的 i18n)** +- **枚举与文案(常量中的 i18n)** 各 feature 的 `constants.ts` 中常出现「枚举/状态 + 展示文案」或「成功/错误消息」,须统一约定以免遗漏 i18n、用法混乱: - **成功/错误/提示类消息**(如 `SUCCESS_MESSAGES`、`ERROR_MESSAGES`):常量值仅表示 **i18n 键**(与英文 fallback 同字面量)。展示时**必须**通过 `t()` 使用,例如 `toast.success(t(SUCCESS_MESSAGES.API_KEY_CREATED))`、`toast.error(t(ERROR_MESSAGES.UNEXPECTED))`,**禁止**直接 `toast.success(SUCCESS_MESSAGES.xxx)` 当作最终文案。 - **状态/选项的 label**:在常量中统一用 **labelKey**(字符串,即 i18n 键),组件中通过 `t(config.labelKey)` 渲染;或约定用 `label` 存与 en 一致的 key 字符串,组件用 `t(config.label)`。同一 feature 内只采用一种方式,避免混用。 diff --git a/web/bun.lock b/web/bun.lock index d86f3a8b3f..783276cb2e 100644 --- a/web/bun.lock +++ b/web/bun.lock @@ -1,72 +1,8 @@ { "lockfileVersion": 1, - "configVersion": 0, "workspaces": { "": { - "name": "new-api-web-workspace", - }, - "classic": { - "name": "react-template", - "version": "0.1.0", - "dependencies": { - "@douyinfe/semi-icons": "^2.63.1", - "@douyinfe/semi-illustrations": "^2.69.1", - "@douyinfe/semi-ui": "^2.69.1", - "@lobehub/icons": "catalog:", - "@visactor/react-vchart": "~1.8.8", - "@visactor/vchart": "~1.8.8", - "@visactor/vchart-semi-theme": "~1.8.8", - "axios": "catalog:", - "clsx": "catalog:", - "dayjs": "catalog:", - "highlight.js": "^11.11.1", - "history": "^5.3.0", - "i18next": "^23.16.8", - "i18next-browser-languagedetector": "^7.2.0", - "katex": "^0.16.22", - "lucide-react": "^0.511.0", - "marked": "^4.1.1", - "mermaid": "^11.6.0", - "qrcode.react": "catalog:", - "react": "catalog:", - "react-dom": "catalog:", - "react-dropzone": "^14.2.3", - "react-fireworks": "^1.0.4", - "react-i18next": "^13.0.0", - "react-icons": "catalog:", - "react-markdown": "catalog:", - "react-router-dom": "^6.3.0", - "react-telegram-login": "^1.1.2", - "react-toastify": "^9.0.8", - "react-turnstile": "^1.0.5", - "rehype-highlight": "^7.0.2", - "rehype-katex": "^7.0.1", - "remark-breaks": "^4.0.0", - "remark-gfm": "catalog:", - "remark-math": "^6.0.0", - "sse.js": "catalog:", - "unist-util-visit": "^5.0.0", - "use-debounce": "^10.0.4", - }, - "devDependencies": { - "@rsbuild/core": "catalog:", - "@rsbuild/plugin-react": "catalog:", - "@so1ve/prettier-config": "^3.1.0", - "autoprefixer": "^10.4.21", - "eslint": "8.57.0", - "eslint-plugin-header": "^3.1.1", - "eslint-plugin-react-hooks": "^5.2.0", - "i18next-cli": "^1.10.3", - "postcss": "^8.5.3", - "prettier": "catalog:", - "prop-types": "^15.8.1", - "tailwindcss": "^3", - "typescript": "4.4.2", - }, - }, - "default": { "name": "newapi-web", - "version": "1.0.0", "dependencies": { "@base-ui/react": "^1.6.0", "@codemirror/lang-markdown": "^6.5.0", @@ -79,7 +15,7 @@ "@hugeicons/core-free-icons": "^4.2.2", "@hugeicons/react": "^1.1.9", "@lezer/highlight": "^1.2.3", - "@lobehub/icons": "catalog:", + "@lobehub/icons": "^5.10.1", "@tanstack/react-query": "^5.101.2", "@tanstack/react-router": "^1.170.17", "@tanstack/react-table": "^8.21.3", @@ -88,11 +24,11 @@ "@visactor/vchart": "^2.1.2", "ai": "^7.0.14", "auto-skeleton-react": "^1.0.5", - "axios": "catalog:", + "axios": "^1.18.1", "class-variance-authority": "^0.7.1", - "clsx": "catalog:", + "clsx": "^2.1.1", "cmdk": "^1.1.1", - "dayjs": "catalog:", + "dayjs": "^1.11.21", "dompurify": "3.4.11", "i18next": "^26.3.4", "i18next-browser-languagedetector": "^8.2.1", @@ -103,19 +39,19 @@ "motion": "^12.42.2", "nanoid": "^5.1.16", "next-themes": "^0.4.6", - "qrcode.react": "catalog:", - "react": "catalog:", + "qrcode.react": "^4.2.0", + "react": "^19.2.7", "react-day-picker": "^10.0.1", - "react-dom": "catalog:", + "react-dom": "^19.2.7", "react-hook-form": "^7.80.0", "react-i18next": "^17.0.8", - "react-icons": "catalog:", + "react-icons": "^5.7.0", "react-resizable-panels": "^4.12.0", "react-top-loading-bar": "^3.0.2", "recharts": "3.9.1", "shiki": "^4.3.0", "sonner": "^2.0.7", - "sse.js": "catalog:", + "sse.js": "^2.8.0", "stream-markdown-parser": "^1.0.9", "tailwind-merge": "^3.6.0", "tailwindcss": "^4.3.2", @@ -127,9 +63,9 @@ "zustand": "^5.0.14", }, "devDependencies": { - "@rsbuild/core": "catalog:", - "@rsbuild/plugin-react": "catalog:", - "@rsbuild/plugin-tailwindcss": "catalog:", + "@rsbuild/core": "^2.1.4", + "@rsbuild/plugin-react": "^2.1.0", + "@rsbuild/plugin-tailwindcss": "^2.0.3", "@tanstack/react-query-devtools": "^5.101.2", "@tanstack/react-router-devtools": "^1.167.0", "@tanstack/router-plugin": "^1.168.19", @@ -140,37 +76,31 @@ "@xyflow/react": "^12.11.1", "embla-carousel-react": "^8.6.0", "knip": "^6.24.0", - "oxfmt": "catalog:", - "oxlint": "catalog:", + "oxfmt": "^0.57.0", + "oxlint": "^1.72.0", "shadcn": "^4.12.0", }, }, }, - "catalog": { - "@lobehub/icons": "^5.10.1", - "@rsbuild/core": "^2.1.4", - "@rsbuild/plugin-react": "^2.1.0", - "@rsbuild/plugin-tailwindcss": "^2.0.3", - "axios": "^1.18.1", - "clsx": "^2.1.1", - "dayjs": "^1.11.21", - "oxfmt": "^0.57.0", - "oxlint": "^1.72.0", - "prettier": "^3.8.3", - "qrcode.react": "^4.2.0", - "react": "^19.2.7", - "react-dom": "^19.2.7", - "react-icons": "^5.7.0", - "react-markdown": "^10.1.0", - "remark-gfm": "^4.0.1", - "sse.js": "^2.8.0", + "overrides": { + "brace-expansion": "2.1.1", + "dompurify": "3.4.11", + "fast-uri": "3.1.2", + "hono": "4.12.22", + "ip-address": "10.2.0", + "js-cookie": "3.0.7", + "mermaid": "11.15.0", + "minimist": "1.2.8", + "postcss": "8.5.15", + "qs": "6.15.2", + "uuid": "14.0.0", }, "packages": { - "@ai-sdk/gateway": ["@ai-sdk/gateway@4.0.11", "", { "dependencies": { "@ai-sdk/provider": "4.0.2", "@ai-sdk/provider-utils": "5.0.5", "@vercel/oidc": "3.2.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-ZdZzQnBxYfjJpWpSNkV+rRWycwTBhxyvwGvxcwx9g+WQoy3MK2xNahSySEgP9hD/X2xY9jkjd0xB67oDE3rLMA=="], + "@ai-sdk/gateway": ["@ai-sdk/gateway@4.0.23", "", { "dependencies": { "@ai-sdk/provider": "4.0.3", "@ai-sdk/provider-utils": "5.0.11", "@vercel/oidc": "3.2.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-f85diFdPMXYJpxCjOYZchMQkRH8h3r6lhK4Q2xmzJ7UA2OQ80L3W7tFu61742xGQK7zHWm5AhxYhNuc50H9SGQ=="], - "@ai-sdk/provider": ["@ai-sdk/provider@4.0.2", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-pfPoy9J1B1xV7cqJ8MYHOsDYrMv5tR3+EMNfI249OhkD2uRakvav3Fo7XpD2luuN/YNCBY7KfEQc7vEV7KEtyw=="], + "@ai-sdk/provider": ["@ai-sdk/provider@4.0.3", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-e0CpNWJUY7OxAFAnCZkw+ri9QOHWwTs1tXP42782KFGCU07qt8NiXCrCVowyCB5dP2r5/Uls+g2oPd8kOJn9dw=="], - "@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@5.0.5", "", { "dependencies": { "@ai-sdk/provider": "4.0.2", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-oI0t3dvCoqWNV1I8o1Rybi2DXDvHES5r/TrwtJW90tuFLVepgJlftPxrcjh8vaSvjqC2diTuA2vXyjKAyHJm4A=="], + "@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@5.0.11", "", { "dependencies": { "@ai-sdk/provider": "4.0.3", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-7/96wE+ZsKB35iS9ASyllrE4Ym/EolXEB7AkuJ5FI++fmS85BVTAs77890C+1Z2jwHfBKjBQSBmsliOsAh0iFQ=="], "@alloc/quick-lru": ["@alloc/quick-lru@5.2.0", "", {}, "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw=="], @@ -182,16 +112,14 @@ "@ant-design/fast-color": ["@ant-design/fast-color@3.0.1", "", {}, "sha512-esKJegpW4nckh0o6kV3Tkb7NPIZYbPnnFxmQDUmL08ukXZAvV85TZBr70eGuke/CIArLaP6aw8lt9KILjnWuOw=="], - "@ant-design/icons": ["@ant-design/icons@6.2.5", "", { "dependencies": { "@ant-design/colors": "^8.0.1", "@ant-design/icons-svg": "^4.4.2", "@rc-component/util": "^1.11.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.0.0", "react-dom": ">=16.0.0" } }, "sha512-0hKtoKqTjGFOndUyJLJmC9Cg6k4rEO7rLo6xmgbNJH+/ZX1C57RVals2v1j1knHl9n7Q+sBOveTvn931wLOCKw=="], + "@ant-design/icons": ["@ant-design/icons@6.3.2", "", { "dependencies": { "@ant-design/colors": "^8.0.1", "@ant-design/icons-svg": "^4.5.0", "@rc-component/util": "^1.11.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.0.0", "react-dom": ">=16.0.0" } }, "sha512-B6O5a5XJ4wjtNOfZejXYwHW5zvKV5gYkjGf11dHGLEbKn0ABDGndo41+gfIiXyTFhvESj4XTotuud33mUFid0g=="], - "@ant-design/icons-svg": ["@ant-design/icons-svg@4.4.2", "", {}, "sha512-vHbT+zJEVzllwP+CM+ul7reTEfBR0vgxFe7+lREAsAA7YGsYpboiq2sQNeQeRvh09GfQgs/GyFEvZpJ9cLXpXA=="], + "@ant-design/icons-svg": ["@ant-design/icons-svg@4.5.0", "", {}, "sha512-1BTUFyKPTBZ53MuTP8s0k5SFEXL7o3VHEOwLgzaoWKwnBeqIcqUtVshc4SKzhI6uACfqhJqBwBUE9FsWR3uULA=="], "@ant-design/react-slick": ["@ant-design/react-slick@2.0.0", "", { "dependencies": { "@babel/runtime": "^7.28.4", "clsx": "^2.1.1", "json2mq": "^0.2.0", "throttle-debounce": "^5.0.0" }, "peerDependencies": { "react": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-HMS9sRoEmZey8LsE/Yo6+klhlzU12PisjrVcydW3So7RdklyEd2qehyU6a7Yp+OYN72mgsYs3NFCyP2lCPFVqg=="], "@antfu/install-pkg": ["@antfu/install-pkg@1.1.0", "", { "dependencies": { "package-manager-detector": "^1.3.0", "tinyexec": "^1.0.1" } }, "sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ=="], - "@astrojs/compiler": ["@astrojs/compiler@2.13.1", "", {}, "sha512-f3FN83d2G/v32ipNClRKgYv30onQlMZX1vCeZMjPsMMPl1mDpmbl0+N5BYo4S/ofzqJyS5hvwacEo0CCVDn/Qg=="], - "@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], "@babel/compat-data": ["@babel/compat-data@7.29.7", "", {}, "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg=="], @@ -266,19 +194,15 @@ "@codemirror/lang-javascript": ["@codemirror/lang-javascript@6.2.5", "", { "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/language": "^6.6.0", "@codemirror/lint": "^6.0.0", "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.17.0", "@lezer/common": "^1.0.0", "@lezer/javascript": "^1.0.0" } }, "sha512-zD4e5mS+50htS7F+TYjBPsiIFGanfVqg4HyUz6WNFikgOPf2BgKlx+TQedI1w6n/IqRBVBbBWmGFdLB/7uxO4A=="], - "@codemirror/lang-markdown": ["@codemirror/lang-markdown@6.5.0", "", { "dependencies": { "@codemirror/autocomplete": "^6.7.1", "@codemirror/lang-html": "^6.0.0", "@codemirror/language": "^6.3.0", "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", "@lezer/common": "^1.2.1", "@lezer/markdown": "^1.0.0" } }, "sha512-0K40bZ35jpHya6FriukbgaleaqzBLZfOh7HuzqbMxBXkbYMJDxfF39c23xOgxFezR+3G+tR2/Mup+Xk865OMvw=="], + "@codemirror/lang-markdown": ["@codemirror/lang-markdown@6.5.1", "", { "dependencies": { "@codemirror/autocomplete": "^6.7.1", "@codemirror/lang-html": "^6.0.0", "@codemirror/language": "^6.3.0", "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", "@lezer/common": "^1.2.1", "@lezer/markdown": "^1.0.0" } }, "sha512-6re5avCNfyRMIoi3XNjbEfQM1vTeVD3JS3g/Fyegyso/eoANFM71Cyvbb66LDyYtQLMEcRFlzioywCqDo9SlLA=="], "@codemirror/language": ["@codemirror/language@6.12.4", "", { "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.23.0", "@lezer/common": "^1.5.0", "@lezer/highlight": "^1.0.0", "@lezer/lr": "^1.0.0", "style-mod": "^4.0.0" } }, "sha512-1q4PaT+o6PbgpkJt4Q8Fv5XJxTy4FUZ4MWETtyiDw3J0Pyr9E2vqcKL+k9wcvjNTIsauxvE7OfmWj3FRPHQ76A=="], "@codemirror/lint": ["@codemirror/lint@6.9.7", "", { "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.42.0", "crelt": "^1.0.5" } }, "sha512-28/+iWLYxKxsvGYhSYL7zaCZqLz5+FFFDq9tVsvGv9kv8RY4fFAchJ5WX9M3YrrRlTIsECjsXPqeNgnSmNP2dg=="], - "@codemirror/state": ["@codemirror/state@6.7.0", "", { "dependencies": { "@marijn/find-cluster-break": "^1.0.0" } }, "sha512-Zbl9NyscLMZkfXPQnNAIIAFftidrA1UbcJEIMp24C0Bukc2I5T8wJS0wsXYsnDOqCFJUeJ1BITGNs5CqPDSmSg=="], + "@codemirror/state": ["@codemirror/state@6.7.1", "", { "dependencies": { "@marijn/find-cluster-break": "^1.0.0" } }, "sha512-9QzNDgE4EYDnAHfrTlR2lwiPciiOymLtwKK+8yHQzCc7GXhAP9xdEbEJFy2IWB1j9UGUl9BsgMmTo/ImA02T7A=="], - "@codemirror/view": ["@codemirror/view@6.43.4", "", { "dependencies": { "@codemirror/state": "^6.7.0", "crelt": "^1.0.6", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, "sha512-YImu23iyKfncJzT7sRy+rEqEhSc8RhOHqDxwy4WzXRKJwYm6iwf/9OJk5ctCAdZ6yi2ZqaGEvmf55fSVqMDrgg=="], - - "@croct/json": ["@croct/json@2.1.0", "", {}, "sha512-UrWfjNQVlBxN+OVcFwHmkjARMW55MBN04E9KfGac8ac8z1QnFVuiOOFtMWXCk3UwsyRqhsNaFoYLZC+xxqsVjQ=="], - - "@croct/json5-parser": ["@croct/json5-parser@0.2.2", "", { "dependencies": { "@croct/json": "^2.1.0" } }, "sha512-0NJMLrbeLbQ0eCVj3UoH/kG2QckUgOASfwmfDTjyW1xAYPyTNJXcWVT/dssJdTJd0pRchW+qF0VFWQHcxs1OVw=="], + "@codemirror/view": ["@codemirror/view@6.43.6", "", { "dependencies": { "@codemirror/state": "^6.7.0", "crelt": "^1.0.6", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, "sha512-EVunGSYN1wz1p75WY1s3Xg7t3i8Yol0kGZGizNdX9BUFgMFILYVe8/u6EVpo7Ff5PwbZuILb4QAq7IZoKzIEQA=="], "@date-fns/tz": ["@date-fns/tz@1.5.0", "", {}, "sha512-lwYN/vDPeNRULcepoE/LO2Pgx+7/RV+S9ARfbc9lr2DtGkOD7pAiruHvbR1RX3Qyf6ja47EWJDMsNK5vK08DJg=="], @@ -288,31 +212,13 @@ "@dnd-kit/modifiers": ["@dnd-kit/modifiers@9.0.0", "", { "dependencies": { "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@dnd-kit/core": "^6.3.0", "react": ">=16.8.0" } }, "sha512-ybiLc66qRGuZoC20wdSSG6pDXFikui/dCNGthxv4Ndy8ylErY0N3KVxY2bgo7AWwIbxDmXDg3ylAFmnrjcbVvw=="], - "@dnd-kit/sortable": ["@dnd-kit/sortable@7.0.2", "", { "dependencies": { "@dnd-kit/utilities": "^3.2.0", "tslib": "^2.0.0" }, "peerDependencies": { "@dnd-kit/core": "^6.0.7", "react": ">=16.8.0" } }, "sha512-wDkBHHf9iCi1veM834Gbk1429bd4lHX4RpAwT0y2cHLf246GAvU2sVw/oxWNpPKQNQRQaeGXhAVgrOl1IT+iyA=="], + "@dnd-kit/sortable": ["@dnd-kit/sortable@10.0.0", "", { "dependencies": { "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@dnd-kit/core": "^6.3.0", "react": ">=16.8.0" } }, "sha512-+xqhmIIzvAYMGfBYYnbKuNicfSsk4RksY2XdmJhT+HAC01nix6fHCztU68jooFiMUB01Ky3F0FyOvhG/BZrWkg=="], "@dnd-kit/utilities": ["@dnd-kit/utilities@3.2.2", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg=="], - "@dotenvx/dotenvx": ["@dotenvx/dotenvx@1.70.0", "", { "dependencies": { "commander": "^11.1.0", "dotenv": "^17.2.1", "eciesjs": "^0.4.10", "enquirer": "^2.4.1", "execa": "^5.1.1", "fdir": "^6.2.0", "ignore": "^5.3.0", "object-treeify": "1.1.33", "picomatch": "^4.0.4", "which": "^4.0.0", "yocto-spinner": "^1.1.0" }, "bin": { "dotenvx": "src/cli/dotenvx.js" } }, "sha512-vC/rom87ym8HEyVdzZZS6/PYGg1Z5fmozUZ8l6cw1sYAxdL1lEyvE/JbK8cMFQoq3GsR/P1PiQRY+VXMtDN9bw=="], + "@dotenvx/dotenvx": ["@dotenvx/dotenvx@1.75.1", "", { "dependencies": { "@dotenvx/primitives": "^0.8.0", "commander": "^11.1.0", "conf": "^10.2.0", "dotenv": "^17.2.1", "enquirer": "^2.4.1", "env-paths": "^2.2.1", "execa": "^5.1.1", "fdir": "^6.2.0", "ignore": "^5.3.0", "object-treeify": "1.1.33", "open": "^8.4.2", "picomatch": "^4.0.4", "systeminformation": "^5.22.11", "undici": "^7.11.0", "which": "^4.0.0", "yocto-spinner": "^1.1.0" }, "bin": { "dotenvx": "src/cli/dotenvx.js" } }, "sha512-/BITOC9dmS/edY2zQwZNicQ059O6RKabtQfyEafV0nGtfYRNHYy1DIPiYVcov40+tob9hfmBnbR963dS+EQ1DQ=="], - "@douyinfe/semi-animation": ["@douyinfe/semi-animation@2.99.3", "", { "dependencies": { "bezier-easing": "^2.1.0" } }, "sha512-Uva9MLF+EjC+m6eBYnX9PFZIQKLxD+iKV6ps/nX/P1FWy17DCDxIsga/cByF0PIsVRLzrSdkCsddj3XETcDw9A=="], - - "@douyinfe/semi-animation-react": ["@douyinfe/semi-animation-react@2.99.3", "", { "dependencies": { "@douyinfe/semi-animation": "2.99.3", "@douyinfe/semi-animation-styled": "2.99.3", "classnames": "^2.2.6" } }, "sha512-0iUWQRO1t838Q1VaPE7DwOnYWeAuuu98MrNnaFkbD8JncYsct2K/2A5TDfa56DwSZ5iVz53jz2En8dMi7oF8sw=="], - - "@douyinfe/semi-animation-styled": ["@douyinfe/semi-animation-styled@2.99.3", "", {}, "sha512-38/ui6SoIJFWRs2jHv1IiNV2CKHaQKhYB4WftCVXCaYYQGL24+0oQ3iLo6qUeaHEWiQK3EcK2Rt7pxtJCJxVOA=="], - - "@douyinfe/semi-foundation": ["@douyinfe/semi-foundation@2.99.3", "", { "dependencies": { "@douyinfe/semi-animation": "2.99.3", "@douyinfe/semi-json-viewer-core": "2.99.3", "@mdx-js/mdx": "^3.0.1", "async-validator": "^3.5.0", "classnames": "^2.2.6", "date-fns": "^2.29.3", "date-fns-tz": "^1.3.8", "fast-copy": "^3.0.1 ", "lodash": "^4.17.21", "lottie-web": "^5.13.0", "memoize-one": "^5.2.1", "prismjs": "^1.29.0", "remark-gfm": "^4.0.0", "scroll-into-view-if-needed": "^2.2.24" } }, "sha512-HKzrcdNGYoEZD81CKI6fj8jU2MWNrZx8HZ0NDHym+smBxSyhpoE/b0FrVo0PmLjCzbCDnySDdJ31GsK5GScmuw=="], - - "@douyinfe/semi-icons": ["@douyinfe/semi-icons@2.99.3", "", { "dependencies": { "classnames": "^2.2.6" }, "peerDependencies": { "react": ">=16.0.0" } }, "sha512-Pm5H3Ua/PDumUCCsnJWwN+znVoKiyFCqag6DJy9/cuF6OOdd1+QUnvi0NHNg6+0fx/LHH088UwKFoOiZRkbaSw=="], - - "@douyinfe/semi-illustrations": ["@douyinfe/semi-illustrations@2.99.3", "", { "peerDependencies": { "react": ">=16.0.0" } }, "sha512-z1rQPgWOV2xtZS8NkmL8JCK1DltQ8FGiL1qYlXbSHjEs1XkNYruq4W3dKv0IJEpTVLIlPsbDg4VmPAuuwLCCkQ=="], - - "@douyinfe/semi-json-viewer-core": ["@douyinfe/semi-json-viewer-core@2.99.3", "", { "dependencies": { "jsonc-parser": "^3.3.1" } }, "sha512-KEbZEyyM2qqGv9K+Yw/ZvAn4CEgcY2lQfL6a2ASEt80FlPoDAIWA7tGjpYxxM9/NcX9omNtsM/HLgDmrCjjBXQ=="], - - "@douyinfe/semi-theme-default": ["@douyinfe/semi-theme-default@2.99.3", "", {}, "sha512-r0IIjrN6vQE1bqbky7FIRi4HQ03x4ykzSIRMf4Za04BFp76IFV6CclyYyUg6cLJ6GjWCnEPMFtwTLKP+b8dAYA=="], - - "@douyinfe/semi-ui": ["@douyinfe/semi-ui@2.99.3", "", { "dependencies": { "@dnd-kit/core": "^6.0.8", "@dnd-kit/sortable": "^7.0.2", "@dnd-kit/utilities": "^3.2.1", "@douyinfe/semi-animation": "2.99.3", "@douyinfe/semi-animation-react": "2.99.3", "@douyinfe/semi-foundation": "2.99.3", "@douyinfe/semi-icons": "2.99.3", "@douyinfe/semi-illustrations": "2.99.3", "@douyinfe/semi-theme-default": "2.99.3", "@tiptap/core": "^3.10.7", "@tiptap/extension-document": "^3.10.7", "@tiptap/extension-hard-break": "^3.10.7", "@tiptap/extension-image": "^3.10.7", "@tiptap/extension-mention": "^3.10.7", "@tiptap/extension-paragraph": "^3.10.7", "@tiptap/extension-text": "^3.10.7", "@tiptap/extension-text-align": "^3.10.7", "@tiptap/extension-text-style": "^3.10.7", "@tiptap/extensions": "^3.10.7", "@tiptap/pm": "^3.10.7", "@tiptap/react": "^3.10.7", "@tiptap/starter-kit": "^3.10.7", "async-validator": "^3.5.0", "classnames": "^2.2.6", "copy-text-to-clipboard": "^2.1.1", "date-fns": "^2.29.3", "date-fns-tz": "^1.3.8", "fast-copy": "^3.0.1 ", "jsonc-parser": "^3.3.1", "lodash": "^4.17.21", "prop-types": "^15.7.2", "prosemirror-state": "^1.4.3", "react-resizable": "^3.0.5", "react-window": "^1.8.2", "scroll-into-view-if-needed": "^2.2.24", "utility-types": "^3.10.0" }, "peerDependencies": { "react": ">=16.0.0", "react-dom": ">=16.0.0" } }, "sha512-6NkeijjZZWzD31omteNVLz+oZuuMKQm3nEcwLI8+44Vv+VUSJPb87WnSFSD3F6eUIt/hZp2vJbCXHWW9SbCpDw=="], - - "@ecies/ciphers": ["@ecies/ciphers@0.2.6", "", { "peerDependencies": { "@noble/ciphers": "^1.0.0" } }, "sha512-patgsRPKGkhhoBjETV4XxD0En4ui5fbX0hzayqI3M8tvNMGUoUvmyYAIWwlxBc1KX5cturfqByYdj5bYGRpN9g=="], + "@dotenvx/primitives": ["@dotenvx/primitives@0.8.0", "", {}, "sha512-VYJy0uhFm9zTJ1TxBaW/pA8bjbOM/OttaNMwZ1RHG4JKyRG7DhSdiqD1ipQoAyoD22olUtxbP78W9xY3Wd11bg=="], "@emnapi/core": ["@emnapi/core@1.11.1", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.2", "tslib": "^2.4.0" } }, "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ=="], @@ -350,27 +256,19 @@ "@emotion/weak-memoize": ["@emotion/weak-memoize@0.4.0", "", {}, "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg=="], - "@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.9.1", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ=="], + "@floating-ui/core": ["@floating-ui/core@1.8.0", "", { "dependencies": { "@floating-ui/utils": "^0.2.12" } }, "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ=="], - "@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.2", "", {}, "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew=="], + "@floating-ui/dom": ["@floating-ui/dom@1.8.0", "", { "dependencies": { "@floating-ui/core": "^1.8.0", "@floating-ui/utils": "^0.2.12" } }, "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg=="], - "@eslint/eslintrc": ["@eslint/eslintrc@2.1.4", "", { "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ=="], + "@floating-ui/react": ["@floating-ui/react@0.27.20", "", { "dependencies": { "@floating-ui/react-dom": "^2.1.9", "@floating-ui/utils": "^0.2.12", "tabbable": "^6.0.0" }, "peerDependencies": { "react": ">=17.0.0", "react-dom": ">=17.0.0" } }, "sha512-CMqMy7OaXl9W0eq1Uy7L7i2Y/anPvHmFmESd2CEw0t5YvZhcVCeo4MBevAmswRllX7Y2dEidA4ozGPunLSTQpw=="], - "@eslint/js": ["@eslint/js@8.57.0", "", {}, "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g=="], + "@floating-ui/react-dom": ["@floating-ui/react-dom@2.1.9", "", { "dependencies": { "@floating-ui/dom": "^1.8.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg=="], - "@floating-ui/core": ["@floating-ui/core@1.7.5", "", { "dependencies": { "@floating-ui/utils": "^0.2.11" } }, "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ=="], + "@floating-ui/utils": ["@floating-ui/utils@0.2.12", "", {}, "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww=="], - "@floating-ui/dom": ["@floating-ui/dom@1.7.6", "", { "dependencies": { "@floating-ui/core": "^1.7.5", "@floating-ui/utils": "^0.2.11" } }, "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ=="], + "@fontsource-variable/lora": ["@fontsource-variable/lora@5.3.0", "", {}, "sha512-2ph8KiZ8Bn141hWuC3ErtpJ+Ui8p2MJQn8TJNRSRmLmnCIOCtHfiBM9R7WLRPeUG/q6hXyHOxWQ8DvRSX+ixvQ=="], - "@floating-ui/react": ["@floating-ui/react@0.27.19", "", { "dependencies": { "@floating-ui/react-dom": "^2.1.8", "@floating-ui/utils": "^0.2.11", "tabbable": "^6.0.0" }, "peerDependencies": { "react": ">=17.0.0", "react-dom": ">=17.0.0" } }, "sha512-31B8h5mm8YxotlE7/AU/PhNAl8eWxAmjL/v2QOxroDNkTFLk3Uu82u63N3b6TXa4EGJeeZLVcd/9AlNlVqzeog=="], - - "@floating-ui/react-dom": ["@floating-ui/react-dom@2.1.8", "", { "dependencies": { "@floating-ui/dom": "^1.7.6" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A=="], - - "@floating-ui/utils": ["@floating-ui/utils@0.2.11", "", {}, "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg=="], - - "@fontsource-variable/lora": ["@fontsource-variable/lora@5.2.8", "", {}, "sha512-cxjTJ9BbOWIzusewR4UMBLVePvTSWV6dtNaNsCkF/oKoyA68fJGWfaYCILOOP1BObE4dmjfZ3xo6m9hdHhtYhg=="], - - "@fontsource-variable/public-sans": ["@fontsource-variable/public-sans@5.2.7", "", {}, "sha512-4mvade2J3slKkvwRkS+p8T3szet/0vhWoSnuUJTVU81Uo2pRpSZY/Y8bSLRqpSwzIPxjVmRJ53oq6JKP/l/PSg=="], + "@fontsource-variable/public-sans": ["@fontsource-variable/public-sans@5.3.0", "", {}, "sha512-AVfkmAt50BMXWpOO21FAntiJFKGX6xTc2dSL8dxtDteONe9IuRXJWGbs0EbG955vAMCq23ENeuopuW87cGWDSQ=="], "@giscus/react": ["@giscus/react@3.1.0", "", { "dependencies": { "giscus": "^1.6.0" }, "peerDependencies": { "react": "^16 || ^17 || ^18 || ^19", "react-dom": "^16 || ^17 || ^18 || ^19" } }, "sha512-0TCO2TvL43+oOdyVVGHDItwxD1UMKP2ZYpT6gXmhFOqfAJtZxTzJ9hkn34iAF/b6YzyJ4Um89QIt9z/ajmAEeg=="], @@ -382,47 +280,9 @@ "@hugeicons/react": ["@hugeicons/react@1.1.9", "", { "peerDependencies": { "react": ">=16.0.0" } }, "sha512-O+lWSWjbijoAvMCxn4K2bQWCGN5+mP1y5j+X99j23mXMj+s0X25fs71T6t9YJLaBodwmZdaewD27dzS/PiboQw=="], - "@humanwhocodes/config-array": ["@humanwhocodes/config-array@0.11.14", "", { "dependencies": { "@humanwhocodes/object-schema": "^2.0.2", "debug": "^4.3.1", "minimatch": "^3.0.5" } }, "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg=="], - - "@humanwhocodes/module-importer": ["@humanwhocodes/module-importer@1.0.1", "", {}, "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA=="], - - "@humanwhocodes/object-schema": ["@humanwhocodes/object-schema@2.0.3", "", {}, "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA=="], - "@iconify/types": ["@iconify/types@2.0.0", "", {}, "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg=="], - "@iconify/utils": ["@iconify/utils@3.1.3", "", { "dependencies": { "@antfu/install-pkg": "^1.1.0", "@iconify/types": "^2.0.0", "import-meta-resolve": "^4.2.0" } }, "sha512-LPKOXPn/zV+zis1oOfGWogaXVpqUybF3ZS6SCZIsz8vg0ivVp9+fVqyYB7xq0aiST/VhUQYGO1qo6uoYSiEJqw=="], - - "@inquirer/ansi": ["@inquirer/ansi@2.0.7", "", {}, "sha512-3eTuUO1vH2cZm2ZKHeQxnOqlTi9EfZDGgIe3BL3I4u+rJHocr9Fz86M4fjYABPvFnQG/gGK551HqDiIcETwU6Q=="], - - "@inquirer/checkbox": ["@inquirer/checkbox@5.2.1", "", { "dependencies": { "@inquirer/ansi": "^2.0.7", "@inquirer/core": "^11.2.1", "@inquirer/figures": "^2.0.7", "@inquirer/type": "^4.0.7" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-b6xmA/VlTe0ZgDQHDui+Nav470u7u49nRd8/iuhOcQPO9Ch7lGuogydhi2VOmNlZ+zXcM8IcPuNSwQcdJaF/kw=="], - - "@inquirer/confirm": ["@inquirer/confirm@6.1.1", "", { "dependencies": { "@inquirer/core": "^11.2.1", "@inquirer/type": "^4.0.7" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-eb8DBZcz/2qHWQda4rk2JiQk5h9QV/cVHi1yjt0f69WFZMRFn0sJTye3EAP8icut8UDMjQPsaH5KbcOogefrFQ=="], - - "@inquirer/core": ["@inquirer/core@11.2.1", "", { "dependencies": { "@inquirer/ansi": "^2.0.7", "@inquirer/figures": "^2.0.7", "@inquirer/type": "^4.0.7", "cli-width": "^4.1.0", "fast-wrap-ansi": "^0.2.0", "mute-stream": "^3.0.0", "signal-exit": "^4.1.0" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-Qd6GJT1yVyrZZCfN8W2qKF5ApmqryXRhRKCuip8h01x2w/esJQ2XIYc6f9abMIHgKQdBfFTSOdbHRLAhuM09UA=="], - - "@inquirer/editor": ["@inquirer/editor@5.2.2", "", { "dependencies": { "@inquirer/core": "^11.2.1", "@inquirer/external-editor": "^3.0.3", "@inquirer/type": "^4.0.7" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-ZRVd/oD+sYsUd5zVm0NflqEzlqfYCyHNsqkHl2oWXEUHs12tCbcSFi+wVFEvD8+LGRaMUsVrE7qeo6lSG/S1Vg=="], - - "@inquirer/expand": ["@inquirer/expand@5.1.1", "", { "dependencies": { "@inquirer/core": "^11.2.1", "@inquirer/type": "^4.0.7" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-YmQpenjbFSHAK3sOd44puHh3V1KXXr+JiNpUztoSQ4drLh2rTVzTap/YtlAVu/5xavifIlBfNEzJ/neZJ1a/1g=="], - - "@inquirer/external-editor": ["@inquirer/external-editor@3.0.3", "", { "dependencies": { "chardet": "^2.1.1", "iconv-lite": "^0.7.2" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-6thf5I8q7lZwzGLAxPaaGEREEkZ3nyePPDQ1oyobblxmEE8mqTLguScP7pDjUTAibiyb4hfXl+qjUEJ+di/aNA=="], - - "@inquirer/figures": ["@inquirer/figures@2.0.7", "", {}, "sha512-aJ8TBPOGB6f/2qziPfElISTCEd5XOYTFckA2SGjhNmiKzfK/u4ot3v0DUzGVdUnKjN10EqnnEPck36BkyfLnJw=="], - - "@inquirer/input": ["@inquirer/input@5.1.2", "", { "dependencies": { "@inquirer/core": "^11.2.1", "@inquirer/type": "^4.0.7" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-9K/DDBSQpOyZSkt6sOVP9Vo0TR7atX2kuILsUu0x3wVcVbe97lJwIJKMLdMw25tDYuXl/qp6erT0Xs1rfmcfZg=="], - - "@inquirer/number": ["@inquirer/number@4.1.1", "", { "dependencies": { "@inquirer/core": "^11.2.1", "@inquirer/type": "^4.0.7" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-XF4IXAbPnGPgw0wsbC/i2tPcyfdZgDpUlhsqU0SfT4IRIGWha6Xm9VRgN5yYxJq+jnyXlfXI/nQ3ulfk0iEICA=="], - - "@inquirer/password": ["@inquirer/password@5.1.1", "", { "dependencies": { "@inquirer/ansi": "^2.0.7", "@inquirer/core": "^11.2.1", "@inquirer/type": "^4.0.7" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-3XBfF7DAsp5qeDsvN5Rd1HmbNokVvEQoUM0QLrRcybC9nX96w3Pbmu7qUsb3IT3J3jBvs2+mTXaKHOUsgHMLzg=="], - - "@inquirer/prompts": ["@inquirer/prompts@8.5.2", "", { "dependencies": { "@inquirer/checkbox": "^5.2.1", "@inquirer/confirm": "^6.1.1", "@inquirer/editor": "^5.2.2", "@inquirer/expand": "^5.1.1", "@inquirer/input": "^5.1.2", "@inquirer/number": "^4.1.1", "@inquirer/password": "^5.1.1", "@inquirer/rawlist": "^5.3.1", "@inquirer/search": "^4.2.1", "@inquirer/select": "^5.2.1" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-IYR/3C/paEVVQYQvdDlFZVjRCJVYHHON0XXMH91KO9GSxs0TdKYWlUdvfQl2EfAHDxUaN3IBffkE/BDTh5nJ6g=="], - - "@inquirer/rawlist": ["@inquirer/rawlist@5.3.1", "", { "dependencies": { "@inquirer/core": "^11.2.1", "@inquirer/type": "^4.0.7" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-QqdTqQddL3qPX/PPrjobpsO25NZ4dWXgTLenrR445L2ptLEYE6Z+PD5c5CNDJNx4ugRgELAIpSIJxZaO2jJ2Og=="], - - "@inquirer/search": ["@inquirer/search@4.2.1", "", { "dependencies": { "@inquirer/core": "^11.2.1", "@inquirer/figures": "^2.0.7", "@inquirer/type": "^4.0.7" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-xJj8QWKRSrfKoBIITLZK61dD3zwo0Rz11fgDImku30/Oe81zMdIdGgrLY2h6RkJ+KZ/GhNYIRMKnH/62qBTA5g=="], - - "@inquirer/select": ["@inquirer/select@5.2.1", "", { "dependencies": { "@inquirer/ansi": "^2.0.7", "@inquirer/core": "^11.2.1", "@inquirer/figures": "^2.0.7", "@inquirer/type": "^4.0.7" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-FlDndEUww8m7BfukO2nJa25vhD+H5jxxCv4oGioKqzyWz3nPHhhw4LKdYRSlXuAx7DsdWia7iyaBPKKS95Evfw=="], - - "@inquirer/type": ["@inquirer/type@4.0.7", "", { "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-t28inv14nMQ1PhKpsJPY+kEs/c00qzeCOS2gTNRyTjG5d6qsVA2fItxW4hkvGZ5lvanGLdtCzVIx5dwdRpN1+g=="], + "@iconify/utils": ["@iconify/utils@3.1.4", "", { "dependencies": { "@antfu/install-pkg": "^1.1.0", "@iconify/types": "^2.0.0", "import-meta-resolve": "^4.2.0" } }, "sha512-b1S7B1k9ohZ+iNTi2ATxbRYG9fTrJmUT0rc46bvVnNxqNRGW7dyo/vRREwyniI5IRN2RSJHDcm+s3BjWrSAjHw=="], "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="], @@ -436,7 +296,7 @@ "@lezer/common": ["@lezer/common@1.5.2", "", {}, "sha512-sxQE460fPZyU3sdc8lafxiPwJHBzZRy/udNFynGQky1SePYBdhkBl1kOagA9uT3pxR8K09bOrmTUqA9wb/PjSQ=="], - "@lezer/css": ["@lezer/css@1.3.3", "", { "dependencies": { "@lezer/common": "^1.2.0", "@lezer/highlight": "^1.0.0", "@lezer/lr": "^1.3.0" } }, "sha512-RzBo8r+/6QJeow7aPHIpGVIH59xTcJXp399820gZoMo9noQDRVpJLheIBUicYwKcsbOYoBRoLZlf2720dG/4Tg=="], + "@lezer/css": ["@lezer/css@1.3.4", "", { "dependencies": { "@lezer/common": "^1.2.0", "@lezer/highlight": "^1.0.0", "@lezer/lr": "^1.3.0" } }, "sha512-N+tn9tej2hPvyKgHEApMOQfHczDJCwxrRFS3SPn9QjYN+uwHvEDnCgKRrb3mxDYxRS8sKMM8fhC3+lc04Abz5Q=="], "@lezer/highlight": ["@lezer/highlight@1.2.3", "", { "dependencies": { "@lezer/common": "^1.3.0" } }, "sha512-qXdH7UqTvGfdVBINrgKhDsVTJTxactNNxLk7+UMwZhU13lMHaOBlJe9Vqp907ya56Y3+ed2tlqzys7jDkTmW0g=="], @@ -446,7 +306,7 @@ "@lezer/lr": ["@lezer/lr@1.4.10", "", { "dependencies": { "@lezer/common": "^1.0.0" } }, "sha512-rnCpTIBafOx4mRp43xOxDJbFipJm/c0cia/V5TiGlhmMa+wsSdoGmUN3w5Bqrks/09Q/D4tNAmWaT8p6NRi77A=="], - "@lezer/markdown": ["@lezer/markdown@1.6.4", "", { "dependencies": { "@lezer/common": "^1.5.0", "@lezer/highlight": "^1.0.0" } }, "sha512-N0SxazMj4k65DBfaf1azqtMZd6u7MqluP84/NZnB/io8Td9aleFmAhz9hcbvSfsxT5tdYlJ5qgv5aMJGY4zEtA=="], + "@lezer/markdown": ["@lezer/markdown@1.7.2", "", { "dependencies": { "@lezer/common": "^1.5.0", "@lezer/highlight": "^1.0.0" } }, "sha512-iTkYvoVcKt3WkeL7qUDyXHONZEwLio4wj8KTNi2dnjQEXBZKMV63BpQrPqfsM+OkvuRbiSTAcycYAsQzLhRNoQ=="], "@lit-labs/ssr-dom-shim": ["@lit-labs/ssr-dom-shim@1.6.0", "", {}, "sha512-VHb0ALPMTlgKjM6yIxxoQNnpKyUKLD04VzeQdsiXkMqkvYlAHxq9glGLmgbb889/1GsohSOAjvQYoiBppXFqrQ=="], @@ -456,27 +316,21 @@ "@lobehub/fluent-emoji": ["@lobehub/fluent-emoji@4.1.0", "", { "dependencies": { "@lobehub/emojilib": "^1.0.0", "antd-style": "^4.1.0", "emoji-regex": "^10.6.0", "es-toolkit": "^1.43.0", "lucide-react": "^0.562.0", "url-join": "^5.0.0" }, "peerDependencies": { "react": "^19.0.0", "react-dom": "^19.0.0" } }, "sha512-R1MB2lfUkDvB7XAQdRzY75c1dx/tB7gEvBPaEEMarzKfCJWmXm7rheS6caVzmgwAlq5sfmTbxPL+un99sp//Yw=="], - "@lobehub/icons": ["@lobehub/icons@5.10.1", "", { "dependencies": { "antd-style": "^4.1.0", "es-toolkit": "^1.45.1", "lucide-react": "^0.469.0", "polished": "^4.3.1" }, "peerDependencies": { "@lobehub/ui": "^5.0.0", "antd": "^6.1.1", "react": "^19.0.0", "react-dom": "^19.0.0" } }, "sha512-KMaE+YqPAXuA8gcmzBFefLa9KgCqmJy9Mg3tlGedrL2coAzCQeps+aqivjejHNMnCDTPnGb+OHvX1um2kT1lQw=="], + "@lobehub/icons": ["@lobehub/icons@5.14.0", "", { "dependencies": { "antd-style": "^4.1.0", "es-toolkit": "^1.49.0", "lucide-react": "^0.469.0", "polished": "^4.3.1" }, "peerDependencies": { "@lobehub/ui": "^5.0.0", "antd": "^6.1.1", "react": "^19.0.0", "react-dom": "^19.0.0" } }, "sha512-ZQADILVrprfGOGw6YfFl2IDbb8C+DLIHtkkdEjI0J2lP3jPS+s3qQ2t4DPjoNqhGF/fdpU7a2dEFusSe/G1d0w=="], - "@lobehub/ui": ["@lobehub/ui@5.15.6", "", { "dependencies": { "@ant-design/cssinjs": "^2.1.2", "@base-ui/react": "1.5.0", "@dnd-kit/core": "^6.3.1", "@dnd-kit/modifiers": "^9.0.0", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", "@emoji-mart/data": "^1.2.1", "@emoji-mart/react": "^1.1.1", "@emotion/is-prop-valid": "^1.4.0", "@floating-ui/react": "^0.27.19", "@giscus/react": "^3.1.0", "@mdx-js/mdx": "^3.1.1", "@mdx-js/react": "^3.1.1", "@pierre/diffs": "^1.1.19", "@radix-ui/react-slot": "^1.2.4", "@shikijs/core": "^4.0.2", "@shikijs/transformers": "^4.0.2", "@splinetool/runtime": "0.9.526", "ahooks": "^3.9.7", "antd-style": "^4.1.0", "chroma-js": "^3.2.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "dayjs": "^1.11.20", "emoji-mart": "^5.6.0", "es-toolkit": "^1.46.0", "fast-deep-equal": "^3.1.3", "immer": "^11.1.4", "katex": "^0.16.45", "leva": "^0.10.1", "lucide-react": "^1.11.0", "marked": "^17.0.6", "mermaid": "^11.14.0", "motion": "^12.38.0", "numeral": "^2.0.6", "polished": "^4.3.1", "query-string": "^9.3.1", "rc-collapse": "^4.0.0", "rc-footer": "^0.6.8", "rc-image": "^7.12.0", "rc-input-number": "^9.5.0", "rc-menu": "^9.16.1", "re-resizable": "^6.11.2", "react-avatar-editor": "^15.1.0", "react-error-boundary": "^6.1.1", "react-hotkeys-hook": "^5.2.4", "react-markdown": "^10.1.0", "react-merge-refs": "^3.0.2", "react-rnd": "^10.5.3", "react-zoom-pan-pinch": "^3.7.0", "rehype-github-alerts": "^4.2.0", "rehype-katex": "^7.0.1", "rehype-raw": "^7.0.0", "remark-breaks": "^4.0.0", "remark-cjk-friendly": "^2.0.1", "remark-gfm": "^4.0.1", "remark-github": "^12.0.0", "remark-math": "^6.0.0", "remend": "^1.3.0", "shiki": "^4.0.2", "shiki-stream": "^0.1.4", "swr": "^2.4.1", "ts-md5": "^2.0.1", "unified": "^11.0.5", "url-join": "^5.0.0", "use-merge-value": "^1.2.0", "uuid": "^13.0.0", "virtua": "^0.49.1" }, "peerDependencies": { "@lobehub/fluent-emoji": "^4.0.0", "@lobehub/icons": "^5.0.0", "antd": "^6.1.1", "react": "^19.0.0", "react-dom": "^19.0.0" } }, "sha512-sjx95F9viJWRuhFlhe+pN7y6/b+dv9U6ysMcO8F+sFUQNYTBfUl80UkBLclHQc2adpxdrkzEN+0g0AXeFsCC1g=="], + "@lobehub/ui": ["@lobehub/ui@5.22.3", "", { "dependencies": { "@ant-design/cssinjs": "^2.1.2", "@base-ui/react": "1.6.0", "@dnd-kit/core": "^6.3.1", "@dnd-kit/modifiers": "^9.0.0", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", "@emoji-mart/data": "^1.2.1", "@emoji-mart/react": "^1.1.1", "@emotion/is-prop-valid": "^1.4.0", "@floating-ui/react": "^0.27.19", "@giscus/react": "^3.1.0", "@mdx-js/mdx": "^3.1.1", "@mdx-js/react": "^3.1.1", "@pierre/diffs": "1.2.12", "@radix-ui/react-slot": "^1.3.0", "@shikijs/core": "^4.3.1", "@shikijs/stream": "^4.3.1", "@shikijs/transformers": "^4.3.1", "@splinetool/runtime": "1.12.98", "ahooks": "^3.9.7", "antd-style": "^4.1.0", "chroma-js": "^3.2.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "dayjs": "^1.11.21", "emoji-mart": "^5.6.0", "es-toolkit": "^1.49.0", "fast-deep-equal": "^3.1.3", "hast-util-to-jsx-runtime": "^2.3.6", "html-url-attributes": "^3.0.1", "immer": "^11.1.11", "katex": "^0.17.0", "leva": "^0.10.1", "lucide-react": "^1.24.0", "marked": "^18.0.6", "mermaid": "^11.16.0", "motion": "^12.0.0", "numeral": "^2.0.6", "polished": "^4.3.1", "query-string": "^9.4.1", "rc-collapse": "^4.0.0", "rc-footer": "^0.6.8", "rc-image": "^7.12.0", "rc-input-number": "^9.5.0", "rc-menu": "^9.16.1", "re-resizable": "^6.11.2", "react-avatar-editor": "^15.1.0", "react-error-boundary": "^6.1.2", "react-hotkeys-hook": "^5.3.3", "react-markdown": "^10.1.0", "react-merge-refs": "^3.0.2", "react-rnd": "^10.5.3", "react-zoom-pan-pinch": "^4.0.3", "rehype-github-alerts": "^4.2.0", "rehype-katex": "^7.0.1", "rehype-raw": "^7.0.0", "remark-breaks": "^4.0.0", "remark-cjk-friendly": "^2.3.1", "remark-gfm": "^4.0.1", "remark-github": "^12.0.0", "remark-math": "^6.0.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.1.2", "remend": "^1.3.0", "shiki": "^4.3.1", "swr": "^2.4.2", "ts-md5": "^2.0.1", "unified": "^11.0.5", "url-join": "^5.0.0", "use-merge-value": "^1.2.0", "uuid": "^14.0.1", "vfile": "^6.0.3", "virtua": "^0.49.3" }, "peerDependencies": { "@lobehub/fluent-emoji": "^4.0.0", "@lobehub/icons": "^5.0.0", "antd": "^6.1.1", "react": "^19.0.0", "react-dom": "^19.0.0" } }, "sha512-sw773r8aXCDKacJgxtshJHLk5flpIRAHHAGImKCD3Z6USO4C5lj9Q6JK4B67c18gSOE7X2JsI8QK6Korim0dzA=="], - "@marijn/find-cluster-break": ["@marijn/find-cluster-break@1.0.2", "", {}, "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g=="], + "@marijn/find-cluster-break": ["@marijn/find-cluster-break@1.0.3", "", {}, "sha512-FY+MKLBoTsLNJF/eLWaOsXGdz6uh3Iu1axjPf6TUq92IYumcTcXWHoS747JARLkcdlJ/Waiaxc5wQfFO8jC6NA=="], "@mdx-js/mdx": ["@mdx-js/mdx@3.1.1", "", { "dependencies": { "@types/estree": "^1.0.0", "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", "@types/mdx": "^2.0.0", "acorn": "^8.0.0", "collapse-white-space": "^2.0.0", "devlop": "^1.0.0", "estree-util-is-identifier-name": "^3.0.0", "estree-util-scope": "^1.0.0", "estree-walker": "^3.0.0", "hast-util-to-jsx-runtime": "^2.0.0", "markdown-extensions": "^2.0.0", "recma-build-jsx": "^1.0.0", "recma-jsx": "^1.0.0", "recma-stringify": "^1.0.0", "rehype-recma": "^1.0.0", "remark-mdx": "^3.0.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.0.0", "source-map": "^0.7.0", "unified": "^11.0.0", "unist-util-position-from-estree": "^2.0.0", "unist-util-stringify-position": "^4.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" } }, "sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ=="], "@mdx-js/react": ["@mdx-js/react@3.1.1", "", { "dependencies": { "@types/mdx": "^2.0.0" }, "peerDependencies": { "@types/react": ">=16", "react": ">=16" } }, "sha512-f++rKLQgUVYDAtECQ6fn/is15GkEH9+nZPM3MS0RcxVqoTfawHvDlSCH7JbMhAM6uJ32v3eXLvLmLvjGu7PTQw=="], - "@mermaid-js/parser": ["@mermaid-js/parser@1.1.1", "", { "dependencies": { "@chevrotain/types": "~11.1.1" } }, "sha512-VuHdsYMK1bT6X2JbcAaWAhugTRvRBRyuZgd+c22swUeI9g/ntaxF7CY7dYarhZovofCbUNO0G7JesfmNtjYOCw=="], + "@mermaid-js/parser": ["@mermaid-js/parser@1.2.0", "", { "dependencies": { "@chevrotain/types": "~11.1.2" } }, "sha512-oYPyv8A4As1yH5Bx+04iQEQxXuIQDe0GKCNSRgao6z8AM9jixXIfP0vsppRLvGf+nKIOb9/LdpWA4YuJiVvESA=="], "@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.29.0", "", { "dependencies": { "@hono/node-server": "^1.19.9", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ=="], - "@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.5", "", { "dependencies": { "@tybys/wasm-util": "^0.10.2" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" } }, "sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q=="], - - "@noble/ciphers": ["@noble/ciphers@1.3.0", "", {}, "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw=="], - - "@noble/curves": ["@noble/curves@1.9.7", "", { "dependencies": { "@noble/hashes": "1.8.0" } }, "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw=="], - - "@noble/hashes": ["@noble/hashes@1.8.0", "", {}, "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A=="], + "@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.6", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" } }, "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg=="], "@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="], @@ -602,101 +456,101 @@ "@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.57.0", "", { "os": "win32", "cpu": "x64" }, "sha512-bQJdH9i4RRfw55jm7+8/xS7GzHLLTbHx4huhrrDxQJaJtbSDbsyOnODvP1ftT7EG0KFKAYO2S+q6AcioXODx8w=="], - "@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.72.0", "", { "os": "android", "cpu": "arm" }, "sha512-zhCmvn+1Mj3UchAc/90i99S0t7jJUsHmFVSPg4UWrjO8b8eaSGwscgO6QAUtvHBstkjQwBttQNswEnAF1mIQdA=="], + "@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.74.0", "", { "os": "android", "cpu": "arm" }, "sha512-+gHd12muVI9ZLBaWLPkHt3Fj7jihFjgQ1MGtBaRL8vWrWrI0P7dLUty/cHrHS0oqPYIRgQUJsPu2CExQuMcwNw=="], - "@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.72.0", "", { "os": "android", "cpu": "arm64" }, "sha512-mtH+aY/ozv1eZoCUC2owjFAtyNBKHpJHygKeEu9zXXnQGW1Q2/qOpvx+I+Lf23+TvTz66F4iiXUbl2cGvoLPCQ=="], + "@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.74.0", "", { "os": "android", "cpu": "arm64" }, "sha512-xjKdoMB+H+RCOByv/7l7nfIGW9mlOisqYdcyC75UqYuQecLpReAeEYUf2CNeDEI3KtmUgxpRw/+c63y4AeF/Bw=="], - "@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.72.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-EvnajNPDtfknB3ZieeOOyDTwJn9QXDiwfnF4ZDQqART6RG6hjY4WigQcZdGoK2dkB3e1vrmEzN9aYbQCUkh/gQ=="], + "@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.74.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-iUK7wvc6sejMKsC+Pt67mntoF5weFcyEunhZfLJceU6gL419mexz5wBkSx/EnkFBExMLNtOi9fnDSc5xfK0IzQ=="], - "@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.72.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-ZkCdEa/G80A7vEHfeCDz/+L3m33DE73v32mDKhgOIgz8Uwf0DFcK7+uu6qC+7LEhmz5fpOe1osWKyjSNMydFIQ=="], + "@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.74.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-ggKc/tn5SJ1u2yG2izC6VKODfYKV8MQ2AicJlNzOjuyrC29udvOef6/JzK2r32xqCnBDLFouR1VCkjzEI0/N9Q=="], - "@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.72.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-NroXv2vh+sxVY1uya/rM5pjhx1hm8BzlYpx9q67QP0Xhw5MH2bf5GJylpvLEC+781p1Xli/317EoV9AlGwViag=="], + "@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.74.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-u++dH/43jy9hTLbneaWlS0gla/Bp1JdwJ2zgevCl8nDFUh6qRCGMxcL0f0lb7By3A9p/LfFr+7cG4HU1hG856g=="], - "@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.72.0", "", { "os": "linux", "cpu": "arm" }, "sha512-0NDywYgfj279Ou/BcQuCYSj7NJwBfmWn5qc5uGO/Ny7fUWmXyIpvawqX/8acQlWG6IXelJsJhj+JAy6sjsKj0A=="], + "@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.74.0", "", { "os": "linux", "cpu": "arm" }, "sha512-Sj1zmtFDVTPeIbIz4ZfcXAbFHqCmKCXdCUlAJzvTF7I20NTH1RDpoF2PhkqNODutJzVhJYmm3oz0GwgY+tvE2g=="], - "@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.72.0", "", { "os": "linux", "cpu": "arm" }, "sha512-4vpXB06h65Ezsy4hRyrGjGrfa1SkVPii09yaajiYhmVpgsFiLD+KNxIx/BNAY+XiO+i1yqp9HHdwqM8VTqa5XQ=="], + "@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.74.0", "", { "os": "linux", "cpu": "arm" }, "sha512-//PKyQb/tQXcHArx2f7z+oVI/eMS2Jpv+edNuAtOrgIhWdGcpHxogveAxzmF2rpH1AIHp4Hq04RF/rgJdiICnQ=="], - "@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.72.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-immaN4g2ZGFiOkKrvRX9LvzZdd2GkQM5wR+UyzYyUuyhUTXGQ4HKUJH18xp4G8OfhCVaVAJfKZxwE1r8+4hhaQ=="], + "@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.74.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-/k1Me+aX2tjuH10K62mLS0y8cLkJBHX6Ce0xPK+eWeel4bSdEGZ8dv4+hYMzg0GrSmjwy4yAYsDPeEeKBft/2w=="], - "@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.72.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-JGHS9Mnr7iWyyLDxgCv1MhzVpAckgptg00F2gnxt/GD7lQ2SW1BRcxHqhSTaSdDpjWRrBkBxMMh4+Hn3aVtExg=="], + "@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.74.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-3tFSjBxc5D8/zvjEuLvOqcA8ZXKD0+6NuaVO/edeamNc49MoAsbfaC9s1UiwODwgF6slGaF8yJA2TPkukd77tg=="], - "@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.72.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-AOYgBZqxNshrg83P9v0RYv+m8s10Cqkj4/PxXFDhcS3k7FqsIG5+CxErshZCIN7G8iy4Y+VGfAsuEdar8AcbBg=="], + "@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.74.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-9QggtPkSPXOCTu8Szis7auOK/sC7KdQaN+/TujP7YVVhzCAOhgdRfgv8uEz0r2tk5xdgus5rLYUrCDoZNtiRUw=="], - "@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.72.0", "", { "os": "linux", "cpu": "none" }, "sha512-QMybPS5ij3/vrKG67mqzHwW++91sYxK/PPUVi6SBtNCEzW4niS52fVBdXbQ6nou0wWbUPEpx8Sl/ZjtgE3clXA=="], + "@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.74.0", "", { "os": "linux", "cpu": "none" }, "sha512-VM5VPUJ4DJIWiK+AZn8FScUqMr6OFrCAYybMYjEEi7W13ParI64MByiXTkKMqZpBmvQ9zxl9Ebq2VUOiZRJYUg=="], - "@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.72.0", "", { "os": "linux", "cpu": "none" }, "sha512-gOc3W7JV0PXRpIL7stUlLe3Wa9Gp0Kdlup87IT3gHDvPKck2xNgMIl/Gs2lldYY2lyXZDC4rWi3hmoLUobkgbQ=="], + "@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.74.0", "", { "os": "linux", "cpu": "none" }, "sha512-SaDY1gh9rOA592J54g+gu5hkOFFQBZsMmIYHs+NRHG+Uq0OxtuuCXMWQ3vu1830Eugv5uMXyjG+bv2Z9y4IXjw=="], - "@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.72.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-rpGxph+FjjHcYI5q6uxB3Az+tnfmEnDbSA8+PK9ZE/VzyUAkvBOMeuY7ZQMhu5mpZH7YQDsTdW6Cx4kV/msc6w=="], + "@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.74.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-ZATQeHZCyr6MbDveg0obD5sxLHFOghtOdC5jwVwYlvFWqtFOxctgFEG6Ef/64hYvZrWyhyCckB10AelqLopeDA=="], - "@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.72.0", "", { "os": "linux", "cpu": "x64" }, "sha512-WND+uhf/Ko13SLqQMWQUgsZuLvYYEvL0ZKgg0tgGYfLqxG7l8Ju123fHDMJyYSDl5E3bUbpFUuii/OvMreFQzw=="], + "@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.74.0", "", { "os": "linux", "cpu": "x64" }, "sha512-+aIvJyrdeD7LwCQ2WYLMUWNmnbeDRSPb40aBYtPjD9+PTqUwgJnk+HK5yLfSMeqXrMrDhE9uTmtt2y50tvjhHw=="], - "@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.72.0", "", { "os": "linux", "cpu": "x64" }, "sha512-SrpbrUL70nG9vh6zP4/oKHWgLuHquwsr7MW9XOn0olBVgh10Uqr8qscKhQoBGEn6olK/IUpn5GSKcdQ5AjUhGA=="], + "@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.74.0", "", { "os": "linux", "cpu": "x64" }, "sha512-XyktaR8lhK2qWiCK0Tk8oYD+/cgn+oHA6ddRnxSSXUKkkojkV78CmShZUxQF+yrBFs0SuW+JBOPG6hecyc/iZg=="], - "@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.72.0", "", { "os": "none", "cpu": "arm64" }, "sha512-qkrsEn6NmgFKr7U/QnezQMb+q/vzAy0Dd9Y95gQGQTyjzDLN+HRZMuM5u70iyH4nBLCfKBzhjMsYCehKay2jyg=="], + "@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.74.0", "", { "os": "none", "cpu": "arm64" }, "sha512-mzbjrPl4neaVUiJ1fUiEUxTGaSZBoiKtaoB6jmIpz9S+VOA2vDYmJpihQ82w6178V5jxziclTg8Cgj5yF6tTDg=="], - "@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.72.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-LWR6ZlFZph+KPjXv8opgZsXRDCdrdQe8VL8Cg9zxCoBS73h6znzZpydVgmdnwj8mB9AuSM5jxEgDJDpQkjboeg=="], + "@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.74.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-vUAe9okpS2Oa5+lX67lqHMuNUvfkleRKwrUDJ/WJBsgmddvZ1mrsh2HVmuFDRzqFELhaJhFaCNOuR6a7L3rtIA=="], - "@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.72.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-yt6HEh7IsHvtjRWtmeZRX134eaXKHq5Gnqlf1xBJdJl1JtdoRUEJw3nAxpZoUDS860cX/foKbztO441anVBtVQ=="], + "@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.74.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-yyXXJyYYSXL4I8K8jAWjJs+J3fa9gH2JmEbo4f5adm+1tNC9itseicBNuwK7BDHvqQ5J534s+yDULu89vYL2ZQ=="], - "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.72.0", "", { "os": "win32", "cpu": "x64" }, "sha512-b2eKFD2hX7tIwmo/cyH6TDq8vzWRZ2qNHrzoGntUTmq0h3zQh/uX3eTSHCwI8OB/ADQfJCRelLItK8BsxuucDA=="], + "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.74.0", "", { "os": "win32", "cpu": "x64" }, "sha512-VTC9IYTIMrVUk/i6Ms1ohzzDKZFkWn0KU2OBbPBzgmVZ2V30165T/zK4LztTr0Xgp9fZ1qQZ1rsZAu/rEmySlA=="], - "@pierre/diffs": ["@pierre/diffs@1.2.5", "", { "dependencies": { "@pierre/theme": "1.0.3", "@shikijs/transformers": "^3.0.0", "diff": "8.0.3", "hast-util-to-html": "9.0.5", "lru_map": "0.4.1", "shiki": "^3.0.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } }, "sha512-uYOz3Kfs5ED0qY0VraUXzylsEKvZPTVdexboM3QKPx/qBZmTT9F3lKAFuPpY5aIrV04sdHtoFCKStyzEu99U2A=="], + "@pierre/diffs": ["@pierre/diffs@1.2.12", "", { "dependencies": { "@pierre/theme": "1.1.0", "@pierre/theming": "0.0.2", "@shikijs/transformers": "^3.0.0 || ^4.0.0", "diff": "9.0.0", "hast-util-to-html": "9.0.5", "lru_map": "0.4.1", "shiki": "^3.0.0 || ^4.0.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } }, "sha512-pY/gmgWL03WnagqCyCnBi3QtRXUv4hCIY6FYqd5b1ZGaoI6a4Bsji8j+yRl2RfzPh/8Hf19rCl1GE80G6a1cLQ=="], - "@pierre/theme": ["@pierre/theme@1.0.3", "", {}, "sha512-sWHv11TMoqKxKDgTIk5VbhQjdPhs8DCcBxbjh3mRlS3YOM/OcrWoGX6MM8eBGn9cUu3M46Py0JnxsG2nJaFTuA=="], + "@pierre/theme": ["@pierre/theme@1.1.0", "", {}, "sha512-GC2OWTAfTIIWWYhPCygwG8t2EtePQkRfON4MI2rwIkJylmiyqIttJID2dCL8sUD8cNdEvYkEyfEHHKMeCiDLoQ=="], - "@primer/octicons": ["@primer/octicons@19.28.0", "", { "dependencies": { "object-assign": "^4.1.1" } }, "sha512-FCpW9ZXI9U9h7wjYSXFQK4Zyp1Roc/kF8nymak4bYccWaWoUixbnIr4u8UYiRoPRSglm+23TZEyUZHrgNql9Jw=="], + "@pierre/theming": ["@pierre/theming@0.0.2", "", { "peerDependencies": { "@pierre/theme": "^1.1.0", "@shikijs/themes": "^3.0.0 || ^4.0.0", "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0", "shiki": "^3.0.0 || ^4.0.0" }, "optionalPeers": ["@pierre/theme", "@shikijs/themes", "react", "react-dom", "shiki"] }, "sha512-QM1M4stXfnzfaE8I8YbjXSApV8c+2dBsXJj8eYg9WTpBR/cTmCZIcfGnN4p13iRrYu2Br/R/OJfEL7uR8Qjctw=="], - "@radix-ui/primitive": ["@radix-ui/primitive@1.1.3", "", {}, "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg=="], + "@primer/octicons": ["@primer/octicons@19.29.2", "", { "dependencies": { "object-assign": "^4.1.1" } }, "sha512-n7zuEgzTz70m5dmBqpYuE8zpeLKxgf73OeDudQWByNzIwWLb0I/UlxqdCLkk6Qb338O7em0aNuhVfExNBVCfTQ=="], - "@radix-ui/react-arrow": ["@radix-ui/react-arrow@1.1.7", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-F+M1tLhO+mlQaOWspE8Wstg+z6PwxwRd8oQ8IXceWz92kfAmalTRf0EjrouQeo7QssEPfCn05B4Ihs1K9WQ/7w=="], + "@radix-ui/primitive": ["@radix-ui/primitive@1.1.6", "", {}, "sha512-w9hl+724uYEgCGR3bhuRepjBtrNB/6gkhCnAf58Ke+SLbHPPQqVZZB59z60roB+5H+nh3nWTcdJhQdFMEydWmw=="], - "@radix-ui/react-compose-refs": ["@radix-ui/react-compose-refs@1.1.2", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg=="], + "@radix-ui/react-arrow": ["@radix-ui/react-arrow@1.1.12", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.7" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-ltXCE0glRomMZ9+u10d9o1Go+edqa1aLxufH59JRNNM3Yz1uvaeNWSaS1HeVh1X64agtdBG5JA1W1I6ySqWiwA=="], - "@radix-ui/react-context": ["@radix-ui/react-context@1.1.2", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jCi/QKUM2r1Ju5a3J64TH2A5SpKAgh0LpknyqdQ4m6DCV0xJ2HG1xARRwNGPQfi1SLdLWZ1OJz6F4OMBBNiGJA=="], + "@radix-ui/react-compose-refs": ["@radix-ui/react-compose-refs@1.1.3", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-rYOP8OMnuuPMQF1uhPVlGNcCDlkokKqGFE3JcxFViIkAXP7EvFWUliJAstrapypaBLJNHbZL6jGhbVDGTwmVhA=="], - "@radix-ui/react-dialog": ["@radix-ui/react-dialog@1.1.15", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-focus-guards": "1.1.3", "@radix-ui/react-focus-scope": "1.1.7", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3", "@radix-ui/react-use-controllable-state": "1.2.2", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.6.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-TCglVRtzlffRNxRMEyR36DGBLJpeusFcgMVD9PZEzAKnUs1lKCgX5u9BmC2Yg+LL9MgZDugFFs1Vl+Jp4t/PGw=="], + "@radix-ui/react-context": ["@radix-ui/react-context@1.2.0", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-fOE+JtN9rygNZkCnHRBEP0TAvLldlhyOxMsbwFvTP4nAs+nBmfnna+o/Zski2wkmY1YMrFC0aSzsHoLY47iLrg=="], - "@radix-ui/react-dismissable-layer": ["@radix-ui/react-dismissable-layer@1.1.11", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-escape-keydown": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Nqcp+t5cTB8BinFkZgXiMJniQH0PsUt2k51FUhbdfeKvc4ACcG2uQniY/8+h1Yv6Kza4Q7lD7PQV0z0oicE0Mg=="], + "@radix-ui/react-dialog": ["@radix-ui/react-dialog@1.1.20", "", { "dependencies": { "@radix-ui/primitive": "1.1.6", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.2.0", "@radix-ui/react-dismissable-layer": "1.1.16", "@radix-ui/react-focus-guards": "1.1.4", "@radix-ui/react-focus-scope": "1.1.13", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-portal": "1.1.14", "@radix-ui/react-presence": "1.1.8", "@radix-ui/react-primitive": "2.1.7", "@radix-ui/react-slot": "1.3.0", "@radix-ui/react-use-controllable-state": "1.2.4", "@radix-ui/react-use-layout-effect": "1.1.2", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.7.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-cngVJcvK0yMvR7wICJpv+1uW3Qw4T7QM5sdbb+oE/lxOdTdvF00oaRpWUjVgmjyXe3J+xh7eZyXZlVF3g2g59g=="], - "@radix-ui/react-focus-guards": ["@radix-ui/react-focus-guards@1.1.3", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-0rFg/Rj2Q62NCm62jZw0QX7a3sz6QCQU0LpZdNrJX8byRGaGVTqbrW9jAoIAHyMQqsNpeZ81YgSizOt5WXq0Pw=="], + "@radix-ui/react-dismissable-layer": ["@radix-ui/react-dismissable-layer@1.1.16", "", { "dependencies": { "@radix-ui/primitive": "1.1.6", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-primitive": "2.1.7", "@radix-ui/react-use-callback-ref": "1.1.2", "@radix-ui/react-use-effect-event": "0.0.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-t45h68IjFx0ccBnPJqk0X6ecv69LkCFWd6DNCFQX56mUnVEXZbNOLCH/u9fHlAjFZ1RrFdl8/m4zev7B7NyhXQ=="], - "@radix-ui/react-focus-scope": ["@radix-ui/react-focus-scope@1.1.7", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-t2ODlkXBQyn7jkl6TNaw/MtVEVvIGelJDCG41Okq/KwUsJBwQ4XVZsHAVUkK4mBv3ewiAS3PGuUWuY2BoK4ZUw=="], + "@radix-ui/react-focus-guards": ["@radix-ui/react-focus-guards@1.1.4", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-cot/aB/mOm0IYVYTTmQcEEK1M48lZWi8FlYe5nDPQQ8NYZUlXEFgncJ9p2Kzer3RKSrY7cTTpEMLZKNo9QoP5Q=="], - "@radix-ui/react-id": ["@radix-ui/react-id@1.1.1", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-kGkGegYIdQsOb4XjsfM97rXsiHaBwco+hFI66oO4s9LU+PLAC5oJ7khdOVFxkhsmlbpUqDAvXw11CluXP+jkHg=="], + "@radix-ui/react-focus-scope": ["@radix-ui/react-focus-scope@1.1.13", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-primitive": "2.1.7", "@radix-ui/react-use-callback-ref": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-dE04aPEuP9rvKKT0d0KjSOtTEYNg6bmCYFsoSJpfC+y91Hic28ZfDCGgv6aJ+2Kw/LBXYipMZpyqVj/OD3Z8Gg=="], - "@radix-ui/react-popper": ["@radix-ui/react-popper@1.2.8", "", { "dependencies": { "@floating-ui/react-dom": "^2.0.0", "@radix-ui/react-arrow": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-layout-effect": "1.1.1", "@radix-ui/react-use-rect": "1.1.1", "@radix-ui/react-use-size": "1.1.1", "@radix-ui/rect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-0NJQ4LFFUuWkE7Oxf0htBKS6zLkkjBH+hM1uk7Ng705ReR8m/uelduy1DBo0PyBXPKVnBA6YBlU94MBGXrSBCw=="], + "@radix-ui/react-id": ["@radix-ui/react-id@1.1.2", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-orBC88futVpqCmhX1p4cvquNHsELQ+w+vBJnuj3ftETI5bJb0bZn3Tqu3SWN2IOcPycTnMGnhwoermvISt72sA=="], - "@radix-ui/react-portal": ["@radix-ui/react-portal@1.1.9", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-bpIxvq03if6UNwXZ+HTK71JLh4APvnXntDc6XOX8UVq4XQOVl7lwok0AvIl+b8zgCw3fSaVTZMpAPPagXbKmHQ=="], + "@radix-ui/react-popper": ["@radix-ui/react-popper@1.3.4", "", { "dependencies": { "@floating-ui/react-dom": "^2.0.0", "@radix-ui/react-arrow": "1.1.12", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.2.0", "@radix-ui/react-primitive": "2.1.7", "@radix-ui/react-use-callback-ref": "1.1.2", "@radix-ui/react-use-layout-effect": "1.1.2", "@radix-ui/react-use-rect": "1.1.2", "@radix-ui/react-use-size": "1.1.2", "@radix-ui/rect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-PXnCa3XgTQk0FegMctxgqJXtFLZe4IFJdbUkB7jKSCKEpb6utEO4S9Vog/pkyCfEPdzM331gvE4xpztmBAfMng=="], - "@radix-ui/react-presence": ["@radix-ui/react-presence@1.1.5", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-/jfEwNDdQVBCNvjkGit4h6pMOzq8bHkopq458dPt2lMjx+eBQUohZNG9A7DtO/O5ukSbxuaNGXMjHicgwy6rQQ=="], + "@radix-ui/react-portal": ["@radix-ui/react-portal@1.1.14", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.7", "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-REwjAGPMa3J9oyDE4cuWkZbwnCbbyky66NurquQklXMSDn67cl6oGFx2gO7KZhPtFNbNw9xTWNrti3VIhgluYw=="], - "@radix-ui/react-primitive": ["@radix-ui/react-primitive@2.1.3", "", { "dependencies": { "@radix-ui/react-slot": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ=="], + "@radix-ui/react-presence": ["@radix-ui/react-presence@1.1.8", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-0hhyrQdXMaATgq4ammLG9+iPqsXxzZkgTSIxdrJHdfLnXO4Uo5L7BoO3/Xf0AEaettadGZWGGJMw6ujzQvIpGA=="], - "@radix-ui/react-slot": ["@radix-ui/react-slot@1.2.4", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Jl+bCv8HxKnlTLVrcDE8zTMJ09R9/ukw4qBs/oZClOfoQk/cOTbDn+NceXfV7j09YPVQUryJPHurafcSg6EVKA=="], + "@radix-ui/react-primitive": ["@radix-ui/react-primitive@2.1.7", "", { "dependencies": { "@radix-ui/react-slot": "1.3.0" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-bC3NiwsprbxKjuon9l7X6BUTw7FPVzEYaL92MPEY5SCd/9hUTPXVFtVwRix7778wtRsVao+zE062gL79FZleeQ=="], - "@radix-ui/react-tooltip": ["@radix-ui/react-tooltip@1.2.8", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-popper": "1.2.8", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-visually-hidden": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-tY7sVt1yL9ozIxvmbtN5qtmH2krXcBCfjEiCgKGLqunJHvgvZG2Pcl2oQ3kbcZARb1BGEHdkLzcYGO8ynVlieg=="], + "@radix-ui/react-slot": ["@radix-ui/react-slot@1.3.0", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-MojKku4U/miO8Av4Dkb+ctMAQx7JmY96LmtDQlAarCRtd7rN52QCSzBF+XAvr5S6coSVj9HEPBgHAHKEJVk/WA=="], - "@radix-ui/react-use-callback-ref": ["@radix-ui/react-use-callback-ref@1.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-FkBMwD+qbGQeMu1cOHnuGB6x4yzPjho8ap5WtbEJ26umhgqVXbhekKUQO+hZEL1vU92a3wHwdp0HAcqAUF5iDg=="], + "@radix-ui/react-tooltip": ["@radix-ui/react-tooltip@1.2.13", "", { "dependencies": { "@radix-ui/primitive": "1.1.6", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.2.0", "@radix-ui/react-dismissable-layer": "1.1.16", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-popper": "1.3.4", "@radix-ui/react-portal": "1.1.14", "@radix-ui/react-presence": "1.1.8", "@radix-ui/react-primitive": "2.1.7", "@radix-ui/react-slot": "1.3.0", "@radix-ui/react-use-controllable-state": "1.2.4", "@radix-ui/react-use-layout-effect": "1.1.2", "@radix-ui/react-visually-hidden": "1.2.8" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-56XPNYGMnGBcPyiBTaEXB7IGPybbsdNkFgSv90SCrHkXnu2Av1HhsyZMegzXlTu/QHA3V6/l22GZCv9iEoiqmQ=="], - "@radix-ui/react-use-controllable-state": ["@radix-ui/react-use-controllable-state@1.2.2", "", { "dependencies": { "@radix-ui/react-use-effect-event": "0.0.2", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg=="], + "@radix-ui/react-use-callback-ref": ["@radix-ui/react-use-callback-ref@1.1.2", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-xCso9j1/u8sEgP1RNHjFrXJLApL8LiqOkI1R4ywuN00rxWdYg4oQXuwKLS3i0j5NWLromUD27/4nlxj2UFVvIw=="], - "@radix-ui/react-use-effect-event": ["@radix-ui/react-use-effect-event@0.0.2", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA=="], + "@radix-ui/react-use-controllable-state": ["@radix-ui/react-use-controllable-state@1.2.4", "", { "dependencies": { "@radix-ui/primitive": "1.1.6", "@radix-ui/react-use-effect-event": "0.0.3", "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-cx2DixxmSfjCcEoRvDvy1NLd6SWK94XFcEEOZUcharUlXbmahFQGKCfwdKZL2ub34iIwOPOEFVF80xb+yfLYiA=="], - "@radix-ui/react-use-escape-keydown": ["@radix-ui/react-use-escape-keydown@1.1.1", "", { "dependencies": { "@radix-ui/react-use-callback-ref": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g=="], + "@radix-ui/react-use-effect-event": ["@radix-ui/react-use-effect-event@0.0.3", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-6c8ZqvPTWILEKnyVkP53EGRCcpnJiKTC21sS/6R1GF5xKyHJJWQEPfkqlcgUkdRQivd6tb23abUwe4ngWmY0JA=="], - "@radix-ui/react-use-layout-effect": ["@radix-ui/react-use-layout-effect@1.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ=="], + "@radix-ui/react-use-layout-effect": ["@radix-ui/react-use-layout-effect@1.1.2", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jrBWOxZITuGcnjRCM2t2U5ZPkCLxD+Ym6DjfssS5haTj2iiak/DOb64JeN6OdLfLgptb6/e2kKR+ZuTrGoZTPA=="], - "@radix-ui/react-use-rect": ["@radix-ui/react-use-rect@1.1.1", "", { "dependencies": { "@radix-ui/rect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-QTYuDesS0VtuHNNvMh+CjlKJ4LJickCMUAqjlE3+j8w+RlRpwyX3apEQKGFzbZGdo7XNG1tXa+bQqIE7HIXT2w=="], + "@radix-ui/react-use-rect": ["@radix-ui/react-use-rect@1.1.2", "", { "dependencies": { "@radix-ui/rect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-d8a+bBY/FxikNPlgJJoaBHZX+zKVbWHYJGTLnLvveQgFSTntkGdEKv3JDtHrMS0DNYpllz2nRsTLGLKYttbpmw=="], - "@radix-ui/react-use-size": ["@radix-ui/react-use-size@1.1.1", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-ewrXRDTAqAXlkl6t/fkXWNAhFX9I+CkKlw6zjEwk86RSPKwZr3xpBRso655aqYafwtnbpHLj6toFzmd6xdVptQ=="], + "@radix-ui/react-use-size": ["@radix-ui/react-use-size@1.1.2", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-giWQp+4mxjBPt4KZ0MmyuykFNWfbDxKt4x+fPkRYmgRFJSbCZFzUglvMb/Kjn38tm10YP4ufiQZDx3zna4LU6w=="], - "@radix-ui/react-visually-hidden": ["@radix-ui/react-visually-hidden@1.2.3", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-pzJq12tEaaIhqjbzpCuv/OypJY/BPavOofm+dbab+MHLajy277+1lLm6JFcGgF5eskJ6mquGirhXY2GD/8u8Ug=="], + "@radix-ui/react-visually-hidden": ["@radix-ui/react-visually-hidden@1.2.8", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.7" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-FjsQEpkNBJJYiPSat6jh2LGKLPX2jAoDVS3AZSBNX3cOUoEGhw/f+z2FCY8Cf1NkoYIbytJ1f4mlWPQpR+MjVg=="], - "@radix-ui/rect": ["@radix-ui/rect@1.1.1", "", {}, "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw=="], + "@radix-ui/rect": ["@radix-ui/rect@1.1.2", "", {}, "sha512-xnXE7wG13PI+cxieVssYXlQJuYVRhH9NBoxt3KNwzghDIA69GMm7d4wXRouHIYjE+KvS6U/MsMO73NdS2MH9ZA=="], - "@rc-component/async-validator": ["@rc-component/async-validator@5.1.0", "", { "dependencies": { "@babel/runtime": "^7.24.4" } }, "sha512-n4HcR5siNUXRX23nDizbZBQPO0ZM/5oTtmKZ6/eqL0L2bo747cklFdZGRN2f+c9qWGICwDzrhW0H7tE9PptdcA=="], + "@rc-component/async-validator": ["@rc-component/async-validator@6.0.0", "", { "dependencies": { "@babel/runtime": "^7.24.4" } }, "sha512-D3AGQwdyE58gmvx6waVSXJ80JGO+IY5L2O8HDnSOex7JNlzB3GuN/4hyHNTdhy2qtOhkpbIjmeAN3tL993wKbA=="], - "@rc-component/cascader": ["@rc-component/cascader@1.15.0", "", { "dependencies": { "@rc-component/select": "~1.6.0", "@rc-component/tree": "~1.3.0", "@rc-component/util": "^1.4.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-ZzpMtwFCRo3fbXHuDnncARJMZQjdqA2w7aDuPofNQt+aDx39st1hgfIpEwTBLhe2Hqsvs/zOr8RTtgxTkCPySw=="], + "@rc-component/cascader": ["@rc-component/cascader@1.17.0", "", { "dependencies": { "@rc-component/select": "~1.8.0", "@rc-component/tree": "~1.3.2", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-3cVNG0zrQF1PoXq262L3wGCU+/YLEC1mGSVHDl577dQmA0ZKkXFbY6nwyXo+beCcM7buo49t24jkr+QZdL7O8w=="], "@rc-component/checkbox": ["@rc-component/checkbox@2.0.0", "", { "dependencies": { "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-3CXGPpAR9gsPKeO2N78HAPOzU30UdemD6HGJoWVJOpa6WleaGB5kzZj3v6bdTZab31YuWgY/RxV3VKPctn0DwQ=="], @@ -704,15 +558,15 @@ "@rc-component/color-picker": ["@rc-component/color-picker@3.1.1", "", { "dependencies": { "@ant-design/fast-color": "^3.0.1", "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-OHaCHLHszCegdXmIq2ZRIZBN/EtpT6Wm8SG/gpzLATHbVKc/avvuKi+zlOuk05FTWvgaMmpxAko44uRJ3M+2pg=="], - "@rc-component/context": ["@rc-component/context@2.0.1", "", { "dependencies": { "@rc-component/util": "^1.3.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-HyZbYm47s/YqtP6pKXNMjPEMaukyg7P0qVfgMLzr7YiFNMHbK2fKTAGzms9ykfGHSfyf75nBbgWw+hHkp+VImw=="], + "@rc-component/context": ["@rc-component/context@2.0.2", "", { "dependencies": { "@rc-component/util": "^1.11.0" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-uiGpAlblCNlziHPwj4S4Iy/oemeuz/hR03mbiEjTCXwsqOIN3BOzsRMyDwpyO5Fm0vIEEJRUf9ZtbRLbhksuTA=="], - "@rc-component/dialog": ["@rc-component/dialog@1.9.0", "", { "dependencies": { "@rc-component/motion": "^1.1.3", "@rc-component/portal": "^2.1.0", "@rc-component/util": "^1.9.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-zbAAogkg4kkKum79sLE6M+vq1jSAW25zdkafrahgcTP9t9S//SD634Znd1A4c8F2Gc12ZKnehGLsVaaOvZzD2A=="], + "@rc-component/dialog": ["@rc-component/dialog@1.10.0", "", { "dependencies": { "@rc-component/motion": "^1.3.3", "@rc-component/portal": "^2.1.0", "@rc-component/util": "^1.9.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-eDukNlz9vNszAGv7i3zKXdxEd3wgVmNxuJijYt8zvTh17QwTu8KK/bdURRd/lU4qaMzhO1HKKmMrwOnkaw0BvQ=="], "@rc-component/drawer": ["@rc-component/drawer@1.4.2", "", { "dependencies": { "@rc-component/motion": "^1.1.4", "@rc-component/portal": "^2.1.3", "@rc-component/util": "^1.9.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-1ib+fZEp6FBu+YvcIktm+nCQ+Q+qIpwpoaJH6opGr4ofh2QMq+qdr5DLC4oCf5qf3pcWX9lUWPYX652k4ini8Q=="], - "@rc-component/dropdown": ["@rc-component/dropdown@1.0.2", "", { "dependencies": { "@rc-component/trigger": "^3.0.0", "@rc-component/util": "^1.2.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.11.0", "react-dom": ">=16.11.0" } }, "sha512-6PY2ecUSYhDPhkNHHb4wfeAya04WhpmUSKzdR60G+kMNVUCX2vjT/AgTS0Lz0I/K6xrPMJ3enQbwVpeN3sHCgg=="], + "@rc-component/dropdown": ["@rc-component/dropdown@1.0.3", "", { "dependencies": { "@rc-component/trigger": "^3.0.0", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.11.0", "react-dom": ">=16.11.0" } }, "sha512-YTST/N6kpqpDz3IMuM/PSSZnrDpSOA6dgHv12gPA90ZTSLv2CoqkZ0+9NtwTY6BeO7dstPblSic2QJg7dSFy/g=="], - "@rc-component/form": ["@rc-component/form@1.8.2", "", { "dependencies": { "@rc-component/async-validator": "^5.1.0", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-ZidCvOLmM9Xr+3vzk4UAoR7Aj1W/5IHyrzlBB7sNkygpTeRVrohQSo4TN7W/nARTH+nt8zSAPsn4BEl4zLEO2g=="], + "@rc-component/form": ["@rc-component/form@1.8.5", "", { "dependencies": { "@rc-component/async-validator": "^6.0.0", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-d24EYtvUOBhxEtSd/EqIu9DaMuqrWF2IRIvAFCTM6NQ/GJIYNr8DvEpUSUlv2uPxEJ0ZPwYQ+wwlGIAaiHvdrw=="], "@rc-component/image": ["@rc-component/image@1.9.0", "", { "dependencies": { "@rc-component/motion": "^1.0.0", "@rc-component/portal": "^2.1.2", "@rc-component/util": "^1.10.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-khF7w7xkBH5B1bsBcI1FSUZdkyd1aqpl2eYyILCqCzzQH3XdfehGUaZTnptyaJJfs09/R5hv9jXWyazOMFIClQ=="], @@ -720,13 +574,13 @@ "@rc-component/input-number": ["@rc-component/input-number@1.6.2", "", { "dependencies": { "@rc-component/mini-decimal": "^1.0.1", "@rc-component/util": "^1.4.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-Gjcq7meZlCOiWN1t1xCC+7/s85humHVokTBI7PJgTfoyw5OWF74y3e6P8PHX104g9+b54jsodFIzyaj6p8LI9w=="], - "@rc-component/mentions": ["@rc-component/mentions@1.9.0", "", { "dependencies": { "@rc-component/input": "~1.3.0", "@rc-component/menu": "~1.3.0", "@rc-component/trigger": "^3.0.0", "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-WUwfFKDSOF5S9UPsNsXcLYtzjTxBGsftTXWRbZuxX6BYrsySISTnujfJNgaaQ6qVzaCDJ35QUkZKvsYxip1C5g=="], + "@rc-component/mentions": ["@rc-component/mentions@1.10.0", "", { "dependencies": { "@rc-component/input": "~1.3.0", "@rc-component/menu": "~1.4.0", "@rc-component/trigger": "^3.0.0", "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-CI1njYUVY0NjHtLhNoVmXlJyy568Sfep9Wsak6vmGjtT6uazx98djGYlCXz2xkHhEm73g91Y3MTvzUyE5avI7w=="], - "@rc-component/menu": ["@rc-component/menu@1.3.1", "", { "dependencies": { "@rc-component/motion": "^1.1.4", "@rc-component/overflow": "^1.0.0", "@rc-component/trigger": "^3.0.0", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-pSZl9nBPgKgxN0aaW7NilIBEwWsc+43S+ulGdWAg9afak96dNOGWsGx0DLLBB1VQsAJvo6bQMTDzXoPlEHsBEw=="], + "@rc-component/menu": ["@rc-component/menu@1.4.1", "", { "dependencies": { "@rc-component/motion": "^1.1.4", "@rc-component/overflow": "^1.0.0", "@rc-component/trigger": "^3.0.0", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-3GsVRoQ4cnF/AoIQ4P+Z1haBfgfBPQfLT1RJY3Nu4DzOnheTslfCiGSPj7bv/cLj5sW5pHqN25dDXGP3JELAlQ=="], - "@rc-component/mini-decimal": ["@rc-component/mini-decimal@1.1.3", "", { "dependencies": { "@babel/runtime": "^7.18.0" } }, "sha512-bk/FJ09fLf+NLODMAFll6CfYrHPBioTedhW6lxDBuuWucJEqFUd4l/D/5JgIi3dina6sYahB8iuPAZTNz2pMxw=="], + "@rc-component/mini-decimal": ["@rc-component/mini-decimal@1.1.4", "", { "dependencies": { "@babel/runtime": "^7.18.0" } }, "sha512-xiuXcaCwyOWpD8a8scdExFl+bntNphAW8XeenL1ig2en0AAZY0Pcp4pC0dI22qJ+NvxKn9RoNIoRdqYU3BLH4w=="], - "@rc-component/motion": ["@rc-component/motion@1.3.2", "", { "dependencies": { "@rc-component/util": "^1.2.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-itfd+GztzJYAb04Z4RkEub1TbJAfZc2Iuy8p44U44xD1F5+fNYFKI3897ijlbIyfvXkTmMm+KGcjkQQGMHywEQ=="], + "@rc-component/motion": ["@rc-component/motion@1.3.3", "", { "dependencies": { "@rc-component/util": "^1.11.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-Xh3IszxvlSv3/PLYFyC2UZi9LNB83yOnkB/LNmRzaypZLvkhqUIPS7MQpGZcCMWrNsXV2p6YTSWbSGvFpEle9A=="], "@rc-component/mutate-observer": ["@rc-component/mutate-observer@2.0.1", "", { "dependencies": { "@rc-component/util": "^1.2.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-AyarjoLU5YlxuValRi+w8JRH2Z84TBbFO2RoGWz9d8bSu0FqT8DtugH3xC3BV7mUwlmROFauyWuXFuq4IFbH+w=="], @@ -734,15 +588,15 @@ "@rc-component/overflow": ["@rc-component/overflow@1.0.1", "", { "dependencies": { "@babel/runtime": "^7.11.1", "@rc-component/resize-observer": "^1.0.1", "@rc-component/util": "^1.4.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-syfmgAABaHCnCDzPwHZ/2tuvIcpOO3jefYZMmfkN+pmo8HKTzsfhS57vxo4ksPdN0By+uWVJhJWNFozNBxi2eA=="], - "@rc-component/pagination": ["@rc-component/pagination@1.2.0", "", { "dependencies": { "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-YcpUFE8dMLfSo6OARJlK6DbHHvrxz7pMGPGmC/caZSJJz6HRKHC1RPP001PRHCvG9Z/veD039uOQmazVuLJzlw=="], + "@rc-component/pagination": ["@rc-component/pagination@1.4.0", "", { "dependencies": { "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-CW1g7P9V8u+e8JQdUsl2RWg+GCsoee0mtJjZUCCxn/vb3jzOwDKm6hAdwddHCVBfWJ58eGUBZz3IvnU8rRktjw=="], - "@rc-component/picker": ["@rc-component/picker@1.10.0", "", { "dependencies": { "@rc-component/overflow": "^1.0.0", "@rc-component/resize-observer": "^1.0.0", "@rc-component/trigger": "^3.6.15", "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "date-fns": ">= 2.x", "dayjs": ">= 1.x", "luxon": ">= 3.x", "moment": ">= 2.x", "react": ">=16.9.0", "react-dom": ">=16.9.0" }, "optionalPeers": ["date-fns", "dayjs", "luxon", "moment"] }, "sha512-vVOXP2RVWozwpERGUFAehVH1Jz6o/uRrAb9qSZm1LC+iJs8rvEwFo1bzz2jlOYV+uWwu0dIuG86tnDui14Ea0w=="], + "@rc-component/picker": ["@rc-component/picker@1.11.0", "", { "dependencies": { "@rc-component/overflow": "^1.0.0", "@rc-component/resize-observer": "^1.0.0", "@rc-component/trigger": "^3.6.15", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "date-fns": ">= 2.x", "dayjs": ">= 1.x", "luxon": ">= 3.x", "moment": ">= 2.x", "react": ">=16.9.0", "react-dom": ">=16.9.0" }, "optionalPeers": ["date-fns", "dayjs", "luxon", "moment"] }, "sha512-6qXGKtoJvO8sUd17m5cyNEbEJub0zflCHnaZTBBmj63DPRZYc0WEHN8rp6hFSl+yMCJS/dJY5G+1fQ8bLCuD7A=="], "@rc-component/portal": ["@rc-component/portal@1.1.2", "", { "dependencies": { "@babel/runtime": "^7.18.0", "classnames": "^2.3.2", "rc-util": "^5.24.4" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-6f813C0IsasTZms08kfA8kPAGxbbkYToa8ALaiDIGGECU4i9hj8Plgbx0sNJDrey3EtHO30hmdaxtT0138xZcg=="], "@rc-component/progress": ["@rc-component/progress@1.0.2", "", { "dependencies": { "@rc-component/util": "^1.2.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-WZUnH9eGxH1+xodZKqdrHke59uyGZSWgj5HBM5Kwk5BrTMuAORO7VJ2IP5Qbm9aH3n9x3IcesqHHR0NWPBC7fQ=="], - "@rc-component/qrcode": ["@rc-component/qrcode@1.1.1", "", { "dependencies": { "@babel/runtime": "^7.24.7" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-LfLGNymzKdUPjXUbRP+xOhIWY4jQ+YMj5MmWAcgcAq1Ij8XP7tRmAXqyuv96XvLUBE/5cA8hLFl9eO1JQMujrA=="], + "@rc-component/qrcode": ["@rc-component/qrcode@2.0.0", "", { "dependencies": { "@babel/runtime": "^7.24.7" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-aAv3QhPP1xyafuTZOxub6a54pCeBnN3IwQkpETrBtthq4BL5IgxnCbuoBWPDpdLw1y1j6BgBUCAKV92+yX06Dw=="], "@rc-component/rate": ["@rc-component/rate@1.0.1", "", { "dependencies": { "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-bkXxeBqDpl5IOC7yL7GcSYjQx9G8H+6kLYQnNZWeBYq2OYIv1MONd6mqKTjnnJYpV0cQIU2z3atdW0j1kttpTw=="], @@ -750,17 +604,17 @@ "@rc-component/segmented": ["@rc-component/segmented@1.3.0", "", { "dependencies": { "@babel/runtime": "^7.11.1", "@rc-component/motion": "^1.1.4", "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.0.0", "react-dom": ">=16.0.0" } }, "sha512-5J/bJ01mbDnoA6P/FW8SxUvKn+OgUSTZJPzCNnTBntG50tzoP7DydGhqxp7ggZXZls7me3mc2EQDXakU3iTVFg=="], - "@rc-component/select": ["@rc-component/select@1.6.15", "", { "dependencies": { "@rc-component/overflow": "^1.0.0", "@rc-component/trigger": "^3.0.0", "@rc-component/util": "^1.3.0", "@rc-component/virtual-list": "^1.0.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": "*", "react-dom": "*" } }, "sha512-SyVCWnqxCQZZcQvQJ/CxSjx2bGma6ds/HtnpkIfZVnt6RoEgbqUmHgD6vrzNarNXwbLXerwVzWwq8F3d1sst7g=="], + "@rc-component/select": ["@rc-component/select@1.8.2", "", { "dependencies": { "@rc-component/overflow": "^1.0.0", "@rc-component/trigger": "^3.0.0", "@rc-component/util": "^1.11.1", "@rc-component/virtual-list": "^1.2.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": "*", "react-dom": "*" } }, "sha512-HQ9zuYqjfZTlcEMWlU1GAPBajd2OHIMVHyjZSGVTCVARwkfCgvXZMTEn0cduy3L+ejAKkaZluOQvxovZoaJaQw=="], - "@rc-component/slider": ["@rc-component/slider@1.0.1", "", { "dependencies": { "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-uDhEPU1z3WDfCJhaL9jfd2ha/Eqpdfxsn0Zb0Xcq1NGQAman0TWaR37OWp2vVXEOdV2y0njSILTMpTfPV1454g=="], + "@rc-component/slider": ["@rc-component/slider@1.1.1", "", { "dependencies": { "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-LSzgWGYDgeCDgR4r1XlU29gbYws6HpLnvJd/uMhLeW/vQgxldeR+Wb4uzHDCHiYEbr1bnEHWdjkPxjJRHxuiig=="], "@rc-component/steps": ["@rc-component/steps@1.2.2", "", { "dependencies": { "@rc-component/util": "^1.2.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-/yVIZ00gDYYPHSY0JP+M+s3ZvuXLu2f9rEjQqiUDs7EcYsUYrpJ/1bLj9aI9R7MBR3fu/NGh6RM9u2qGfqp+Nw=="], "@rc-component/switch": ["@rc-component/switch@1.0.3", "", { "dependencies": { "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-Jgi+EbOBquje/XNdofr7xbJQZPYJP+BlPfR0h+WN4zFkdtB2EWqEfvkXJWeipflwjWip0/17rNbxEAqs8hVHfw=="], - "@rc-component/table": ["@rc-component/table@1.10.2", "", { "dependencies": { "@rc-component/context": "^2.0.1", "@rc-component/resize-observer": "^1.0.0", "@rc-component/util": "^1.11.1", "@rc-component/virtual-list": "^1.0.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-b3PjqB9Gp25p5t/zq+9QrbXbodkptT8/zvLmwgd2FNPUUtaYyDnQqfxeD5a7ao8E8lpinLHsi2u2vdfPhyNvAw=="], + "@rc-component/table": ["@rc-component/table@1.10.4", "", { "dependencies": { "@rc-component/context": "^2.0.1", "@rc-component/resize-observer": "^1.0.0", "@rc-component/util": "^1.11.1", "@rc-component/virtual-list": "^1.0.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-HwoTnrwc29zeoXkXGhWqzJh8FIibGUxi1jM4LtoSzmR9d5Vv5osUQpZxnXKBP8iOCvyD6BQzZm1nXJRcnrxpAg=="], - "@rc-component/tabs": ["@rc-component/tabs@1.9.1", "", { "dependencies": { "@rc-component/dropdown": "~1.0.0", "@rc-component/menu": "~1.3.0", "@rc-component/motion": "^1.1.3", "@rc-component/resize-observer": "^1.0.0", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-6mY08Fce6aNOHuGsxbzT+f2ekgL9mg1cGGHkittMlVGymjGg+kGupu5v90sRxcUd/paRU9jclLLXtF/PkK1FUA=="], + "@rc-component/tabs": ["@rc-component/tabs@1.11.0", "", { "dependencies": { "@rc-component/dropdown": "~1.0.0", "@rc-component/menu": "~1.4.0", "@rc-component/motion": "^1.1.3", "@rc-component/resize-observer": "^1.0.0", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-hA/drZYOVa/MMIb4M2fWf3yaTyTG4qVuIABmghvEhyfw2nBob5VTH69lMCDjSVKmgODjO6nWlCV+gVn3xBrj5Q=="], "@rc-component/tooltip": ["@rc-component/tooltip@1.4.0", "", { "dependencies": { "@rc-component/trigger": "^3.7.1", "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-8Rx5DCctIlLI4raR0I0xHjVTf1aF48+gKCNeAAo5bmF5VoR5YED+A/XEqzXv9KKqrJDRcd3Wndpxh2hyzrTtSg=="], @@ -768,20 +622,18 @@ "@rc-component/tree": ["@rc-component/tree@1.3.2", "", { "dependencies": { "@rc-component/motion": "^1.0.0", "@rc-component/util": "^1.11.1", "@rc-component/virtual-list": "^1.2.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": "*", "react-dom": "*" } }, "sha512-bJFj46wEkpBPnWyTm18XmgAgNQ/4YvprxMOPPY2a6rmhGJYxLuNKEFiL5Qej4Qctu9wHJm8WW+v2SYskafE0kA=="], - "@rc-component/tree-select": ["@rc-component/tree-select@1.9.0", "", { "dependencies": { "@rc-component/select": "~1.6.0", "@rc-component/tree": "~1.3.0", "@rc-component/util": "^1.4.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": "*", "react-dom": "*" } }, "sha512-GXcFe15a+trUl1/J3OHWQhsVWFpwFpGFK2cqYWZ1sK22Zs3KZTvMwDpzr75PIo1s6QVioVxpE/pRwRopkeDQ6w=="], + "@rc-component/tree-select": ["@rc-component/tree-select@1.11.0", "", { "dependencies": { "@rc-component/select": "~1.8.0", "@rc-component/tree": "~1.3.2", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": "*", "react-dom": "*" } }, "sha512-EhS0X0wtUhBfK4S5TlpSY3MR9ndPMGgujtt1PJW3Ej+ToAlnS/6ohYURtCoXBYGqazUwHmgQGVUDsfpVwhWPkg=="], - "@rc-component/trigger": ["@rc-component/trigger@3.9.1", "", { "dependencies": { "@rc-component/motion": "^1.1.4", "@rc-component/portal": "^2.2.0", "@rc-component/resize-observer": "^1.1.1", "@rc-component/util": "^1.2.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-LNsYvz60mrLJ/kRvKcHE7boUvcQfVMCfRqZ71x3Fo9AOiZ1KKIEqkzMA8DNvz2V3Bcvir/vwQNn7JF1NPODQ7Q=="], + "@rc-component/trigger": ["@rc-component/trigger@3.10.1", "", { "dependencies": { "@rc-component/motion": "^1.3.3", "@rc-component/portal": "^2.2.1", "@rc-component/resize-observer": "^1.1.2", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-mXlDN0IXdtV8Yqqm8195ECCyrbmfvvfKvwVvSlH0+qvKD6BUF8gRhEjSy0FOcD1+CcDRHgTiX99LoxfQrmh3Cw=="], "@rc-component/upload": ["@rc-component/upload@1.1.1", "", { "dependencies": { "@rc-component/util": "^1.11.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-GvYWSKeaJTOxxC5p6+nOSadzfvXA1h8C/iHFPFZX+szH3JUXrvs+DLiW8YUTBgvMh8m63mJeHrlYlJzAlg+pDA=="], - "@rc-component/util": ["@rc-component/util@1.11.1", "", { "dependencies": { "is-mobile": "^5.0.0", "react-is": "^18.2.0" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-awVlI3ub2vqfqkYxOBc/uQ0efm3jw0wcrhtO/YWLyZfxiKXczKwNbVuhlnyxytDt7H9pbbVQiqr+O6MLATtRYg=="], + "@rc-component/util": ["@rc-component/util@1.12.0", "", { "dependencies": { "is-mobile": "^5.0.0", "react-is": "^19.2.7" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-AEjPL8JVdohIITaiXokyjL9WQ6tKWWjAYK9QU16tGNE9JaQABBQy+hA4H2Lup5MgXy9yY3iLrbZJheuU13hTdQ=="], - "@rc-component/virtual-list": ["@rc-component/virtual-list@1.2.0", "", { "dependencies": { "@babel/runtime": "^7.20.0", "@rc-component/resize-observer": "^1.0.1", "@rc-component/util": "^1.4.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-iavRm1Jo4GDbASQwdGa7jFyk93RvSOo9xHyBT4QL1pgFJj/Fdf1G+3RErH7/7BmAMvx2AkF62mjGYxDbXsK9TQ=="], + "@rc-component/virtual-list": ["@rc-component/virtual-list@1.4.0", "", { "dependencies": { "@babel/runtime": "^8.0.0", "@rc-component/resize-observer": "^1.0.1", "@rc-component/util": "^1.4.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-qoyNStkTJQDezPjBibGA5HNxS9NiKJvemD1bLp7qfyxDlwy7ofPLUP0ZqJ47hR8AKcFaizd0AP/7QWLTLpudKQ=="], "@reduxjs/toolkit": ["@reduxjs/toolkit@2.12.0", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "@standard-schema/utils": "^0.3.0", "immer": "^11.0.0", "redux": "^5.0.1", "redux-thunk": "^3.1.0", "reselect": "^5.1.0" }, "peerDependencies": { "react": "^16.9.0 || ^17.0.0 || ^18 || ^19", "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0" }, "optionalPeers": ["react", "react-redux"] }, "sha512-KiT+RzZbp6mQET+Mg+h2c97+9j1sNflUxQkIHI7Yuzf6Peu+OYpmkn6nbHWmLLWj+1ZODUJFwGZ7gx3L9R9EOw=="], - "@remix-run/router": ["@remix-run/router@1.23.3", "", {}, "sha512-4An71tdz9X8+3sI4Qqqd2LWd9vS39J7sqd9EU4Scw7TJE/qB10Flv/UuqbPVgfQV9XoK8Np6jNquZitnZq5i+Q=="], - "@resvg/resvg-js": ["@resvg/resvg-js@2.4.1", "", { "optionalDependencies": { "@resvg/resvg-js-android-arm-eabi": "2.4.1", "@resvg/resvg-js-android-arm64": "2.4.1", "@resvg/resvg-js-darwin-arm64": "2.4.1", "@resvg/resvg-js-darwin-x64": "2.4.1", "@resvg/resvg-js-linux-arm-gnueabihf": "2.4.1", "@resvg/resvg-js-linux-arm64-gnu": "2.4.1", "@resvg/resvg-js-linux-arm64-musl": "2.4.1", "@resvg/resvg-js-linux-x64-gnu": "2.4.1", "@resvg/resvg-js-linux-x64-musl": "2.4.1", "@resvg/resvg-js-win32-arm64-msvc": "2.4.1", "@resvg/resvg-js-win32-ia32-msvc": "2.4.1", "@resvg/resvg-js-win32-x64-msvc": "2.4.1" } }, "sha512-wTOf1zerZX8qYcMmLZw3czR4paI4hXqPjShNwJRh5DeHxvgffUS5KM7XwxtbIheUW6LVYT5fhT2AJiP6mU7U4A=="], "@resvg/resvg-js-android-arm-eabi": ["@resvg/resvg-js-android-arm-eabi@2.4.1", "", { "os": "android", "cpu": "arm" }, "sha512-AA6f7hS0FAPpvQMhBCf6f1oD1LdlqNXKCxAAPpKh6tR11kqV0YIB9zOlIYgITM14mq2YooLFl6XIbbvmY+jwUw=="], @@ -808,69 +660,67 @@ "@resvg/resvg-js-win32-x64-msvc": ["@resvg/resvg-js-win32-x64-msvc@2.4.1", "", { "os": "win32", "cpu": "x64" }, "sha512-vY4kTLH2S3bP+puU5x7hlAxHv+ulFgcK6Zn3efKSr0M0KnZ9A3qeAjZteIpkowEFfUeMPNg2dvvoFRJA9zqxSw=="], - "@rsbuild/core": ["@rsbuild/core@2.1.4", "", { "dependencies": { "@rspack/core": "~2.1.2", "@swc/helpers": "^0.5.23" }, "peerDependencies": { "core-js": ">= 3.0.0" }, "optionalPeers": ["core-js"], "bin": { "rsbuild": "./bin/rsbuild.js" } }, "sha512-kdubx/qB6tXduCdqaW78OULLZJ3ludpuA4mOkDko18THsI1rUy9U34DsaDSnotE8GAvTeme+FX9MnqLEUlg8kQ=="], + "@rsbuild/core": ["@rsbuild/core@2.1.6", "", { "dependencies": { "@rspack/core": "~2.1.4", "@swc/helpers": "^0.5.23" }, "peerDependencies": { "core-js": ">= 3.0.0" }, "optionalPeers": ["core-js"], "bin": { "rsbuild": "./bin/rsbuild.js" } }, "sha512-w2WxblstOgHnDElkqJZVO/jM/EqPaEhg7zqQhON3Xu3Mj9FlVOJx+SgimOtghFzxLt8x7atX4oMUtMTNSZGf0Q=="], "@rsbuild/plugin-react": ["@rsbuild/plugin-react@2.1.0", "", { "dependencies": { "@rspack/plugin-react-refresh": "^2.0.2", "react-refresh": "^0.18.0" }, "peerDependencies": { "@rsbuild/core": "^2.0.0" }, "optionalPeers": ["@rsbuild/core"] }, "sha512-RQTIAWB/CwPjoWt9iAl+8HixeQVgZ7kEIBrWPCixfITyHdiD84h0YpUTpEUuz6kGHw1KXT9mHZ3Rwy6WG7aRDA=="], "@rsbuild/plugin-tailwindcss": ["@rsbuild/plugin-tailwindcss@2.0.3", "", { "dependencies": { "@tailwindcss/webpack": "^4.3.1" }, "peerDependencies": { "@rsbuild/core": "^2.0.0" }, "optionalPeers": ["@rsbuild/core"] }, "sha512-sl7mN0fyoP0W+zEyFR2xEMVAS2cZPlOAqsXwI8Ei9tUSvV7V4G8Xw2WBVCOQ/B4KEFfJ6H1+TEuPlAzHLEfc4g=="], - "@rspack/binding": ["@rspack/binding@2.1.2", "", { "optionalDependencies": { "@rspack/binding-darwin-arm64": "2.1.2", "@rspack/binding-darwin-x64": "2.1.2", "@rspack/binding-linux-arm64-gnu": "2.1.2", "@rspack/binding-linux-arm64-musl": "2.1.2", "@rspack/binding-linux-riscv64-gnu": "2.1.2", "@rspack/binding-linux-riscv64-musl": "2.1.2", "@rspack/binding-linux-x64-gnu": "2.1.2", "@rspack/binding-linux-x64-musl": "2.1.2", "@rspack/binding-wasm32-wasi": "2.1.2", "@rspack/binding-win32-arm64-msvc": "2.1.2", "@rspack/binding-win32-ia32-msvc": "2.1.2", "@rspack/binding-win32-x64-msvc": "2.1.2" } }, "sha512-/mFcRSUW7Pl19KeaBIujJvZYNJQu0wD5D3aa5h+Qcph26v7nmLYlX7eajIHGi8tt2qTZX1lXifw2KLIXKwYaRQ=="], + "@rspack/binding": ["@rspack/binding@2.1.4", "", { "optionalDependencies": { "@rspack/binding-darwin-arm64": "2.1.4", "@rspack/binding-darwin-x64": "2.1.4", "@rspack/binding-linux-arm64-gnu": "2.1.4", "@rspack/binding-linux-arm64-musl": "2.1.4", "@rspack/binding-linux-riscv64-gnu": "2.1.4", "@rspack/binding-linux-riscv64-musl": "2.1.4", "@rspack/binding-linux-x64-gnu": "2.1.4", "@rspack/binding-linux-x64-musl": "2.1.4", "@rspack/binding-wasm32-wasi": "2.1.4", "@rspack/binding-win32-arm64-msvc": "2.1.4", "@rspack/binding-win32-ia32-msvc": "2.1.4", "@rspack/binding-win32-x64-msvc": "2.1.4" } }, "sha512-iye4BaTYtTt0qa39avWwEsUobVxFNhQHr6B8reFeKU7sdaZsC9LUoDR8JAt5gOnbnzFMPdKgrdU/VzkC6rXbIg=="], - "@rspack/binding-darwin-arm64": ["@rspack/binding-darwin-arm64@2.1.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-IYcxareUOYJZz+uNMSIwn+iDRiVyjZNOjoxO/zL4OFaPK8Ncrw0ka/9DqL9Gd7OpnAXN1zK3uS8yD0O1yIYI3Q=="], + "@rspack/binding-darwin-arm64": ["@rspack/binding-darwin-arm64@2.1.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-3Xcs01iw48F4WeE4SHga6bCNb/UEFvtQX4P4eMIaJfGPjTQuxfabGE8yCPm9e3tpLZ5uo+IBnJ6nh5r6tIDOXQ=="], - "@rspack/binding-darwin-x64": ["@rspack/binding-darwin-x64@2.1.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-aoifkILvx/XEHyvg8yW57xu95nx7f9f/3ah1+RguHSNKcJMcoCep9VX1Ct1N0ftqg8MC0JUObc7xWL5W14hmjA=="], + "@rspack/binding-darwin-x64": ["@rspack/binding-darwin-x64@2.1.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-bz/AsCplLs+3fXULPQU9d4r8H4PdeljgHFyItvVIrA/NKZqzQ8sX0topf/zJVZAOtPH7GNnrKjq0/F0U2DHikQ=="], - "@rspack/binding-linux-arm64-gnu": ["@rspack/binding-linux-arm64-gnu@2.1.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-My4m40tyJSgiCEf3bB2KIEX710q3nZg99LIjy+8Zxgi3oZTkg1bFmFRusFU5U4eN5408zfSqDDGvjDE3Yv7o4w=="], + "@rspack/binding-linux-arm64-gnu": ["@rspack/binding-linux-arm64-gnu@2.1.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-x0HQTLU1MusCtNamuXxf3ayEPkvh9uuaq4wVyBqveRkn4FznSOoHUsxTAKMnjGARX+vdLV/y/SwWJRDp2RI4zw=="], - "@rspack/binding-linux-arm64-musl": ["@rspack/binding-linux-arm64-musl@2.1.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-yt+GGWUH7WPE8K97cRc8OpZhH7Pbj1vU+lkvKbDtF/rR8X9a/bJsA/nBqyUV2oBKOVbrp5I8rFZlnDskMqgvKw=="], + "@rspack/binding-linux-arm64-musl": ["@rspack/binding-linux-arm64-musl@2.1.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-SEYCQD9UflKJMkYGnG5nt2gcsqdkgJsQmryBC/jxo+bOuY9gUSReU99FqCt7WRQrsHLbGeAFeTWs1QzItWG/Bw=="], - "@rspack/binding-linux-riscv64-gnu": ["@rspack/binding-linux-riscv64-gnu@2.1.2", "", { "os": "linux", "cpu": "none" }, "sha512-uys8Jyw8Z3ralvICbN/L/nZfy5qELIwpOY72rhIqhoDYwFcL4fmMaY7WsvUcJOjCB2rqOcWPaWKuF2oPvo9iDQ=="], + "@rspack/binding-linux-riscv64-gnu": ["@rspack/binding-linux-riscv64-gnu@2.1.4", "", { "os": "linux", "cpu": "none" }, "sha512-jYtQKtnDRaVfyasvTGY04Z7m+xDWZYVwAIEOB4hP7czM7FVLOMgHlMlvw/EgF0DNHrBthqbPfBIS2tP50CzpEA=="], - "@rspack/binding-linux-riscv64-musl": ["@rspack/binding-linux-riscv64-musl@2.1.2", "", { "os": "linux", "cpu": "none" }, "sha512-JYNVQwqCaRGQWvjHQYzZkIzQiwllMaJwh4Rdu3ww6W2OJcJUqT08sL1pkOtU0iCxT4VUYiRRcp93VGTGpHr8fg=="], + "@rspack/binding-linux-riscv64-musl": ["@rspack/binding-linux-riscv64-musl@2.1.4", "", { "os": "linux", "cpu": "none" }, "sha512-ZgxKjQAm9pidq2kChQO2PqKI9OQpLuGD7iPBuyT0gQg3m1+7vvbbkArLBPzJ12CQHVZvqua7n/QGx8pQjJI2Zw=="], - "@rspack/binding-linux-x64-gnu": ["@rspack/binding-linux-x64-gnu@2.1.2", "", { "os": "linux", "cpu": "x64" }, "sha512-KDoPy0Msf/JLhxgPPrJQzZeB4Qpqd32em8AP5lSW2s6jR5I35dHgAe9xc2A++EQtnSrU4GTn6DBvFC7q84SihQ=="], + "@rspack/binding-linux-x64-gnu": ["@rspack/binding-linux-x64-gnu@2.1.4", "", { "os": "linux", "cpu": "x64" }, "sha512-C53B3e6M4yzlYn4hDxR9cHZV+HqkfFGR0zuhH8QCfdBfN5KyGsmXmujiFU85ANEvBgf9CF8VreBQeJ20lyto/g=="], - "@rspack/binding-linux-x64-musl": ["@rspack/binding-linux-x64-musl@2.1.2", "", { "os": "linux", "cpu": "x64" }, "sha512-66hWmIGvn4zCKAYXJE9Bp5SNSLYnLFq2Ke/efE+ZtWy43Dd5vk9AAOmThVGBwdwmIxmGtHGCp+cAuS4G0wu0TA=="], + "@rspack/binding-linux-x64-musl": ["@rspack/binding-linux-x64-musl@2.1.4", "", { "os": "linux", "cpu": "x64" }, "sha512-UaeG3FRo7e5RameQvWRNQ6KeXF29LEk67U/ohb9tF4U38mKH1OGqhmwCf5yLkqiOSgOi7Ff3ireOZD83Fso1iw=="], - "@rspack/binding-wasm32-wasi": ["@rspack/binding-wasm32-wasi@2.1.2", "", { "dependencies": { "@emnapi/core": "1.11.1", "@emnapi/runtime": "1.11.1", "@napi-rs/wasm-runtime": "1.1.6" }, "cpu": "none" }, "sha512-EB4SqH8DW/E/OmqssNQvnIVGQiVUyYNlA/pcc6Ia4MlTNwu6eNDppcNLrToH+kSZpL4CpHSFfSM3eIsSuar2Rw=="], + "@rspack/binding-wasm32-wasi": ["@rspack/binding-wasm32-wasi@2.1.4", "", { "dependencies": { "@emnapi/core": "1.11.2", "@emnapi/runtime": "1.11.2", "@napi-rs/wasm-runtime": "1.1.6" }, "cpu": "none" }, "sha512-0P1WZEfu7JOPzD/jQfk9U/6gnRFc7RpvYCQaYZVVYZNJ2gU6O0/yLegRGKNK/2L0zjYwiD0ynhOIBVUUERf5Pw=="], - "@rspack/binding-win32-arm64-msvc": ["@rspack/binding-win32-arm64-msvc@2.1.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-T6Fs/g32MRja/UpCq4AdyPRj8tA0cOkcEa4PrAcn/ztUgK8b/qMVxj5mhMI+n7k+kHZQnpeB1Q4HqdSJi6OocA=="], + "@rspack/binding-win32-arm64-msvc": ["@rspack/binding-win32-arm64-msvc@2.1.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-+aStQipk1EakLRPfD+/aQbtmTXfxqSWetcRRDWV3cAsD4ebv1tF8FLKYY1PCaFpQbX1FxzCBGF0KHxkAsi9cxA=="], - "@rspack/binding-win32-ia32-msvc": ["@rspack/binding-win32-ia32-msvc@2.1.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-OtxkFVz14mVL4QK8QriSELn9B6PaYGHw1jGJwVDEzpu2ZxSHCTQPz9dVE1ekYtREEqZUkRU7Fp7VfhJSmjTt2Q=="], + "@rspack/binding-win32-ia32-msvc": ["@rspack/binding-win32-ia32-msvc@2.1.4", "", { "os": "win32", "cpu": "ia32" }, "sha512-7nyrLRQ07j6i6omZuwiwwTI6rpjdy/Su3niLDAG7WsLL21u3/UQQrw6Fvm8SH3XYteghoHLSM3dhgaisuUhdJg=="], - "@rspack/binding-win32-x64-msvc": ["@rspack/binding-win32-x64-msvc@2.1.2", "", { "os": "win32", "cpu": "x64" }, "sha512-Am+nx9fLF3nzgD/K05Bs1Bb+WO8SFLWAYRbXkymaL1r+RQxjRj7jd5ap2PhGOCcfaNA4yVWkAFvmFP92eRu7bQ=="], + "@rspack/binding-win32-x64-msvc": ["@rspack/binding-win32-x64-msvc@2.1.4", "", { "os": "win32", "cpu": "x64" }, "sha512-Z4je7JBaDpO9vvNMgCxlycycRJq+GQwwuXSXagW2xvvGM10Ij63YVtIehSMG9xaW8PED41oc9nWndoEsiD60pA=="], - "@rspack/core": ["@rspack/core@2.1.2", "", { "dependencies": { "@rspack/binding": "2.1.2" }, "peerDependencies": { "@module-federation/runtime-tools": "^0.24.1 || ^2.0.0", "@swc/helpers": "^0.5.23" }, "optionalPeers": ["@module-federation/runtime-tools", "@swc/helpers"] }, "sha512-crpNQKhHfnzrIl4Sa4fjH30Ho5aAPgyqpmJZ41SkUFOzyKHdZKYfE5LF3CMh7MiFQFPPxiiKf5BcpxmtZZx4MQ=="], + "@rspack/core": ["@rspack/core@2.1.4", "", { "dependencies": { "@rspack/binding": "2.1.4" }, "peerDependencies": { "@module-federation/runtime-tools": "^0.24.1 || ^2.0.0", "@swc/helpers": "^0.5.23" }, "optionalPeers": ["@module-federation/runtime-tools", "@swc/helpers"] }, "sha512-lpJgtr+JAXuDAMBJfRJ1LHyWVuYJyhZu6L6aj9t4lipUU03qwakHnzn3vwSCr68PsVvVPzR6NbJE1gJienSV0g=="], "@rspack/plugin-react-refresh": ["@rspack/plugin-react-refresh@2.0.2", "", { "peerDependencies": { "@rspack/core": "^2.0.0", "react-refresh": ">=0.10.0 <1.0.0" }, "optionalPeers": ["@rspack/core"] }, "sha512-dGNZiCxQxgAUI9sah7gd8u+O7OJZRCmqtEJNDOd8xW5RqcieC86F7p5qcShyw6onH5pKf57evpr2VjGbaFGkZg=="], "@sec-ant/readable-stream": ["@sec-ant/readable-stream@0.4.1", "", {}, "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg=="], - "@shikijs/core": ["@shikijs/core@4.3.0", "", { "dependencies": { "@shikijs/primitive": "4.3.0", "@shikijs/types": "4.3.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-EooU3i9F6IAE8kEu+AnGf9DFZWkQBZ+hJn3tLVbsH+61mtQiva5biai66fAA6nvFPXkLgvrh7BrR7YcJU83xQQ=="], + "@shikijs/core": ["@shikijs/core@4.3.1", "", { "dependencies": { "@shikijs/primitive": "4.3.1", "@shikijs/types": "4.3.1", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-ANMDxuaPsNMdDC1m4vfvhlDmJweMwkE5XitTwrq2rWHx5jM+dlm4MmHt2PP6t0uejfR77SuhrhJ0zEijIF/uhA=="], - "@shikijs/engine-javascript": ["@shikijs/engine-javascript@4.3.0", "", { "dependencies": { "@shikijs/types": "4.3.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.6" } }, "sha512-hTv/KiFf2tpiqlACPiztGGurEARWIutB8YUhcrA1pUC7VzzwKO+g5crUocrLztrZ5ro5Z4hbXg7bYclETn3gSQ=="], + "@shikijs/engine-javascript": ["@shikijs/engine-javascript@4.3.1", "", { "dependencies": { "@shikijs/types": "4.3.1", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.6" } }, "sha512-JBItcnPuYq7jVJdZo/vMj94r+szT7XEjHFX+mvFDGSEIbVAXAGyHAHzhbWzpGOwYidCZrErJLLgn2PVeiokHnQ=="], - "@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@4.3.0", "", { "dependencies": { "@shikijs/types": "4.3.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-1vMdN3gHfnKfLYwecUI2ITJI4RhHt96xEaJumVn7Heb0IlJ8WQMIH0Voak+2j22BpSNKdnOfB/pCTPnPm2gq7A=="], + "@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@4.3.1", "", { "dependencies": { "@shikijs/types": "4.3.1", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-OXyNMzg0pews+msMj4cHeqT4xiYKKvbnn6VbdAXxfoFl3SSx4fJTc8FadECuc5/H9p3BzhNAoAUXKwAu9rWYhg=="], - "@shikijs/langs": ["@shikijs/langs@4.3.0", "", { "dependencies": { "@shikijs/types": "4.3.0" } }, "sha512-rnlqFbBRSys9bT4gl/5rw9RnS0W/I84ZldXPkO7cvlEMoV85TyF/aU01N7/NbSR776RNLjrJKjfFUXJR6wN1Cg=="], + "@shikijs/langs": ["@shikijs/langs@4.3.1", "", { "dependencies": { "@shikijs/types": "4.3.1" } }, "sha512-m0l9nsDqgBHvbZbk7A0/kXz/impK3uB/c6rAn6Gpg/uPtdZRQ+alsN/17MU5thb68XTj/4DxkZAotrM0GGSpDQ=="], - "@shikijs/primitive": ["@shikijs/primitive@4.3.0", "", { "dependencies": { "@shikijs/types": "4.3.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-CPkz64PTa5diRW1ggzMZH9VM/du4RNChYgVtgqrFcgruvIybmCvySv8GkiHSczUHXYuuR8TdKEwFx+UnZMpgdg=="], + "@shikijs/primitive": ["@shikijs/primitive@4.3.1", "", { "dependencies": { "@shikijs/types": "4.3.1", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-CXQRQOYy1leqQ8ceTeJdmXv/bsUY++6QyLpXJ94LZAAYj5X2SKRdc5ipguv4NPyGVKItB2PPwUpRNe0Sjh5S1A=="], - "@shikijs/themes": ["@shikijs/themes@4.3.0", "", { "dependencies": { "@shikijs/types": "4.3.0" } }, "sha512-Avgt05YiT+Y3prjIc9lmQxhJzHBcCfR6cjiFW4OyaMBbt2A6trX5rfjUzx+Vj/mE9qpArYjatnqo9XPjQNW/AQ=="], + "@shikijs/stream": ["@shikijs/stream@4.3.1", "", { "dependencies": { "@shikijs/core": "4.3.1" }, "peerDependencies": { "react": "^19.0.0", "solid-js": "^1.9.0", "svelte": "^5.0.0-0", "vue": "^3.2.0" }, "optionalPeers": ["react", "solid-js", "svelte", "vue"] }, "sha512-QsZDisEVgtvnEgLftu/Ng5JkZlPn37AJoJQY330RnFoNcRtszr0JV3ldRLjIpgvl+qPRKF4t6h1P7FQhjQj6Sw=="], - "@shikijs/transformers": ["@shikijs/transformers@4.1.0", "", { "dependencies": { "@shikijs/core": "4.1.0", "@shikijs/types": "4.1.0" } }, "sha512-YbuOcAA3kwqKDU9YSt00dtFLrY5lBXjKU3dWaMATyEyPSqBm9Jqblk/uVICxz7lcjwAHzYaEvIiMWX3mTpogkA=="], + "@shikijs/themes": ["@shikijs/themes@4.3.1", "", { "dependencies": { "@shikijs/types": "4.3.1" } }, "sha512-dgpoJ4WqNi2yTmizQHBJ5zcX6j2lE6icN/0yt4l1kkf16jrY/pwPLoTb1ETsWMz0OBLf9ZNvwmxft+cH+N9qSA=="], - "@shikijs/types": ["@shikijs/types@4.3.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-oc8b9U2SYvofKZk8e/737nIX0qwf6eV2vHFATeObAu7r+mUVpLs8Re0BmVkIjAWAYgkmG/CzLNo7rzuBzRu/wQ=="], + "@shikijs/transformers": ["@shikijs/transformers@4.3.1", "", { "dependencies": { "@shikijs/core": "4.3.1", "@shikijs/types": "4.3.1" } }, "sha512-z6ir0bGDgWcF2FduktEfPgIsdOtIlDiLAjFBgBzE42Q9xHbkkIXZtORHzlLVB71iZP9elEcqKg6keajvOUwE2A=="], + + "@shikijs/types": ["@shikijs/types@4.3.1", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-CHFxE0jztBIZRHH6gxXE7DXUCFXjReEGxZ/j0rfSLGKZuwp2xBYycEP14875DSa9KLL/6700oxIq6oO6ef9K2g=="], "@shikijs/vscode-textmate": ["@shikijs/vscode-textmate@10.0.2", "", {}, "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg=="], "@sindresorhus/merge-streams": ["@sindresorhus/merge-streams@4.0.0", "", {}, "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ=="], - "@so1ve/prettier-config": ["@so1ve/prettier-config@3.26.0", "", { "dependencies": { "@so1ve/prettier-plugin-toml": "3.26.0", "prettier-plugin-astro": "^0.14.1", "prettier-plugin-jsdoc": "^1.8.0" }, "peerDependencies": { "prettier": "^3.7.4" } }, "sha512-DWiWczVdwbolZy/BKlFqsWWLkxarGAhtcyoS7K2u6BUXBFZg6V+87laCvs/UC/kHiucx/IvZXdf3CQtZfoYxxw=="], - - "@so1ve/prettier-plugin-toml": ["@so1ve/prettier-plugin-toml@3.26.0", "", { "peerDependencies": { "prettier": "^3.7.4" } }, "sha512-iFJpSndNdIMnzNKbdXXRqyA2rrLsVqePhX3m+ongWip3BFxmRpfW9pon2FTm7qsZrslu39wQ7wPvIuxbmXZe2g=="], - - "@splinetool/runtime": ["@splinetool/runtime@0.9.526", "", { "dependencies": { "on-change": "^4.0.0", "semver-compare": "^1.0.0" } }, "sha512-qznHbXA5aKwDbCgESAothCNm1IeEZcmNWG145p5aXj4w5uoqR1TZ9qkTHTKLTsUbHeitCwdhzmRqan1kxboLgQ=="], + "@splinetool/runtime": ["@splinetool/runtime@1.12.98", "", { "dependencies": { "on-change": "4.0.0", "semver-compare": "1.0.0" } }, "sha512-UWZH/+4XtNgMMgmDiWhZS55WOwUDGuTj4uH6fiZV6Jol3d3v3z1RRBObspx8GMio0HajOYGg7FJ8TZdyBdpW4A=="], "@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="], @@ -878,67 +728,37 @@ "@stitches/react": ["@stitches/react@1.2.8", "", { "peerDependencies": { "react": ">= 16.3.0" } }, "sha512-9g9dWI4gsSVe8bNLlb+lMkBYsnIKCZTmvqvDG+Avnn69XfmHZKiaMrx7cgTaddq7aTPPmXiTsbFcUy0xgI4+wA=="], - "@swc/core": ["@swc/core@1.15.40", "", { "dependencies": { "@swc/counter": "^0.1.3", "@swc/types": "^0.1.26" }, "optionalDependencies": { "@swc/core-darwin-arm64": "1.15.40", "@swc/core-darwin-x64": "1.15.40", "@swc/core-linux-arm-gnueabihf": "1.15.40", "@swc/core-linux-arm64-gnu": "1.15.40", "@swc/core-linux-arm64-musl": "1.15.40", "@swc/core-linux-ppc64-gnu": "1.15.40", "@swc/core-linux-s390x-gnu": "1.15.40", "@swc/core-linux-x64-gnu": "1.15.40", "@swc/core-linux-x64-musl": "1.15.40", "@swc/core-win32-arm64-msvc": "1.15.40", "@swc/core-win32-ia32-msvc": "1.15.40", "@swc/core-win32-x64-msvc": "1.15.40" }, "peerDependencies": { "@swc/helpers": ">=0.5.17" }, "optionalPeers": ["@swc/helpers"] }, "sha512-2kwzJikRvgtNAG7MwVZY2vEzZjTxKIq5jXOihuSV/8U+Hej8Va22t65aKnJZs3P+NwojZvR8Mf8kyM7O+V8sQg=="], - - "@swc/core-darwin-arm64": ["@swc/core-darwin-arm64@1.15.40", "", { "os": "darwin", "cpu": "arm64" }, "sha512-PaYyclfmQ++77D8ityYvmmVzHv9aG8ROwt2GfG6/ccloy4Hgf80qtOnzb9VYvPsUT7Ty1uhuDRhv3XYpf62qhQ=="], - - "@swc/core-darwin-x64": ["@swc/core-darwin-x64@1.15.40", "", { "os": "darwin", "cpu": "x64" }, "sha512-HbbPzvfLBUXjIB1Ezks+//lNUjmLjfyd63XSwprJgrZaXYdm70kohXPJUWdqKZozolFxbPaO+xtBaiUp6BoueA=="], - - "@swc/core-linux-arm-gnueabihf": ["@swc/core-linux-arm-gnueabihf@1.15.40", "", { "os": "linux", "cpu": "arm" }, "sha512-SlRZsCjOCPR2LvFs0Ri/Xrx/5o5TCt8vl4gW6mX1hEZOG0a625RxzRHpHdAQNGykmAN/7IeaFAJG+QnNmxlHcA=="], - - "@swc/core-linux-arm64-gnu": ["@swc/core-linux-arm64-gnu@1.15.40", "", { "os": "linux", "cpu": "arm64" }, "sha512-Q8byxJt2fh8CR3EUX6snBpy47AoBVm+In/+Z3rjDHMjC38ZvR9/gtUUNCT0tfrn4EdVsO8/QPi59nxrxvqxvBQ=="], - - "@swc/core-linux-arm64-musl": ["@swc/core-linux-arm64-musl@1.15.40", "", { "os": "linux", "cpu": "arm64" }, "sha512-4z0MgHU+7M0pZDqBN1El7mFXDI1SBwinfcUkAyA4v8QrhOIUOZltySt2aStQLZGrdXVXM4Y4ylfiTC04ED+MoQ=="], - - "@swc/core-linux-ppc64-gnu": ["@swc/core-linux-ppc64-gnu@1.15.40", "", { "os": "linux", "cpu": "ppc64" }, "sha512-fLI4iUgeSZu0eRWUXwe6YzPFx9gHbFiPkl8Rp3mJfP8OpNR3nTQCGPvHdDh9xniW7mVvgMY4ni7A4VzqI1KrpA=="], - - "@swc/core-linux-s390x-gnu": ["@swc/core-linux-s390x-gnu@1.15.40", "", { "os": "linux", "cpu": "s390x" }, "sha512-YqeKMAb7d4nQSGMJQ454IlaCENpzcDqhvBE9+CPfdnYpnUXxd+BSrB6Xk0YjW8UyoEhUj4p6quATCxbsp6J3jg=="], - - "@swc/core-linux-x64-gnu": ["@swc/core-linux-x64-gnu@1.15.40", "", { "os": "linux", "cpu": "x64" }, "sha512-7HOuS1iGcme/j/TuL1TfmmLGiMQrjv/GmjyZeydl00FKPtpGXEldwqfI56xgd1YzrzoB2svWjxbGGyQ0TEASxg=="], - - "@swc/core-linux-x64-musl": ["@swc/core-linux-x64-musl@1.15.40", "", { "os": "linux", "cpu": "x64" }, "sha512-h4kZYHc7dpc9P9u4brRJaS8Pl7tPVHAeiLSzw7T5RfIJgAoSdaCMKzI/2Uay9gFhaw8uyCDl0L5q37r0EpAfIA=="], - - "@swc/core-win32-arm64-msvc": ["@swc/core-win32-arm64-msvc@1.15.40", "", { "os": "win32", "cpu": "arm64" }, "sha512-+mQgKZXSj6mV38Zh05QaxSjUDmGP/R2JWlXZTDLSPkDzHU6p3GxN9eeSf5dfyDVU86946fmCvSzyl/ucImx8+A=="], - - "@swc/core-win32-ia32-msvc": ["@swc/core-win32-ia32-msvc@1.15.40", "", { "os": "win32", "cpu": "ia32" }, "sha512-yvwdPLGd25mcj/mNatjNQ0lZujtQD6psH3v9PNmMb+fSzjbNG8KIDxjFWrcV+fsFVLOkyOmdJsFmX7NAFjVyPw=="], - - "@swc/core-win32-x64-msvc": ["@swc/core-win32-x64-msvc@1.15.40", "", { "os": "win32", "cpu": "x64" }, "sha512-OXtKsLU1bVtInzzDEAY2sYiF/rl4tvAnLLLpuMp3HzAOQZ5A+i69AKDhA1YLQTaMAqO3vzyYNVAYVRMPtSYD4w=="], - - "@swc/counter": ["@swc/counter@0.1.3", "", {}, "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ=="], - "@swc/helpers": ["@swc/helpers@0.5.23", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw=="], - "@swc/types": ["@swc/types@0.1.26", "", { "dependencies": { "@swc/counter": "^0.1.3" } }, "sha512-lyMwd7WGgG79RS7EERZV3T8wMdmPq3xwyg+1nmAM64kIhx5yl+juO2PYIHb7vTiPgPCj8LYjsNV2T5wiQHUEaw=="], + "@tailwindcss/node": ["@tailwindcss/node@4.3.3", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "enhanced-resolve": "^5.24.1", "jiti": "^2.7.0", "lightningcss": "1.32.0", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", "tailwindcss": "4.3.3" } }, "sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg=="], - "@tailwindcss/node": ["@tailwindcss/node@4.3.1", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "enhanced-resolve": "5.21.6", "jiti": "^2.7.0", "lightningcss": "1.32.0", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", "tailwindcss": "4.3.1" } }, "sha512-6NDaqRoAMSXD1mr/RXu0HBvNE9a2n5tHPsxu9XHLws8o4Twes5rBM2205SUUiJ9goAtadrN6xTGX0UDEwp/N4A=="], + "@tailwindcss/oxide": ["@tailwindcss/oxide@4.3.3", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.3.3", "@tailwindcss/oxide-darwin-arm64": "4.3.3", "@tailwindcss/oxide-darwin-x64": "4.3.3", "@tailwindcss/oxide-freebsd-x64": "4.3.3", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.3", "@tailwindcss/oxide-linux-arm64-gnu": "4.3.3", "@tailwindcss/oxide-linux-arm64-musl": "4.3.3", "@tailwindcss/oxide-linux-x64-gnu": "4.3.3", "@tailwindcss/oxide-linux-x64-musl": "4.3.3", "@tailwindcss/oxide-wasm32-wasi": "4.3.3", "@tailwindcss/oxide-win32-arm64-msvc": "4.3.3", "@tailwindcss/oxide-win32-x64-msvc": "4.3.3" } }, "sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA=="], - "@tailwindcss/oxide": ["@tailwindcss/oxide@4.3.1", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.3.1", "@tailwindcss/oxide-darwin-arm64": "4.3.1", "@tailwindcss/oxide-darwin-x64": "4.3.1", "@tailwindcss/oxide-freebsd-x64": "4.3.1", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.1", "@tailwindcss/oxide-linux-arm64-gnu": "4.3.1", "@tailwindcss/oxide-linux-arm64-musl": "4.3.1", "@tailwindcss/oxide-linux-x64-gnu": "4.3.1", "@tailwindcss/oxide-linux-x64-musl": "4.3.1", "@tailwindcss/oxide-wasm32-wasi": "4.3.1", "@tailwindcss/oxide-win32-arm64-msvc": "4.3.1", "@tailwindcss/oxide-win32-x64-msvc": "4.3.1" } }, "sha512-yVPyo8RNkabVr3O2EhHEE0Rewu7YKzc1DhIqfL46LKveFrmu9XbDazNOJY7/GRuvw1h6u3utWnR29H/p5JPlgA=="], + "@tailwindcss/oxide-android-arm64": ["@tailwindcss/oxide-android-arm64@4.3.3", "", { "os": "android", "cpu": "arm64" }, "sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw=="], - "@tailwindcss/oxide-android-arm64": ["@tailwindcss/oxide-android-arm64@4.3.1", "", { "os": "android", "cpu": "arm64" }, "sha512-SVlyf61g374l5cHyg8x9kf5xmLcOaxvOTsbsqDnSsDJaKOEFZ7GCvi84VAVGpxojYOs1+3K6M0UjXfqPU8vmOQ=="], + "@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/oxide-darwin-arm64@4.3.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-BiaWatpBcERQFDlOjRDpIVXuFK5PJez5SA4JMg6VYZdBYU+qKfV/vqjcIs+IYmtitf1xYQZTwXvU/8y4lfZUGw=="], - "@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/oxide-darwin-arm64@4.3.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-hVnWLwv+e/l7c4WKyVtHVrIPvYdqWHjRB3MDIqARynzFtnQg85kmQEFCbV9Ja0VVx4xXTIiDWY60Y7iz/iNoDA=="], + "@tailwindcss/oxide-darwin-x64": ["@tailwindcss/oxide-darwin-x64@4.3.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-fAeUqfV5ndhxRwai8cXGzdLvul9utWOmeTkv69unv4ZXixjn61Z+p9lCWdwOwA3TYboG3BwdVuN/RDjhBRl0mw=="], - "@tailwindcss/oxide-darwin-x64": ["@tailwindcss/oxide-darwin-x64@4.3.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-Cf7abu0WVgbhU7ANgPUnSAvm7nCvMweusHb8FnaHlLfv/Caq4GYaEZg7ZImzzmjx4lIAfuS8q+eLIS7A7IzxIg=="], + "@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/oxide-freebsd-x64@4.3.3", "", { "os": "freebsd", "cpu": "x64" }, "sha512-iyf5bV6+wnAlflVeEy7R25dupxTNECZN5QMI0qNT6eT+EgaGdZcKhGkr5SdoaWiLJ3spLqIY9VCeSGrwmtg4kw=="], - "@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/oxide-freebsd-x64@4.3.1", "", { "os": "freebsd", "cpu": "x64" }, "sha512-ZZqzX2Y+GXtXXfqSfpJhDm60OoZfvLHLCgm+J7NVqgHHJjG/m9ugZI77RwTsVd4fnBJuCFP6Ae6kTJb71UdS8g=="], + "@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/oxide-linux-arm-gnueabihf@4.3.3", "", { "os": "linux", "cpu": "arm" }, "sha512-aAYUprJAJQWWbRrPvtjdroZ56Md+JM8pMiopS6xGEwDfLhqj+2ver2p4nU4Mb3CRqcMmNBjo8KkUgcxhkzVQGQ=="], - "@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/oxide-linux-arm-gnueabihf@4.3.1", "", { "os": "linux", "cpu": "arm" }, "sha512-/Ah/xik0LaMYfv9DZ0S/t4pBlBNYOcqtRwusjgovHkvT8ixueWCLyJjsaF5kQIckjb4IT8Q6K6p/iPmZMixYgg=="], + "@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/oxide-linux-arm64-gnu@4.3.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-nDxldcEENOxZRzC2uu9jrutZdAAQtb+8WWDCSnWL1zvBk1+FN+x6MtDViPB5AJMfttVCUhehGWus3XBPgatM/w=="], - "@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/oxide-linux-arm64-gnu@4.3.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-gqdFoVJlw444GvpnheZLHmvTzSxI/cOUUh2KSNejQjTcYkW062SVD+En0rUgD+QV91bz1XGIGtt1HJd48xUGbQ=="], + "@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/oxide-linux-arm64-musl@4.3.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA=="], - "@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/oxide-linux-arm64-musl@4.3.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-Bwv9KwOvE0VKa86xPFif9b9c3Y1NxOV1P0gLti/IYaWEsQYZXDlxfGEtA8mdDZ7SG3wyNXAWYT5SIn3giL57oA=="], + "@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/oxide-linux-x64-gnu@4.3.3", "", { "os": "linux", "cpu": "x64" }, "sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w=="], - "@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/oxide-linux-x64-gnu@4.3.1", "", { "os": "linux", "cpu": "x64" }, "sha512-Ymi8O8T15HYQdOUWUtTI6ldN0neHP85FC+Qz32xTcZ7iJXtem/x8ITev0o1e9e5rkqj4lONZfTRLvkmin1+tKg=="], + "@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/oxide-linux-x64-musl@4.3.3", "", { "os": "linux", "cpu": "x64" }, "sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img=="], - "@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/oxide-linux-x64-musl@4.3.1", "", { "os": "linux", "cpu": "x64" }, "sha512-M+P/91qJ6uILLw4k2G93GMDRAXj61SMvFQYt39AqvUqYgExXpLL5aepfns7sj4HiAQeolirQF9E0lzRvdf4zPQ=="], + "@tailwindcss/oxide-wasm32-wasi": ["@tailwindcss/oxide-wasm32-wasi@4.3.3", "", { "dependencies": { "@emnapi/core": "^1.11.1", "@emnapi/runtime": "^1.11.1", "@emnapi/wasi-threads": "^1.2.2", "@napi-rs/wasm-runtime": "^1.1.4", "@tybys/wasm-util": "^0.10.2", "tslib": "^2.8.1" }, "cpu": "none" }, "sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ=="], - "@tailwindcss/oxide-wasm32-wasi": ["@tailwindcss/oxide-wasm32-wasi@4.3.1", "", { "dependencies": { "@emnapi/core": "^1.10.0", "@emnapi/runtime": "^1.10.0", "@emnapi/wasi-threads": "^1.2.1", "@napi-rs/wasm-runtime": "^1.1.4", "@tybys/wasm-util": "^0.10.2", "tslib": "^2.8.1" }, "cpu": "none" }, "sha512-zsM8uOeqvVGHsAXsJxsT28ttosFahLJKCLOTUBqRAtKnVgGSRitds9T432QiT8b77Yga7JIBkulIRRlJPtYhRA=="], + "@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/oxide-win32-arm64-msvc@4.3.3", "", { "os": "win32", "cpu": "arm64" }, "sha512-3rc292Ca2ceK6Ulcc/bAVnTs/3nDtoPhyEKlgPv+yQJQi/JS/AMJlqzxvlDacL1nekbrcf6bTqp/jV4qgnPxNQ=="], - "@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/oxide-win32-arm64-msvc@4.3.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-aiNvSq9BsVk8V513lDKlrCFAgf8qBMPZTpgEhInL+NwQqs97mYmupVMrPrgBBSL8Pv/0zXu9MrMF9rMun1ZeNg=="], + "@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/oxide-win32-x64-msvc@4.3.3", "", { "os": "win32", "cpu": "x64" }, "sha512-yJ0pwIVc/nYeGoV02WtsN8KYyLQv7kyI2wDnkezyJlGGjkd4QLwDGAwl47YpPJeuI0M0ObaXGSPjvWDPeTPggw=="], - "@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/oxide-win32-x64-msvc@4.3.1", "", { "os": "win32", "cpu": "x64" }, "sha512-xDEyu1rg290472FEGaKHnzyDyh5QH+AlWvsU5hMoMtPpzmKlRI0jaYKCgSHDYtaQWZOYbMaduSyCwFwY4n1HmA=="], - - "@tailwindcss/webpack": ["@tailwindcss/webpack@4.3.1", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "@tailwindcss/node": "4.3.1", "@tailwindcss/oxide": "4.3.1", "tailwindcss": "4.3.1" }, "peerDependencies": { "@rspack/core": "^1.0.0 || ^2.0.0", "webpack": "^5.0.0" }, "optionalPeers": ["@rspack/core", "webpack"] }, "sha512-HM33EjYPbkMlBGcYoVA/pk/hML3wAn2JOnjF79eDWVLuktOhRczDwWsSBQBOWV6LLBVAgGZS/pZ519OHUF8vKg=="], + "@tailwindcss/webpack": ["@tailwindcss/webpack@4.3.3", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "@tailwindcss/node": "4.3.3", "@tailwindcss/oxide": "4.3.3", "tailwindcss": "4.3.3" }, "peerDependencies": { "@rspack/core": "^1.0.0 || ^2.0.0", "webpack": "^5.0.0" }, "optionalPeers": ["@rspack/core", "webpack"] }, "sha512-e7A7ubt+D+MzXAlQcOaDaHMD5oYzxULVdZVjLzGVStIXebGfD4RcVHxBSRP7xE+G8sS3o691zyfIbhm/veOLjQ=="], "@tanstack/history": ["@tanstack/history@1.162.0", "", {}, "sha512-79pf/RkhteYZTRgcR4F9kbk84P2N8rugQJswxfIqovlbRiT3yI7eBE+5QorIrZaOKktsgzRlXh1l/du/xpl4iA=="], @@ -950,7 +770,7 @@ "@tanstack/react-query-devtools": ["@tanstack/react-query-devtools@5.101.2", "", { "dependencies": { "@tanstack/query-devtools": "5.101.2" }, "peerDependencies": { "@tanstack/react-query": "^5.101.2", "react": "^18 || ^19" } }, "sha512-eU7HctdA9gDjqoERoEdzLbw9DiqnBDfh5+Hu0u26gjqoHJezOpQAuiesDL2VvkU+2cPV76zgv0tMZsOrI4LjnQ=="], - "@tanstack/react-router": ["@tanstack/react-router@1.170.17", "", { "dependencies": { "@tanstack/history": "1.162.0", "@tanstack/react-store": "^0.9.3", "@tanstack/router-core": "1.171.14", "isbot": "^5.1.22" }, "peerDependencies": { "react": ">=18.0.0 || >=19.0.0", "react-dom": ">=18.0.0 || >=19.0.0" } }, "sha512-ppLkjCfSMaeug9rmFRYzOd4TIqWV+yTE7tzIny7alJsSnM7w4lzEZm6eqCehG0SPetpZ0R3K+UnanSmBgOAVcQ=="], + "@tanstack/react-router": ["@tanstack/react-router@1.170.18", "", { "dependencies": { "@tanstack/history": "1.162.0", "@tanstack/react-store": "^0.9.3", "@tanstack/router-core": "1.171.15", "isbot": "^5.1.22" }, "peerDependencies": { "react": ">=18.0.0 || >=19.0.0", "react-dom": ">=18.0.0 || >=19.0.0" } }, "sha512-wpbGYZEp/fmz1q4bn7BD8VZ+/VZ7GBqSJv5V969pU+chP8y7dquWDmKTFMohvUegb9lg12m1uPVvD6kB2wORvQ=="], "@tanstack/react-router-devtools": ["@tanstack/react-router-devtools@1.167.0", "", { "dependencies": { "@tanstack/router-devtools-core": "1.168.0" }, "peerDependencies": { "@tanstack/react-router": "^1.170.0", "@tanstack/router-core": "^1.170.0", "react": ">=18.0.0 || >=19.0.0", "react-dom": ">=18.0.0 || >=19.0.0" }, "optionalPeers": ["@tanstack/router-core"] }, "sha512-nGw095EG7IHx0h5NtlEmzf6vcCTaFNPWdTSuDKazajhN0ct/v/TkekJ9J6KYUCeV1a8/2ZmToc58M+0rrOyn7w=="], @@ -958,15 +778,15 @@ "@tanstack/react-table": ["@tanstack/react-table@8.21.3", "", { "dependencies": { "@tanstack/table-core": "8.21.3" }, "peerDependencies": { "react": ">=16.8", "react-dom": ">=16.8" } }, "sha512-5nNMTSETP4ykGegmVkhjcS8tTLW6Vl4axfEGQN3v0zdHYbK4UfoqfPChclTrJ4EoK9QynqAu9oUf8VEmrpZ5Ww=="], - "@tanstack/react-virtual": ["@tanstack/react-virtual@3.14.5", "", { "dependencies": { "@tanstack/virtual-core": "3.17.3" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-4EKRXh7zBLkbKbFmG3AUVkircuHd+7OdT1pocJSepxtfBd3qnrJgJ5rtPkRYyo9fmyVb2+pI2xPy5oYvMLQy6A=="], + "@tanstack/react-virtual": ["@tanstack/react-virtual@3.14.6", "", { "dependencies": { "@tanstack/virtual-core": "3.17.4" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-4+Uq8m0/gzO4kMCHUEpTtGX1RnONK0C+g88b2ltwPMWUBiaVarBuWKoPJaz7gj1cKCVRAdyu+U8GcKhwCc2beA=="], - "@tanstack/router-core": ["@tanstack/router-core@1.171.8", "", { "dependencies": { "@tanstack/history": "1.162.0", "cookie-es": "^3.0.0", "seroval": "^1.5.4", "seroval-plugins": "^1.5.4" } }, "sha512-PbrTBbofFcacrH3RLgHYILRqTFnAGq+gXrXoA/vo7qUSkJpSO4GWfLtrtCahD4VayzRm19IPwcjPPLEugag6pw=="], + "@tanstack/router-core": ["@tanstack/router-core@1.171.15", "", { "dependencies": { "@tanstack/history": "1.162.0", "cookie-es": "^3.0.0", "seroval": "^1.5.4", "seroval-plugins": "^1.5.4" } }, "sha512-IILCDcLaItMZQ2jEmCABHY1Nhjjn5XUvwpQp3e4Nmu+vfg0BgYFuu/QASz2SwE2ZNbVMrvt8X/wxa+Gg5aErxA=="], "@tanstack/router-devtools-core": ["@tanstack/router-devtools-core@1.168.0", "", { "dependencies": { "clsx": "^2.1.1", "goober": "^2.1.16" }, "peerDependencies": { "@tanstack/router-core": "^1.170.0", "csstype": "^3.0.10" }, "optionalPeers": ["csstype"] }, "sha512-wQoQhlBK7nlZgqzaqdYXKWNTpdHdsaREdaPhFZVH0/Ador+F+eM3/NF2i3f2LPeS0GgKraZUQXe1Q/1+KHyEYg=="], - "@tanstack/router-generator": ["@tanstack/router-generator@1.167.18", "", { "dependencies": { "@babel/types": "^7.28.5", "@tanstack/router-core": "1.171.14", "@tanstack/router-utils": "1.162.2", "@tanstack/virtual-file-routes": "1.162.0", "jiti": "^2.7.0", "magic-string": "^0.30.21", "prettier": "^3.5.0", "zod": "^4.4.3" } }, "sha512-kFvM4caRds9Q3EXg64bZubJ6rbDxyV0YDSBSGvOGzmKspQPdz5Xrh0uj5T1Ov8avUUg+c761u04VQAaEzSBXRw=="], + "@tanstack/router-generator": ["@tanstack/router-generator@1.167.21", "", { "dependencies": { "@babel/types": "^7.28.5", "@tanstack/router-core": "1.171.15", "@tanstack/router-utils": "1.162.2", "@tanstack/virtual-file-routes": "1.162.0", "jiti": "^2.7.0", "magic-string": "^0.30.21", "prettier": "^3.5.0", "zod": "^4.4.3" } }, "sha512-m3oXZyienj8owialdyoZ0txHQrnEx/Ra+D9kWtar5fC2cWZr5Pvxl86VY2mX5RRLC5QLKLeRGT1x4HV95wHVDQ=="], - "@tanstack/router-plugin": ["@tanstack/router-plugin@1.168.19", "", { "dependencies": { "@babel/core": "^7.28.5", "@babel/template": "^7.27.2", "@babel/types": "^7.28.5", "@tanstack/router-core": "1.171.14", "@tanstack/router-generator": "1.167.18", "@tanstack/router-utils": "1.162.2", "chokidar": "^5.0.0", "unplugin": "^3.0.0", "zod": "^4.4.3" }, "peerDependencies": { "@rsbuild/core": ">=1.0.2 || ^2.0.0", "@tanstack/react-router": "^1.170.17", "vite": ">=5.0.0 || >=6.0.0 || >=7.0.0 || >=8.0.0", "vite-plugin-solid": "^2.11.10 || ^3.0.0-0", "webpack": ">=5.92.0" }, "optionalPeers": ["@rsbuild/core", "@tanstack/react-router", "vite", "vite-plugin-solid", "webpack"] }, "sha512-aFglwLc+bbPTgZlkXn3PvOwpjJAfgUyPGSuql4MP3XrqTTh6WkBiy2RYb6oaG5h0s7EKwivEuq85K3Y4V0Mt1g=="], + "@tanstack/router-plugin": ["@tanstack/router-plugin@1.168.23", "", { "dependencies": { "@babel/core": "^7.28.5", "@babel/template": "^7.27.2", "@babel/types": "^7.28.5", "@tanstack/router-core": "1.171.15", "@tanstack/router-generator": "1.167.21", "@tanstack/router-utils": "1.162.2", "chokidar": "^5.0.0", "unplugin": "^3.0.0", "zod": "^4.4.3" }, "peerDependencies": { "@rsbuild/core": ">=1.0.2 || ^2.0.0", "@tanstack/react-router": "^1.170.18", "vite": ">=5.0.0 || >=6.0.0 || >=7.0.0 || >=8.0.0", "vite-plugin-solid": "^2.11.10 || ^3.0.0-0", "webpack": ">=5.92.0" }, "optionalPeers": ["@rsbuild/core", "@tanstack/react-router", "vite", "vite-plugin-solid", "webpack"] }, "sha512-0+PIcvnaAimFwjoEIeV3h7LKjzC8zNnp7pH2UamdKwQ9QlY99WU9V0Xl0zbM0i9hrUa/mKgWPDAzELmPUu5fMA=="], "@tanstack/router-utils": ["@tanstack/router-utils@1.162.2", "", { "dependencies": { "@babel/generator": "^7.28.5", "@babel/parser": "^7.28.5", "@babel/types": "^7.28.5", "ansis": "^4.1.0", "babel-dead-code-elimination": "^1.0.12", "diff": "^8.0.2", "pathe": "^2.0.3", "tinyglobby": "^0.2.15" } }, "sha512-hTWqJtqIFFdvuCl8WXNyrodp2L9zo2G37xKRrcVmVRWpAB2h+U1LuRAfS4tsFTiWOIoE/B+WDVFB8JpoEdw6jQ=="], @@ -974,76 +794,10 @@ "@tanstack/table-core": ["@tanstack/table-core@8.21.3", "", {}, "sha512-ldZXEhOBb8Is7xLs01fR3YEc3DERiz5silj8tnGkFZytt1abEvl/GhUmCE0PMLaMPTa3Jk4HbKmRlHmu+gCftg=="], - "@tanstack/virtual-core": ["@tanstack/virtual-core@3.17.3", "", {}, "sha512-8Np/TFELpI0ySuJoVmjvOrQYXH/8sTX0Biv9szhFhY39xOdAAY+smrMxjxOum/ux3eM8MUJQsEJ0/R0UpvC8dw=="], + "@tanstack/virtual-core": ["@tanstack/virtual-core@3.17.4", "", {}, "sha512-nGm5KteqxasUdThLc2izl6dHUqLv0LQj7Nuyo5gYalTPf/U8a9ermvsl7reT+6ioBW1l8WfpP/mcU338nLXpqw=="], "@tanstack/virtual-file-routes": ["@tanstack/virtual-file-routes@1.162.0", "", {}, "sha512-uhOeFyxLcU41HzvrxsGpiWdcMbScY1EDgbZ5K7DVRMYInbLYWAC0EA/kx9wXAoSM8q82bUG2hRl8+EAjE6XAbA=="], - "@tiptap/core": ["@tiptap/core@3.24.0", "", { "peerDependencies": { "@tiptap/pm": "3.24.0" } }, "sha512-GTAsXAI32p4hEZgPzvUv2RPrObxamy9AFhmhG10fXSvN/cDUs8naEYVIqDV3Sh99jMwQEbTFKW1E1mcspsY6ow=="], - - "@tiptap/extension-blockquote": ["@tiptap/extension-blockquote@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-DgwEEJ1GbDQcT054ynxoaZGmB9apGeUklPrinq9o6xdLHpdg+bO9HCQzggdB8n21VLLglb8jfAEWsVNwh3eASQ=="], - - "@tiptap/extension-bold": ["@tiptap/extension-bold@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-CujogYaynasklFKHADUseuvj8X2FnWktTCCo3Hl+nlyRvBTmm5TK2aqiamg3v2P4dBh3O6a70mo8BfRJPuiR1g=="], - - "@tiptap/extension-bubble-menu": ["@tiptap/extension-bubble-menu@3.24.0", "", { "dependencies": { "@floating-ui/dom": "^1.0.0" }, "peerDependencies": { "@tiptap/core": "3.24.0", "@tiptap/pm": "3.24.0" } }, "sha512-jRXD+JPu9ayvq78g8hsCxx4q/qUFtrdfIYirRSf5YUseuuUbtfrq83AsGabcygpUTefjJkMQoXNITkh6294Ggw=="], - - "@tiptap/extension-bullet-list": ["@tiptap/extension-bullet-list@3.24.0", "", { "peerDependencies": { "@tiptap/extension-list": "3.24.0" } }, "sha512-IOpAm5c4XVVVvkOef+V9XYMVpea+3MgBpCQgn83UQRlwO9eIMwmcyxOznu7gQPQVShTEpkt4T6uK+ZN9o8meIA=="], - - "@tiptap/extension-code": ["@tiptap/extension-code@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-MAQtrPRQ+HRmcGotWbksdIGeH1gqayFAdvi4lNGeFT7taHXP1o1XD7CQp7iYIKmg8IU4/MQ+RdetSfuC1A9edQ=="], - - "@tiptap/extension-code-block": ["@tiptap/extension-code-block@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0", "@tiptap/pm": "3.24.0" } }, "sha512-NZglw4oHoH6oJ5+HvxxQCYk+wODJmsxzUpRQdsOmje08sekQH+Zt9i4UKimBhg4urpd5r+dKXTslab9a5eQ86w=="], - - "@tiptap/extension-document": ["@tiptap/extension-document@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-yxgM3+yXy2XZzEwH43y2Kp8D1BkblxEWLXqo0YCoAKtxyKCcEaT8kdlf70kS7D0+VSzYU4D0iN7VdQIYHcL2mA=="], - - "@tiptap/extension-dropcursor": ["@tiptap/extension-dropcursor@3.24.0", "", { "peerDependencies": { "@tiptap/extensions": "3.24.0" } }, "sha512-Dbv1c5LnvG3PT+yEbCNroyOeeUkHq9wcir2pbC7wri7g7d2sCi0+HvKH0MAxLwY3j5NJJSiSyG2ypMaXOAs4sg=="], - - "@tiptap/extension-floating-menu": ["@tiptap/extension-floating-menu@3.24.0", "", { "peerDependencies": { "@floating-ui/dom": "^1.0.0", "@tiptap/core": "3.24.0", "@tiptap/pm": "3.24.0" } }, "sha512-7QEbf3mUzFAkejjQGX9f0L507oMtnOBRwHt2skUTR+9yXgudsN8zaDBSSRHLeMWGk9b7L293ZMA6zCRrZaHrfA=="], - - "@tiptap/extension-gapcursor": ["@tiptap/extension-gapcursor@3.24.0", "", { "peerDependencies": { "@tiptap/extensions": "3.24.0" } }, "sha512-CzCP5/jni5RFwW9jCfBO6auh83GbaioMTpSk6tyR3sd+CbwlBcUdsJFGJkbaRdiSS9dgIyi+6hRbhjpYdHcp+w=="], - - "@tiptap/extension-hard-break": ["@tiptap/extension-hard-break@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-T/ZEBiHQPMyTqDvXG0tiqBToNeuSemIPmNtdoGSgBN/degVl7VJZqQIrLIvOUHfjf3QkRs7TE/mcqTJsIboO/g=="], - - "@tiptap/extension-heading": ["@tiptap/extension-heading@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-GCSgapIzQPqEGNcVGE0/Pcjg5wITMLYJlrS3GGVw7BPmECJwgexcoOsEwkxtzJnXT/HpFXbvOFW43sM0KeHSjg=="], - - "@tiptap/extension-horizontal-rule": ["@tiptap/extension-horizontal-rule@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0", "@tiptap/pm": "3.24.0" } }, "sha512-DFzWJTrb23x+qssLLs85vEyho8ItUGp3RY9XUsVTIAGZn5IsoUw8wMsvIBlH1ux4Ch7gLchtcD6kpTdMdrL9kw=="], - - "@tiptap/extension-image": ["@tiptap/extension-image@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-mH+bvsX2cPKuZzV7YMQi4FV2YbDP+Kmq36bY+Bwi/x4mYUc8u0cjQxcu8RzLO7GtsgUJPxGMwfkQxmDqXFLZvw=="], - - "@tiptap/extension-italic": ["@tiptap/extension-italic@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-mf3cbNlbMPUNj3IyUkIke+o3ZpOUrtVeY5Yqs5IM/VhkUUh/PdIzqw74VuqEAJ0Z4oZ6nNDHeYLrl3Be1j99lQ=="], - - "@tiptap/extension-link": ["@tiptap/extension-link@3.24.0", "", { "dependencies": { "linkifyjs": "^4.3.3" }, "peerDependencies": { "@tiptap/core": "3.24.0", "@tiptap/pm": "3.24.0" } }, "sha512-MwMoNGG2mL5XGFV1tEGunBRglwsIbW+ZOB2QnKiv+Mcbi2JCWMrorndJZBqpVPR5nM+Bef2KnpchEJmYlQLvKQ=="], - - "@tiptap/extension-list": ["@tiptap/extension-list@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0", "@tiptap/pm": "3.24.0" } }, "sha512-GcxDVMMmDGj7OFTBrV7JpVgr5wxlr2vmjwH7U8QxZX7OJI5vrsMYl/U6KRTvUpG8wP+Zmo5jRlLM+BbL+a/W3g=="], - - "@tiptap/extension-list-item": ["@tiptap/extension-list-item@3.24.0", "", { "peerDependencies": { "@tiptap/extension-list": "3.24.0" } }, "sha512-zl/U3viJiV9OzkKM37AHIUN1af1TSLrcbHUUoNLkfJ33Nq+NlpaXpCVK0rKRqiLFJf7zk/a5KWG5CrOy9TxjKA=="], - - "@tiptap/extension-list-keymap": ["@tiptap/extension-list-keymap@3.24.0", "", { "peerDependencies": { "@tiptap/extension-list": "3.24.0" } }, "sha512-69fKcrngYGEKWNn4R5oLwl0YuV3FY4kufEValVcjnihUmqJTE1vx+fwctYoTsOGnIuNGpUIQ7f9YDD/0w34qBw=="], - - "@tiptap/extension-mention": ["@tiptap/extension-mention@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0", "@tiptap/pm": "3.24.0", "@tiptap/suggestion": "3.24.0" } }, "sha512-c68AYrEoHJ4vlBvt5stBUTveKXiNwt5BxaQxgq2R4OXjc3VMoh+XJqo1bBbMNHEJfuGMNpcdfZ2zf09jnBf8/A=="], - - "@tiptap/extension-ordered-list": ["@tiptap/extension-ordered-list@3.24.0", "", { "peerDependencies": { "@tiptap/extension-list": "3.24.0" } }, "sha512-buRa6bmBDw0TztH+rAcusIye14DiLDS+yGheo6GiNCTD7kKJnksXagBdxvip3jhW5sx7gyAKvoBmvGSg1BbsGA=="], - - "@tiptap/extension-paragraph": ["@tiptap/extension-paragraph@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-wD06aB6hO7LgcrlhGiw7I64k2tus9kNoICX5R+UecBSB1DVJdzKvXoXL2kPNv4DqYvljHdkIeK/OpuOTQd6MJA=="], - - "@tiptap/extension-strike": ["@tiptap/extension-strike@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-sfN1iQs6Fdlorrfe8wipDkTPwu/Egx3s2fkY7TAWusTGFHwlovuRUGFKqCL9dI4N3u6uqUMpEuWmQNgv+aQGjQ=="], - - "@tiptap/extension-text": ["@tiptap/extension-text@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-Im7keLPEihxm3+LyF+drYCoaOY5hlq35lvHAp/el6M8pJ/scts88HrYpdR1Yc4BtpZBIhfHSyWgPaupI4qwdeg=="], - - "@tiptap/extension-text-align": ["@tiptap/extension-text-align@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-WKFtYXGthtkUc+Cwy2fItSr+9FKwLZjkJVAY1GhkRdcq35qTuVhkb4Q4wR2Rhkb6QRqtlxF1NDuTf2vxiQmfBQ=="], - - "@tiptap/extension-text-style": ["@tiptap/extension-text-style@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-1Hy+5tFEAsnoLhZ/eqmza4USvFHwMA8haeAdCGlwTeshBrt+nUKTrEsRHidF60cGsRwlTcuqxSkjT94dULgp5Q=="], - - "@tiptap/extension-underline": ["@tiptap/extension-underline@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0" } }, "sha512-D4W4X3UMq9dLVIOfPB9+UodQ4eAJ8yDcm8qFWAwq0a15YWH6bnwulCuIdV+U5dEG+yaRxN8haB9GrrID9jmrSA=="], - - "@tiptap/extensions": ["@tiptap/extensions@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0", "@tiptap/pm": "3.24.0" } }, "sha512-z6gRYzy2ucJp07OQ0F2W07NxyhMTxPYH1ia2eGiQkWax1i56oExpjMsDHP8THWlg8Tb7NnbfKpkfh881EsmofA=="], - - "@tiptap/pm": ["@tiptap/pm@3.24.0", "", { "dependencies": { "prosemirror-changeset": "^2.3.0", "prosemirror-commands": "^1.6.2", "prosemirror-dropcursor": "^1.8.1", "prosemirror-gapcursor": "^1.3.2", "prosemirror-history": "^1.4.1", "prosemirror-inputrules": "^1.4.0", "prosemirror-keymap": "^1.2.2", "prosemirror-model": "^1.24.1", "prosemirror-schema-list": "^1.5.0", "prosemirror-state": "^1.4.3", "prosemirror-tables": "^1.6.4", "prosemirror-transform": "^1.10.2", "prosemirror-view": "^1.38.1" } }, "sha512-QQP/78ryOZDN99gNBV7dgh69/8AYaOYQYFklq/iR+ZRFaaL3+qqHFvPVJapGkzPdymBgNJ34xjFM8n5pJ4QmMg=="], - - "@tiptap/react": ["@tiptap/react@3.24.0", "", { "dependencies": { "@types/use-sync-external-store": "^0.0.6", "fast-equals": "^5.3.3", "use-sync-external-store": "^1.4.0" }, "optionalDependencies": { "@tiptap/extension-bubble-menu": "^3.24.0", "@tiptap/extension-floating-menu": "^3.24.0" }, "peerDependencies": { "@tiptap/core": "3.24.0", "@tiptap/pm": "3.24.0", "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", "@types/react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-KxnrlQbzOgA02EMsfuGGHtNhfkJQGqVlQttmQctI9DOl/F3gcaRqg+wNTBY1Fof8yDaZ8Z1LL1F0C05W0o3vUw=="], - - "@tiptap/starter-kit": ["@tiptap/starter-kit@3.24.0", "", { "dependencies": { "@tiptap/core": "^3.24.0", "@tiptap/extension-blockquote": "^3.24.0", "@tiptap/extension-bold": "^3.24.0", "@tiptap/extension-bullet-list": "^3.24.0", "@tiptap/extension-code": "^3.24.0", "@tiptap/extension-code-block": "^3.24.0", "@tiptap/extension-document": "^3.24.0", "@tiptap/extension-dropcursor": "^3.24.0", "@tiptap/extension-gapcursor": "^3.24.0", "@tiptap/extension-hard-break": "^3.24.0", "@tiptap/extension-heading": "^3.24.0", "@tiptap/extension-horizontal-rule": "^3.24.0", "@tiptap/extension-italic": "^3.24.0", "@tiptap/extension-link": "^3.24.0", "@tiptap/extension-list": "^3.24.0", "@tiptap/extension-list-item": "^3.24.0", "@tiptap/extension-list-keymap": "^3.24.0", "@tiptap/extension-ordered-list": "^3.24.0", "@tiptap/extension-paragraph": "^3.24.0", "@tiptap/extension-strike": "^3.24.0", "@tiptap/extension-text": "^3.24.0", "@tiptap/extension-underline": "^3.24.0", "@tiptap/extensions": "^3.24.0", "@tiptap/pm": "^3.24.0" } }, "sha512-Ef4PCP96vcY2GonXN9J0M8iC6zvxPTmQlL/QZiCwuYqqnH/hNpYIjNSQdTndiDpxRKofa32Sr2HWktgEnL32Bg=="], - - "@tiptap/suggestion": ["@tiptap/suggestion@3.24.0", "", { "peerDependencies": { "@tiptap/core": "3.24.0", "@tiptap/pm": "3.24.0" } }, "sha512-UlLIij1fxFy7tbCmqUoInWRijzsi8hsbaXKCx6L3KvLXtxHb4hMnDhd6W++rOk9Q1hDpmNf8qNIX498q/ZNstw=="], - "@tokenlens/core": ["@tokenlens/core@1.3.0", "", {}, "sha512-d8YNHNC+q10bVpi95fELJwJyPVf1HfvBEI18eFQxRSZTdByXrP+f/ZtlhSzkx0Jl0aEmYVeBA5tPeeYRioLViQ=="], "@tokenlens/fetch": ["@tokenlens/fetch@1.3.0", "", { "dependencies": { "@tokenlens/core": "1.3.0" } }, "sha512-RONDRmETYly9xO8XMKblmrZjKSwCva4s5ebJwQNfNlChZoA5kplPoCgnWceHnn1J1iRjLVlrCNB43ichfmGBKQ=="], @@ -1068,7 +822,7 @@ "@turf/rewind": ["@turf/rewind@6.5.0", "", { "dependencies": { "@turf/boolean-clockwise": "^6.5.0", "@turf/clone": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "@turf/meta": "^6.5.0" } }, "sha512-IoUAMcHWotBWYwSYuYypw/LlqZmO+wcBpn8ysrBNbazkFNkLf3btSDZMkKJO/bvOzl55imr/Xj4fi3DdsLsbzQ=="], - "@tybys/wasm-util": ["@tybys/wasm-util@0.10.2", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg=="], + "@tybys/wasm-util": ["@tybys/wasm-util@0.10.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg=="], "@types/d3": ["@types/d3@7.4.3", "", { "dependencies": { "@types/d3-array": "*", "@types/d3-axis": "*", "@types/d3-brush": "*", "@types/d3-chord": "*", "@types/d3-color": "*", "@types/d3-contour": "*", "@types/d3-delaunay": "*", "@types/d3-dispatch": "*", "@types/d3-drag": "*", "@types/d3-dsv": "*", "@types/d3-ease": "*", "@types/d3-fetch": "*", "@types/d3-force": "*", "@types/d3-format": "*", "@types/d3-geo": "*", "@types/d3-hierarchy": "*", "@types/d3-interpolate": "*", "@types/d3-path": "*", "@types/d3-polygon": "*", "@types/d3-quadtree": "*", "@types/d3-random": "*", "@types/d3-scale": "*", "@types/d3-scale-chromatic": "*", "@types/d3-selection": "*", "@types/d3-shape": "*", "@types/d3-time": "*", "@types/d3-time-format": "*", "@types/d3-timer": "*", "@types/d3-transition": "*", "@types/d3-zoom": "*" } }, "sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww=="], @@ -1112,7 +866,7 @@ "@types/d3-quadtree": ["@types/d3-quadtree@3.0.6", "", {}, "sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg=="], - "@types/d3-random": ["@types/d3-random@3.0.3", "", {}, "sha512-Imagg1vJ3y76Y2ea0871wpabqp613+8/r0mCLEBfdtqC7xMSfj9idOnmBYyMoULfHePJyxMAw3nWhJxzc+LFwQ=="], + "@types/d3-random": ["@types/d3-random@3.0.4", "", {}, "sha512-UHYId5WTCx4L4YNel7NU00XUXXgvgpgZOvp10PuvsQENjMDXhh2RyFc0KBjO7B45ne4Ha1yVH7ii0vnzKkuzWA=="], "@types/d3-scale": ["@types/d3-scale@4.0.9", "", { "dependencies": { "@types/d3-time": "*" } }, "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw=="], @@ -1140,7 +894,7 @@ "@types/geojson": ["@types/geojson@7946.0.16", "", {}, "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg=="], - "@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ=="], + "@types/hast": ["@types/hast@3.0.5", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="], "@types/js-cookie": ["@types/js-cookie@3.0.6", "", {}, "sha512-wkw9yd1kEXOPnvEeEV1Go1MmxtBJL0RR79aOTAApecWFVu7w0NNXNqhcWgvw2YgZDYadliXkl14pa3WXw5jlCQ=="], @@ -1152,11 +906,11 @@ "@types/mdurl": ["@types/mdurl@2.0.0", "", {}, "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg=="], - "@types/mdx": ["@types/mdx@2.0.13", "", {}, "sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw=="], + "@types/mdx": ["@types/mdx@2.0.14", "", {}, "sha512-T48PeuJtvLosNTPVhfnIp3i/n3a4g4Bad7YCq5k64D4u7NwDrAotikQ+5+sjtUvBmxCMlbo3dVL+C2dP0rWHzg=="], "@types/ms": ["@types/ms@2.1.0", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="], - "@types/node": ["@types/node@26.1.0", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-O0A1G3xPGy4w7AgQdAQYUlQ+BKk2Oovw8eRpofyp5KdBZULnbe+WqaOVNrm705SHphCiG4XHsACrSmPu1f+Kgw=="], + "@types/node": ["@types/node@26.1.1", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw=="], "@types/parse-json": ["@types/parse-json@4.0.2", "", {}, "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw=="], @@ -1172,23 +926,23 @@ "@types/validate-npm-package-name": ["@types/validate-npm-package-name@4.0.2", "", {}, "sha512-lrpDziQipxCEeK5kWxvljWYhUvOiB2A9izZd9B2AFarYAkqZshb4lPbRs7zKEic6eGtH8V/2qJW+dPp9OtF6bw=="], - "@typescript/native-preview": ["@typescript/native-preview@7.0.0-dev.20260702.3", "", { "optionalDependencies": { "@typescript/native-preview-darwin-arm64": "7.0.0-dev.20260702.3", "@typescript/native-preview-darwin-x64": "7.0.0-dev.20260702.3", "@typescript/native-preview-linux-arm": "7.0.0-dev.20260702.3", "@typescript/native-preview-linux-arm64": "7.0.0-dev.20260702.3", "@typescript/native-preview-linux-x64": "7.0.0-dev.20260702.3", "@typescript/native-preview-win32-arm64": "7.0.0-dev.20260702.3", "@typescript/native-preview-win32-x64": "7.0.0-dev.20260702.3" }, "bin": { "tsgo": "bin/tsgo" } }, "sha512-j21laxUja23ex6qYGjwiSiQ6YpS/p5E7lCMDYKDBAdBv93Z1NzV96BZV3gdRwl+buH09EPuBAiqxKQqRO1grhw=="], + "@typescript/native-preview": ["@typescript/native-preview@7.0.0-dev.20260707.2", "", { "optionalDependencies": { "@typescript/native-preview-darwin-arm64": "7.0.0-dev.20260707.2", "@typescript/native-preview-darwin-x64": "7.0.0-dev.20260707.2", "@typescript/native-preview-linux-arm": "7.0.0-dev.20260707.2", "@typescript/native-preview-linux-arm64": "7.0.0-dev.20260707.2", "@typescript/native-preview-linux-x64": "7.0.0-dev.20260707.2", "@typescript/native-preview-win32-arm64": "7.0.0-dev.20260707.2", "@typescript/native-preview-win32-x64": "7.0.0-dev.20260707.2" }, "bin": { "tsgo": "bin/tsgo" } }, "sha512-oUGp+Rep/hqMhPunyinsALUwSlzHINSxitifPiSaeqoKOKD2OlR9NE3TaPqwsl4NlGslsOSUXI1JotWQzpYCPg=="], - "@typescript/native-preview-darwin-arm64": ["@typescript/native-preview-darwin-arm64@7.0.0-dev.20260702.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-sswJ7XRSH17/jDv6eqlRyNzjQev4w+TH+16RgeoZkKbQfZnVuLchF4ORCecEuia15X2yE8pbiQGY596LVbGKdA=="], + "@typescript/native-preview-darwin-arm64": ["@typescript/native-preview-darwin-arm64@7.0.0-dev.20260707.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-wny2pgKjGbiZtnOIHVa3tXC1UfDqxNEFzyPGmiqybedG8hipG2Nfp0l5UxbaKCjkLacUpH/W5bP2hBOMVhCOzg=="], - "@typescript/native-preview-darwin-x64": ["@typescript/native-preview-darwin-x64@7.0.0-dev.20260702.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-j8ZYT/chWtx3QT1Bghp0/+2g6aKLaxRVpXEHt6Fjdj4OXQTpH4pljOE0+LeAqaET88PUo/XM9pi0TJ5TJwHLMg=="], + "@typescript/native-preview-darwin-x64": ["@typescript/native-preview-darwin-x64@7.0.0-dev.20260707.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-Afc7M5zOwo+GpfcYwz5Z8HMB2tPVsui7nNIqEuuFB73MPdVqNn/Wmpe4tP4MRri0AtJnJknoHBaTJ/VDAp/Jhw=="], - "@typescript/native-preview-linux-arm": ["@typescript/native-preview-linux-arm@7.0.0-dev.20260702.3", "", { "os": "linux", "cpu": "arm" }, "sha512-SM73Mp3oYUWkyHmym0MVfPnMeLGM6oo1vcPZTxVoL7BOKWkJKK+iM7D1tcqDSZNPwURSkWMxP17Dh+4JPqzikg=="], + "@typescript/native-preview-linux-arm": ["@typescript/native-preview-linux-arm@7.0.0-dev.20260707.2", "", { "os": "linux", "cpu": "arm" }, "sha512-hJm/UOqZTr9FHmR7uNm8VGX4oKtfWk0Jem0zPeJFNC8ckGUfSBueyiEYMZB+XmRc1aG4x1E46y3CplP4CLHvGQ=="], - "@typescript/native-preview-linux-arm64": ["@typescript/native-preview-linux-arm64@7.0.0-dev.20260702.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-FEBt9UER27yvn3o4quXZ9fQ/Hd39hxFPljJe8dxstCvyYLh0A9TwDuuwghWCisp5U9TDWWtl8m1GLjvqIKc6IA=="], + "@typescript/native-preview-linux-arm64": ["@typescript/native-preview-linux-arm64@7.0.0-dev.20260707.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-iITBa2WjjTI5N9t5l7Z4KoOSI+2zBlhbvFzsD/f8qX8QoKjz/Y4DPyBDgezYi8nkqjjksbgSOJ3/ykzhwrB9cg=="], - "@typescript/native-preview-linux-x64": ["@typescript/native-preview-linux-x64@7.0.0-dev.20260702.3", "", { "os": "linux", "cpu": "x64" }, "sha512-CY/r7gHjDnf3xWptpQVRQnagMdUDbh+zL01SF+cTJsg1WVY3TtVNrCo48dwAnJL+U97qx1SKaGVsi/8cSPwrZA=="], + "@typescript/native-preview-linux-x64": ["@typescript/native-preview-linux-x64@7.0.0-dev.20260707.2", "", { "os": "linux", "cpu": "x64" }, "sha512-du0dzi6y97Po5vDNdPJTyyijHCpaS22JLRnKZEJXBDaO9gCIymOv/5QQokFRuOlQm0bWl3i9PF4OVdGP6uAOQA=="], - "@typescript/native-preview-win32-arm64": ["@typescript/native-preview-win32-arm64@7.0.0-dev.20260702.3", "", { "os": "win32", "cpu": "arm64" }, "sha512-9U/ahdJAWZdYxPdNry3VAhB9avaQCiqsEk2PfheeKrKSKCtfs5FoPXy/QXAaIGIBK/Lw4a7OqyVyEbd0i77TkQ=="], + "@typescript/native-preview-win32-arm64": ["@typescript/native-preview-win32-arm64@7.0.0-dev.20260707.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-SsAwfhyHJ1akgBc+99z4+hwdbHsdWaKB8EwCNIMA6JfSLMeUjffrYvxu+vfMyxVtOVOz7RrRXRoiDiu4a2sCtg=="], - "@typescript/native-preview-win32-x64": ["@typescript/native-preview-win32-x64@7.0.0-dev.20260702.3", "", { "os": "win32", "cpu": "x64" }, "sha512-kPqfivHuzzEK2NFEl2QeCCiWJ4qkGMJYFX9TmJ4ylh784XICgQLX3PJe7OCqZcUicfeMIIDu6m3flcCi+4tW4Q=="], + "@typescript/native-preview-win32-x64": ["@typescript/native-preview-win32-x64@7.0.0-dev.20260707.2", "", { "os": "win32", "cpu": "x64" }, "sha512-DL4u27stv0fo71sVhOzHSwE+YMZsbBijVI+kg5dLDLilSH79WFTJ8RSQ46vJrCMt+Gjlv/JOZP1PuLJDfioYeQ=="], - "@ungap/structured-clone": ["@ungap/structured-clone@1.3.1", "", {}, "sha512-mUFwbeTqrVgDQxFveS+df2yfap6iuP20NAKAsBt5jDEoOTDew+zwLAOilHCeQJOVSvmgCX4ogqIrA0mnyr08yQ=="], + "@ungap/structured-clone": ["@ungap/structured-clone@1.3.3", "", {}, "sha512-60YRaenCQcVjYEKOcG824+DRGGIQ3VKErcBoAEDJZz5bKIs2ZG+X/H9Nk+Q6EVkwJk5QNApxbrc5QtBSwtrXAg=="], "@upsetjs/venn.js": ["@upsetjs/venn.js@2.0.0", "", { "optionalDependencies": { "d3-selection": "^3.0.0", "d3-transition": "^3.0.1" } }, "sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw=="], @@ -1198,63 +952,43 @@ "@vercel/oidc": ["@vercel/oidc@3.2.0", "", {}, "sha512-UycprH3T6n3jH0k44NHMa7pnFHGu/N05MjojYr+Mc6I7obkoLIJujSWwin1pCvdy/eOxrI/l3uDLQsmcrOb4ug=="], - "@visactor/react-vchart": ["@visactor/react-vchart@2.1.2", "", { "dependencies": { "@visactor/vchart": "2.1.2", "@visactor/vchart-extension": "2.1.2", "@visactor/vrender-core": "^1.1.3", "@visactor/vrender-kits": "^1.1.3", "@visactor/vutils": "~1.0.23", "react-is": "^18.2.0" }, "peerDependencies": { "react": ">=16.0.0", "react-dom": ">=16.0.0" } }, "sha512-7EadIvN/ORSTvSNw5cvGL53X+dKWFVwa5J2k7n99PA3xSAGnpZl2tBR9uKRf9BFOsTN8RmniO1dafJDuRTnvaw=="], + "@visactor/react-vchart": ["@visactor/react-vchart@2.1.4", "", { "dependencies": { "@visactor/vchart": "2.1.4", "@visactor/vchart-extension": "2.1.4", "@visactor/vrender-core": "~1.1.4", "@visactor/vrender-kits": "~1.1.4", "@visactor/vutils": "~1.0.23", "react-is": "^18.2.0" }, "peerDependencies": { "react": ">=16.0.0", "react-dom": ">=16.0.0" } }, "sha512-6QTmGm3bsphFeulPwLDxVJccnFXqkqPnyKiuOo3hwyvXD4W4TTiJl5hR9iT7hr8PANGcSmiMKDNzbWKRJx5/jw=="], - "@visactor/vchart": ["@visactor/vchart@2.1.2", "", { "dependencies": { "@visactor/vdataset": "~1.0.23", "@visactor/vlayouts": "~1.0.23", "@visactor/vrender": "^1.1.3", "@visactor/vrender-animate": "^1.1.3", "@visactor/vrender-components": "^1.1.3", "@visactor/vrender-core": "^1.1.3", "@visactor/vrender-kits": "^1.1.3", "@visactor/vscale": "~1.0.23", "@visactor/vutils": "~1.0.23", "@visactor/vutils-extension": "2.1.2" } }, "sha512-mJqm7LoC4lBs7e+5tCPtZJjqh/+DebXrcBzea54iuetVOxBcVJU2Ph731lMnegVwbbccZSTJN9xjxXiTiCtuMw=="], + "@visactor/vchart": ["@visactor/vchart@2.1.4", "", { "dependencies": { "@visactor/vdataset": "~1.0.23", "@visactor/vlayouts": "~1.0.23", "@visactor/vrender": "~1.1.4", "@visactor/vrender-animate": "~1.1.4", "@visactor/vrender-components": "~1.1.4", "@visactor/vrender-core": "~1.1.4", "@visactor/vrender-kits": "~1.1.4", "@visactor/vscale": "~1.0.23", "@visactor/vutils": "~1.0.23", "@visactor/vutils-extension": "2.1.4" } }, "sha512-NueAYq9hg9QHbsDK5WBZzOktQZiBdumMjE9mI5BKTJ9zzTOT+A2BfyK4xfFELojceXDwRs9sEH4xf93G2kexOw=="], - "@visactor/vchart-extension": ["@visactor/vchart-extension@2.1.2", "", { "dependencies": { "@visactor/vchart": "2.1.2", "@visactor/vdataset": "~1.0.23", "@visactor/vlayouts": "~1.0.23", "@visactor/vrender-animate": "^1.1.3", "@visactor/vrender-components": "^1.1.3", "@visactor/vrender-core": "^1.1.3", "@visactor/vrender-kits": "^1.1.3", "@visactor/vutils": "~1.0.23" } }, "sha512-iZ4DESeOObKU2oREeqBQ/vYgI3gM+pTGnrqeVkm5RECbeuS44IPOSrkNh4mCcSdJO36nAcfJ5MqYhK4fh7pxug=="], - - "@visactor/vchart-semi-theme": ["@visactor/vchart-semi-theme@1.8.8", "", { "dependencies": { "@visactor/vchart-theme-utils": "1.8.8" }, "peerDependencies": { "@visactor/vchart": "~1.8.8" } }, "sha512-lm57CX3r6Bm7iGBYYyWhDY+1BvkyhNVLEckKx2PnlPKpJHikKSIK2ACyI5SmHuSOOdYzhY2QK6ZfYa2NShJ83w=="], - - "@visactor/vchart-theme-utils": ["@visactor/vchart-theme-utils@1.8.8", "", { "peerDependencies": { "@visactor/vchart": "~1.8.8" } }, "sha512-RdCey3/t0+82EYyFZvx210rgJJWti9rsgcL3ROZS7o9CtRW1CMj9u9LKLDNIcPLNcLNACFC0aoT03jpdD1BCpA=="], + "@visactor/vchart-extension": ["@visactor/vchart-extension@2.1.4", "", { "dependencies": { "@visactor/vchart": "2.1.4", "@visactor/vdataset": "~1.0.23", "@visactor/vlayouts": "~1.0.23", "@visactor/vrender-animate": "~1.1.4", "@visactor/vrender-components": "~1.1.4", "@visactor/vrender-core": "~1.1.4", "@visactor/vrender-kits": "~1.1.4", "@visactor/vutils": "~1.0.23" } }, "sha512-17uvyKW3/2rS9wSAhWbhh2JgB1DKXH122vWm5HJrUqG8BVLk4JxaMdDyDRZBo2USqf8ehzjv5vfxwpffJ4kPhg=="], "@visactor/vdataset": ["@visactor/vdataset@1.0.23", "", { "dependencies": { "@turf/flatten": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/rewind": "^6.5.0", "@visactor/vutils": "1.0.23", "d3-dsv": "^2.0.0", "d3-geo": "^1.12.1", "d3-hexbin": "^0.2.2", "d3-hierarchy": "^3.1.1", "eventemitter3": "^4.0.7", "geobuf": "^3.0.1", "geojson-dissolve": "^3.1.0", "path-browserify": "^1.0.1", "pbf": "^3.2.1", "point-at-length": "^1.1.0", "simple-statistics": "^7.7.3", "simplify-geojson": "^1.0.4", "topojson-client": "^3.1.0" } }, "sha512-zrLk9FBUWJoW6b30XnPKzXwAXl8USdLDfed6QZLsmdkylRU8V7yZeXE2aKwU8Lg1U4HmQngqmqOx7/QlbX44Tg=="], - "@visactor/vgrammar-coordinate": ["@visactor/vgrammar-coordinate@0.10.11", "", { "dependencies": { "@visactor/vgrammar-util": "0.10.11", "@visactor/vutils": "~0.17.3" } }, "sha512-XSUvEkaf/NQHFafmTwqoIMZicp9fF3o6NB2FDpuWrK4DI1lTuip/0RkqrC+kBAjc5erjt0em0TiITyqXpp4G6w=="], - - "@visactor/vgrammar-core": ["@visactor/vgrammar-core@0.10.11", "", { "dependencies": { "@visactor/vdataset": "~0.17.3", "@visactor/vgrammar-coordinate": "0.10.11", "@visactor/vgrammar-util": "0.10.11", "@visactor/vrender-components": "0.17.17", "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3" } }, "sha512-VL9vcLPDg1LrHl7EOx0Ga9ATsoaChKIaCGzxjrPEjWiIS5VPU9Rs0jBKP+ch8BjamAoSuqL5mKd0L/RaUBqlaA=="], - - "@visactor/vgrammar-hierarchy": ["@visactor/vgrammar-hierarchy@0.10.11", "", { "dependencies": { "@visactor/vgrammar-core": "0.10.11", "@visactor/vgrammar-util": "0.10.11", "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vutils": "~0.17.3" } }, "sha512-0r3k51pPlJHu63BduG3htsV/ul62aVcKJxFftRfvKkwGjm1KeHoOZEEAwIf78U2puio0BkLqVn2Ek2L4FYZaIg=="], - - "@visactor/vgrammar-projection": ["@visactor/vgrammar-projection@0.10.11", "", { "dependencies": { "@visactor/vgrammar-core": "0.10.11", "@visactor/vgrammar-util": "0.10.11", "@visactor/vutils": "~0.17.3", "d3-geo": "^1.12.1" } }, "sha512-yEiKsxdfs5+g60wv5xZ1kyS/EDrAsUzAxCMpFFASVUYbQObHvW+elm+UPq2TBX6KZqAM0gsd1inzaLvfsCrLSg=="], - - "@visactor/vgrammar-sankey": ["@visactor/vgrammar-sankey@0.10.11", "", { "dependencies": { "@visactor/vgrammar-core": "0.10.11", "@visactor/vgrammar-util": "0.10.11", "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vutils": "~0.17.3" } }, "sha512-BbJTPuyydsL/L5XtQv59Q82GgJeePY7Wleac798usx3GnDK0GAOrPsI3bubSsOESJ4pNk3V4HPGEQDG1vCPb4w=="], - - "@visactor/vgrammar-util": ["@visactor/vgrammar-util@0.10.11", "", { "dependencies": { "@visactor/vutils": "~0.17.3" } }, "sha512-cJZLmKZvN95Y+yGhX+28+UpZu3bhYYlXDlHJNvXHyonI76ZYgtceyon2b3lI6XIsUsBGcD4Uo777s949X5os3g=="], - - "@visactor/vgrammar-wordcloud": ["@visactor/vgrammar-wordcloud@0.10.11", "", { "dependencies": { "@visactor/vgrammar-core": "0.10.11", "@visactor/vgrammar-util": "0.10.11", "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vutils": "~0.17.3" } }, "sha512-JWDqjGhr9JlYkKVBeEkiOqLQk7C1x1BtnsZ+E8oN541gzUqHwfS9qZyhwI3OyoSLewJlsSSPu1vXLKSQzLzKPA=="], - - "@visactor/vgrammar-wordcloud-shape": ["@visactor/vgrammar-wordcloud-shape@0.10.11", "", { "dependencies": { "@visactor/vgrammar-core": "0.10.11", "@visactor/vgrammar-util": "0.10.11", "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3" } }, "sha512-NsQOYJp+9WHnIApMvkcUOaajxIg5U/r6rD8LKnoXW/HqAN2TFYXcRR3Daqmk9rrpM5VztQimKOsA1yZWyzozrA=="], - "@visactor/vlayouts": ["@visactor/vlayouts@1.0.23", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "@visactor/vscale": "1.0.23", "@visactor/vutils": "1.0.23", "eventemitter3": "^4.0.7" } }, "sha512-fK1f5LmuumhYanLArk5yrT4BZxu4IAmdc8WMwfB/KAvV+2dTPFuBUMWbWnDl0siQoU9SX9l/bLozUnI9n7BwBQ=="], - "@visactor/vrender": ["@visactor/vrender@1.1.4", "", { "dependencies": { "@visactor/vrender-animate": "1.1.4", "@visactor/vrender-components": "1.1.4", "@visactor/vrender-core": "1.1.4", "@visactor/vrender-kits": "1.1.4" } }, "sha512-+T09pS5EJ2HizxMCa3r8MuvgcWnoJpGUK2ykLZLcR6w+5kfpfbu2B8uQzetTOKn1CVIhDbuO05monfI7mCYGQA=="], + "@visactor/vrender": ["@visactor/vrender@1.1.5", "", { "dependencies": { "@visactor/vrender-animate": "1.1.5", "@visactor/vrender-components": "1.1.5", "@visactor/vrender-core": "1.1.5", "@visactor/vrender-kits": "1.1.5" } }, "sha512-iM1kJpvxK0PwBi6sxfxRsSdHJH02nn9pIQc4Kz6WAC4JRlqRjxGPZXa1Cn3FvpJPzUVPDDVY22Y83Hl/eSt5Mw=="], - "@visactor/vrender-animate": ["@visactor/vrender-animate@1.1.4", "", { "dependencies": { "@visactor/vrender-core": "1.1.4", "@visactor/vutils": "~1.0.12" } }, "sha512-XBaCXMLSNw9E+htAEaqjby28mdINyVokNkLjKJ/ukmGobi3XX8siekXTNzCfe9M9UG4QGRTqyph848sxLB02Tw=="], + "@visactor/vrender-animate": ["@visactor/vrender-animate@1.1.5", "", { "dependencies": { "@visactor/vrender-core": "1.1.5", "@visactor/vutils": "~1.0.12" } }, "sha512-SpS+BGAgC6w2/Nk0laI+8j8Cj8of7xbdgoItv7ErcwT7/bMMZqdTh5hI7vM3addwcridYn4tUpKfXsjFT6cmPg=="], - "@visactor/vrender-components": ["@visactor/vrender-components@1.1.4", "", { "dependencies": { "@visactor/vrender-animate": "1.1.4", "@visactor/vrender-core": "1.1.4", "@visactor/vrender-kits": "1.1.4", "@visactor/vscale": "~1.0.12", "@visactor/vutils": "~1.0.12" } }, "sha512-N1bnIuefe6Lms7Ij8NGjKfNUYQpZ+M8RYsnjBR2So0wmnxAnXUTgqbpWDT9DiXzRF17qYSkF0HZJIdS/wN2o3Q=="], + "@visactor/vrender-components": ["@visactor/vrender-components@1.1.5", "", { "dependencies": { "@visactor/vrender-animate": "1.1.5", "@visactor/vrender-core": "1.1.5", "@visactor/vrender-kits": "1.1.5", "@visactor/vscale": "~1.0.12", "@visactor/vutils": "~1.0.12" } }, "sha512-xIEMeU/dV8x0bJ1xjbElhtoD+Sjet7Ahoq2Fm10p/VEf1ov9u4ZoGBZZaA/oZJsrvL6WchdZAHEM5TAmId5hBw=="], - "@visactor/vrender-core": ["@visactor/vrender-core@1.1.4", "", { "dependencies": { "@visactor/vutils": "~1.0.12", "color-convert": "2.0.1" } }, "sha512-AyMKFohr/iK1Wc5jxvE/04MLcFI0VAR5qleDy+b2WwLi7UoeXn0tBhtzz72xIOKU1OrzvmflWsVmdnlh6ittwg=="], + "@visactor/vrender-core": ["@visactor/vrender-core@1.1.5", "", { "dependencies": { "@visactor/vutils": "~1.0.12", "color-convert": "2.0.1" } }, "sha512-kaAHJlmitRNZYW6U3I+r3rdYmMcYLIQWuTxo4IiXF6KhmNeYmqa12LFV9J3fYEz9eb93SOYBGmjU467EkgU0XA=="], - "@visactor/vrender-kits": ["@visactor/vrender-kits@1.1.4", "", { "dependencies": { "@resvg/resvg-js": "2.4.1", "@visactor/vrender-core": "1.1.4", "@visactor/vutils": "~1.0.12", "gifuct-js": "2.1.2", "lottie-web": "^5.12.2", "roughjs": "4.6.6" } }, "sha512-YD1y2TWh5yl6AzpW47HPcYogk0d6KntuwUrGocXqSkLXwzsGnYntE9RvAEGTu4ketdeahh+8/0w34d6BU0Hzig=="], + "@visactor/vrender-kits": ["@visactor/vrender-kits@1.1.5", "", { "dependencies": { "@resvg/resvg-js": "2.4.1", "@visactor/vrender-core": "1.1.5", "@visactor/vutils": "~1.0.12", "gifuct-js": "2.1.2", "lottie-web": "^5.12.2", "roughjs": "4.6.6" } }, "sha512-AI+N5EVYshJj0P8mnTSMgAsfACsGdX19cavCAUCS7iHec6nGX93qQg1zfH2oNZelwCAYpDvJY/yUzRYB/sozqA=="], "@visactor/vscale": ["@visactor/vscale@1.0.23", "", { "dependencies": { "@visactor/vutils": "1.0.23" } }, "sha512-XePhYuRoNAp+8MeSMuEOOvhVAlOwvM1sDT2yFxE6zdwVB2GjZk8mH+5N2xQGQWk75YmGJjlJASFtgwjlb1yWxw=="], "@visactor/vutils": ["@visactor/vutils@1.0.23", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-M8SLqgdHhKN8QmQKTWD1gzEaHptpIV9pvMYvC6+VeOsqYvZZ6UdhSCAAczTYVo+m/uwcEC2JHSUspbrs8rzlRQ=="], - "@visactor/vutils-extension": ["@visactor/vutils-extension@2.1.2", "", { "dependencies": { "@visactor/vdataset": "~1.0.23", "@visactor/vutils": "~1.0.23" } }, "sha512-9ss8NpeD5N8oo0dgHo1ZIRVJZ0oEFQbMMD4xBtsXqmz0TCFyFu2icoxAdTupjbo/3GtdZX7wqayPkEIm6Za+Ow=="], + "@visactor/vutils-extension": ["@visactor/vutils-extension@2.1.4", "", { "dependencies": { "@visactor/vdataset": "~1.0.23", "@visactor/vutils": "~1.0.23" } }, "sha512-gyTxhrTN0Ybzis4FsHniTNQSKo9GWLT2f+0du3E6wEDQ/PijNRS6onkY3HyBXZbsnJlvk/sMZUqrtVJi3cTvzg=="], "@workflow/serde": ["@workflow/serde@4.1.0", "", {}, "sha512-pav4F2BoirECWR7Nf1TKt+2eETcBj7jj4cBefQ8VXQCA6NPkaKeLfj/zMgi+3zYV5ZIBT4GuUiphsj0/b9hPQQ=="], - "@xyflow/react": ["@xyflow/react@12.11.1", "", { "dependencies": { "@xyflow/system": "0.0.78", "classcat": "^5.0.3", "zustand": "^4.4.0" }, "peerDependencies": { "@types/react": ">=17", "@types/react-dom": ">=17", "react": ">=17", "react-dom": ">=17" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-L+zBoLGSXham0MnlY8QqjfR7/C5JNw0zxkaey5aZ5XmCgJBAdH4+WRIu8CR40d3l/BdU635V6YbhBK1jMo8/6Q=="], + "@xyflow/react": ["@xyflow/react@12.11.2", "", { "dependencies": { "@xyflow/system": "0.0.79", "classcat": "^5.0.3", "zustand": "^4.4.0" }, "peerDependencies": { "@types/react": ">=17", "@types/react-dom": ">=17", "react": ">=17", "react-dom": ">=17" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-eLAlDWJfWnQEhJwGMjlWdAXO9eYllKpliUmPQlAmOLxz6mExXuzMVDUKLMquixgkrtmMFFtug3jGKmYYld12cA=="], - "@xyflow/system": ["@xyflow/system@0.0.78", "", { "dependencies": { "@types/d3-drag": "^3.0.7", "@types/d3-interpolate": "^3.0.4", "@types/d3-selection": "^3.0.10", "@types/d3-transition": "^3.0.8", "@types/d3-zoom": "^3.0.8", "d3-drag": "^3.0.0", "d3-interpolate": "^3.0.1", "d3-selection": "^3.0.0", "d3-zoom": "^3.0.0" } }, "sha512-lY0z2qP33fUhTva9Vaxrk0lqZta2pkbxB1trHAx1omnJqRtPvDlAQYV2r5fhS6AdpkulYmbNW0svy+A4/t4B/g=="], + "@xyflow/system": ["@xyflow/system@0.0.79", "", { "dependencies": { "@types/d3-drag": "^3.0.7", "@types/d3-interpolate": "^3.0.4", "@types/d3-selection": "^3.0.10", "@types/d3-transition": "^3.0.8", "@types/d3-zoom": "^3.0.8", "d3-drag": "^3.0.0", "d3-interpolate": "^3.0.1", "d3-selection": "^3.0.0", "d3-zoom": "^3.0.0" } }, "sha512-czLyOh91NF0hIzbNzwi8I6GlqG23BHh2435OddfI6uiaLH3xdrdygO93gqgH1Bv9mhy8XPFQJOBn1FTq4LvEWA=="], "abs-svg-path": ["abs-svg-path@0.1.1", "", {}, "sha512-d8XPSGjfyzlXC3Xx891DJRyZfqk5JU0BJrDQcsWomFIV1/BIzPW5HDH5iDdWpqWaav0YVIEzT1RHTwWr0FFshA=="], "accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="], - "acorn": ["acorn@8.16.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="], + "acorn": ["acorn@8.17.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg=="], "acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="], @@ -1262,30 +996,22 @@ "ahooks": ["ahooks@3.9.7", "", { "dependencies": { "@babel/runtime": "^7.21.0", "@types/js-cookie": "^3.0.6", "dayjs": "^1.9.1", "intersection-observer": "^0.12.0", "js-cookie": "^3.0.5", "lodash": "^4.17.21", "react-fast-compare": "^3.2.2", "resize-observer-polyfill": "^1.5.1", "screenfull": "^5.0.0", "tslib": "^2.4.1" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-S0lvzhbdlhK36RFBkGv+RbOM/dbbweym+BIHM/bwwuWVSVN5TuVErHPMWo4w0t1NDYg5KPp2iEf7Y7E5LASYiw=="], - "ai": ["ai@7.0.14", "", { "dependencies": { "@ai-sdk/gateway": "4.0.11", "@ai-sdk/provider": "4.0.2", "@ai-sdk/provider-utils": "5.0.5" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-qA82fZyD4xh9IDB+s3SvwbjwjR+GGRmJjTYMwON1uROj8vPDIQbPTZLLq6ZWTVESn9daeH1GMv0zKfVLwNU2sQ=="], + "ai": ["ai@7.0.31", "", { "dependencies": { "@ai-sdk/gateway": "4.0.23", "@ai-sdk/provider": "4.0.3", "@ai-sdk/provider-utils": "5.0.11" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-pJfwKXjF5kw0rKRTePwYo60EfWb8wfzJAgf3ojln/YkOsVVKttzZAJVcRPsg37Z3a06ZdKkxX+DSrMAFlPm5Mw=="], - "ajv": ["ajv@6.15.0", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw=="], + "ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="], "ajv-formats": ["ajv-formats@3.0.1", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ=="], "ansi-colors": ["ansi-colors@4.1.3", "", {}, "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw=="], - "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], - - "ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + "ansi-regex": ["ansi-regex@6.2.2", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="], "ansis": ["ansis@4.3.1", "", {}, "sha512-BJ8/l4R5LRE7hW9WdSuGYrLSHi2ynxeFpDFbH0K/CgNeY/tyhk+vO6TYxXC5r5CpUhNVX310xzPsN/H9lCdfOA=="], - "antd": ["antd@6.4.3", "", { "dependencies": { "@ant-design/colors": "^8.0.1", "@ant-design/cssinjs": "^2.1.2", "@ant-design/cssinjs-utils": "^2.1.2", "@ant-design/fast-color": "^3.0.1", "@ant-design/icons": "^6.2.3", "@ant-design/react-slick": "~2.0.0", "@babel/runtime": "^7.29.2", "@rc-component/cascader": "~1.15.0", "@rc-component/checkbox": "~2.0.0", "@rc-component/collapse": "~1.2.0", "@rc-component/color-picker": "~3.1.1", "@rc-component/dialog": "~1.9.0", "@rc-component/drawer": "~1.4.2", "@rc-component/dropdown": "~1.0.2", "@rc-component/form": "~1.8.1", "@rc-component/image": "~1.9.0", "@rc-component/input": "~1.3.0", "@rc-component/input-number": "~1.6.2", "@rc-component/mentions": "~1.9.0", "@rc-component/menu": "~1.3.0", "@rc-component/motion": "^1.3.2", "@rc-component/mutate-observer": "^2.0.1", "@rc-component/notification": "~2.0.7", "@rc-component/pagination": "~1.2.0", "@rc-component/picker": "~1.10.0", "@rc-component/progress": "~1.0.2", "@rc-component/qrcode": "~1.1.1", "@rc-component/rate": "~1.0.1", "@rc-component/resize-observer": "^1.1.2", "@rc-component/segmented": "~1.3.0", "@rc-component/select": "~1.6.15", "@rc-component/slider": "~1.0.1", "@rc-component/steps": "~1.2.2", "@rc-component/switch": "~1.0.3", "@rc-component/table": "~1.10.0", "@rc-component/tabs": "~1.9.0", "@rc-component/tooltip": "~1.4.0", "@rc-component/tour": "~2.4.0", "@rc-component/tree": "~1.3.1", "@rc-component/tree-select": "~1.9.0", "@rc-component/trigger": "^3.9.0", "@rc-component/upload": "~1.1.0", "@rc-component/util": "^1.11.0", "clsx": "^2.1.1", "dayjs": "^1.11.11", "scroll-into-view-if-needed": "^3.1.0", "throttle-debounce": "^5.0.2" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-6H2avkxCGfxcF67r3J2mwm9Ck50el1pks/73vfM1wDsPL/tPtj5vHuauMgJFnrqmq7CH3g8aoZ0VBQbt+jpAsw=="], + "antd": ["antd@6.5.1", "", { "dependencies": { "@ant-design/colors": "^8.0.1", "@ant-design/cssinjs": "^2.1.2", "@ant-design/cssinjs-utils": "^2.1.2", "@ant-design/fast-color": "^3.0.1", "@ant-design/icons": "^6.3.2", "@ant-design/react-slick": "~2.0.0", "@babel/runtime": "^7.29.2", "@rc-component/cascader": "~1.17.0", "@rc-component/checkbox": "~2.0.0", "@rc-component/collapse": "~1.2.0", "@rc-component/color-picker": "~3.1.1", "@rc-component/dialog": "~1.10.0", "@rc-component/drawer": "~1.4.2", "@rc-component/dropdown": "~1.0.3", "@rc-component/form": "~1.8.5", "@rc-component/image": "~1.9.0", "@rc-component/input": "~1.3.1", "@rc-component/input-number": "~1.6.2", "@rc-component/mentions": "~1.10.0", "@rc-component/menu": "~1.4.1", "@rc-component/motion": "^1.3.3", "@rc-component/mutate-observer": "^2.0.1", "@rc-component/notification": "~2.0.7", "@rc-component/pagination": "~1.4.0", "@rc-component/picker": "~1.11.0", "@rc-component/progress": "~1.0.2", "@rc-component/qrcode": "~2.0.0", "@rc-component/rate": "~1.0.1", "@rc-component/resize-observer": "^1.1.2", "@rc-component/segmented": "~1.3.0", "@rc-component/select": "~1.8.2", "@rc-component/slider": "~1.1.1", "@rc-component/steps": "~1.2.2", "@rc-component/switch": "~1.0.3", "@rc-component/table": "~1.10.4", "@rc-component/tabs": "~1.11.0", "@rc-component/tooltip": "~1.4.0", "@rc-component/tour": "~2.4.0", "@rc-component/tree": "~1.3.2", "@rc-component/tree-select": "~1.11.0", "@rc-component/trigger": "^3.10.0", "@rc-component/upload": "~1.1.1", "@rc-component/util": "^1.11.1", "clsx": "^2.1.1", "dayjs": "^1.11.11", "scroll-into-view-if-needed": "^3.1.0", "throttle-debounce": "^5.0.2" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-VZVVF9zYI6S0NHqboVhCoY9Iiqj6dphW1NPB+sEaAf2HuIQ0haXWXj7ZvAXTRDzusktV6+cvvrSZEdRi4twATg=="], "antd-style": ["antd-style@4.1.0", "", { "dependencies": { "@ant-design/cssinjs": "^2.0.0", "@babel/runtime": "^7.24.1", "@emotion/cache": "^11.11.0", "@emotion/css": "^11.11.2", "@emotion/react": "^11.11.4", "@emotion/serialize": "^1.1.3", "@emotion/utils": "^1.2.1", "use-merge-value": "^1.2.0" }, "peerDependencies": { "antd": ">=6.0.0", "react": ">=18" } }, "sha512-vnPBGg0OVlSz90KRYZhxd89aZiOImTiesF+9MQqN8jsLGZUQTjbP04X9jTdEfsztKUuMbBWg/RmB/wHTakbtMQ=="], - "any-promise": ["any-promise@1.3.0", "", {}, "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A=="], - - "anymatch": ["anymatch@3.1.3", "", { "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw=="], - - "arg": ["arg@5.0.2", "", {}, "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg=="], - "argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], "aria-hidden": ["aria-hidden@1.2.6", "", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA=="], @@ -1298,16 +1024,14 @@ "astring": ["astring@1.9.0", "", { "bin": { "astring": "bin/astring" } }, "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg=="], - "async-validator": ["async-validator@3.5.2", "", {}, "sha512-8eLCg00W9pIRZSB781UUX/H6Oskmm8xloZfr09lz5bikRpBVDlJ3hRVuxxP1SxcwsEYfJ4IU8Q19Y8/893r3rQ=="], - "asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="], + "atomically": ["atomically@1.7.0", "", {}, "sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w=="], + "attr-accept": ["attr-accept@2.2.5", "", {}, "sha512-0bDNnY/u6pPwHDMoF0FieU354oBi0a8rD9FcsLwzcGWbc8KS8KPIi7y+s13OlVY+gMWc/9xEMUgNE6Qm8ZllYQ=="], "auto-skeleton-react": ["auto-skeleton-react@1.0.5", "", { "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-e7299X8Rm6dXMUU2FlIJBNSOrit65GsyHzPhtkGX9Mf7u3zfGduSRazZrT7h2XAXRGye5nPayIjyNoG4oHFxcQ=="], - "autoprefixer": ["autoprefixer@10.5.0", "", { "dependencies": { "browserslist": "^4.28.2", "caniuse-lite": "^1.0.30001787", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": { "autoprefixer": "bin/autoprefixer" } }, "sha512-FMhOoZV4+qR6aTUALKX2rEqGG+oyATvwBt9IIzVR5rMa2HRWPkxf+P+PAJLD1I/H5/II+HuZcBJYEFBpq39ong=="], - "axios": ["axios@1.18.1", "", { "dependencies": { "follow-redirects": "^1.16.0", "form-data": "^4.0.5", "https-proxy-agent": "^5.0.1", "proxy-from-env": "^2.1.0" } }, "sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g=="], "babel-dead-code-elimination": ["babel-dead-code-elimination@1.0.12", "", { "dependencies": { "@babel/core": "^7.23.7", "@babel/parser": "^7.23.6", "@babel/traverse": "^7.23.7", "@babel/types": "^7.23.6" } }, "sha512-GERT7L2TiYcYDtYk1IpD+ASAYXjKbLTDPhBtYj7X1NuRMDTMtAx9kyBenub1Ev41lo91OHCKdmP+egTDmfQ7Ig=="], @@ -1318,21 +1042,15 @@ "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], - "baseline-browser-mapping": ["baseline-browser-mapping@2.10.33", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-bA6+tcSLpz2tIEdDXZPpPTIuxBcC4+w6SieaYyfigIa4h8GlFxbA17v22Vx3JUtuZQj9SgOsnbK+aTBzyDyEuw=="], + "baseline-browser-mapping": ["baseline-browser-mapping@2.10.43", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ=="], - "bezier-easing": ["bezier-easing@2.1.0", "", {}, "sha512-gbIqZ/eslnUFC1tjEvtz0sgx+xTK20wDnYMIA27VA04R7w6xxXQPZDbibjA9DTWZRA2CXtwHykkVzlCaAJAZig=="], + "body-parser": ["body-parser@2.3.0", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^2.0.0", "debug": "^4.4.3", "http-errors": "^2.0.1", "iconv-lite": "^0.7.2", "on-finished": "^2.4.1", "qs": "^6.15.2", "raw-body": "^3.0.2", "type-is": "^2.1.0" } }, "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw=="], - "binary-extensions": ["binary-extensions@2.3.0", "", {}, "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw=="], - - "binary-searching": ["binary-searching@2.0.5", "", {}, "sha512-v4N2l3RxL+m4zDxyxz3Ne2aTmiPn8ZUpKFpdPtO+ItW1NcTCXA7JeHG5GMBSvoKSkQZ9ycS+EouDVxYB9ufKWA=="], - - "body-parser": ["body-parser@2.2.2", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^1.0.5", "debug": "^4.4.3", "http-errors": "^2.0.0", "iconv-lite": "^0.7.0", "on-finished": "^2.4.1", "qs": "^6.14.1", "raw-body": "^3.0.1", "type-is": "^2.0.1" } }, "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA=="], - - "brace-expansion": ["brace-expansion@1.1.15", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg=="], + "brace-expansion": ["brace-expansion@2.1.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA=="], "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], - "browserslist": ["browserslist@4.28.2", "", { "dependencies": { "baseline-browser-mapping": "^2.10.12", "caniuse-lite": "^1.0.30001782", "electron-to-chromium": "^1.5.328", "node-releases": "^2.0.36", "update-browserslist-db": "^1.2.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg=="], + "browserslist": ["browserslist@4.28.6", "", { "dependencies": { "baseline-browser-mapping": "^2.10.42", "caniuse-lite": "^1.0.30001803", "electron-to-chromium": "^1.5.389", "node-releases": "^2.0.51", "update-browserslist-db": "^1.2.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw=="], "buffer-from": ["buffer-from@1.1.2", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="], @@ -1346,13 +1064,11 @@ "callsites": ["callsites@3.1.0", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="], - "camelcase-css": ["camelcase-css@2.0.1", "", {}, "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA=="], - - "caniuse-lite": ["caniuse-lite@1.0.30001793", "", {}, "sha512-iwSsYWaCOoh26cV8NwNRViHlrfUvYsHDfRVcbtmw0Kg6PJIZZXwMkj1442FYLBGkeUf1juAsU3DTfxW579mrPA=="], + "caniuse-lite": ["caniuse-lite@1.0.30001806", "", {}, "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw=="], "ccount": ["ccount@2.0.1", "", {}, "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg=="], - "chalk": ["chalk@4.1.1", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg=="], + "chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], "character-entities": ["character-entities@2.0.2", "", {}, "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ=="], @@ -1362,8 +1078,6 @@ "character-reference-invalid": ["character-reference-invalid@2.0.1", "", {}, "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw=="], - "chardet": ["chardet@2.1.1", "", {}, "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ=="], - "chokidar": ["chokidar@5.0.0", "", { "dependencies": { "readdirp": "^5.0.0" } }, "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw=="], "chroma-js": ["chroma-js@3.2.0", "", {}, "sha512-os/OippSlX1RlWWr+QDPcGUZs0uoqr32urfxESG9U93lhUfbnlyckte84Q8P1UQY/qth983AS1JONKmLS4T0nw=="], @@ -1378,8 +1092,6 @@ "cli-spinners": ["cli-spinners@2.9.2", "", {}, "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="], - "cli-width": ["cli-width@4.1.0", "", {}, "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ=="], - "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="], "cmdk": ["cmdk@1.1.1", "", { "dependencies": { "@radix-ui/react-compose-refs": "^1.1.1", "@radix-ui/react-dialog": "^1.1.6", "@radix-ui/react-id": "^1.1.0", "@radix-ui/react-primitive": "^2.0.2" }, "peerDependencies": { "react": "^18 || ^19 || ^19.0.0-rc", "react-dom": "^18 || ^19 || ^19.0.0-rc" } }, "sha512-Vsv7kFaXm+ptHDMZ7izaRsP70GgrW9NBNGswt9OZaVBLlE0SNpDq8eu/VGXyF9r7M0azK3Wy7OlYXsuyYLFzHg=="], @@ -1400,14 +1112,12 @@ "commander": ["commander@14.0.3", "", {}, "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw=="], - "comment-parser": ["comment-parser@1.4.7", "", {}, "sha512-0h+uSNtQGW3D98eQt3jJ8L06Fves8hncB4V/PKdw/Qb8Hnk19VaKuTr55UNRYiSoVa7WwrFls+rh3ux9agmkeQ=="], - - "compute-scroll-into-view": ["compute-scroll-into-view@1.0.20", "", {}, "sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg=="], - - "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="], + "compute-scroll-into-view": ["compute-scroll-into-view@3.1.1", "", {}, "sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw=="], "concat-stream": ["concat-stream@2.0.0", "", { "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.0.2", "typedarray": "^0.0.6" } }, "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A=="], + "conf": ["conf@10.2.0", "", { "dependencies": { "ajv": "^8.6.3", "ajv-formats": "^2.1.1", "atomically": "^1.7.0", "debounce-fn": "^4.0.0", "dot-prop": "^6.0.1", "env-paths": "^2.2.1", "json-schema-typed": "^7.0.3", "onetime": "^5.1.2", "pkg-up": "^3.1.0", "semver": "^7.3.5" } }, "sha512-8fLl9F04EJqjSqH+QjITQfJF8BrOVaYr1jewVgSRAEWePfxT0sku4w2hrGQ60BC/TNLGQ2pgxNlTbWQmMPFvXg=="], + "content-disposition": ["content-disposition@1.1.0", "", {}, "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g=="], "content-type": ["content-type@1.0.5", "", {}, "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="], @@ -1420,17 +1130,15 @@ "cookie-signature": ["cookie-signature@1.2.2", "", {}, "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg=="], - "copy-text-to-clipboard": ["copy-text-to-clipboard@2.2.0", "", {}, "sha512-WRvoIdnTs1rgPMkgA2pUOa/M4Enh2uzCwdKsOMYNAJiz/4ZvEJgmbF4OmninPmlFdAWisfeh0tH+Cpf7ni3RqQ=="], - "core-util-is": ["core-util-is@1.0.3", "", {}, "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="], "cors": ["cors@2.8.6", "", { "dependencies": { "object-assign": "^4", "vary": "^1" } }, "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw=="], "cose-base": ["cose-base@1.0.3", "", { "dependencies": { "layout-base": "^1.0.0" } }, "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg=="], - "cosmiconfig": ["cosmiconfig@9.0.1", "", { "dependencies": { "env-paths": "^2.2.1", "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", "parse-json": "^5.2.0" }, "peerDependencies": { "typescript": ">=4.9.5" }, "optionalPeers": ["typescript"] }, "sha512-hr4ihw+DBqcvrsEDioRO31Z17x71pUYoNe/4h6Z0wB72p7MU7/9gH8Q3s12NFhHPfYBBOV3qyfUxmr/Yn3shnQ=="], + "cosmiconfig": ["cosmiconfig@9.0.2", "", { "dependencies": { "env-paths": "^2.2.1", "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", "parse-json": "^5.2.0" }, "peerDependencies": { "typescript": ">=4.9.5" }, "optionalPeers": ["typescript"] }, "sha512-gtTZxTDau1wL7Y7zifc2dd8jHSK/k6BTx/2Xp/BpdlAdnlYWFVt7qhJqgwi7637yRwRQ3qL4ZidbB4I8tA5VOg=="], - "crelt": ["crelt@1.0.6", "", {}, "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g=="], + "crelt": ["crelt@1.0.7", "", {}, "sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA=="], "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], @@ -1438,7 +1146,7 @@ "csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="], - "cytoscape": ["cytoscape@3.33.4", "", {}, "sha512-HIN5Pmd9MrX9BkV7tDwnOcEJCSFvCpc8X97h3f508J6I5FsqAY65wKOCvgH2CuP42CaahWaz4tuh32SOOIH7ww=="], + "cytoscape": ["cytoscape@3.34.0", "", {}, "sha512-62rNSrioXw93uliKFBwjukeQyeWwH2PqDrTac31r2P6464u3AUvTk0xS4LVvT251g7IgkFunrI48ZEZGjywSOg=="], "cytoscape-cose-bilkent": ["cytoscape-cose-bilkent@4.1.0", "", { "dependencies": { "cose-base": "^1.0.0" }, "peerDependencies": { "cytoscape": "^3.2.0" } }, "sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ=="], @@ -1514,10 +1222,10 @@ "date-fns": ["date-fns@4.4.0", "", {}, "sha512-+1UMbeh68lH1SegH83CGWwpb6OHHbpSgr3+s5Eww5M4CAgswBpoWS0AjTOfEJ33HiYKz1hdj/KTFprzXHmq/6w=="], - "date-fns-tz": ["date-fns-tz@1.3.8", "", { "peerDependencies": { "date-fns": ">=2.0.0" } }, "sha512-qwNXUFtMHTTU6CFSFjoJ80W8Fzzp24LntbjFFBgL/faqds4e5mo9mftoRLgr3Vi1trISsg4awSpYVsOQCRnapQ=="], - "dayjs": ["dayjs@1.11.21", "", {}, "sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA=="], + "debounce-fn": ["debounce-fn@4.0.0", "", { "dependencies": { "mimic-fn": "^3.0.0" } }, "sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ=="], + "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], "decimal.js-light": ["decimal.js-light@2.5.1", "", {}, "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg=="], @@ -1528,8 +1236,6 @@ "dedent": ["dedent@1.7.2", "", { "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, "optionalPeers": ["babel-plugin-macros"] }, "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA=="], - "deep-is": ["deep-is@0.1.4", "", {}, "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="], - "deepmerge": ["deepmerge@4.3.1", "", {}, "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="], "default-browser": ["default-browser@5.5.0", "", { "dependencies": { "bundle-name": "^4.1.0", "default-browser-id": "^5.0.0" } }, "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw=="], @@ -1552,25 +1258,19 @@ "devlop": ["devlop@1.1.0", "", { "dependencies": { "dequal": "^2.0.0" } }, "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA=="], - "didyoumean": ["didyoumean@1.2.2", "", {}, "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw=="], - "diff": ["diff@8.0.4", "", {}, "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw=="], - "dlv": ["dlv@1.1.3", "", {}, "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA=="], - - "doctrine": ["doctrine@3.0.0", "", { "dependencies": { "esutils": "^2.0.2" } }, "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w=="], - "dompurify": ["dompurify@3.4.11", "", { "optionalDependencies": { "@types/trusted-types": "^2.0.7" } }, "sha512-zhlUV12GsaRzMsf9q5M254YhA4+VuF0fG+QFqu6aYpoGlKtz+w8//jBcGVYBgQkR5GHjUomejY84AV+/uPbWdw=="], + "dot-prop": ["dot-prop@6.0.1", "", { "dependencies": { "is-obj": "^2.0.0" } }, "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA=="], + "dotenv": ["dotenv@17.4.2", "", {}, "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw=="], "dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="], - "eciesjs": ["eciesjs@0.4.18", "", { "dependencies": { "@ecies/ciphers": "^0.2.5", "@noble/ciphers": "^1.3.0", "@noble/curves": "^1.9.7", "@noble/hashes": "^1.8.0" } }, "sha512-wG99Zcfcys9fZux7Cft8BAX/YrOJLJSZ3jyYPfhZHqN2E+Ffx+QXBDsv3gubEgPtV6dTzJMSQUwk1H98/t/0wQ=="], - "ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="], - "electron-to-chromium": ["electron-to-chromium@1.5.364", "", {}, "sha512-G/dYE3+AYhyHwzTwg8UbnXf7zqMERYh7l2jJ3QujhFsH8agSYwtnGAR2aZ7f0AakIKJXd5En/Hre4igIUrdlYw=="], + "electron-to-chromium": ["electron-to-chromium@1.5.393", "", {}, "sha512-kiDJdIUawuEIcp9XoICKp1iTYDEbgguIPq526N1Q7jIQDeQ3CqoMx71025PI/7E48Ddtw2HuWsVjY7afEgNxmg=="], "embla-carousel": ["embla-carousel@8.6.0", "", {}, "sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA=="], @@ -1584,7 +1284,7 @@ "encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="], - "enhanced-resolve": ["enhanced-resolve@5.21.6", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.3" } }, "sha512-aNnGCvbJ/RIyWo1IuhNdVjnNF+EjH9wpzpNHt+ci/m9He9LJvUN8wrCcXjp9cWsGNAuvSpVFTx/vraAFQ8qGjQ=="], + "enhanced-resolve": ["enhanced-resolve@5.24.3", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.3" } }, "sha512-PwKooW9JUzh5chmYfHM3IQl5OkK2u2Nm011MgeZrss3JmFraUx/fqrf78kk8GUMYoibx/14MdwTl/1WKkG7TpQ=="], "enquirer": ["enquirer@2.4.1", "", { "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" } }, "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ=="], @@ -1602,7 +1302,7 @@ "es-set-tostringtag": ["es-set-tostringtag@2.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="], - "es-toolkit": ["es-toolkit@1.47.0", "", {}, "sha512-n1GuoD0WEQZMBk5tttoZSqwgyLx01oqa5XsBmCHwPyNe1S9jPBEmtR2pSgp2kJuWE3ciFZ6yRHmY4pM4C3OOkw=="], + "es-toolkit": ["es-toolkit@1.49.0", "", {}, "sha512-G5iZ6Pc/FNRY/soKZHC+TxGDD83rHUDXxzaWhGCX44vAv/tMs56WMusnm/KMNK+luUPsgA9U28cGr4RDlSzL2g=="], "esast-util-from-estree": ["esast-util-from-estree@2.0.0", "", { "dependencies": { "@types/estree-jsx": "^1.0.0", "devlop": "^1.0.0", "estree-util-visit": "^2.0.0", "unist-util-position-from-estree": "^2.0.0" } }, "sha512-4CyanoAudUSBAn5K13H4JhsMH6L9ZP7XbLVe/dKybkxMO7eDyLsT8UHl9TRNrU2Gr9nz+FovfSIjuXWJ81uVwQ=="], @@ -1614,26 +1314,8 @@ "escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="], - "eslint": ["eslint@8.57.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", "@eslint/js": "8.57.0", "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.2.2", "eslint-visitor-keys": "^3.4.3", "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3", "strip-ansi": "^6.0.1", "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" } }, "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ=="], - - "eslint-plugin-header": ["eslint-plugin-header@3.1.1", "", { "peerDependencies": { "eslint": ">=7.7.0" } }, "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg=="], - - "eslint-plugin-react-hooks": ["eslint-plugin-react-hooks@5.2.0", "", { "peerDependencies": { "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" } }, "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg=="], - - "eslint-scope": ["eslint-scope@7.2.2", "", { "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg=="], - - "eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="], - - "espree": ["espree@9.6.1", "", { "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.4.1" } }, "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ=="], - "esprima": ["esprima@4.0.1", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="], - "esquery": ["esquery@1.7.0", "", { "dependencies": { "estraverse": "^5.1.0" } }, "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g=="], - - "esrecurse": ["esrecurse@4.3.0", "", { "dependencies": { "estraverse": "^5.2.0" } }, "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag=="], - - "estraverse": ["estraverse@5.3.0", "", {}, "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="], - "estree-util-attach-comments": ["estree-util-attach-comments@3.0.0", "", { "dependencies": { "@types/estree": "^1.0.0" } }, "sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw=="], "estree-util-build-jsx": ["estree-util-build-jsx@3.0.1", "", { "dependencies": { "@types/estree-jsx": "^1.0.0", "devlop": "^1.0.0", "estree-util-is-identifier-name": "^3.0.0", "estree-walker": "^3.0.0" } }, "sha512-8U5eiL6BTrPxp/CHbs2yMgP8ftMhR5ww1eIKoWRMlqvltHF8fZn5LRDvTKuxD3DUn+shRbLGqXemcP51oFCsGQ=="], @@ -1648,8 +1330,6 @@ "estree-walker": ["estree-walker@3.0.3", "", { "dependencies": { "@types/estree": "^1.0.0" } }, "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g=="], - "esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="], - "etag": ["etag@1.8.1", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="], "eventemitter3": ["eventemitter3@5.0.4", "", {}, "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw=="], @@ -1662,32 +1342,18 @@ "express": ["express@5.2.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="], - "express-rate-limit": ["express-rate-limit@8.5.2", "", { "dependencies": { "ip-address": "^10.2.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-5Kb34ipNX694DH48vN9irak1Qx30nb0PLYHXfJgw4YEjiC3ZEmZJhwOp+VfiCYwFzvFTdB9QkArYS5kXa2cx2A=="], + "express-rate-limit": ["express-rate-limit@8.6.0", "", { "dependencies": { "debug": "^4.4.3", "ip-address": "^10.2.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-XKJXDsASUOo0LLtFwW5hCcQGH0N4WQc/Rn8/Pvoia+TJFOkkFPvrtW9lZOeeNcxQJspvOIERMwiRLsVFlhHEkA=="], "extend": ["extend@3.0.2", "", {}, "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="], "extend-shallow": ["extend-shallow@2.0.1", "", { "dependencies": { "is-extendable": "^0.1.0" } }, "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug=="], - "fast-copy": ["fast-copy@3.0.2", "", {}, "sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ=="], - "fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="], - "fast-equals": ["fast-equals@5.4.0", "", {}, "sha512-jt2DW/aNFNwke7AUd+Z+e6pz39KO5rzdbbFCg2sGafS4mk13MI7Z8O5z9cADNn5lhGODIgLwug6TZO2ctf7kcw=="], - "fast-glob": ["fast-glob@3.3.3", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="], - "fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="], - - "fast-levenshtein": ["fast-levenshtein@2.0.6", "", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="], - - "fast-string-truncated-width": ["fast-string-truncated-width@3.0.3", "", {}, "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g=="], - - "fast-string-width": ["fast-string-width@3.0.2", "", { "dependencies": { "fast-string-truncated-width": "^3.0.2" } }, "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg=="], - "fast-uri": ["fast-uri@3.1.2", "", {}, "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ=="], - "fast-wrap-ansi": ["fast-wrap-ansi@0.2.2", "", { "dependencies": { "fast-string-width": "^3.0.2" } }, "sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q=="], - "fastq": ["fastq@1.20.1", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw=="], "fd-package-json": ["fd-package-json@2.0.0", "", { "dependencies": { "walk-up-path": "^4.0.0" } }, "sha512-jKmm9YtsNXN789RS/0mSzOC1NUq9mkVd65vbSSVsKdjGvYXBuE4oWe2QOEoFeRmJg+lPuZxpmrfFclNhoRMneQ=="], @@ -1696,9 +1362,7 @@ "figures": ["figures@6.1.0", "", { "dependencies": { "is-unicode-supported": "^2.0.0" } }, "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg=="], - "file-entry-cache": ["file-entry-cache@6.0.1", "", { "dependencies": { "flat-cache": "^3.0.4" } }, "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg=="], - - "file-selector": ["file-selector@2.1.2", "", { "dependencies": { "tslib": "^2.7.0" } }, "sha512-QgXo+mXTe8ljeqUFaX3QVHc5osSItJ/Km+xpocx0aSqWGMSCf6qYs/VnzZgS864Pjn5iceMRFigeAV7AfTlaig=="], + "file-selector": ["file-selector@0.5.0", "", { "dependencies": { "tslib": "^2.0.3" } }, "sha512-s8KNnmIDTBoD0p9uJ9uD0XY38SCeBOtj0UMXyQSLg1Ypfrfj8+dAvwsLjYQkQ2GjhVtp2HrnF5cJzMhBjfD8HA=="], "file-source": ["file-source@0.6.1", "", { "dependencies": { "stream-source": "0.3" } }, "sha512-1R1KneL7eTXmXfKxC10V/9NeGOdbsAXJ+lQ//fvvcHUgtaZcZDWNJNblxAoVOyV1cj45pOtUrR3vZTBwqcW8XA=="], @@ -1710,33 +1374,23 @@ "find-root": ["find-root@1.1.0", "", {}, "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng=="], - "find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="], - - "flat-cache": ["flat-cache@3.2.0", "", { "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.3", "rimraf": "^3.0.2" } }, "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw=="], - - "flatted": ["flatted@3.4.2", "", {}, "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA=="], + "find-up": ["find-up@3.0.0", "", { "dependencies": { "locate-path": "^3.0.0" } }, "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg=="], "follow-redirects": ["follow-redirects@1.16.0", "", {}, "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw=="], "for-in": ["for-in@1.0.2", "", {}, "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ=="], - "form-data": ["form-data@4.0.5", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.2", "mime-types": "^2.1.12" } }, "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w=="], + "form-data": ["form-data@4.0.6", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.4", "mime-types": "^2.1.35" } }, "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ=="], "formatly": ["formatly@0.3.0", "", { "dependencies": { "fd-package-json": "^2.0.0" }, "bin": { "formatly": "bin/index.mjs" } }, "sha512-9XNj/o4wrRFyhSMJOvsuyMwy8aUfBaZ1VrqHVfohyXf0Sw0e+yfKG+xZaY3arGCOMdwFsqObtzVOc1gU9KiT9w=="], "forwarded": ["forwarded@0.2.0", "", {}, "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="], - "fraction.js": ["fraction.js@5.3.4", "", {}, "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ=="], - "framer-motion": ["framer-motion@12.42.2", "", { "dependencies": { "motion-dom": "^12.42.2", "motion-utils": "^12.39.0", "tslib": "^2.4.0" }, "peerDependencies": { "@emotion/is-prop-valid": "*", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["@emotion/is-prop-valid", "react", "react-dom"] }, "sha512-5XY9luDiu0oHfHBjpDthFMh0ES+122w6p/papSJBweMkO8Sn+PW2QaEgRblQBpWFnuvZS5qvarpt/hO2pjGmnw=="], "fresh": ["fresh@2.0.0", "", {}, "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A=="], - "fs-extra": ["fs-extra@11.3.5", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-eKpRKAovdpZtR1WopLHxlBWvAgPny3c4gX1G5Jhwmmw4XJj0ifSD5qB5TOo8hmA0wlRKDAOAhEE1yVPgs6Fgcg=="], - - "fs.realpath": ["fs.realpath@1.0.0", "", {}, "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="], - - "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + "fs-extra": ["fs-extra@11.3.6", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-w8ZNZr2mKIc7qeNaQ9AVPT1+iFaI+Avd4xudVOvdDJ8VytREi1Ft5Ih7hd9jjehod8vAM5GMsfQ/TpPf4EyoEA=="], "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], @@ -1774,11 +1428,7 @@ "giscus": ["giscus@1.6.0", "", { "dependencies": { "lit": "^3.2.1" } }, "sha512-Zrsi8r4t1LVW950keaWcsURuZUQwUaMKjvJgTCY125vkW6OiEBkatE7ScJDbpqKHdZwb///7FVC21SE3iFK3PQ=="], - "glob": ["glob@13.0.6", "", { "dependencies": { "minimatch": "^10.2.2", "minipass": "^7.1.3", "path-scurry": "^2.0.2" } }, "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw=="], - - "glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="], - - "globals": ["globals@13.24.0", "", { "dependencies": { "type-fest": "^0.20.2" } }, "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ=="], + "glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], "goober": ["goober@2.1.19", "", { "peerDependencies": { "csstype": "^3.0.10" } }, "sha512-U7veizMqxyKlM58+Z5j2ngJBH/r9siDmxpvNxSw0PylF6WQvrASJEZrxh1hidRBJc2jqoBVSyOban5u8m+6Rxg=="], @@ -1786,12 +1436,8 @@ "graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="], - "graphemer": ["graphemer@1.4.0", "", {}, "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag=="], - "hachure-fill": ["hachure-fill@0.5.2", "", {}, "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg=="], - "has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="], - "has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="], "has-tostringtag": ["has-tostringtag@1.0.2", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="], @@ -1826,13 +1472,9 @@ "hastscript": ["hastscript@9.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-parse-selector": "^4.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0" } }, "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w=="], - "highlight.js": ["highlight.js@11.11.1", "", {}, "sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w=="], - - "history": ["history@5.3.0", "", { "dependencies": { "@babel/runtime": "^7.7.6" } }, "sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ=="], - "hoist-non-react-statics": ["hoist-non-react-statics@3.3.2", "", { "dependencies": { "react-is": "^16.7.0" } }, "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw=="], - "hono": ["hono@4.12.23", "", {}, "sha512-eIaZ9qDgu7XV0pxOCrg7/WhnQ6Ivm22UcxhXx/A3dcbqbbYgBEkc6e/J/s7j2tS96zoB0S9VBdLwQNCWwUo4LA=="], + "hono": ["hono@4.12.22", "", {}, "sha512-7fvVPbB92zNRsQke+uiRGwtTuef0tB2Dg4hWxYfFNvkQhIltWoyi0ONReM5LWA+jJWS3nfT5lTq+qbsIpX0IQw=="], "html-parse-stringify": ["html-parse-stringify@3.0.1", "", { "dependencies": { "void-elements": "3.1.0" } }, "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg=="], @@ -1846,38 +1488,28 @@ "human-signals": ["human-signals@8.0.1", "", {}, "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ=="], - "i18next": ["i18next@26.3.4", "", { "peerDependencies": { "typescript": "^5 || ^6" }, "optionalPeers": ["typescript"] }, "sha512-pa7m0d7pBDqGHZxljT+WPFeyFgQ7P7SciPPo1tTqYuO0z4sqADYhwnBESmmGp/wEof1inwdls/k8ZgTg8rxFHA=="], + "i18next": ["i18next@26.3.6", "", { "peerDependencies": { "typescript": "^5 || ^6 || ^7" }, "optionalPeers": ["typescript"] }, "sha512-Bu5Z2nAXgfVyM8xvW3jk9EKRIuX37PudsrBViThNFx7CR7aaYTpP01cxNB/E4c4UUzTDiAZRstEhsRfPOL/8xA=="], "i18next-browser-languagedetector": ["i18next-browser-languagedetector@8.2.1", "", { "dependencies": { "@babel/runtime": "^7.23.2" } }, "sha512-bZg8+4bdmaOiApD7N7BPT9W8MLZG+nPTOFlLiJiT8uzKXFjhxw4v2ierCXOwB5sFDMtuA5G4kgYZ0AznZxQ/cw=="], - "i18next-cli": ["i18next-cli@1.58.1", "", { "dependencies": { "@croct/json5-parser": "^0.2.2", "@swc/core": "^1.15.26", "chokidar": "^5.0.0", "commander": "^14.0.3", "execa": "^9.6.1", "glob": "^13.0.6", "i18next-resources-for-ts": "^2.1.0", "inquirer": "^13.4.1", "jiti": "^2.6.1", "jsonc-parser": "^3.3.1", "magic-string": "^0.30.21", "minimatch": "^10.2.5", "ora": "^9.3.0", "react": "^19.2.5", "react-i18next": "^17.0.7", "yaml": "^2.8.3" }, "bin": { "i18next-cli": "dist/esm/cli.js" } }, "sha512-vpTtfeCm4LvGV16aLX421wZqD20g4Z8LD0yIC4m0x02rVMdUJXOUVm7l8Xxl1+6OwWq/8InR17RGZN9QfsHScQ=="], - - "i18next-resources-for-ts": ["i18next-resources-for-ts@2.1.0", "", { "dependencies": { "@babel/runtime": "^7.28.6", "@swc/core": "^1.15.18", "chokidar": "^5.0.0", "yaml": "^2.8.2" }, "bin": { "i18next-resources-for-ts": "bin/i18next-resources-for-ts.js" } }, "sha512-n5UexwEVt0OoIAhG2MWpSnAVJW1U8mQrQTmXyxc5DMAx+NLhcLZhSMJo/FnUsA5JQ3obTYqTgB7YIuZKWpDgow=="], - - "iconv-lite": ["iconv-lite@0.7.2", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw=="], + "iconv-lite": ["iconv-lite@0.7.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ=="], "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], "ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], - "immer": ["immer@11.1.8", "", {}, "sha512-/tbkHMW7y10Lx6i1crLjD4/OhNkRG+Fo7byZHtah0547nIeXYcpIXaUh0IAQY6gO5459qpGGYapcEOHtFXkIuA=="], + "immer": ["immer@11.1.15", "", {}, "sha512-VrNANlmnWQnh5COXIIOQXM9oOJw7naGKlBT74ZOOR6lpVXc3gFEu9FJLDFcpCJ2j+NWr8TIwtWD//T6ZX6TKiQ=="], "import-fresh": ["import-fresh@3.3.1", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="], "import-meta-resolve": ["import-meta-resolve@4.2.0", "", {}, "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg=="], - "imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="], - - "inflight": ["inflight@1.0.6", "", { "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA=="], - "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], "inline-style-parser": ["inline-style-parser@0.2.7", "", {}, "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA=="], "input-otp": ["input-otp@1.4.2", "", { "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-l3jWwYNvrEa6NTCt7BECfCm48GvwuZzkoeG3gBL2w4CHeOXW3eKFmf9UNYkNfYc3mxMrthMnxjIE07MT0zLBQA=="], - "inquirer": ["inquirer@13.4.3", "", { "dependencies": { "@inquirer/ansi": "^2.0.5", "@inquirer/core": "^11.1.10", "@inquirer/prompts": "^8.4.3", "@inquirer/type": "^4.0.5", "mute-stream": "^3.0.0", "run-async": "^4.0.6", "rxjs": "^7.8.2" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-EPd3IqieHSavSOXh+LZhrIkdQcOELWeRblLT6kslQr+cF9XTh/HxZdSt1YkHH1iq4dvqBnV42uwg2YlorgOy6g=="], - "internmap": ["internmap@2.0.3", "", {}, "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg=="], "intersection-observer": ["intersection-observer@0.12.2", "", {}, "sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg=="], @@ -1892,13 +1524,11 @@ "is-arrayish": ["is-arrayish@0.2.1", "", {}, "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="], - "is-binary-path": ["is-binary-path@2.1.0", "", { "dependencies": { "binary-extensions": "^2.0.0" } }, "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw=="], - "is-core-module": ["is-core-module@2.16.2", "", { "dependencies": { "hasown": "^2.0.3" } }, "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA=="], "is-decimal": ["is-decimal@2.0.1", "", {}, "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A=="], - "is-docker": ["is-docker@3.0.0", "", { "bin": { "is-docker": "cli.js" } }, "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ=="], + "is-docker": ["is-docker@2.2.1", "", { "bin": { "is-docker": "cli.js" } }, "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ=="], "is-extendable": ["is-extendable@1.0.1", "", { "dependencies": { "is-plain-object": "^2.0.4" } }, "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA=="], @@ -1920,8 +1550,6 @@ "is-obj": ["is-obj@3.0.0", "", {}, "sha512-IlsXEHOjtKhpN8r/tRFj2nDyTmHvcfNeu/nrRIcXE17ROeatXchkojffa1SpdqW4cr/Fj6QkEf/Gn4zf6KKvEQ=="], - "is-path-inside": ["is-path-inside@3.0.3", "", {}, "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ=="], - "is-plain-obj": ["is-plain-obj@4.1.0", "", {}, "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg=="], "is-plain-object": ["is-plain-object@2.0.4", "", { "dependencies": { "isobject": "^3.0.1" } }, "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og=="], @@ -1934,11 +1562,11 @@ "is-unicode-supported": ["is-unicode-supported@2.1.0", "", {}, "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ=="], - "is-wsl": ["is-wsl@3.1.1", "", { "dependencies": { "is-inside-container": "^1.0.0" } }, "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw=="], + "is-wsl": ["is-wsl@2.2.0", "", { "dependencies": { "is-docker": "^2.0.0" } }, "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww=="], "isarray": ["isarray@0.0.1", "", {}, "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="], - "isbot": ["isbot@5.1.40", "", {}, "sha512-yNeeynhhtIVRBk12tBV4eHNxwB42HzR4Q3Ea7vCOiJhImGaAIdIMrbJtacQlBizGLjUPw+akkFI5Dn9T70XoVQ=="], + "isbot": ["isbot@5.2.1", "", {}, "sha512-dJ+LpKyClQZ7NG+j3OensC/mAZkGpukE9YUrgPYvAZj2doVL0edfDgywTUh5CXa0o+nW9a1V9e5+CJTX8+SxRw=="], "isexe": ["isexe@3.1.5", "", {}, "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w=="], @@ -1950,50 +1578,40 @@ "js-binary-schema-parser": ["js-binary-schema-parser@2.0.3", "", {}, "sha512-xezGJmOb4lk/M1ZZLTR/jaBHQ4gG/lqQnJqdIv4721DMggsa1bDVlHXNeHYogaIEHD9vCRv0fcL4hMA+Coarkg=="], - "js-cookie": ["js-cookie@3.0.8", "", {}, "sha512-yeJd4aNAdYZQjaon2bpD/Gb0B/omw7HQOsynXXcOiWVCacbBcPlgn8S/d1X6blFSaHao7ozqtW7NZW19xpCtIw=="], + "js-cookie": ["js-cookie@3.0.7", "", {}, "sha512-z/wZZgDrkNV1eA0ULjM/F9/50Ya8fbzgKneSpoPsXSGd0KnpdtHfOZWK+GcwLk+EZbS4F9RBhU+K2RgzuDaItw=="], "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], - "js-yaml": ["js-yaml@4.2.0", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw=="], + "js-yaml": ["js-yaml@4.3.0", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q=="], "jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="], - "json-buffer": ["json-buffer@3.0.1", "", {}, "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="], - "json-parse-even-better-errors": ["json-parse-even-better-errors@2.3.1", "", {}, "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="], "json-schema": ["json-schema@0.4.0", "", {}, "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="], - "json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="], + "json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], "json-schema-typed": ["json-schema-typed@8.0.2", "", {}, "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA=="], - "json-stable-stringify-without-jsonify": ["json-stable-stringify-without-jsonify@1.0.1", "", {}, "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="], - "json2mq": ["json2mq@0.2.0", "", { "dependencies": { "string-convert": "^0.2.0" } }, "sha512-SzoRg7ux5DWTII9J2qkrZrqV1gt+rTaoufMxEzXbS26Uid0NwaJd123HcoB80TgubEppxxIGdNxCx50fEoEWQA=="], "json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="], - "jsonc-parser": ["jsonc-parser@3.3.1", "", {}, "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ=="], - "jsonfile": ["jsonfile@6.2.1", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q=="], "katex": ["katex@0.17.0", "", { "dependencies": { "commander": "^8.3.0" }, "bin": { "katex": "cli.js" } }, "sha512-Vdw0ATsQ9V+LuegM/BTwQqV/6cTl5lbGcIrU+BCgLxyf6bo38ybOr372tuSIxir3CN720flu1meYR6XzNMwQnw=="], - "keyv": ["keyv@4.5.4", "", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="], - "khroma": ["khroma@2.1.0", "", {}, "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw=="], "kleur": ["kleur@4.1.5", "", {}, "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ=="], - "knip": ["knip@6.24.0", "", { "dependencies": { "fdir": "^6.5.0", "formatly": "^0.3.0", "get-tsconfig": "4.14.0", "jiti": "^2.7.0", "oxc-parser": "^0.137.0", "oxc-resolver": "11.21.3", "picomatch": "^4.0.4", "smol-toml": "^1.6.1", "strip-json-comments": "5.0.3", "tinyglobby": "^0.2.17", "unbash": "^4.0.1", "yaml": "^2.9.0", "zod": "^4.1.11" }, "bin": { "knip": "bin/knip.js", "knip-bun": "bin/knip-bun.js" } }, "sha512-PokLlgeEjLh1rAsB7ts+52wZ37HBr1nDhE6NNONwEaXdeZGCJOkP7ZlIAI2Gtu8xohquzTWy75bc/1diI9shQw=="], + "knip": ["knip@6.27.0", "", { "dependencies": { "fdir": "^6.5.0", "formatly": "^0.3.0", "get-tsconfig": "4.14.0", "jiti": "^2.7.0", "oxc-parser": "^0.137.0", "oxc-resolver": "11.21.3", "picomatch": "^4.0.4", "smol-toml": "^1.6.1", "strip-json-comments": "5.0.3", "tinyglobby": "^0.2.17", "unbash": "^4.0.1", "yaml": "^2.9.0", "zod": "^4.1.11" }, "bin": { "knip": "bin/knip.js", "knip-bun": "bin/knip-bun.js" } }, "sha512-CngYEYrD0n20N06FXA8n3u/0Wnnugoa+B9k14OP+iKIgkCHuzvIdsP3nfwjhByoc1WfogpxfiriMboAXFETDUw=="], "layout-base": ["layout-base@1.0.2", "", {}, "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg=="], "leva": ["leva@0.10.1", "", { "dependencies": { "@radix-ui/react-portal": "^1.1.4", "@radix-ui/react-tooltip": "^1.1.8", "@stitches/react": "^1.2.8", "@use-gesture/react": "^10.2.5", "colord": "^2.9.2", "dequal": "^2.0.2", "merge-value": "^1.0.0", "react-colorful": "^5.5.1", "react-dropzone": "^12.0.0", "v8n": "^1.3.3", "zustand": "^3.6.9" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" } }, "sha512-BcjnfUX8jpmwZUz2L7AfBtF9vn4ggTH33hmeufDULbP3YgNZ/C+ss/oO3stbrqRQyaOmRwy70y7BGTGO81S3rA=="], - "levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="], - "lightningcss": ["lightningcss@1.32.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.32.0", "lightningcss-darwin-arm64": "1.32.0", "lightningcss-darwin-x64": "1.32.0", "lightningcss-freebsd-x64": "1.32.0", "lightningcss-linux-arm-gnueabihf": "1.32.0", "lightningcss-linux-arm64-gnu": "1.32.0", "lightningcss-linux-arm64-musl": "1.32.0", "lightningcss-linux-x64-gnu": "1.32.0", "lightningcss-linux-x64-musl": "1.32.0", "lightningcss-win32-arm64-msvc": "1.32.0", "lightningcss-win32-x64-msvc": "1.32.0" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="], "lightningcss-android-arm64": ["lightningcss-android-arm64@1.32.0", "", { "os": "android", "cpu": "arm64" }, "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg=="], @@ -2018,13 +1636,9 @@ "lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.32.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q=="], - "lilconfig": ["lilconfig@3.1.3", "", {}, "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw=="], - "lines-and-columns": ["lines-and-columns@1.2.4", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="], - "linkify-it": ["linkify-it@5.0.1", "", { "dependencies": { "uc.micro": "^2.0.0" } }, "sha512-wVoTjP4Q6R0NW5hiZkVJaFZPWgtXfoGF+6LucL3/FtiNjmcHhYjEr5f1Kqjirc1nBW07J/ZuRFumqr2oqccEWg=="], - - "linkifyjs": ["linkifyjs@4.3.3", "", {}, "sha512-P8aEP5U/D1/IlTY2OeYsErdwh9bGuLE30NcXtKEjgdHcahveQoQwM2yZNsioQHsWFz0P7KKudisbrzCgR0sDHg=="], + "linkify-it": ["linkify-it@5.0.2", "", { "dependencies": { "uc.micro": "^2.0.0" } }, "sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q=="], "lit": ["lit@3.3.3", "", { "dependencies": { "@lit/reactive-element": "^2.1.0", "lit-element": "^4.2.0", "lit-html": "^3.3.0" } }, "sha512-fycuvZg/hkpozL00lm1pEJH5nN/lr9ZXd6mJI2HSN4+Bzc+LDNdEApJ6HFbPkdFNHLvOplIIuJvxkS4XUxqirw=="], @@ -2032,14 +1646,12 @@ "lit-html": ["lit-html@3.3.3", "", { "dependencies": { "@types/trusted-types": "^2.0.2" } }, "sha512-el8M6jK2o3RXBnrSHX3ZKrsN8zEV63pSExTO1wYJz7QndGYZ8353e2a5PPX+qHe2aGayfnchQmkAojaWAREOIA=="], - "locate-path": ["locate-path@6.0.0", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="], + "locate-path": ["locate-path@3.0.0", "", { "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" } }, "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A=="], "lodash": ["lodash@4.18.1", "", {}, "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q=="], "lodash-es": ["lodash-es@4.18.1", "", {}, "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A=="], - "lodash.merge": ["lodash.merge@4.6.2", "", {}, "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="], - "log-symbols": ["log-symbols@6.0.0", "", { "dependencies": { "chalk": "^5.3.0", "is-unicode-supported": "^1.3.0" } }, "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw=="], "longest-streak": ["longest-streak@3.1.0", "", {}, "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g=="], @@ -2048,13 +1660,11 @@ "lottie-web": ["lottie-web@5.13.0", "", {}, "sha512-+gfBXl6sxXMPe8tKQm7qzLnUy5DUPJPKIyRHwtpCpyUEYjHYRJC/5gjUvdkuO2c3JllrPtHXH5UJJK8LRYl5yQ=="], - "lowlight": ["lowlight@3.3.0", "", { "dependencies": { "@types/hast": "^3.0.0", "devlop": "^1.0.0", "highlight.js": "~11.11.0" } }, "sha512-0JNhgFoPvP6U6lE/UdVsSq99tn6DhjjpAj5MxG49ewd2mOBVtwWYIT8ClyABhq198aXXODMU6Ox8DrGy/CpTZQ=="], - "lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], "lru_map": ["lru_map@0.4.1", "", {}, "sha512-I+lBvqMMFfqaV8CJCISjI3wbjmwVu/VyOoU7+qtu9d7ioW5klMgsTTiUOUp+DJvfTTzKXoPbyC6YfgkNcyPSOg=="], - "lucide-react": ["lucide-react@1.23.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-38BpJcD0JhFosxHApP/BYsBetLpQFRoTRzEzstM/XCc3jsAG7wqaY1lgVwxiUe3xqYE+lNxo2PkCmYwXWrwwIw=="], + "lucide-react": ["lucide-react@1.25.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-/mdJTRbiwcLOQ1NZZK1amZF9rIZyvO18D6r9TngE6TG1NmqHgFuT4eE7Xrkm9UsXMbBJD1NlfwHVltCDWHrOTw=="], "magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], @@ -2074,11 +1684,11 @@ "markdown-it-task-checkbox": ["markdown-it-task-checkbox@1.0.6", "", {}, "sha512-7pxkHuvqTOu3iwVGmDPeYjQg+AIS9VQxzyLP9JCg9lBjgPAJXGEkChK6A2iFuj3tS0GV3HG2u5AMNhcQqwxpJw=="], - "markdown-it-ts": ["markdown-it-ts@1.0.2", "", { "dependencies": { "@types/linkify-it": "^5.0.0", "@types/mdurl": "^2.0.0", "entities": "^4.5.0", "linkify-it": "^5.0.1", "mdurl": "^2.0.0", "punycode.js": "^2.3.1", "uc.micro": "^2.1.0" } }, "sha512-zba9mN313K2HmKk+BOHqkO/nuZtj9M1TTnUlSbItGrCMpYzc8OHGCm+IaqxWCi2pGcgpiFC8ltxkasYWYpp/YQ=="], + "markdown-it-ts": ["markdown-it-ts@1.0.4", "", { "dependencies": { "@types/linkify-it": "^5.0.0", "@types/mdurl": "^2.0.0", "entities": "^4.5.0", "linkify-it": "^5.0.1", "mdurl": "^2.0.0", "punycode.js": "^2.3.1", "uc.micro": "^2.1.0" } }, "sha512-FmCjj7D0C54EhWNn6WdSIBoyEbEoLeqE/Orgzik+CHSIz3aQJW3/U3uc8BEOMdGl/SE4O+s4BjwKhtO7LPOwWA=="], "markdown-table": ["markdown-table@3.0.4", "", {}, "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw=="], - "marked": ["marked@18.0.5", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-S6GcvALHg6K4ohtu4E7x0a1AqhAjp6cV8KhLSyN9qVapnzJkusVBxZRcIU9AeYsbe6P1hKDusSbEOzGyyuce6w=="], + "marked": ["marked@18.0.6", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-MrV5puXBfuiy6wl6DLaq3BtIJQAJToAd5zt/ZKhRfGRAuFPALE7/4Y7jnxRQoEgK/pBgurGqLyAuRgZ2xOjr6w=="], "math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="], @@ -2116,14 +1726,14 @@ "mdast-util-to-markdown": ["mdast-util-to-markdown@2.1.2", "", { "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "longest-streak": "^3.0.0", "mdast-util-phrasing": "^4.0.0", "mdast-util-to-string": "^4.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "unist-util-visit": "^5.0.0", "zwitch": "^2.0.0" } }, "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA=="], + "mdast-util-to-markdown-cjk-friendly": ["mdast-util-to-markdown-cjk-friendly@1.0.0", "", { "dependencies": { "mdast-util-to-markdown": "^2.1.2", "micromark-extension-cjk-friendly-util": "3.0.1", "micromark-util-symbol": "^2.0.1" }, "peerDependencies": { "@types/mdast": "*" }, "optionalPeers": ["@types/mdast"] }, "sha512-BoaAm8mlJ+LAYz0Qs532Y3ciTuQYgBUPZcSFbvC/ZKmEMAKgulw84YvQK1gI34t/vL2euSfuaWlqczkTBgamkw=="], + "mdast-util-to-string": ["mdast-util-to-string@4.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0" } }, "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg=="], "mdurl": ["mdurl@2.0.0", "", {}, "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w=="], "media-typer": ["media-typer@1.1.0", "", {}, "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw=="], - "memoize-one": ["memoize-one@5.2.1", "", {}, "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q=="], - "merge-descriptors": ["merge-descriptors@2.0.0", "", {}, "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g=="], "merge-stream": ["merge-stream@2.0.0", "", {}, "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="], @@ -2216,16 +1826,14 @@ "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], - "mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="], + "mimic-fn": ["mimic-fn@3.1.0", "", {}, "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ=="], "mimic-function": ["mimic-function@5.0.1", "", {}, "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA=="], - "minimatch": ["minimatch@3.1.5", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w=="], + "minimatch": ["minimatch@10.2.5", "", { "dependencies": { "brace-expansion": "^5.0.5" } }, "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg=="], "minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="], - "minipass": ["minipass@7.1.3", "", {}, "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A=="], - "mixin-deep": ["mixin-deep@1.3.2", "", { "dependencies": { "for-in": "^1.0.2", "is-extendable": "^1.0.1" } }, "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA=="], "motion": ["motion@12.42.2", "", { "dependencies": { "framer-motion": "^12.42.2", "tslib": "^2.4.0" }, "peerDependencies": { "@emotion/is-prop-valid": "*", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["@emotion/is-prop-valid", "react", "react-dom"] }, "sha512-Atvv11yUKIid41cVrRBDVX5m8tF8kNpExRSlbpt6APClhDjtwQssgFHhQzejxw7/7YYbjHSPKBVbHo05BuJT5Q=="], @@ -2236,23 +1844,13 @@ "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], - "mute-stream": ["mute-stream@3.0.0", "", {}, "sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw=="], - - "mz": ["mz@2.7.0", "", { "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", "thenify-all": "^1.0.0" } }, "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q=="], - "nanoid": ["nanoid@5.1.16", "", { "bin": { "nanoid": "bin/nanoid.js" } }, "sha512-kVrnsrJqMR8+oLJnGEmSWw9BivK5mt7H3FZatVRjrc5wGqFYuBxX1yG7+A7Gi5AefkX6t/oCkizcQgpu0cY1dQ=="], - "natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="], - "negotiator": ["negotiator@1.0.0", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="], - "newapi-web": ["newapi-web@workspace:default"], - "next-themes": ["next-themes@0.4.6", "", { "peerDependencies": { "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" } }, "sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA=="], - "node-releases": ["node-releases@2.0.46", "", {}, "sha512-GYVXHE2KnrzAfsAjl4uP++evGFCrAU1jta4ubEjIG7YWt/64Gqv66a30yKwWczVjA6j3bM4nBwH7Pk1JmDHaxQ=="], - - "normalize-path": ["normalize-path@3.0.0", "", {}, "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="], + "node-releases": ["node-releases@2.0.51", "", {}, "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ=="], "npm-run-path": ["npm-run-path@6.0.0", "", { "dependencies": { "path-key": "^4.0.0", "unicorn-magic": "^0.3.0" } }, "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA=="], @@ -2260,13 +1858,11 @@ "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], - "object-hash": ["object-hash@3.0.0", "", {}, "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw=="], - "object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="], "object-treeify": ["object-treeify@1.1.33", "", {}, "sha512-EFVjAYfzWqWsBMRHPMAXLCDIJnpMhdWAqR7xG6M6a2cs6PMFpl/+Z20w9zDW4vkxOFfddegBKq9Rehd0bxWE7A=="], - "on-change": ["on-change@4.0.2", "", {}, "sha512-cMtCyuJmTx/bg2HCpHo3ZLeF7FZnBOapLqZHr2AlLeJ5Ul0Zu2mUJJz051Fdwu/Et2YW04ZD+TtU+gVy0ACNCA=="], + "on-change": ["on-change@4.0.0", "", {}, "sha512-PTu7C9Jsz4b+sNMDpH0eZFTr7uxdOtoDWRnhaVNK50bgrrnW5nvbWI0jm5DG9qOoTnIhBzE9xoKVFPD9xgtbdg=="], "on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="], @@ -2280,25 +1876,23 @@ "open": ["open@11.0.0", "", { "dependencies": { "default-browser": "^5.4.0", "define-lazy-prop": "^3.0.0", "is-in-ssh": "^1.0.0", "is-inside-container": "^1.0.0", "powershell-utils": "^0.1.0", "wsl-utils": "^0.3.0" } }, "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw=="], - "optionator": ["optionator@0.9.4", "", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="], - "ora": ["ora@8.2.0", "", { "dependencies": { "chalk": "^5.3.0", "cli-cursor": "^5.0.0", "cli-spinners": "^2.9.2", "is-interactive": "^2.0.0", "is-unicode-supported": "^2.0.0", "log-symbols": "^6.0.0", "stdin-discarder": "^0.2.2", "string-width": "^7.2.0", "strip-ansi": "^7.1.0" } }, "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw=="], - "orderedmap": ["orderedmap@2.1.1", "", {}, "sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g=="], - "oxc-parser": ["oxc-parser@0.137.0", "", { "dependencies": { "@oxc-project/types": "^0.137.0" }, "optionalDependencies": { "@oxc-parser/binding-android-arm-eabi": "0.137.0", "@oxc-parser/binding-android-arm64": "0.137.0", "@oxc-parser/binding-darwin-arm64": "0.137.0", "@oxc-parser/binding-darwin-x64": "0.137.0", "@oxc-parser/binding-freebsd-x64": "0.137.0", "@oxc-parser/binding-linux-arm-gnueabihf": "0.137.0", "@oxc-parser/binding-linux-arm-musleabihf": "0.137.0", "@oxc-parser/binding-linux-arm64-gnu": "0.137.0", "@oxc-parser/binding-linux-arm64-musl": "0.137.0", "@oxc-parser/binding-linux-ppc64-gnu": "0.137.0", "@oxc-parser/binding-linux-riscv64-gnu": "0.137.0", "@oxc-parser/binding-linux-riscv64-musl": "0.137.0", "@oxc-parser/binding-linux-s390x-gnu": "0.137.0", "@oxc-parser/binding-linux-x64-gnu": "0.137.0", "@oxc-parser/binding-linux-x64-musl": "0.137.0", "@oxc-parser/binding-openharmony-arm64": "0.137.0", "@oxc-parser/binding-wasm32-wasi": "0.137.0", "@oxc-parser/binding-win32-arm64-msvc": "0.137.0", "@oxc-parser/binding-win32-ia32-msvc": "0.137.0", "@oxc-parser/binding-win32-x64-msvc": "0.137.0" } }, "sha512-yFImD+WLElJpLKy8llG1qe4DCmMsL18peRp8XP1JKfig/gISbJkglnpDtX2aTmAn10kZF7164HbN2H8QPsXxGg=="], "oxc-resolver": ["oxc-resolver@11.21.3", "", { "optionalDependencies": { "@oxc-resolver/binding-android-arm-eabi": "11.21.3", "@oxc-resolver/binding-android-arm64": "11.21.3", "@oxc-resolver/binding-darwin-arm64": "11.21.3", "@oxc-resolver/binding-darwin-x64": "11.21.3", "@oxc-resolver/binding-freebsd-x64": "11.21.3", "@oxc-resolver/binding-linux-arm-gnueabihf": "11.21.3", "@oxc-resolver/binding-linux-arm-musleabihf": "11.21.3", "@oxc-resolver/binding-linux-arm64-gnu": "11.21.3", "@oxc-resolver/binding-linux-arm64-musl": "11.21.3", "@oxc-resolver/binding-linux-ppc64-gnu": "11.21.3", "@oxc-resolver/binding-linux-riscv64-gnu": "11.21.3", "@oxc-resolver/binding-linux-riscv64-musl": "11.21.3", "@oxc-resolver/binding-linux-s390x-gnu": "11.21.3", "@oxc-resolver/binding-linux-x64-gnu": "11.21.3", "@oxc-resolver/binding-linux-x64-musl": "11.21.3", "@oxc-resolver/binding-openharmony-arm64": "11.21.3", "@oxc-resolver/binding-wasm32-wasi": "11.21.3", "@oxc-resolver/binding-win32-arm64-msvc": "11.21.3", "@oxc-resolver/binding-win32-x64-msvc": "11.21.3" } }, "sha512-2Mx3fKQz7+xgrBONjsxOgCGtMHOn38/HxMzW1I5efwXB5a4lRN0Vp40gYUJFBWJslcrvwoofTrqoTnLbwTd3pA=="], "oxfmt": ["oxfmt@0.57.0", "", { "dependencies": { "tinypool": "2.1.0" }, "optionalDependencies": { "@oxfmt/binding-android-arm-eabi": "0.57.0", "@oxfmt/binding-android-arm64": "0.57.0", "@oxfmt/binding-darwin-arm64": "0.57.0", "@oxfmt/binding-darwin-x64": "0.57.0", "@oxfmt/binding-freebsd-x64": "0.57.0", "@oxfmt/binding-linux-arm-gnueabihf": "0.57.0", "@oxfmt/binding-linux-arm-musleabihf": "0.57.0", "@oxfmt/binding-linux-arm64-gnu": "0.57.0", "@oxfmt/binding-linux-arm64-musl": "0.57.0", "@oxfmt/binding-linux-ppc64-gnu": "0.57.0", "@oxfmt/binding-linux-riscv64-gnu": "0.57.0", "@oxfmt/binding-linux-riscv64-musl": "0.57.0", "@oxfmt/binding-linux-s390x-gnu": "0.57.0", "@oxfmt/binding-linux-x64-gnu": "0.57.0", "@oxfmt/binding-linux-x64-musl": "0.57.0", "@oxfmt/binding-openharmony-arm64": "0.57.0", "@oxfmt/binding-win32-arm64-msvc": "0.57.0", "@oxfmt/binding-win32-ia32-msvc": "0.57.0", "@oxfmt/binding-win32-x64-msvc": "0.57.0" }, "peerDependencies": { "svelte": "^5.0.0", "vite-plus": "*" }, "optionalPeers": ["svelte", "vite-plus"], "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-ZB7Bi+rGDSqmVIo9jwcLyFgjxXvQhDdU+jx+ZrVy6VRiVXK2+CHc4hO3J4dUQjHe7V0ymHB+MDuv5z+NhK07HA=="], - "oxlint": ["oxlint@1.72.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.72.0", "@oxlint/binding-android-arm64": "1.72.0", "@oxlint/binding-darwin-arm64": "1.72.0", "@oxlint/binding-darwin-x64": "1.72.0", "@oxlint/binding-freebsd-x64": "1.72.0", "@oxlint/binding-linux-arm-gnueabihf": "1.72.0", "@oxlint/binding-linux-arm-musleabihf": "1.72.0", "@oxlint/binding-linux-arm64-gnu": "1.72.0", "@oxlint/binding-linux-arm64-musl": "1.72.0", "@oxlint/binding-linux-ppc64-gnu": "1.72.0", "@oxlint/binding-linux-riscv64-gnu": "1.72.0", "@oxlint/binding-linux-riscv64-musl": "1.72.0", "@oxlint/binding-linux-s390x-gnu": "1.72.0", "@oxlint/binding-linux-x64-gnu": "1.72.0", "@oxlint/binding-linux-x64-musl": "1.72.0", "@oxlint/binding-openharmony-arm64": "1.72.0", "@oxlint/binding-win32-arm64-msvc": "1.72.0", "@oxlint/binding-win32-ia32-msvc": "1.72.0", "@oxlint/binding-win32-x64-msvc": "1.72.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.22.1", "vite-plus": "*" }, "optionalPeers": ["oxlint-tsgolint", "vite-plus"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-1rhdZIP/EvoI91ABIwNU5Q8+bWf8mjrS5UzIOZld4d4bXxJvtlUhlQvaoTogIGin/qdErMOrwaIJvCSIAKTLhA=="], + "oxlint": ["oxlint@1.74.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.74.0", "@oxlint/binding-android-arm64": "1.74.0", "@oxlint/binding-darwin-arm64": "1.74.0", "@oxlint/binding-darwin-x64": "1.74.0", "@oxlint/binding-freebsd-x64": "1.74.0", "@oxlint/binding-linux-arm-gnueabihf": "1.74.0", "@oxlint/binding-linux-arm-musleabihf": "1.74.0", "@oxlint/binding-linux-arm64-gnu": "1.74.0", "@oxlint/binding-linux-arm64-musl": "1.74.0", "@oxlint/binding-linux-ppc64-gnu": "1.74.0", "@oxlint/binding-linux-riscv64-gnu": "1.74.0", "@oxlint/binding-linux-riscv64-musl": "1.74.0", "@oxlint/binding-linux-s390x-gnu": "1.74.0", "@oxlint/binding-linux-x64-gnu": "1.74.0", "@oxlint/binding-linux-x64-musl": "1.74.0", "@oxlint/binding-openharmony-arm64": "1.74.0", "@oxlint/binding-win32-arm64-msvc": "1.74.0", "@oxlint/binding-win32-ia32-msvc": "1.74.0", "@oxlint/binding-win32-x64-msvc": "1.74.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.24.0", "vite-plus": "*" }, "optionalPeers": ["oxlint-tsgolint", "vite-plus"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-odGl2s2x5IOJoj3A0v1k0PGBXVFBZeZ2+AK/+K2MJur7Ghi3bkyX5NuLUWHKqa4js1wjep3hJeuTQJOlr+4+dA=="], - "p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], + "p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], - "p-locate": ["p-locate@5.0.0", "", { "dependencies": { "p-limit": "^3.0.2" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="], + "p-locate": ["p-locate@3.0.0", "", { "dependencies": { "p-limit": "^2.0.0" } }, "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ=="], - "package-manager-detector": ["package-manager-detector@1.6.0", "", {}, "sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA=="], + "p-try": ["p-try@2.2.0", "", {}, "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="], + + "package-manager-detector": ["package-manager-detector@1.7.0", "", {}, "sha512-xg1eHpwYL/D/HEdWw2goFZP6vV0FH7W+PZ5rFkGjdIDLtxq7EkzBUeT3m+lndYCt8wKbmofUu1MUdMCXkCk9ZQ=="], "parent-module": ["parent-module@1.0.1", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="], @@ -2318,16 +1912,12 @@ "path-data-parser": ["path-data-parser@0.1.0", "", {}, "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w=="], - "path-exists": ["path-exists@4.0.0", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="], - - "path-is-absolute": ["path-is-absolute@1.0.1", "", {}, "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="], + "path-exists": ["path-exists@3.0.0", "", {}, "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ=="], "path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], "path-parse": ["path-parse@1.0.7", "", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="], - "path-scurry": ["path-scurry@2.0.2", "", { "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" } }, "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg=="], - "path-source": ["path-source@0.1.3", "", { "dependencies": { "array-source": "0.0", "file-source": "0.6" } }, "sha512-dWRHm5mIw5kw0cs3QZLNmpUWty48f5+5v9nWD2dw3Y0Hf+s01Ag8iJEWV0Sm0kocE8kK27DrIowha03e1YR+Qw=="], "path-to-regexp": ["path-to-regexp@8.4.2", "", {}, "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA=="], @@ -2340,14 +1930,12 @@ "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], - "picomatch": ["picomatch@4.0.4", "", {}, "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A=="], - - "pify": ["pify@2.3.0", "", {}, "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog=="], - - "pirates": ["pirates@4.0.7", "", {}, "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA=="], + "picomatch": ["picomatch@4.0.5", "", {}, "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A=="], "pkce-challenge": ["pkce-challenge@5.0.1", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="], + "pkg-up": ["pkg-up@3.1.0", "", { "dependencies": { "find-up": "^3.0.0" } }, "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA=="], + "point-at-length": ["point-at-length@1.1.0", "", { "dependencies": { "abs-svg-path": "~0.1.1", "isarray": "~0.0.1", "parse-svg-path": "~0.1.1" } }, "sha512-nNHDk9rNEh/91o2Y8kHLzBLNpLf80RYd2gCun9ss+V0ytRSf6XhryBTx071fesktjbachRmGuUbId+JQmzhRXw=="], "points-on-curve": ["points-on-curve@0.2.0", "", {}, "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A=="], @@ -2358,63 +1946,19 @@ "postcss": ["postcss@8.5.15", "", { "dependencies": { "nanoid": "^3.3.12", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A=="], - "postcss-import": ["postcss-import@15.1.0", "", { "dependencies": { "postcss-value-parser": "^4.0.0", "read-cache": "^1.0.0", "resolve": "^1.1.7" }, "peerDependencies": { "postcss": "^8.0.0" } }, "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew=="], - - "postcss-js": ["postcss-js@4.1.0", "", { "dependencies": { "camelcase-css": "^2.0.1" }, "peerDependencies": { "postcss": "^8.4.21" } }, "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw=="], - - "postcss-load-config": ["postcss-load-config@6.0.1", "", { "dependencies": { "lilconfig": "^3.1.1" }, "peerDependencies": { "jiti": ">=1.21.0", "postcss": ">=8.0.9", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["jiti", "postcss", "tsx", "yaml"] }, "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g=="], - - "postcss-nested": ["postcss-nested@6.2.0", "", { "dependencies": { "postcss-selector-parser": "^6.1.1" }, "peerDependencies": { "postcss": "^8.2.14" } }, "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ=="], - - "postcss-selector-parser": ["postcss-selector-parser@7.1.1", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg=="], - - "postcss-value-parser": ["postcss-value-parser@4.2.0", "", {}, "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="], + "postcss-selector-parser": ["postcss-selector-parser@7.1.4", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-HeP7D2wyhkR+XaK6v4W8oRF62Dsz4flyuczALJp61GckGm42u1saSSJ/0auvcBqxs3jMRFEcPK34At/0JBKdOg=="], "powershell-utils": ["powershell-utils@0.1.0", "", {}, "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A=="], - "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="], - - "prettier": ["prettier@3.8.3", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw=="], - - "prettier-plugin-astro": ["prettier-plugin-astro@0.14.1", "", { "dependencies": { "@astrojs/compiler": "^2.9.1", "prettier": "^3.0.0", "sass-formatter": "^0.7.6" } }, "sha512-RiBETaaP9veVstE4vUwSIcdATj6dKmXljouXc/DDNwBSPTp8FRkLGDSGFClKsAFeeg+13SB0Z1JZvbD76bigJw=="], - - "prettier-plugin-jsdoc": ["prettier-plugin-jsdoc@1.8.1", "", { "dependencies": { "binary-searching": "^2.0.5", "comment-parser": "^1.4.0", "mdast-util-from-markdown": "^2.0.0" }, "peerDependencies": { "prettier": "^3.0.0" } }, "sha512-XuMqBWTc3b/8eCOe+OlZlFy9Z413a7WOmF4i5hDGtjbtIFOdvRrVtGjXR2Feye3TrLWhkkkHheNXPTyYKxw3nA=="], + "prettier": ["prettier@3.9.5", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg=="], "pretty-ms": ["pretty-ms@9.3.0", "", { "dependencies": { "parse-ms": "^4.0.0" } }, "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ=="], - "prismjs": ["prismjs@1.30.0", "", {}, "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw=="], - "prompts": ["prompts@2.4.2", "", { "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" } }, "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q=="], "prop-types": ["prop-types@15.8.1", "", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="], - "property-information": ["property-information@7.1.0", "", {}, "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ=="], - - "prosemirror-changeset": ["prosemirror-changeset@2.4.1", "", { "dependencies": { "prosemirror-transform": "^1.0.0" } }, "sha512-96WBLhOaYhJ+kPhLg3uW359Tz6I/MfcrQfL4EGv4SrcqKEMC1gmoGrXHecPE8eOwTVCJ4IwgfzM8fFad25wNfw=="], - - "prosemirror-commands": ["prosemirror-commands@1.7.1", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.10.2" } }, "sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w=="], - - "prosemirror-dropcursor": ["prosemirror-dropcursor@1.8.2", "", { "dependencies": { "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0", "prosemirror-view": "^1.1.0" } }, "sha512-CCk6Gyx9+Tt2sbYk5NK0nB1ukHi2ryaRgadV/LvyNuO3ena1payM2z6Cg0vO1ebK8cxbzo41ku2DE5Axj1Zuiw=="], - - "prosemirror-gapcursor": ["prosemirror-gapcursor@1.4.1", "", { "dependencies": { "prosemirror-keymap": "^1.0.0", "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", "prosemirror-view": "^1.0.0" } }, "sha512-pMdYaEnjNMSwl11yjEGtgTmLkR08m/Vl+Jj443167p9eB3HVQKhYCc4gmHVDsLPODfZfjr/MmirsdyZziXbQKw=="], - - "prosemirror-history": ["prosemirror-history@1.5.0", "", { "dependencies": { "prosemirror-state": "^1.2.2", "prosemirror-transform": "^1.0.0", "prosemirror-view": "^1.31.0", "rope-sequence": "^1.3.0" } }, "sha512-zlzTiH01eKA55UAf1MEjtssJeHnGxO0j4K4Dpx+gnmX9n+SHNlDqI2oO1Kv1iPN5B1dm5fsljCfqKF9nFL6HRg=="], - - "prosemirror-inputrules": ["prosemirror-inputrules@1.5.1", "", { "dependencies": { "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.0.0" } }, "sha512-7wj4uMjKaXWAQ1CDgxNzNtR9AlsuwzHfdFH1ygEHA2KHF2DOEaXl1CJfNPAKCg9qNEh4rum975QLaCiQPyY6Fw=="], - - "prosemirror-keymap": ["prosemirror-keymap@1.2.3", "", { "dependencies": { "prosemirror-state": "^1.0.0", "w3c-keyname": "^2.2.0" } }, "sha512-4HucRlpiLd1IPQQXNqeo81BGtkY8Ai5smHhKW9jjPKRc2wQIxksg7Hl1tTI2IfT2B/LgX6bfYvXxEpJl7aKYKw=="], - - "prosemirror-model": ["prosemirror-model@1.25.7", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-A79aN8QEFUwI6cax8Yq4Rpcx1TJZ3Kagn+ii7qLo4/V8H3mMiHrhFyhTyHHvpSnOgMPpWiDGSwM3etwrxE50ug=="], - - "prosemirror-schema-list": ["prosemirror-schema-list@1.5.1", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.7.3" } }, "sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q=="], - - "prosemirror-state": ["prosemirror-state@1.4.4", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-transform": "^1.0.0", "prosemirror-view": "^1.27.0" } }, "sha512-6jiYHH2CIGbCfnxdHbXZ12gySFY/fz/ulZE333G6bPqIZ4F+TXo9ifiR86nAHpWnfoNjOb3o5ESi7J8Uz1jXHw=="], - - "prosemirror-tables": ["prosemirror-tables@1.8.5", "", { "dependencies": { "prosemirror-keymap": "^1.2.3", "prosemirror-model": "^1.25.4", "prosemirror-state": "^1.4.4", "prosemirror-transform": "^1.10.5", "prosemirror-view": "^1.41.4" } }, "sha512-V/0cDCsHKHe/tfWkeCmthNUcEp1IVO3p6vwN8XtwE9PZQLAZJigbw3QoraAdfJPir4NKJtNvOB8oYGKRl+t0Dw=="], - - "prosemirror-transform": ["prosemirror-transform@1.12.0", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-GxboyN4AMIsoHNtz5uf2r2Ru551i5hWeCMD6E2Ib4Eogqoub0NflniaBPVQ4MrGE5yZ8JV9tUHg9qcZTTrcN4w=="], - - "prosemirror-view": ["prosemirror-view@1.41.8", "", { "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-TnKDdohEatgyZNGCDWIdccOHXhYloJwbwU+phw/a23KBvJIR9lWQWW7WHHK3vBdOLDNuF7TaX98GObUZOWkOnA=="], + "property-information": ["property-information@7.2.0", "", {}, "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg=="], "protocol-buffers-schema": ["protocol-buffers-schema@3.6.1", "", {}, "sha512-VG2K63Igkiv9p76tk1lilczEK1cT+kCjKtkdhw1dQZV3k3IXJbd3o6Ho8b9zJZaHSnT2hKe4I+ObmX9w6m5SmQ=="], @@ -2422,19 +1966,17 @@ "proxy-from-env": ["proxy-from-env@2.1.0", "", {}, "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA=="], - "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], - "punycode.js": ["punycode.js@2.3.1", "", {}, "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA=="], "qrcode.react": ["qrcode.react@4.2.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-QpgqWi8rD9DsS9EP3z7BT+5lY5SFhsqGjpgW5DY/i3mK4M9DTBNz3ErMi8BWYEfI3L0d8GIbGmcdFAS1uIRGjA=="], "qs": ["qs@6.15.2", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw=="], - "query-string": ["query-string@9.4.0", "", { "dependencies": { "decode-uri-component": "^0.4.1", "filter-obj": "^5.1.0", "split-on-first": "^3.0.0" } }, "sha512-ivvWyHqU9K1Log4hJFhqVIIMoEi0nzmlRhvk2pPcTuQH/Y0K5iTTMxEx7R0PRHD2Z1hMVbWnjfsEWbIKIK+3IA=="], + "query-string": ["query-string@9.4.1", "", { "dependencies": { "decode-uri-component": "^0.4.1", "filter-obj": "^5.1.0", "split-on-first": "^3.0.0" } }, "sha512-lSyJeN3RuaG7DZGWThtYRhk96+kEyZ/+doZpERuWbjeFL+Ok3vEat/swU498rAI0NcVt5/RJp8UDuLz7FckxrA=="], "queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="], - "range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="], + "range-parser": ["range-parser@1.3.0", "", {}, "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw=="], "raw-body": ["raw-body@3.0.2", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.7.0", "unpipe": "~1.0.0" } }, "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA=="], @@ -2466,27 +2008,25 @@ "react-avatar-editor": ["react-avatar-editor@15.1.0", "", { "peerDependencies": { "react": "^0.14.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^0.14.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Zto7u9l6Wd5LPPtjeFJ+7uwoT4bs01OSgkN2kxD18lWl8IiZ0GY3nWCbKPx4qIU7Au1vENsMJm19rfVWHHayaQ=="], - "react-colorful": ["react-colorful@5.7.0", "", { "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-fuesYIemttah97XmsIHmz4OORDHiSFzyc9HMAIrCHJou2jaRQmL8cFJ76K4zQhhj8jzwOBlOi4BaGTjjOZCfTg=="], + "react-colorful": ["react-colorful@5.8.0", "", { "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-Wy9OzPfjSN9bF12OB8N7UQvlsZ0I+7wHxpN+bV5BjNQGxOj6IiwkRjevJK9yOBjJWGQvAaf1OXtn8rUeEatAng=="], "react-day-picker": ["react-day-picker@10.0.1", "", { "dependencies": { "@date-fns/tz": "^1.4.1", "date-fns": "^4.1.0" }, "peerDependencies": { "@types/react": ">=16.8.0", "react": ">=16.8.0" }, "optionalPeers": ["@types/react"] }, "sha512-eNh6BlwcYInWaJtRv18mXQ06Ys/H6rdTZAnTaSdOYJuTpwP1JMCHNd1FDRadA+gbeinq+psdULN5Xnowy9mV8w=="], "react-dom": ["react-dom@19.2.7", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.7" } }, "sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ=="], - "react-draggable": ["react-draggable@4.6.0", "", { "dependencies": { "clsx": "^2.1.1", "prop-types": "^15.8.1" }, "peerDependencies": { "react": ">= 16.3.0", "react-dom": ">= 16.3.0" } }, "sha512-g4vqY53xhmPrBnZvGP+1YQV0eYnB3o0VLzoi6q2IpwnQrxIZ34tYRKpVtsWIXPg4D/pvLn+oYCW5gOK2cWIrgA=="], + "react-draggable": ["react-draggable@4.7.0", "", { "dependencies": { "clsx": "^2.1.1", "prop-types": "^15.8.1" }, "peerDependencies": { "react": ">= 16.3.0", "react-dom": ">= 16.3.0" } }, "sha512-kTpANmKWVnFXiZ76Ag2ZowiFStuBYnJ606PI1TbUsOg29/400/JNIxI9+CuenhiAqFuXWJffz6F4UI3R51kUug=="], - "react-dropzone": ["react-dropzone@14.4.1", "", { "dependencies": { "attr-accept": "^2.2.4", "file-selector": "^2.1.0", "prop-types": "^15.8.1" }, "peerDependencies": { "react": ">= 16.8 || 18.0.0" } }, "sha512-QDuV76v3uKbHiH34SpwifZ+gOLi1+RdsCO1kl5vxMT4wW8R82+sthjvBw4th3NHF/XX6FBsqDYZVNN+pnhaw0g=="], + "react-dropzone": ["react-dropzone@12.1.0", "", { "dependencies": { "attr-accept": "^2.2.2", "file-selector": "^0.5.0", "prop-types": "^15.8.1" }, "peerDependencies": { "react": ">= 16.8" } }, "sha512-iBYHA1rbopIvtzokEX4QubO6qk5IF/x3BtKGu74rF2JkQDXnwC4uO/lHKpaw4PJIV6iIAYOlwLv2FpiGyqHNog=="], "react-error-boundary": ["react-error-boundary@6.1.2", "", { "peerDependencies": { "react": "^18.0.0 || ^19.0.0" } }, "sha512-3DpCr5HVdZ0caUjYE/kIHBEJN0mNP3ZCgf16c48uJ5TbWjorKVp+YG8W3XqlJ7vJAVNw6wNIImyPXmFydwmyng=="], "react-fast-compare": ["react-fast-compare@3.2.2", "", {}, "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ=="], - "react-fireworks": ["react-fireworks@1.0.4", "", {}, "sha512-jj1a+HTicB4pR6g2lqhVyAox0GTE0TOrZK2XaJFRYOwltgQWeYErZxnvU9+zH/blY+Hpmu9IKyb39OD3KcCMJw=="], + "react-hook-form": ["react-hook-form@7.82.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17 || ^18 || ^19" } }, "sha512-Zw/uFZ2dO+02GHlBn7JFGn8kZJ7LdM33B/0BXOovzFay+CMhf94JMw5BVu+F1tVkUKjNvBuaE3fz5BJhga10Tg=="], - "react-hook-form": ["react-hook-form@7.80.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17 || ^18 || ^19" } }, "sha512-4P+fk6oXsxY+6xSj7Euhc2sumQD8zQqCuVHoJwoyp9EchP+IUW9OESB7uHFJOKsIBQ4MQqYE84INJFqUCYNoOg=="], + "react-hotkeys-hook": ["react-hotkeys-hook@5.3.3", "", { "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-aswgyWUnE25hmhzHTfKDmKzsaSE5DJ4LKaU/o6rQSXkDd/1Bh9TfAFQbHkf6fLy11HvlYkp+cDDarGdhmCDhoQ=="], - "react-hotkeys-hook": ["react-hotkeys-hook@5.3.2", "", { "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-DDDy9xK6mbTQ6aPlQvIl0dA/a90T/AWml4Rm21JXFDLlRHalIg4/Rv3equUQYs5xPTWq+oEl6RD7mi/nBpU3Uw=="], - - "react-i18next": ["react-i18next@17.0.8", "", { "dependencies": { "@babel/runtime": "^7.29.2", "html-parse-stringify": "^3.0.1", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "i18next": ">= 26.2.0", "react": ">= 16.8.0", "typescript": "^5 || ^6" }, "optionalPeers": ["typescript"] }, "sha512-0ooKbGLU8JXhe1zwpQUWIeXSgLPOfwJmgheWRIUpcoA0CpyabpGhayjdG+/eA5esC1AQ8h2jWpXjJfzQzeDOCw=="], + "react-i18next": ["react-i18next@17.0.10", "", { "dependencies": { "@babel/runtime": "^7.29.2", "html-parse-stringify": "^3.0.1", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "i18next": ">= 26.2.0", "react": ">= 16.8.0", "typescript": "^5 || ^6 || ^7" }, "optionalPeers": ["typescript"] }, "sha512-XneHftyYA774MJkkccSkZ5oKrUpCnXIPmxio3wemqrVzCRLWiGXOMbIzObrer03fNDEnm8g8R5yYls4HcE+esg=="], "react-icons": ["react-icons@5.7.0", "", { "peerDependencies": { "react": "*" } }, "sha512-LBLy340Rzqy6+/yVhZKT3B/QpP1BZaesGqasf09HPOBzRarcDIFH0WwXlXQfE7q7ipxK4MSiC5DIBWURCny6fw=="], @@ -2504,39 +2044,21 @@ "react-remove-scroll-bar": ["react-remove-scroll-bar@2.3.8", "", { "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q=="], - "react-resizable": ["react-resizable@3.2.0", "", { "dependencies": { "prop-types": "15.x", "react-draggable": "^4.5.0" }, "peerDependencies": { "react": ">= 16.3", "react-dom": ">= 16.3" } }, "sha512-3NKQ0SLZV7rs3LQHeXlOzDSRQfFrkX6TVet77/Qk03zqiZyee37b7N8/gwDJAA8UUjRz7PdWCCy49hcso45SMQ=="], - - "react-resizable-panels": ["react-resizable-panels@4.12.0", "", { "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" } }, "sha512-t/Gp57qSCxGQ52ckhz+8lM7dnuymeU95TEzl2U203qEbGkSLHrtm7US2/ANzq/zOlja3CwPTAfCDuh1unv9mfw=="], + "react-resizable-panels": ["react-resizable-panels@4.12.2", "", { "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" } }, "sha512-NwY5LCo4WrxVvDh0xoMML6EMLPONP/8ckKcIdpnojxexoatZdjLiRqLJQjQK5CPkd4SYiB/2M5BVrjZBQtOO7Q=="], "react-rnd": ["react-rnd@10.5.3", "", { "dependencies": { "re-resizable": "^6.11.2", "react-draggable": "^4.5.0", "tslib": "2.6.2" }, "peerDependencies": { "react": ">=16.3.0", "react-dom": ">=16.3.0" } }, "sha512-s/sIT3pGZnQ+57egijkTp9mizjIWrJz68Pq6yd+F/wniFY3IriML18dUXnQe/HP9uMiJ+9MAp44hljG99fZu6Q=="], - "react-router": ["react-router@6.30.4", "", { "dependencies": { "@remix-run/router": "1.23.3" }, "peerDependencies": { "react": ">=16.8" } }, "sha512-SVUsDe+DybHM/WmYKIVYhZh1o5Dcuf16yM6WjG02Q9XVFMZIJyHYhwrr6bFBXZkVP6z69kNkMyBCujt8FaFLJA=="], - - "react-router-dom": ["react-router-dom@6.30.4", "", { "dependencies": { "@remix-run/router": "1.23.3", "react-router": "6.30.4" }, "peerDependencies": { "react": ">=16.8", "react-dom": ">=16.8" } }, "sha512-q4HvNl+mmDdkS0g+MqiBZNteQJCuimWoOyHMy4T/RQLAn9Z29+E91QXRaxOujeMl2HTzRSS0KFPd7lxX3PjV0Q=="], - "react-style-singleton": ["react-style-singleton@2.2.3", "", { "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ=="], - "react-telegram-login": ["react-telegram-login@1.1.2", "", { "dependencies": { "react": "^16.13.1" } }, "sha512-pDP+bvfaklWgnK5O6yvZnIwgky0nnYUU6Zhk0EjdMSkPsLQoOzZRsXIoZnbxyBXhi7346bsxMH+EwwJPTxClDw=="], - - "react-template": ["react-template@workspace:classic"], - - "react-toastify": ["react-toastify@9.1.3", "", { "dependencies": { "clsx": "^1.1.1" }, "peerDependencies": { "react": ">=16", "react-dom": ">=16" } }, "sha512-fPfb8ghtn/XMxw3LkxQBk3IyagNpF/LIKjOBflbexr2AWxAH1MJgvnESwEwBn9liLFXgTKWgBSdZpw9m4OTHTg=="], - "react-top-loading-bar": ["react-top-loading-bar@3.0.2", "", { "peerDependencies": { "react": "^16 || ^17 || ^18 || ^19" } }, "sha512-hW0CHrHqKdBOBsVhms73ka0rgb9/aoiRfqo7jiS1vwIYDK7VkyMj52ypo5ewhshTQGHKE6mRvR99GZBZ+FuM/Q=="], - "react-turnstile": ["react-turnstile@1.1.5", "", { "peerDependencies": { "react": ">= 16.13.1", "react-dom": ">= 16.13.1" } }, "sha512-VTL5OeHAatzCEVQxAZox70/TPmhKxEbNgtr++dg+8zm9QrWKuoU9E0+7gqmycOSCDZuJFzvMMLKQb5PVUPLV6w=="], - - "react-window": ["react-window@1.8.11", "", { "dependencies": { "@babel/runtime": "^7.0.0", "memoize-one": ">=3.1.1 <6" }, "peerDependencies": { "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-+SRbUVT2scadgFSWx+R1P754xHPEqvcfSfVX10QYg6POOz+WNgkN48pS+BtZNIMGiL1HYrSEiCkwsMS15QogEQ=="], - - "react-zoom-pan-pinch": ["react-zoom-pan-pinch@3.7.0", "", { "peerDependencies": { "react": "*", "react-dom": "*" } }, "sha512-UmReVZ0TxlKzxSbYiAj+LeGRW8s8LraAFTXRAxzMYnNRgGPsxCudwZKVkjvGmjtx7SW/hZamt69NUmGf4xrkXA=="], - - "read-cache": ["read-cache@1.0.0", "", { "dependencies": { "pify": "^2.3.0" } }, "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA=="], + "react-zoom-pan-pinch": ["react-zoom-pan-pinch@4.0.3", "", { "peerDependencies": { "react": "*", "react-dom": "*" } }, "sha512-N2Hi6L78fFmhRra+ORpFSW7WST5x6kxpOPplIvtB0b7b+U2anpo1z1wLgaWRPS2kUSqcraRG+JgBCIlDJnqqAg=="], "readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="], "readdirp": ["readdirp@5.0.0", "", {}, "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ=="], - "recast": ["recast@0.23.11", "", { "dependencies": { "ast-types": "^0.16.1", "esprima": "~4.0.0", "source-map": "~0.6.1", "tiny-invariant": "^1.3.3", "tslib": "^2.0.1" } }, "sha512-YTUo+Flmw4ZXiWfQKGcwwc11KnoRAYgzAE2E7mXKCjSviTKShtxBsN6YUUBB2gtaBzKzeKunxhUwNHQuRryhWA=="], + "recast": ["recast@0.23.12", "", { "dependencies": { "ast-types": "^0.16.1", "esprima": "~4.0.0", "source-map": "~0.6.1", "tiny-invariant": "^1.3.3", "tslib": "^2.0.1" } }, "sha512-dEWRjcINDu/F4l2dYx57ugBtD7HV9KXESyxhzw/MqWLeglJrsjJKqACPyUPg+6AF8mIgm+Zi0dZ3ACoIg+QtpA=="], "recharts": ["recharts@3.9.1", "", { "dependencies": { "@reduxjs/toolkit": "^1.9.0 || 2.x.x", "clsx": "^2.1.1", "decimal.js-light": "^2.5.1", "es-toolkit": "^1.39.3", "eventemitter3": "^5.0.1", "immer": "^11.1.8", "react-redux": "8.x.x || 9.x.x", "reselect": "5.2.0", "tiny-invariant": "^1.3.3", "use-sync-external-store": "^1.2.2", "victory-vendor": "^37.0.2" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-is": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-WMcwlXcB7l+BbxiEdyClkG+1sxrMHNZpzT577LEvU4+rXPd8oTAy1wXk72hnk2KOOmxuLvw3z5DtXT7HEAydtg=="], @@ -2560,8 +2082,6 @@ "rehype-github-alerts": ["rehype-github-alerts@4.2.0", "", { "dependencies": { "@primer/octicons": "^19.20.0", "hast-util-from-html": "^2.0.3", "hast-util-is-element": "^3.0.0", "unist-util-visit": "^5.0.0" } }, "sha512-6di6kEu9WUHKLKrkKG2xX6AOuaCMGghg0Wq7MEuM/jBYUPVIq6PJpMe00dxMfU+/YSBtDXhffpDimgDi+BObIQ=="], - "rehype-highlight": ["rehype-highlight@7.0.2", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-to-text": "^4.0.0", "lowlight": "^3.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" } }, "sha512-k158pK7wdC2qL3M5NcZROZ2tR/l7zOzjxXd5VGdcfIyoijjQqpHd3JKtYSBDpDZ38UI2WJWuFAtkMDxmx5kstA=="], - "rehype-katex": ["rehype-katex@7.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/katex": "^0.16.0", "hast-util-from-html-isomorphic": "^2.0.0", "hast-util-to-text": "^4.0.0", "katex": "^0.16.0", "unist-util-visit-parents": "^6.0.0", "vfile": "^6.0.0" } }, "sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA=="], "rehype-raw": ["rehype-raw@7.0.0", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-raw": "^9.0.0", "vfile": "^6.0.0" } }, "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww=="], @@ -2570,7 +2090,7 @@ "remark-breaks": ["remark-breaks@4.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-newline-to-break": "^2.0.0", "unified": "^11.0.0" } }, "sha512-IjEjJOkH4FuJvHZVIW0QCDWxcG96kCq7An/KVH2NfJe6rKZU2AsHeB3OEjPNRxi4QC34Xdx7I2KGYn6IpT7gxQ=="], - "remark-cjk-friendly": ["remark-cjk-friendly@2.0.1", "", { "dependencies": { "micromark-extension-cjk-friendly": "2.0.1" }, "peerDependencies": { "@types/mdast": "^4.0.0", "unified": "^11.0.0" }, "optionalPeers": ["@types/mdast"] }, "sha512-6WwkoQyZf/4j5k53zdFYrR8Ca+UVn992jXdLUSBDZR4eBpFhKyVxmA4gUHra/5fesjGIxrDhHesNr/sVoiiysA=="], + "remark-cjk-friendly": ["remark-cjk-friendly@2.3.1", "", { "dependencies": { "mdast-util-to-markdown-cjk-friendly": "1.0.0", "micromark-extension-cjk-friendly": "2.0.1" }, "peerDependencies": { "@types/mdast": "^4.0.0", "unified": "^11.0.0" }, "optionalPeers": ["@types/mdast"] }, "sha512-f+pKZRxCRwNEGFBKNRAZAqU91GIK1SAo3ZyFHWRUgC9zcxRR0BXKd6YwqgSsxtW0rNpUDtONj7H5nje2WL3fcA=="], "remark-gfm": ["remark-gfm@4.0.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-gfm": "^3.0.0", "micromark-extension-gfm": "^3.0.0", "remark-parse": "^11.0.0", "remark-stringify": "^11.0.0", "unified": "^11.0.0" } }, "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg=="], @@ -2606,39 +2126,27 @@ "reusify": ["reusify@1.1.0", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="], - "rimraf": ["rimraf@3.0.2", "", { "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" } }, "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA=="], - "robust-predicates": ["robust-predicates@3.0.3", "", {}, "sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA=="], - "rope-sequence": ["rope-sequence@1.3.4", "", {}, "sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ=="], - "roughjs": ["roughjs@4.6.6", "", { "dependencies": { "hachure-fill": "^0.5.2", "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ=="], "router": ["router@2.2.0", "", { "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", "is-promise": "^4.0.0", "parseurl": "^1.3.3", "path-to-regexp": "^8.0.0" } }, "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ=="], "run-applescript": ["run-applescript@7.1.0", "", {}, "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q=="], - "run-async": ["run-async@4.0.6", "", {}, "sha512-IoDlSLTs3Yq593mb3ZoKWKXMNu3UpObxhgA/Xuid5p4bbfi2jdY1Hj0m1K+0/tEuQTxIGMhQDqGjKb7RuxGpAQ=="], - "run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="], "rw": ["rw@1.3.3", "", {}, "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="], - "rxjs": ["rxjs@7.8.2", "", { "dependencies": { "tslib": "^2.1.0" } }, "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA=="], - - "s.color": ["s.color@0.0.15", "", {}, "sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA=="], - "safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], "safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="], - "sass-formatter": ["sass-formatter@0.7.9", "", { "dependencies": { "suf-log": "^2.5.3" } }, "sha512-CWZ8XiSim+fJVG0cFLStwDvft1VI7uvXdCNJYXhDvowiv+DsbD1nXLiQ4zrE5UBvj5DWZJ93cwN0NX5PMsr1Pw=="], - "scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="], "screenfull": ["screenfull@5.2.0", "", {}, "sha512-9BakfsO2aUQN2K9Fdbj87RJIEZ82Q9IGim7FqM5OsebfoFC6ZHXgDq/KvniuLTPdeM8wY2o6Dj3WQ7KeQCj3cA=="], - "scroll-into-view-if-needed": ["scroll-into-view-if-needed@2.2.31", "", { "dependencies": { "compute-scroll-into-view": "^1.0.20" } }, "sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA=="], + "scroll-into-view-if-needed": ["scroll-into-view-if-needed@3.1.0", "", { "dependencies": { "compute-scroll-into-view": "^3.0.2" } }, "sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ=="], "semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], @@ -2646,9 +2154,9 @@ "send": ["send@1.2.1", "", { "dependencies": { "debug": "^4.4.3", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.1", "mime-types": "^3.0.2", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.2" } }, "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ=="], - "seroval": ["seroval@1.5.4", "", {}, "sha512-46uFvgrXTVxZcUorgSSRZ4y+ieqLLQRMlG4bnCZKW3qI6BZm7Rg4ntMW4p1mILEEBZWrFlcpp0AyIIlM6jD9iw=="], + "seroval": ["seroval@1.5.6", "", {}, "sha512-rVQVWjjSvlINzaQPZH5JFqsqEsIWdTxY3iJZCnTL/5gQbXIRooVZKI60tVCkOVfzcRPejboxO2t0P89dg5mQaA=="], - "seroval-plugins": ["seroval-plugins@1.5.4", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-S0xQPhUTefAhNvNWFg0c1J8qJArHt5KdtJ/cFAofo06KD1MVSeFWyl4iiu+ApDIuw0WhjpOfCdgConOfAnLgkw=="], + "seroval-plugins": ["seroval-plugins@1.5.6", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-HXuLAX2pu/UByPpaeo/TaMfvMIi+1QqIoPJYCcAtU8QkVNwgR6MPlGuCQTErV1JwraaMbYaWVIBX7mppzGLATQ=="], "serve-static": ["serve-static@2.2.1", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw=="], @@ -2656,7 +2164,7 @@ "setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="], - "shadcn": ["shadcn@4.12.0", "", { "dependencies": { "@babel/core": "^7.28.0", "@babel/parser": "^7.28.0", "@babel/plugin-transform-typescript": "^7.28.0", "@babel/preset-typescript": "^7.27.1", "@dotenvx/dotenvx": "^1.48.4", "@modelcontextprotocol/sdk": "^1.26.0", "@types/validate-npm-package-name": "^4.0.2", "browserslist": "^4.26.2", "commander": "^14.0.0", "cosmiconfig": "^9.0.0", "dedent": "^1.6.0", "deepmerge": "^4.3.1", "diff": "^8.0.2", "execa": "^9.6.0", "fast-glob": "^3.3.3", "fs-extra": "^11.3.1", "fuzzysort": "^3.1.0", "kleur": "^4.1.5", "open": "^11.0.0", "ora": "^8.2.0", "postcss": "^8.5.6", "postcss-selector-parser": "^7.1.0", "prompts": "^2.4.2", "recast": "^0.23.11", "stringify-object": "^5.0.0", "tailwind-merge": "^3.0.1", "ts-morph": "^26.0.0", "tsconfig-paths": "^4.2.0", "undici": "^7.27.2", "validate-npm-package-name": "^7.0.1", "zod": "^3.24.1", "zod-to-json-schema": "^3.24.6" }, "bin": { "shadcn": "dist/index.js" } }, "sha512-o781ieQziCnXH2FKsEqxp1fnbHdbgAPO9inTSPeZ59hQfsZXuMGp3ul8oFSV5KQS4nbUK9b+DrDE6C7OvfKKQQ=="], + "shadcn": ["shadcn@4.13.1", "", { "dependencies": { "@babel/core": "^7.28.0", "@babel/parser": "^7.28.0", "@babel/plugin-transform-typescript": "^7.28.0", "@babel/preset-typescript": "^7.27.1", "@dotenvx/dotenvx": "^1.48.4", "@modelcontextprotocol/sdk": "^1.26.0", "@types/validate-npm-package-name": "^4.0.2", "browserslist": "^4.26.2", "commander": "^14.0.0", "cosmiconfig": "^9.0.0", "dedent": "^1.6.0", "deepmerge": "^4.3.1", "diff": "^8.0.2", "execa": "^9.6.0", "fast-glob": "^3.3.3", "fs-extra": "^11.3.1", "fuzzysort": "^3.1.0", "kleur": "^4.1.5", "open": "^11.0.0", "ora": "^8.2.0", "postcss": "^8.5.6", "postcss-selector-parser": "^7.1.0", "prompts": "^2.4.2", "recast": "^0.23.11", "stringify-object": "^5.0.0", "tailwind-merge": "^3.0.1", "ts-morph": "^26.0.0", "tsconfig-paths": "^4.2.0", "undici": "^7.27.2", "validate-npm-package-name": "^7.0.1", "zod": "^3.24.1", "zod-to-json-schema": "^3.24.6" }, "bin": { "shadcn": "dist/index.js" } }, "sha512-pSNPND8mVWGBytdd8l4Cksg7MyRZOsv28HpvNCtFtLwZoxLSGM6v3NMUpmpbOaIoreopS/UOpQvnCyttOHVLAQ=="], "shapefile": ["shapefile@0.6.6", "", { "dependencies": { "array-source": "0.0", "commander": "2", "path-source": "0.1", "slice-source": "0.4", "stream-source": "0.3", "text-encoding": "^0.6.4" }, "bin": { "dbf2json": "bin/dbf2json", "shp2json": "bin/shp2json" } }, "sha512-rLGSWeK2ufzCVx05wYd+xrWnOOdSV7xNUW5/XFgx3Bc02hBkpMlrd2F1dDII7/jhWzv0MSyBFh5uJIy9hLdfuw=="], @@ -2664,11 +2172,9 @@ "shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="], - "shiki": ["shiki@4.3.0", "", { "dependencies": { "@shikijs/core": "4.3.0", "@shikijs/engine-javascript": "4.3.0", "@shikijs/engine-oniguruma": "4.3.0", "@shikijs/langs": "4.3.0", "@shikijs/themes": "4.3.0", "@shikijs/types": "4.3.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-NKKjWzR6LIGL3sXBrWDw9sDS9cxx42/DkysaNqJEeOWE8Kix5gpak0bc00OfDVEO4oyXSyz8+aRaqKoBD1yo7A=="], + "shiki": ["shiki@4.3.1", "", { "dependencies": { "@shikijs/core": "4.3.1", "@shikijs/engine-javascript": "4.3.1", "@shikijs/engine-oniguruma": "4.3.1", "@shikijs/langs": "4.3.1", "@shikijs/themes": "4.3.1", "@shikijs/types": "4.3.1", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-oR+qDVi2OjX1tmDpyv+3KviX01KzO6Af+0NNnKnsp9491UEGz2YpxTuJboS/6VhYpTdqzmuJBuiTlrAWWJAssw=="], - "shiki-stream": ["shiki-stream@0.1.4", "", { "dependencies": { "@shikijs/core": "^3.0.0" }, "peerDependencies": { "react": "^19.0.0", "solid-js": "^1.9.0", "vue": "^3.2.0" }, "optionalPeers": ["react", "solid-js", "vue"] }, "sha512-4pz6JGSDmVTTkPJ/ueixHkFAXY4ySCc+unvCaDZV7hqq/sdJZirRxgIXSuNSKgiFlGTgRR97sdu2R8K55sPsrw=="], - - "side-channel": ["side-channel@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="], + "side-channel": ["side-channel@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4", "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ=="], "side-channel-list": ["side-channel-list@1.0.1", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4" } }, "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w=="], @@ -2678,7 +2184,7 @@ "signal-exit": ["signal-exit@4.1.0", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="], - "simple-statistics": ["simple-statistics@7.8.9", "", {}, "sha512-YT6MLqYsz7y1rQZOLFlOCCgSRpCi6bqY417yhoOLI7aVoBi29dD39EPrOE03W9DY25H0J0jizVsHZnkLzyGJFg=="], + "simple-statistics": ["simple-statistics@7.9.3", "", {}, "sha512-WXpxUfo7BJCRpyl4besiuMV7wNj9xiPIq7IKmUQO4upIaF8pK2AXwhjttHN5L8KXZrLkGMCHGHq4p+pJXiIahQ=="], "simplify-geojson": ["simplify-geojson@1.0.5", "", { "dependencies": { "concat-stream": "~1.4.1", "minimist": "1.2.6", "simplify-geometry": "0.0.2" }, "bin": { "simplify-geojson": "cli.js" } }, "sha512-02l1W4UipP5ivNVq6kX15mAzCRIV1oI3tz0FUEyOsNiv1ltuFDjbNhO+nbv/xhbDEtKqWLYuzpWhUsJrjR/ypA=="], @@ -2688,7 +2194,7 @@ "slice-source": ["slice-source@0.4.1", "", {}, "sha512-YiuPbxpCj4hD9Qs06hGAz/OZhQ0eDuALN0lRWJez0eD/RevzKqGdUx1IOMUnXgpr+sXZLq3g8ERwbAH0bCb8vg=="], - "smol-toml": ["smol-toml@1.6.1", "", {}, "sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg=="], + "smol-toml": ["smol-toml@1.7.0", "", {}, "sha512-aqVvWoyO21L23mb+drl4RmMXbf6N7FdHjAhTRA9ZBL7apWBgfWC16KjrASI+1p9GAroljyMHj6fK67i0UiTNvQ=="], "sonner": ["sonner@2.0.7", "", { "peerDependencies": { "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-W6ZN4p58k8aDKA4XPcx2hpIQXBRAgyiWVkYhT7CvK6D3iAu7xjvVyhQHg2/iaKJZ1XVJ4r7XuwGL+WGEK37i9w=="], @@ -2708,7 +2214,7 @@ "stdin-discarder": ["stdin-discarder@0.2.2", "", {}, "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ=="], - "stream-markdown-parser": ["stream-markdown-parser@1.0.9", "", { "dependencies": { "markdown-it-container": "^4.0.0", "markdown-it-footnote": "^4.0.0", "markdown-it-ins": "^4.0.0", "markdown-it-mark": "^4.0.0", "markdown-it-sub": "^2.0.0", "markdown-it-sup": "^2.0.0", "markdown-it-task-checkbox": "^1.0.6", "markdown-it-ts": "^1.0.2" } }, "sha512-uqf2F7DMBxc2JCWv9QyrzFNWQpzLF8zIH0BuLgA5LKv2jRbF+VJ9Dqz7LyRToJilAnns7PTud5XbsaSmIcjZ6Q=="], + "stream-markdown-parser": ["stream-markdown-parser@1.1.3", "", { "dependencies": { "markdown-it-container": "^4.0.0", "markdown-it-footnote": "^4.0.0", "markdown-it-ins": "^4.0.0", "markdown-it-mark": "^4.0.0", "markdown-it-sub": "^2.0.0", "markdown-it-sup": "^2.0.0", "markdown-it-task-checkbox": "^1.0.6", "markdown-it-ts": "^1.0.4" } }, "sha512-tge6aKbOGU36vBLeeroHGBAJ7qiNcsTYyvmgqevVN0+5kMiLOjAyeDmv3PQkniTMbgOsswVHN9izmgmSw5bsBQ=="], "stream-source": ["stream-source@0.3.5", "", {}, "sha512-ZuEDP9sgjiAwUVoDModftG0JtYiLUV8K4ljYD1VyUMRWtbVf92474o4kuuul43iZ8t/hRuiDAx1dIJSvirrK/g=="], @@ -2722,7 +2228,7 @@ "stringify-object": ["stringify-object@5.0.0", "", { "dependencies": { "get-own-enumerable-keys": "^1.0.0", "is-obj": "^3.0.0", "is-regexp": "^3.1.0" } }, "sha512-zaJYxz2FtcMb4f+g60KsRNFOpVMUyuJgA51Zi5Z1DOTC3S59+OQiVOzE9GZt0x72uBGWKsQIuBKeF9iusmKFsg=="], - "strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + "strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="], "strip-bom": ["strip-bom@3.0.0", "", {}, "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA=="], @@ -2738,32 +2244,22 @@ "stylis": ["stylis@4.4.0", "", {}, "sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA=="], - "sucrase": ["sucrase@3.35.1", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", "lines-and-columns": "^1.1.6", "mz": "^2.7.0", "pirates": "^4.0.1", "tinyglobby": "^0.2.11", "ts-interface-checker": "^0.1.9" }, "bin": { "sucrase": "bin/sucrase", "sucrase-node": "bin/sucrase-node" } }, "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw=="], - - "suf-log": ["suf-log@2.5.3", "", { "dependencies": { "s.color": "0.0.15" } }, "sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow=="], - - "supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], - "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="], - "swr": ["swr@2.4.1", "", { "dependencies": { "dequal": "^2.0.3", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-2CC6CiKQtEwaEeNiqWTAw9PGykW8SR5zZX8MZk6TeAvEAnVS7Visz8WzphqgtQ8v2xz/4Q5K+j+SeMaKXeeQIA=="], + "swr": ["swr@2.4.2", "", { "dependencies": { "dequal": "^2.0.3", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-ej644Y2bvkIajfR32KGeSSdBXQW+ScjGjkybZgSE7kFpk9eGnV44XY9FJylXi+W75pavSX1PVNB57W5EbhGIYw=="], - "tabbable": ["tabbable@6.4.0", "", {}, "sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg=="], + "systeminformation": ["systeminformation@5.33.0", "", { "os": "!aix", "bin": { "systeminformation": "lib/cli.js" } }, "sha512-0LYSL01CCbjVeJG7iXI8fUCFU76zMjzbHd/EU3or4QpSFYCLMgslR11prwHuA3siz5jmOkqoLhjgOyDRmXBKmA=="], + + "tabbable": ["tabbable@6.5.0", "", {}, "sha512-wieBHXygIm7OyQOu5hQlkk62/WyCFYGlWg7L6/ZCUZwx0o398Zkn4pVmMyfYhfMG8kGrj/Krt8eIk6UKC6VzwA=="], "tailwind-merge": ["tailwind-merge@3.6.0", "", {}, "sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w=="], - "tailwindcss": ["tailwindcss@4.3.2", "", {}, "sha512-WtctNNSH8A9jlMIqxzuYumOHU5uGZyRv0Q5svQl+oEPy5w84YpBxdb7MdqyiSPQge5jTJ6zFQLq0PFygdccSBA=="], + "tailwindcss": ["tailwindcss@4.3.3", "", {}, "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ=="], "tapable": ["tapable@2.3.3", "", {}, "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A=="], "text-encoding": ["text-encoding@0.6.4", "", {}, "sha512-hJnc6Qg3dWoOMkqP53F0dzRIgtmsAge09kxUIqGrEUS4qr5rWLckGYaQAVr+opBrIMRErGgy6f5aPnyPpyGRfg=="], - "text-table": ["text-table@0.2.0", "", {}, "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="], - - "thenify": ["thenify@3.3.1", "", { "dependencies": { "any-promise": "^1.0.0" } }, "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw=="], - - "thenify-all": ["thenify-all@1.6.0", "", { "dependencies": { "thenify": ">= 3.1.0 < 4" } }, "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA=="], - "throttle-debounce": ["throttle-debounce@5.0.2", "", {}, "sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A=="], "tiny-invariant": ["tiny-invariant@1.3.3", "", {}, "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="], @@ -2790,9 +2286,7 @@ "trough": ["trough@2.2.0", "", {}, "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw=="], - "ts-dedent": ["ts-dedent@2.2.0", "", {}, "sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ=="], - - "ts-interface-checker": ["ts-interface-checker@0.1.13", "", {}, "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="], + "ts-dedent": ["ts-dedent@2.3.0", "", {}, "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg=="], "ts-md5": ["ts-md5@2.0.1", "", {}, "sha512-yF35FCoEOFBzOclSkMNEUbFQZuv89KEQ+5Xz03HrMSGUGB1+r+El+JiGOFwsP4p9RFNzwlrydYoTLvPOuICl9w=="], @@ -2804,19 +2298,13 @@ "tw-animate-css": ["tw-animate-css@1.4.0", "", {}, "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ=="], - "type-check": ["type-check@0.4.0", "", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="], - - "type-fest": ["type-fest@0.20.2", "", {}, "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ=="], - "type-is": ["type-is@2.1.0", "", { "dependencies": { "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA=="], "typedarray": ["typedarray@0.0.6", "", {}, "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA=="], - "typescript": ["typescript@4.4.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ=="], - "uc.micro": ["uc.micro@2.1.0", "", {}, "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A=="], - "unbash": ["unbash@4.0.2", "", {}, "sha512-8gwNZ29+0/3zmXw7ToIHZtg6wK37xnniRUdBt7B27xZxaxfgR5tGMaGHT0t0dLtBV9fXE7zurh0s6Z1DHVjfWg=="], + "unbash": ["unbash@4.0.3", "", {}, "sha512-3cudTErfToSc4Ggv8XGXVNVli/xHKUtUZvaY5UVwhOcUPbQGz7PeaEnT/SAVgNziZtX67KEN9swMUYkLghxA1w=="], "undici": ["undici@7.28.0", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="], @@ -2846,18 +2334,14 @@ "unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="], - "unplugin": ["unplugin@3.0.0", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "picomatch": "^4.0.3", "webpack-virtual-modules": "^0.6.2" } }, "sha512-0Mqk3AT2TZCXWKdcoaufeXNukv2mTrEZExeXlHIOZXdqYoHHr4n51pymnwV8x2BOVxwXbK2HLlI7usrqMpycdg=="], + "unplugin": ["unplugin@3.3.0", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "picomatch": "^4.0.4", "webpack-virtual-modules": "^0.6.2" }, "peerDependencies": { "@farmfe/core": "*", "@rspack/core": "*", "bun-types-no-globals": "*", "esbuild": "*", "rolldown": "*", "rollup": "*", "unloader": "*", "vite": "*", "webpack": "*" }, "optionalPeers": ["@farmfe/core", "@rspack/core", "bun-types-no-globals", "esbuild", "rolldown", "rollup", "unloader", "vite", "webpack"] }, "sha512-qa66K+crbfyE6JK10GjvbJeRrOsuC/JpbnHctfyp/i4oBTxWOzJfRZyDiOk1PtErMFRu8JhsU/wPvOdBNWe5Rg=="], "update-browserslist-db": ["update-browserslist-db@1.2.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="], - "uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="], - "url-join": ["url-join@5.0.0", "", {}, "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA=="], "use-callback-ref": ["use-callback-ref@1.3.3", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg=="], - "use-debounce": ["use-debounce@10.1.1", "", { "peerDependencies": { "react": "*" } }, "sha512-kvds8BHR2k28cFsxW8k3nc/tRga2rs1RHYCqmmGqb90MEeE++oALwzh2COiuBLO1/QXiOuShXoSN2ZpWnMmvuQ=="], - "use-merge-value": ["use-merge-value@1.2.0", "", { "peerDependencies": { "react": ">= 16.x" } }, "sha512-DXgG0kkgJN45TcyoXL49vJnn55LehnrmoHc7MbKi+QDBvr8dsesqws8UlyIWGHMR+JXgxc1nvY+jDGMlycsUcw=="], "use-sidecar": ["use-sidecar@1.1.3", "", { "dependencies": { "detect-node-es": "^1.1.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ=="], @@ -2868,8 +2352,6 @@ "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], - "utility-types": ["utility-types@3.11.0", "", {}, "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw=="], - "uuid": ["uuid@14.0.0", "", { "bin": { "uuid": "dist-node/bin/uuid" } }, "sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg=="], "v8n": ["v8n@1.5.1", "", {}, "sha512-LdabyT4OffkyXFCe9UT+uMkxNBs5rcTVuZClvxQr08D5TUgo1OFKkoT65qYRCsiKBl/usHjpXvP4hHMzzDRj3A=="], @@ -2888,7 +2370,7 @@ "victory-vendor": ["victory-vendor@37.3.6", "", { "dependencies": { "@types/d3-array": "^3.0.3", "@types/d3-ease": "^3.0.0", "@types/d3-interpolate": "^3.0.1", "@types/d3-scale": "^4.0.2", "@types/d3-shape": "^3.1.0", "@types/d3-time": "^3.0.0", "@types/d3-timer": "^3.0.0", "d3-array": "^3.1.6", "d3-ease": "^3.0.1", "d3-interpolate": "^3.0.1", "d3-scale": "^4.0.2", "d3-shape": "^3.1.0", "d3-time": "^3.0.0", "d3-timer": "^3.0.1" } }, "sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ=="], - "virtua": ["virtua@0.49.1", "", { "peerDependencies": { "react": ">=16.14.0", "react-dom": ">=16.14.0", "solid-js": ">=1.0", "svelte": ">=5.0", "vue": ">=3.2" }, "optionalPeers": ["react", "react-dom", "solid-js", "svelte", "vue"] }, "sha512-6f79msqg3jzNFdqJiS0FSzhRN1EHlDhR7EvW7emp6z5qQ22VdsReiDHflkpMEMhoAyUuYr69nwT0aagiM7NrUg=="], + "virtua": ["virtua@0.49.3", "", { "peerDependencies": { "react": ">=16.14.0", "react-dom": ">=16.14.0", "solid-js": ">=1.0", "svelte": ">=5.0", "vue": ">=3.2" }, "optionalPeers": ["react", "react-dom", "solid-js", "svelte", "vue"] }, "sha512-k1Yn988Vz/L40uDtEWPjfdVo15Suumh4tU4/z5Srs0elNcU9DgBskqdh3llpHyAlXrCeHWTfcclYvY1uU4MmIg=="], "void-elements": ["void-elements@3.1.0", "", {}, "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w=="], @@ -2902,8 +2384,6 @@ "which": ["which@4.0.0", "", { "dependencies": { "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" } }, "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg=="], - "word-wrap": ["word-wrap@1.2.5", "", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="], - "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], "wsl-utils": ["wsl-utils@0.3.1", "", { "dependencies": { "is-wsl": "^3.1.0", "powershell-utils": "^0.1.0" } }, "sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg=="], @@ -2912,9 +2392,7 @@ "yaml": ["yaml@2.9.0", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA=="], - "yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="], - - "yocto-spinner": ["yocto-spinner@1.2.0", "", { "dependencies": { "yoctocolors": "^2.1.1" } }, "sha512-Yw0hUB6UA3o4YUgKy3oSe9a4cxoaZ9sBfYDw+JSxo6Id0KoJGoxzPA24qqUXYKBWABs/zDSGTz9kww7t3F0XGw=="], + "yocto-spinner": ["yocto-spinner@1.2.2", "", { "dependencies": { "yoctocolors": "^2.1.1" } }, "sha512-DODGl1wJjA/s5pnJFKau9lIYHT81lnhob1i3e1TjxZRxEhWRKl74nTbWE6H5KlkViQQTo/Z29YFdxzTZAMY3ng=="], "yoctocolors": ["yoctocolors@2.1.2", "", {}, "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug=="], @@ -2926,27 +2404,11 @@ "zwitch": ["zwitch@2.0.4", "", {}, "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A=="], - "@codemirror/autocomplete/@codemirror/view": ["@codemirror/view@6.43.3", "", { "dependencies": { "@codemirror/state": "^6.7.0", "crelt": "^1.0.6", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, "sha512-MwEwCAr/o0agJefhC2+reBv5kfOQpMcDRUNQrRYZgWlhH8IwQcerMZrpqWyUFSyO0ebgN2cnh/w87F7G4BGSng=="], - - "@codemirror/lang-html/@codemirror/view": ["@codemirror/view@6.43.3", "", { "dependencies": { "@codemirror/state": "^6.7.0", "crelt": "^1.0.6", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, "sha512-MwEwCAr/o0agJefhC2+reBv5kfOQpMcDRUNQrRYZgWlhH8IwQcerMZrpqWyUFSyO0ebgN2cnh/w87F7G4BGSng=="], - - "@codemirror/lang-javascript/@codemirror/view": ["@codemirror/view@6.43.3", "", { "dependencies": { "@codemirror/state": "^6.7.0", "crelt": "^1.0.6", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, "sha512-MwEwCAr/o0agJefhC2+reBv5kfOQpMcDRUNQrRYZgWlhH8IwQcerMZrpqWyUFSyO0ebgN2cnh/w87F7G4BGSng=="], - - "@codemirror/lang-markdown/@codemirror/view": ["@codemirror/view@6.43.3", "", { "dependencies": { "@codemirror/state": "^6.7.0", "crelt": "^1.0.6", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, "sha512-MwEwCAr/o0agJefhC2+reBv5kfOQpMcDRUNQrRYZgWlhH8IwQcerMZrpqWyUFSyO0ebgN2cnh/w87F7G4BGSng=="], - - "@codemirror/language/@codemirror/view": ["@codemirror/view@6.43.3", "", { "dependencies": { "@codemirror/state": "^6.7.0", "crelt": "^1.0.6", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, "sha512-MwEwCAr/o0agJefhC2+reBv5kfOQpMcDRUNQrRYZgWlhH8IwQcerMZrpqWyUFSyO0ebgN2cnh/w87F7G4BGSng=="], - - "@codemirror/lint/@codemirror/view": ["@codemirror/view@6.43.3", "", { "dependencies": { "@codemirror/state": "^6.7.0", "crelt": "^1.0.6", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, "sha512-MwEwCAr/o0agJefhC2+reBv5kfOQpMcDRUNQrRYZgWlhH8IwQcerMZrpqWyUFSyO0ebgN2cnh/w87F7G4BGSng=="], - "@dotenvx/dotenvx/commander": ["commander@11.1.0", "", {}, "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ=="], "@dotenvx/dotenvx/execa": ["execa@5.1.1", "", { "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^4.0.1", "onetime": "^5.1.2", "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" } }, "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg=="], - "@douyinfe/semi-foundation/date-fns": ["date-fns@2.30.0", "", { "dependencies": { "@babel/runtime": "^7.21.0" } }, "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw=="], - - "@douyinfe/semi-ui/date-fns": ["date-fns@2.30.0", "", { "dependencies": { "@babel/runtime": "^7.21.0" } }, "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw=="], - - "@emoji-mart/react/react": ["react@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ=="], + "@dotenvx/dotenvx/open": ["open@8.4.2", "", { "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", "is-wsl": "^2.2.0" } }, "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ=="], "@emotion/babel-plugin/@emotion/hash": ["@emotion/hash@0.9.2", "", {}, "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g=="], @@ -2962,69 +2424,35 @@ "@emotion/serialize/@emotion/unitless": ["@emotion/unitless@0.10.0", "", {}, "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg=="], - "@eslint/eslintrc/strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="], - "@lobehub/fluent-emoji/lucide-react": ["lucide-react@0.562.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-82hOAu7y0dbVuFfmO4bYF1XEwYk/mEbM5E+b1jgci/udUBEE/R7LF5Ip0CCEmXe8AybRM8L+04eP+LGZeDvkiw=="], "@lobehub/icons/lucide-react": ["lucide-react@0.469.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-28vvUnnKQ/dBwiCQtwJw7QauYnE7yd2Cyp4tTTJpvglX4EMpbflcdBgrgToX2j71B3YvugK/NH3BGUk+E/p/Fw=="], - "@lobehub/ui/@base-ui/react": ["@base-ui/react@1.5.0", "", { "dependencies": { "@babel/runtime": "^7.29.2", "@base-ui/utils": "0.2.9", "@floating-ui/react-dom": "^2.1.8", "@floating-ui/utils": "^0.2.11", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "@date-fns/tz": "^1.2.0", "@types/react": "^17 || ^18 || ^19", "date-fns": "^4.0.0", "react": "^17 || ^18 || ^19", "react-dom": "^17 || ^18 || ^19" }, "optionalPeers": ["@date-fns/tz", "@types/react", "date-fns"] }, "sha512-z1gSAlced1yY+iM+mHDEtIkD8UI3Ebs52MuBPxvV6f5hRutk+xvCH/wuB7hDqDzK9JG5FoMz5nhrqtSs1wjt1A=="], - - "@lobehub/ui/@dnd-kit/sortable": ["@dnd-kit/sortable@10.0.0", "", { "dependencies": { "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@dnd-kit/core": "^6.3.0", "react": ">=16.8.0" } }, "sha512-+xqhmIIzvAYMGfBYYnbKuNicfSsk4RksY2XdmJhT+HAC01nix6fHCztU68jooFiMUB01Ky3F0FyOvhG/BZrWkg=="], - - "@lobehub/ui/@shikijs/core": ["@shikijs/core@4.1.0", "", { "dependencies": { "@shikijs/primitive": "4.1.0", "@shikijs/types": "4.1.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-jLJtSJeuFffqX6/inRE1zqU5aFv2hrszvYgq3OjbAgFRZiWv7abKMDdQzYxuSDfmUPQozZvI/kuy6VMTvnvqTQ=="], - - "@lobehub/ui/katex": ["katex@0.16.47", "", { "dependencies": { "commander": "^8.3.0" }, "bin": { "katex": "cli.js" } }, "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg=="], - - "@lobehub/ui/lucide-react": ["lucide-react@1.17.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-9FA9evdox/JQL5PT57fdA1x/yg8T7knJ98+zjTL3UfKza6pflQUUh3XtaQIHKvnsJw1lmsEyHVlt5jchYxOQ5w=="], - - "@lobehub/ui/marked": ["marked@17.0.6", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-gB0gkNafnonOw0obSTEGZTT86IuhILt2Wfx0mWH/1Au83kybTayroZ/V6nS25mN7u8ASy+5fMhgB3XPNrOZdmA=="], - - "@lobehub/ui/motion": ["motion@12.40.0", "", { "dependencies": { "framer-motion": "^12.40.0", "tslib": "^2.4.0" }, "peerDependencies": { "@emotion/is-prop-valid": "*", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["@emotion/is-prop-valid", "react", "react-dom"] }, "sha512-yjrHUrBFW6kQvjJwRsoiPSAhC5tRwRqNGJWmiJ4CrGnbKp0V88AdzkhBmDoqIsIPfarOe0Uddd37Xq43/gIocA=="], - - "@lobehub/ui/shiki": ["shiki@4.1.0", "", { "dependencies": { "@shikijs/core": "4.1.0", "@shikijs/engine-javascript": "4.1.0", "@shikijs/engine-oniguruma": "4.1.0", "@shikijs/langs": "4.1.0", "@shikijs/themes": "4.1.0", "@shikijs/types": "4.1.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-l/ABZPUR5v70jI10EzqfMS/I96vjSGv2y0ihUV+WYFzv0EfvW4s54m0Lg8wCrrL+2IkwBzFTuxkZjPf8b2NX9Q=="], - - "@lobehub/ui/uuid": ["uuid@13.0.2", "", { "bin": { "uuid": "dist-node/bin/uuid" } }, "sha512-vzi9uRZ926x4XV73S/4qQaTwPXM2JBj6/6lI/byHH1jOpCzb0zDbfytgA9LcN/hzb2l7WQSQnxITOVx5un/wGw=="], - "@mdx-js/mdx/source-map": ["source-map@0.7.6", "", {}, "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ=="], - "@modelcontextprotocol/sdk/ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="], - "@oxc-resolver/binding-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.11.0", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.2", "tslib": "^2.4.0" } }, "sha512-l9Oo58x0HOP5znGzVhYW9U3e5wVuA4LAZU2AGezTmkhO1CgQRFDhDg4nneHsu/t3WniXg9QrG2nIXL/ZS8ln8Q=="], "@oxc-resolver/binding-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.11.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-55coeOFKHv1ywEcUXJtWU5f+Jr/W5tZDvZig8DLKSwUN1JpROQ4rk/SNOQiFWmaR/VKF4zuFyW1B8JduOSv6Pg=="], - "@pierre/diffs/@shikijs/transformers": ["@shikijs/transformers@3.23.0", "", { "dependencies": { "@shikijs/core": "3.23.0", "@shikijs/types": "3.23.0" } }, "sha512-F9msZVxdF+krQNSdQ4V+Ja5QemeAoTQ2jxt7nJCwhDsdF1JWS3KxIQXA3lQbyKwS3J61oHRUSv4jYWv3CkaKTQ=="], + "@pierre/diffs/diff": ["diff@9.0.0", "", {}, "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw=="], - "@pierre/diffs/diff": ["diff@8.0.3", "", {}, "sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ=="], + "@rc-component/dialog/@rc-component/portal": ["@rc-component/portal@2.2.1", "", { "dependencies": { "@rc-component/util": "^1.11.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-ck+r1kW/JSv0wxPji3KN2ss9K6Z0qqwusw/mf/0JobXhZ8hC2ejZwCJObW/SvDi0uhA0VzmCnx0CaCci95tcmA=="], - "@pierre/diffs/shiki": ["shiki@3.23.0", "", { "dependencies": { "@shikijs/core": "3.23.0", "@shikijs/engine-javascript": "3.23.0", "@shikijs/engine-oniguruma": "3.23.0", "@shikijs/langs": "3.23.0", "@shikijs/themes": "3.23.0", "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-55Dj73uq9ZXL5zyeRPzHQsK7Nbyt6Y10k5s7OjuFZGMhpp4r/rsLBH0o/0fstIzX1Lep9VxefWljK/SKCzygIA=="], + "@rc-component/drawer/@rc-component/portal": ["@rc-component/portal@2.2.1", "", { "dependencies": { "@rc-component/util": "^1.11.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-ck+r1kW/JSv0wxPji3KN2ss9K6Z0qqwusw/mf/0JobXhZ8hC2ejZwCJObW/SvDi0uhA0VzmCnx0CaCci95tcmA=="], - "@radix-ui/react-dialog/@radix-ui/react-slot": ["@radix-ui/react-slot@1.2.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A=="], + "@rc-component/image/@rc-component/portal": ["@rc-component/portal@2.2.1", "", { "dependencies": { "@rc-component/util": "^1.11.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-ck+r1kW/JSv0wxPji3KN2ss9K6Z0qqwusw/mf/0JobXhZ8hC2ejZwCJObW/SvDi0uhA0VzmCnx0CaCci95tcmA=="], - "@radix-ui/react-primitive/@radix-ui/react-slot": ["@radix-ui/react-slot@1.2.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A=="], + "@rc-component/tour/@rc-component/portal": ["@rc-component/portal@2.2.1", "", { "dependencies": { "@rc-component/util": "^1.11.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-ck+r1kW/JSv0wxPji3KN2ss9K6Z0qqwusw/mf/0JobXhZ8hC2ejZwCJObW/SvDi0uhA0VzmCnx0CaCci95tcmA=="], - "@radix-ui/react-tooltip/@radix-ui/react-slot": ["@radix-ui/react-slot@1.2.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A=="], + "@rc-component/trigger/@rc-component/portal": ["@rc-component/portal@2.2.1", "", { "dependencies": { "@rc-component/util": "^1.11.0", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-ck+r1kW/JSv0wxPji3KN2ss9K6Z0qqwusw/mf/0JobXhZ8hC2ejZwCJObW/SvDi0uhA0VzmCnx0CaCci95tcmA=="], - "@rc-component/dialog/@rc-component/portal": ["@rc-component/portal@2.2.0", "", { "dependencies": { "@rc-component/util": "^1.2.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-oc6FlA+uXCMiwArHsJyHcIkX4q6uKyndrPol2eWX8YPkAnztHOPsFIRtmWG4BMlGE5h7YIRE3NiaJ5VS8Lb1QQ=="], + "@rc-component/util/react-is": ["react-is@19.2.7", "", {}, "sha512-kZFnouyVv7eP/Phmrlo9FK+zcAdriZJvzxXHF1Sl1P377WSGe2G/JxVolhTrB/jeV47lKImhNUsijjHAAbcl/A=="], - "@rc-component/drawer/@rc-component/portal": ["@rc-component/portal@2.2.0", "", { "dependencies": { "@rc-component/util": "^1.2.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-oc6FlA+uXCMiwArHsJyHcIkX4q6uKyndrPol2eWX8YPkAnztHOPsFIRtmWG4BMlGE5h7YIRE3NiaJ5VS8Lb1QQ=="], + "@rc-component/virtual-list/@babel/runtime": ["@babel/runtime@8.0.0", "", {}, "sha512-sL6cvO2IfkSu/iU+zs2S/w01B7A8V7suXSIKEN4hPFFdZoiPGxrj5pAG0lCaqLWiEIrjKzdznIWuaLcxPR53qw=="], - "@rc-component/image/@rc-component/portal": ["@rc-component/portal@2.2.0", "", { "dependencies": { "@rc-component/util": "^1.2.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-oc6FlA+uXCMiwArHsJyHcIkX4q6uKyndrPol2eWX8YPkAnztHOPsFIRtmWG4BMlGE5h7YIRE3NiaJ5VS8Lb1QQ=="], + "@rspack/binding-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.11.2", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.2", "tslib": "^2.4.0" } }, "sha512-TC8MkTuZUtcTSiFeuC0ksCh9QIJ5+F21MvZ4Wn4ORfYaFJ/0dsiudv5tVkejgwZlwQ39jL9WWDe2lz8x0WglOA=="], - "@rc-component/tour/@rc-component/portal": ["@rc-component/portal@2.2.0", "", { "dependencies": { "@rc-component/util": "^1.2.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-oc6FlA+uXCMiwArHsJyHcIkX4q6uKyndrPol2eWX8YPkAnztHOPsFIRtmWG4BMlGE5h7YIRE3NiaJ5VS8Lb1QQ=="], - - "@rc-component/trigger/@rc-component/portal": ["@rc-component/portal@2.2.0", "", { "dependencies": { "@rc-component/util": "^1.2.1", "clsx": "^2.1.1" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-oc6FlA+uXCMiwArHsJyHcIkX4q6uKyndrPol2eWX8YPkAnztHOPsFIRtmWG4BMlGE5h7YIRE3NiaJ5VS8Lb1QQ=="], - - "@reduxjs/toolkit/reselect": ["reselect@5.1.1", "", {}, "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w=="], - - "@rspack/binding-wasm32-wasi/@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.6", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" } }, "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg=="], - - "@shikijs/transformers/@shikijs/core": ["@shikijs/core@4.1.0", "", { "dependencies": { "@shikijs/primitive": "4.1.0", "@shikijs/types": "4.1.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-jLJtSJeuFffqX6/inRE1zqU5aFv2hrszvYgq3OjbAgFRZiWv7abKMDdQzYxuSDfmUPQozZvI/kuy6VMTvnvqTQ=="], - - "@shikijs/transformers/@shikijs/types": ["@shikijs/types@4.1.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-3EQWX54fMpniOrDblzAhiwiJwpiTMW6+B9DWyUd9ska483tbayFYuw47UxwuPknI31bKnySfVQ/QW+jFL4rFdA=="], - - "@tailwindcss/node/tailwindcss": ["tailwindcss@4.3.1", "", {}, "sha512-hk+TB1m+K8CYNrP6rjQaq/Y+4Zylwpa87mLYBKCunwnnQ9p+fHb7kmSfGqyEJoxF/O6CDyABWVFEafNSYKll+Q=="], + "@rspack/binding-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.11.2", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA=="], "@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.11.1", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.2", "tslib": "^2.4.0" }, "bundled": true }, "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ=="], @@ -3032,72 +2460,14 @@ "@tailwindcss/oxide-wasm32-wasi/@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.2", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA=="], - "@tailwindcss/oxide-wasm32-wasi/@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.5", "", { "dependencies": { "@tybys/wasm-util": "^0.10.2" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" }, "bundled": true }, "sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q=="], + "@tailwindcss/oxide-wasm32-wasi/@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.6", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" }, "bundled": true }, "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg=="], - "@tailwindcss/oxide-wasm32-wasi/@tybys/wasm-util": ["@tybys/wasm-util@0.10.2", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg=="], + "@tailwindcss/oxide-wasm32-wasi/@tybys/wasm-util": ["@tybys/wasm-util@0.10.3", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg=="], "@tailwindcss/oxide-wasm32-wasi/tslib": ["tslib@2.8.1", "", { "bundled": true }, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], - "@tailwindcss/webpack/tailwindcss": ["tailwindcss@4.3.1", "", {}, "sha512-hk+TB1m+K8CYNrP6rjQaq/Y+4Zylwpa87mLYBKCunwnnQ9p+fHb7kmSfGqyEJoxF/O6CDyABWVFEafNSYKll+Q=="], - - "@tanstack/react-router/@tanstack/router-core": ["@tanstack/router-core@1.171.14", "", { "dependencies": { "@tanstack/history": "1.162.0", "cookie-es": "^3.0.0", "seroval": "^1.5.4", "seroval-plugins": "^1.5.4" } }, "sha512-Mo3hwx0qB0cJsVYGDjG0+Ouf7VV74h/vsoDMGztdlyzDanp4gBA2s7IVvm6hFrmQM6GpD9F0Z7SqD7OldfLE7g=="], - - "@tanstack/router-generator/@tanstack/router-core": ["@tanstack/router-core@1.171.14", "", { "dependencies": { "@tanstack/history": "1.162.0", "cookie-es": "^3.0.0", "seroval": "^1.5.4", "seroval-plugins": "^1.5.4" } }, "sha512-Mo3hwx0qB0cJsVYGDjG0+Ouf7VV74h/vsoDMGztdlyzDanp4gBA2s7IVvm6hFrmQM6GpD9F0Z7SqD7OldfLE7g=="], - - "@tanstack/router-plugin/@tanstack/router-core": ["@tanstack/router-core@1.171.14", "", { "dependencies": { "@tanstack/history": "1.162.0", "cookie-es": "^3.0.0", "seroval": "^1.5.4", "seroval-plugins": "^1.5.4" } }, "sha512-Mo3hwx0qB0cJsVYGDjG0+Ouf7VV74h/vsoDMGztdlyzDanp4gBA2s7IVvm6hFrmQM6GpD9F0Z7SqD7OldfLE7g=="], - - "@ts-morph/common/minimatch": ["minimatch@10.2.5", "", { "dependencies": { "brace-expansion": "^5.0.5" } }, "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg=="], - - "@visactor/vchart-semi-theme/@visactor/vchart": ["@visactor/vchart@1.8.11", "", { "dependencies": { "@visactor/vdataset": "~0.17.3", "@visactor/vgrammar-core": "0.10.11", "@visactor/vgrammar-hierarchy": "0.10.11", "@visactor/vgrammar-projection": "0.10.11", "@visactor/vgrammar-sankey": "0.10.11", "@visactor/vgrammar-util": "0.10.11", "@visactor/vgrammar-wordcloud": "0.10.11", "@visactor/vgrammar-wordcloud-shape": "0.10.11", "@visactor/vrender-components": "0.17.17", "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3", "@visactor/vutils-extension": "1.8.11" } }, "sha512-RdQ822J02GgAQNXvO1LiT0T3O6FjdgPdcm9hVBFyrpBBmuI8MH02IE7Y1kGe9NiFTH4tDwP0ixRgBmqNSGSLZQ=="], - - "@visactor/vchart-theme-utils/@visactor/vchart": ["@visactor/vchart@1.8.11", "", { "dependencies": { "@visactor/vdataset": "~0.17.3", "@visactor/vgrammar-core": "0.10.11", "@visactor/vgrammar-hierarchy": "0.10.11", "@visactor/vgrammar-projection": "0.10.11", "@visactor/vgrammar-sankey": "0.10.11", "@visactor/vgrammar-util": "0.10.11", "@visactor/vgrammar-wordcloud": "0.10.11", "@visactor/vgrammar-wordcloud-shape": "0.10.11", "@visactor/vrender-components": "0.17.17", "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3", "@visactor/vutils-extension": "1.8.11" } }, "sha512-RdQ822J02GgAQNXvO1LiT0T3O6FjdgPdcm9hVBFyrpBBmuI8MH02IE7Y1kGe9NiFTH4tDwP0ixRgBmqNSGSLZQ=="], - "@visactor/vdataset/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - "@visactor/vgrammar-coordinate/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - - "@visactor/vgrammar-core/@visactor/vdataset": ["@visactor/vdataset@0.17.5", "", { "dependencies": { "@turf/flatten": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/rewind": "^6.5.0", "@visactor/vutils": "0.17.5", "d3-dsv": "^2.0.0", "d3-geo": "^1.12.1", "d3-hexbin": "^0.2.2", "d3-hierarchy": "^3.1.1", "eventemitter3": "^4.0.7", "geobuf": "^3.0.1", "geojson-dissolve": "^3.1.0", "path-browserify": "^1.0.1", "pbf": "^3.2.1", "point-at-length": "^1.1.0", "simple-statistics": "^7.7.3", "simplify-geojson": "^1.0.4", "topojson-client": "^3.1.0" } }, "sha512-zVBdLWHWrhldGc8JDjSYF9lvpFT4ZEFQDB0b6yvfSiHzHKHiSco+rWmUFvA7r4ObT6j2QWF1vZAV9To8Ml4vHw=="], - - "@visactor/vgrammar-core/@visactor/vrender-components": ["@visactor/vrender-components@0.17.17", "", { "dependencies": { "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3" } }, "sha512-7gYFQrozvBkyGF7s/JHXdWDZnATzymxzug63CZd4EB7A0OXKatVDImXRePqwzlPD3QamF7QMVWn0CuIx3gQ2gA=="], - - "@visactor/vgrammar-core/@visactor/vrender-core": ["@visactor/vrender-core@0.17.17", "", { "dependencies": { "@visactor/vutils": "~0.17.3", "color-convert": "2.0.1" } }, "sha512-pAZGaimunDAWOBdFhzPh0auH5ryxAHr+MVoz+QdASG+6RZXy8D02l8v2QYu4+e4uorxe/s2ZkdNDm81SlNkoHQ=="], - - "@visactor/vgrammar-core/@visactor/vrender-kits": ["@visactor/vrender-kits@0.17.17", "", { "dependencies": { "@resvg/resvg-js": "2.4.1", "@visactor/vrender-core": "0.17.17", "@visactor/vutils": "~0.17.3", "roughjs": "4.5.2" } }, "sha512-noRP1hAHvPCv36nf2P6sZ930Tk+dJ8jpPWIUm1cFYmUNdcumgIS8Cug0RyeZ+saSqVt5FDTwIwifhOqupw5Zaw=="], - - "@visactor/vgrammar-core/@visactor/vscale": ["@visactor/vscale@0.17.5", "", { "dependencies": { "@visactor/vutils": "0.17.5" } }, "sha512-2dkS1IlAJ/IdTp8JElbctOOv6lkHKBKPDm8KvwBo0NuGWQeYAebSeyN3QCdwKbj76gMlCub4zc+xWrS5YiA2zA=="], - - "@visactor/vgrammar-core/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - - "@visactor/vgrammar-hierarchy/@visactor/vrender-core": ["@visactor/vrender-core@0.17.17", "", { "dependencies": { "@visactor/vutils": "~0.17.3", "color-convert": "2.0.1" } }, "sha512-pAZGaimunDAWOBdFhzPh0auH5ryxAHr+MVoz+QdASG+6RZXy8D02l8v2QYu4+e4uorxe/s2ZkdNDm81SlNkoHQ=="], - - "@visactor/vgrammar-hierarchy/@visactor/vrender-kits": ["@visactor/vrender-kits@0.17.17", "", { "dependencies": { "@resvg/resvg-js": "2.4.1", "@visactor/vrender-core": "0.17.17", "@visactor/vutils": "~0.17.3", "roughjs": "4.5.2" } }, "sha512-noRP1hAHvPCv36nf2P6sZ930Tk+dJ8jpPWIUm1cFYmUNdcumgIS8Cug0RyeZ+saSqVt5FDTwIwifhOqupw5Zaw=="], - - "@visactor/vgrammar-hierarchy/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - - "@visactor/vgrammar-projection/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - - "@visactor/vgrammar-sankey/@visactor/vrender-core": ["@visactor/vrender-core@0.17.17", "", { "dependencies": { "@visactor/vutils": "~0.17.3", "color-convert": "2.0.1" } }, "sha512-pAZGaimunDAWOBdFhzPh0auH5ryxAHr+MVoz+QdASG+6RZXy8D02l8v2QYu4+e4uorxe/s2ZkdNDm81SlNkoHQ=="], - - "@visactor/vgrammar-sankey/@visactor/vrender-kits": ["@visactor/vrender-kits@0.17.17", "", { "dependencies": { "@resvg/resvg-js": "2.4.1", "@visactor/vrender-core": "0.17.17", "@visactor/vutils": "~0.17.3", "roughjs": "4.5.2" } }, "sha512-noRP1hAHvPCv36nf2P6sZ930Tk+dJ8jpPWIUm1cFYmUNdcumgIS8Cug0RyeZ+saSqVt5FDTwIwifhOqupw5Zaw=="], - - "@visactor/vgrammar-sankey/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - - "@visactor/vgrammar-util/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - - "@visactor/vgrammar-wordcloud/@visactor/vrender-core": ["@visactor/vrender-core@0.17.17", "", { "dependencies": { "@visactor/vutils": "~0.17.3", "color-convert": "2.0.1" } }, "sha512-pAZGaimunDAWOBdFhzPh0auH5ryxAHr+MVoz+QdASG+6RZXy8D02l8v2QYu4+e4uorxe/s2ZkdNDm81SlNkoHQ=="], - - "@visactor/vgrammar-wordcloud/@visactor/vrender-kits": ["@visactor/vrender-kits@0.17.17", "", { "dependencies": { "@resvg/resvg-js": "2.4.1", "@visactor/vrender-core": "0.17.17", "@visactor/vutils": "~0.17.3", "roughjs": "4.5.2" } }, "sha512-noRP1hAHvPCv36nf2P6sZ930Tk+dJ8jpPWIUm1cFYmUNdcumgIS8Cug0RyeZ+saSqVt5FDTwIwifhOqupw5Zaw=="], - - "@visactor/vgrammar-wordcloud/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - - "@visactor/vgrammar-wordcloud-shape/@visactor/vrender-core": ["@visactor/vrender-core@0.17.17", "", { "dependencies": { "@visactor/vutils": "~0.17.3", "color-convert": "2.0.1" } }, "sha512-pAZGaimunDAWOBdFhzPh0auH5ryxAHr+MVoz+QdASG+6RZXy8D02l8v2QYu4+e4uorxe/s2ZkdNDm81SlNkoHQ=="], - - "@visactor/vgrammar-wordcloud-shape/@visactor/vrender-kits": ["@visactor/vrender-kits@0.17.17", "", { "dependencies": { "@resvg/resvg-js": "2.4.1", "@visactor/vrender-core": "0.17.17", "@visactor/vutils": "~0.17.3", "roughjs": "4.5.2" } }, "sha512-noRP1hAHvPCv36nf2P6sZ930Tk+dJ8jpPWIUm1cFYmUNdcumgIS8Cug0RyeZ+saSqVt5FDTwIwifhOqupw5Zaw=="], - - "@visactor/vgrammar-wordcloud-shape/@visactor/vscale": ["@visactor/vscale@0.17.5", "", { "dependencies": { "@visactor/vutils": "0.17.5" } }, "sha512-2dkS1IlAJ/IdTp8JElbctOOv6lkHKBKPDm8KvwBo0NuGWQeYAebSeyN3QCdwKbj76gMlCub4zc+xWrS5YiA2zA=="], - - "@visactor/vgrammar-wordcloud-shape/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - "@visactor/vlayouts/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], "@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], @@ -3106,15 +2476,15 @@ "accepts/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="], - "ajv-formats/ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="], - - "antd/scroll-into-view-if-needed": ["scroll-into-view-if-needed@3.1.0", "", { "dependencies": { "compute-scroll-into-view": "^3.0.2" } }, "sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ=="], - - "anymatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], - "babel-plugin-macros/cosmiconfig": ["cosmiconfig@7.1.0", "", { "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", "yaml": "^1.10.0" } }, "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA=="], - "cosmiconfig/typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="], + "body-parser/content-type": ["content-type@2.0.0", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="], + + "conf/ajv-formats": ["ajv-formats@2.1.1", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA=="], + + "conf/json-schema-typed": ["json-schema-typed@7.0.3", "", {}, "sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A=="], + + "conf/semver": ["semver@7.8.5", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA=="], "cross-spawn/which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], @@ -3132,46 +2502,34 @@ "d3-geo/d3-array": ["d3-array@1.2.4", "", {}, "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw=="], - "d3-sankey/d3-array": ["d3-array@2.12.1", "", { "dependencies": { "internmap": "^1.0.0" } }, "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ=="], + "d3-sankey/d3-array": ["d3-array@1.2.4", "", {}, "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw=="], "d3-sankey/d3-shape": ["d3-shape@1.3.7", "", { "dependencies": { "d3-path": "1" } }, "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw=="], + "dot-prop/is-obj": ["is-obj@2.0.0", "", {}, "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="], + + "enquirer/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + "estree-util-to-js/source-map": ["source-map@0.7.6", "", {}, "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ=="], "express/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="], "extend-shallow/is-extendable": ["is-extendable@0.1.1", "", {}, "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw=="], - "fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], - "geojson-dissolve/@turf/meta": ["@turf/meta@3.14.0", "", {}, "sha512-OtXqLQuR9hlQ/HkAF/OdzRea7E0eZK1ay8y8CBXkoO2R6v34CsDrWYLMSo0ZzMsaQDpKo76NPP2GGo+PyG1cSg=="], - "geojson-flatten/minimist": ["minimist@1.2.0", "", {}, "sha512-7Wl+Jz+IGWuSdgsQEJ4JunV0si/iMhg42MnQQG6h1R6TNeVenp4U9x5CC5v/gYqz/fENLQITAWXidNtVL0NNbw=="], - - "glob/minimatch": ["minimatch@10.2.5", "", { "dependencies": { "brace-expansion": "^5.0.5" } }, "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg=="], - "hoist-non-react-statics/react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="], - "i18next-cli/minimatch": ["minimatch@10.2.5", "", { "dependencies": { "brace-expansion": "^5.0.5" } }, "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg=="], - - "i18next-cli/ora": ["ora@9.4.0", "", { "dependencies": { "chalk": "^5.6.2", "cli-cursor": "^5.0.0", "cli-spinners": "^3.2.0", "is-interactive": "^2.0.0", "is-unicode-supported": "^2.1.0", "log-symbols": "^7.0.1", "stdin-discarder": "^0.3.2", "string-width": "^8.1.0" } }, "sha512-84cglkRILFxdtA8hAvLNdMrtBpPNBTrQ9/ulg0FA7xLMnD6mifv+enAIeRmvtv+WgdCE+LPGOfQmtJRrVaIVhQ=="], - - "i18next-cli/react": ["react@19.2.6", "", {}, "sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q=="], + "is-inside-container/is-docker": ["is-docker@3.0.0", "", { "bin": { "is-docker": "cli.js" } }, "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ=="], "katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="], - "leva/react-dropzone": ["react-dropzone@12.1.0", "", { "dependencies": { "attr-accept": "^2.2.2", "file-selector": "^0.5.0", "prop-types": "^15.8.1" }, "peerDependencies": { "react": ">= 16.8" } }, "sha512-iBYHA1rbopIvtzokEX4QubO6qk5IF/x3BtKGu74rF2JkQDXnwC4uO/lHKpaw4PJIV6iIAYOlwLv2FpiGyqHNog=="], - "leva/zustand": ["zustand@3.7.2", "", { "peerDependencies": { "react": ">=16.8" }, "optionalPeers": ["react"] }, "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA=="], - "log-symbols/chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], - "log-symbols/is-unicode-supported": ["is-unicode-supported@1.3.0", "", {}, "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ=="], "mdast-util-find-and-replace/escape-string-regexp": ["escape-string-regexp@5.0.0", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="], - "mermaid/dompurify": ["dompurify@3.4.7", "", { "optionalDependencies": { "@types/trusted-types": "^2.0.7" } }, "sha512-2jBxDJY4RR06tQNy4w5FlFH7kfxsQZlufd0sbv+chfHCxeJwrFw2baUDsSwvBISD4K4RDbd0PTfy3uNXsR6siA=="], - "mermaid/katex": ["katex@0.16.47", "", { "dependencies": { "commander": "^8.3.0" }, "bin": { "katex": "cli.js" } }, "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg=="], "mermaid/marked": ["marked@16.4.2", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA=="], @@ -3182,19 +2540,13 @@ "npm-run-path/path-key": ["path-key@4.0.0", "", {}, "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ=="], - "ora/chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], - - "ora/strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="], + "onetime/mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="], "parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="], "parse5/entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="], - "path-scurry/lru-cache": ["lru-cache@11.5.1", "", {}, "sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A=="], - - "postcss/nanoid": ["nanoid@3.3.12", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ=="], - - "postcss-nested/postcss-selector-parser": ["postcss-selector-parser@6.1.2", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg=="], + "postcss/nanoid": ["nanoid@3.3.16", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q=="], "prompts/kleur": ["kleur@3.0.3", "", {}, "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w=="], @@ -3202,38 +2554,12 @@ "rc-menu/@rc-component/trigger": ["@rc-component/trigger@2.3.1", "", { "dependencies": { "@babel/runtime": "^7.23.2", "@rc-component/portal": "^1.1.0", "classnames": "^2.3.2", "rc-motion": "^2.0.0", "rc-resize-observer": "^1.3.1", "rc-util": "^5.44.0" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-ORENF39PeXTzM+gQEshuk460Z8N4+6DkjpxlpE7Q3gYy1iBpLrx0FOJz3h62ryrJZ/3zCAUIkT1Pb/8hHWpb3A=="], - "react-i18next/typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="], - "react-rnd/tslib": ["tslib@2.6.2", "", {}, "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="], - "react-telegram-login/react": ["react@16.14.0", "", { "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.2" } }, "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g=="], - - "react-template/@visactor/react-vchart": ["@visactor/react-vchart@1.8.11", "", { "dependencies": { "@visactor/vchart": "1.8.11", "@visactor/vgrammar-core": "0.10.11", "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vutils": "~0.17.3", "react-is": "^18.2.0" }, "peerDependencies": { "react": ">=16.0.0", "react-dom": ">=16.0.0" } }, "sha512-wHnCex9gOpnttTtSu04ozKJhTveUk8Ln2KX/7PZyCJxqlXq+eWvW4zvM6Ja8T8kGXfXtFYVVNh9zBMQ7y2T/Sw=="], - - "react-template/@visactor/vchart": ["@visactor/vchart@1.8.11", "", { "dependencies": { "@visactor/vdataset": "~0.17.3", "@visactor/vgrammar-core": "0.10.11", "@visactor/vgrammar-hierarchy": "0.10.11", "@visactor/vgrammar-projection": "0.10.11", "@visactor/vgrammar-sankey": "0.10.11", "@visactor/vgrammar-util": "0.10.11", "@visactor/vgrammar-wordcloud": "0.10.11", "@visactor/vgrammar-wordcloud-shape": "0.10.11", "@visactor/vrender-components": "0.17.17", "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3", "@visactor/vutils-extension": "1.8.11" } }, "sha512-RdQ822J02GgAQNXvO1LiT0T3O6FjdgPdcm9hVBFyrpBBmuI8MH02IE7Y1kGe9NiFTH4tDwP0ixRgBmqNSGSLZQ=="], - - "react-template/i18next": ["i18next@23.16.8", "", { "dependencies": { "@babel/runtime": "^7.23.2" } }, "sha512-06r/TitrM88Mg5FdUXAKL96dJMzgqLE5dv3ryBAra4KCwD9mJ4ndOTS95ZuymIGoE+2hzfdaMak2X11/es7ZWg=="], - - "react-template/i18next-browser-languagedetector": ["i18next-browser-languagedetector@7.2.2", "", { "dependencies": { "@babel/runtime": "^7.23.2" } }, "sha512-6b7r75uIJDWCcCflmbof+sJ94k9UQO4X0YR62oUfqGI/GjCLVzlCwu8TFdRZIqVLzWbzNcmkmhfqKEr4TLz4HQ=="], - - "react-template/katex": ["katex@0.16.47", "", { "dependencies": { "commander": "^8.3.0" }, "bin": { "katex": "cli.js" } }, "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg=="], - - "react-template/lucide-react": ["lucide-react@0.511.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-VK5a2ydJ7xm8GvBeKLS9mu1pVK6ucef9780JVUjw6bAjJL/QXnd4Y0p7SPeOUMC27YhzNCZvm5d/QX0Tp3rc0w=="], - - "react-template/marked": ["marked@4.3.0", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A=="], - - "react-template/react-i18next": ["react-i18next@13.5.0", "", { "dependencies": { "@babel/runtime": "^7.22.5", "html-parse-stringify": "^3.0.1" }, "peerDependencies": { "i18next": ">= 23.2.3", "react": ">= 16.8.0" } }, "sha512-CFJ5NDGJ2MUyBohEHxljOq/39NQ972rh1ajnadG9BjTk+UXbHLq4z5DKEbEQBDoIhUmmbuS/fIMJKo6VOax1HA=="], - - "react-template/tailwindcss": ["tailwindcss@3.4.19", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", "chokidar": "^3.6.0", "didyoumean": "^1.2.2", "dlv": "^1.1.3", "fast-glob": "^3.3.2", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", "jiti": "^1.21.7", "lilconfig": "^3.1.3", "micromatch": "^4.0.8", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", "picocolors": "^1.1.1", "postcss": "^8.4.47", "postcss-import": "^15.1.0", "postcss-js": "^4.0.1", "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", "postcss-nested": "^6.2.0", "postcss-selector-parser": "^6.1.2", "resolve": "^1.22.8", "sucrase": "^3.35.0" }, "bin": { "tailwind": "lib/cli.js", "tailwindcss": "lib/cli.js" } }, "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ=="], - - "react-toastify/clsx": ["clsx@1.2.1", "", {}, "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg=="], - "rehype-katex/katex": ["katex@0.16.47", "", { "dependencies": { "commander": "^8.3.0" }, "bin": { "katex": "cli.js" } }, "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg=="], "restore-cursor/onetime": ["onetime@7.0.0", "", { "dependencies": { "mimic-function": "^5.0.0" } }, "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ=="], - "rimraf/glob": ["glob@7.2.3", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q=="], - "send/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="], "set-value/is-extendable": ["is-extendable@0.1.1", "", {}, "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw=="], @@ -3242,18 +2568,10 @@ "shapefile/commander": ["commander@2.20.3", "", {}, "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="], - "shiki-stream/@shikijs/core": ["@shikijs/core@3.23.0", "", { "dependencies": { "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-NSWQz0riNb67xthdm5br6lAkvpDJRTgB36fxlo37ZzM2yq0PQFFzbd8psqC2XMPgCzo1fW6cVi18+ArJ44wqgA=="], - "simplify-geojson/concat-stream": ["concat-stream@1.4.11", "", { "dependencies": { "inherits": "~2.0.1", "readable-stream": "~1.1.9", "typedarray": "~0.0.5" } }, "sha512-X3JMh8+4je3U1cQpG87+f9lXHDrqcb2MVLg9L7o8b1UZ0DzhRrUpdn65ttzu10PpJPPI3MQNkis+oha6TSA9Mw=="], - "simplify-geojson/minimist": ["minimist@1.2.6", "", {}, "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="], - "split-string/extend-shallow": ["extend-shallow@3.0.2", "", { "dependencies": { "assign-symbols": "^1.0.0", "is-extendable": "^1.0.1" } }, "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q=="], - "string-width/strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="], - - "sucrase/commander": ["commander@4.1.1", "", {}, "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA=="], - "topojson-client/commander": ["commander@2.20.3", "", {}, "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="], "topojson-server/commander": ["commander@2.20.3", "", {}, "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="], @@ -3262,6 +2580,8 @@ "type-is/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="], + "wsl-utils/is-wsl": ["is-wsl@3.1.1", "", { "dependencies": { "is-inside-container": "^1.0.0" } }, "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw=="], + "@dotenvx/dotenvx/execa/get-stream": ["get-stream@6.0.1", "", {}, "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg=="], "@dotenvx/dotenvx/execa/human-signals": ["human-signals@2.1.0", "", {}, "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw=="], @@ -3274,112 +2594,10 @@ "@dotenvx/dotenvx/execa/strip-final-newline": ["strip-final-newline@2.0.0", "", {}, "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA=="], - "@lobehub/ui/@base-ui/react/@base-ui/utils": ["@base-ui/utils@0.2.9", "", { "dependencies": { "@babel/runtime": "^7.29.2", "@floating-ui/utils": "^0.2.11", "reselect": "^5.1.1", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "@types/react": "^17 || ^18 || ^19", "react": "^17 || ^18 || ^19", "react-dom": "^17 || ^18 || ^19" }, "optionalPeers": ["@types/react"] }, "sha512-x/PDDCYzoqPpjrdyb3VcyylTI2IjUXEtYDGi5foh7KsnmNJIIaVwA2GLgDH1dps1GgXiJbA60hM+AyuTfQzIvw=="], - - "@lobehub/ui/@shikijs/core/@shikijs/primitive": ["@shikijs/primitive@4.1.0", "", { "dependencies": { "@shikijs/types": "4.1.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-zx2/2Uwj2q9X3KSyYREEhXO23xBw5WUhP4orK2lE4r+t9JGITmEe0JH+wPmJhqHpOT2bRRs6lAL945+LDvOAGw=="], - - "@lobehub/ui/@shikijs/core/@shikijs/types": ["@shikijs/types@4.1.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-3EQWX54fMpniOrDblzAhiwiJwpiTMW6+B9DWyUd9ska483tbayFYuw47UxwuPknI31bKnySfVQ/QW+jFL4rFdA=="], - - "@lobehub/ui/katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="], - - "@lobehub/ui/motion/framer-motion": ["framer-motion@12.40.0", "", { "dependencies": { "motion-dom": "^12.40.0", "motion-utils": "^12.39.0", "tslib": "^2.4.0" }, "peerDependencies": { "@emotion/is-prop-valid": "*", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["@emotion/is-prop-valid", "react", "react-dom"] }, "sha512-uaBd3qC1v3KQqBEjwTUd183K6PbS+j0yR9w9VmEOLWA/tnUcSn8Xa3uck7t4dgpDoUss8xQTcj8W2L07lrnLFg=="], - - "@lobehub/ui/shiki/@shikijs/engine-javascript": ["@shikijs/engine-javascript@4.1.0", "", { "dependencies": { "@shikijs/types": "4.1.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.6" } }, "sha512-YquhawCUgaBfhsS72e2Y/dI59gCBNPHu3fEO/tvLaXrTssxZrY5ddjtNLTwndrMgPo8b3IscE+xoICDzpTmlFQ=="], - - "@lobehub/ui/shiki/@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@4.1.0", "", { "dependencies": { "@shikijs/types": "4.1.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-axLpjVs45YBvvINa+dJF+NPW+KtFkNXsFr4SDw2BMj9GdeMnGxVB9PQb2xXlJYovslt/nz6giedAyOANkfc7hg=="], - - "@lobehub/ui/shiki/@shikijs/langs": ["@shikijs/langs@4.1.0", "", { "dependencies": { "@shikijs/types": "4.1.0" } }, "sha512-nwOMruEkbgdZfQ/b8CgpNBVOpvG1k0N5tbmgiFeqsan401+x3ILqlzZJowSla4Agmq4hG2Uf2wh5jLTEhR8VSg=="], - - "@lobehub/ui/shiki/@shikijs/themes": ["@shikijs/themes@4.1.0", "", { "dependencies": { "@shikijs/types": "4.1.0" } }, "sha512-emCcTnUM7yO2wltYbaxm+yLvcCI4+h8XBKc4KmJ7EZUXoSGjcCHifkI//R4OFit9ewpg7H2/9tjOuXrT2v/Knw=="], - - "@lobehub/ui/shiki/@shikijs/types": ["@shikijs/types@4.1.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-3EQWX54fMpniOrDblzAhiwiJwpiTMW6+B9DWyUd9ska483tbayFYuw47UxwuPknI31bKnySfVQ/QW+jFL4rFdA=="], - - "@modelcontextprotocol/sdk/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], - - "@pierre/diffs/@shikijs/transformers/@shikijs/core": ["@shikijs/core@3.23.0", "", { "dependencies": { "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-NSWQz0riNb67xthdm5br6lAkvpDJRTgB36fxlo37ZzM2yq0PQFFzbd8psqC2XMPgCzo1fW6cVi18+ArJ44wqgA=="], - - "@pierre/diffs/@shikijs/transformers/@shikijs/types": ["@shikijs/types@3.23.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ=="], - - "@pierre/diffs/shiki/@shikijs/core": ["@shikijs/core@3.23.0", "", { "dependencies": { "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-NSWQz0riNb67xthdm5br6lAkvpDJRTgB36fxlo37ZzM2yq0PQFFzbd8psqC2XMPgCzo1fW6cVi18+ArJ44wqgA=="], - - "@pierre/diffs/shiki/@shikijs/engine-javascript": ["@shikijs/engine-javascript@3.23.0", "", { "dependencies": { "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.4" } }, "sha512-aHt9eiGFobmWR5uqJUViySI1bHMqrAgamWE1TYSUoftkAeCCAiGawPMwM+VCadylQtF4V3VNOZ5LmfItH5f3yA=="], - - "@pierre/diffs/shiki/@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@3.23.0", "", { "dependencies": { "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g=="], - - "@pierre/diffs/shiki/@shikijs/langs": ["@shikijs/langs@3.23.0", "", { "dependencies": { "@shikijs/types": "3.23.0" } }, "sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg=="], - - "@pierre/diffs/shiki/@shikijs/themes": ["@shikijs/themes@3.23.0", "", { "dependencies": { "@shikijs/types": "3.23.0" } }, "sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA=="], - - "@pierre/diffs/shiki/@shikijs/types": ["@shikijs/types@3.23.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ=="], - - "@rspack/binding-wasm32-wasi/@napi-rs/wasm-runtime/@tybys/wasm-util": ["@tybys/wasm-util@0.10.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg=="], - - "@shikijs/transformers/@shikijs/core/@shikijs/primitive": ["@shikijs/primitive@4.1.0", "", { "dependencies": { "@shikijs/types": "4.1.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-zx2/2Uwj2q9X3KSyYREEhXO23xBw5WUhP4orK2lE4r+t9JGITmEe0JH+wPmJhqHpOT2bRRs6lAL945+LDvOAGw=="], - - "@ts-morph/common/minimatch/brace-expansion": ["brace-expansion@5.0.6", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g=="], - - "@visactor/vchart-semi-theme/@visactor/vchart/@visactor/vdataset": ["@visactor/vdataset@0.17.5", "", { "dependencies": { "@turf/flatten": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/rewind": "^6.5.0", "@visactor/vutils": "0.17.5", "d3-dsv": "^2.0.0", "d3-geo": "^1.12.1", "d3-hexbin": "^0.2.2", "d3-hierarchy": "^3.1.1", "eventemitter3": "^4.0.7", "geobuf": "^3.0.1", "geojson-dissolve": "^3.1.0", "path-browserify": "^1.0.1", "pbf": "^3.2.1", "point-at-length": "^1.1.0", "simple-statistics": "^7.7.3", "simplify-geojson": "^1.0.4", "topojson-client": "^3.1.0" } }, "sha512-zVBdLWHWrhldGc8JDjSYF9lvpFT4ZEFQDB0b6yvfSiHzHKHiSco+rWmUFvA7r4ObT6j2QWF1vZAV9To8Ml4vHw=="], - - "@visactor/vchart-semi-theme/@visactor/vchart/@visactor/vrender-components": ["@visactor/vrender-components@0.17.17", "", { "dependencies": { "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3" } }, "sha512-7gYFQrozvBkyGF7s/JHXdWDZnATzymxzug63CZd4EB7A0OXKatVDImXRePqwzlPD3QamF7QMVWn0CuIx3gQ2gA=="], - - "@visactor/vchart-semi-theme/@visactor/vchart/@visactor/vrender-core": ["@visactor/vrender-core@0.17.17", "", { "dependencies": { "@visactor/vutils": "~0.17.3", "color-convert": "2.0.1" } }, "sha512-pAZGaimunDAWOBdFhzPh0auH5ryxAHr+MVoz+QdASG+6RZXy8D02l8v2QYu4+e4uorxe/s2ZkdNDm81SlNkoHQ=="], - - "@visactor/vchart-semi-theme/@visactor/vchart/@visactor/vrender-kits": ["@visactor/vrender-kits@0.17.17", "", { "dependencies": { "@resvg/resvg-js": "2.4.1", "@visactor/vrender-core": "0.17.17", "@visactor/vutils": "~0.17.3", "roughjs": "4.5.2" } }, "sha512-noRP1hAHvPCv36nf2P6sZ930Tk+dJ8jpPWIUm1cFYmUNdcumgIS8Cug0RyeZ+saSqVt5FDTwIwifhOqupw5Zaw=="], - - "@visactor/vchart-semi-theme/@visactor/vchart/@visactor/vscale": ["@visactor/vscale@0.17.5", "", { "dependencies": { "@visactor/vutils": "0.17.5" } }, "sha512-2dkS1IlAJ/IdTp8JElbctOOv6lkHKBKPDm8KvwBo0NuGWQeYAebSeyN3QCdwKbj76gMlCub4zc+xWrS5YiA2zA=="], - - "@visactor/vchart-semi-theme/@visactor/vchart/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - - "@visactor/vchart-semi-theme/@visactor/vchart/@visactor/vutils-extension": ["@visactor/vutils-extension@1.8.11", "", { "dependencies": { "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3" } }, "sha512-Hknzpy3+xh4sdL0iSn5N93BHiMJF4FdwSwhHYEibRpriZmWKG6wBxsJ0Bll4d7oS4f+svxt8Sg2vRYKzQEcIxQ=="], - - "@visactor/vchart-theme-utils/@visactor/vchart/@visactor/vdataset": ["@visactor/vdataset@0.17.5", "", { "dependencies": { "@turf/flatten": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/rewind": "^6.5.0", "@visactor/vutils": "0.17.5", "d3-dsv": "^2.0.0", "d3-geo": "^1.12.1", "d3-hexbin": "^0.2.2", "d3-hierarchy": "^3.1.1", "eventemitter3": "^4.0.7", "geobuf": "^3.0.1", "geojson-dissolve": "^3.1.0", "path-browserify": "^1.0.1", "pbf": "^3.2.1", "point-at-length": "^1.1.0", "simple-statistics": "^7.7.3", "simplify-geojson": "^1.0.4", "topojson-client": "^3.1.0" } }, "sha512-zVBdLWHWrhldGc8JDjSYF9lvpFT4ZEFQDB0b6yvfSiHzHKHiSco+rWmUFvA7r4ObT6j2QWF1vZAV9To8Ml4vHw=="], - - "@visactor/vchart-theme-utils/@visactor/vchart/@visactor/vrender-components": ["@visactor/vrender-components@0.17.17", "", { "dependencies": { "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3" } }, "sha512-7gYFQrozvBkyGF7s/JHXdWDZnATzymxzug63CZd4EB7A0OXKatVDImXRePqwzlPD3QamF7QMVWn0CuIx3gQ2gA=="], - - "@visactor/vchart-theme-utils/@visactor/vchart/@visactor/vrender-core": ["@visactor/vrender-core@0.17.17", "", { "dependencies": { "@visactor/vutils": "~0.17.3", "color-convert": "2.0.1" } }, "sha512-pAZGaimunDAWOBdFhzPh0auH5ryxAHr+MVoz+QdASG+6RZXy8D02l8v2QYu4+e4uorxe/s2ZkdNDm81SlNkoHQ=="], - - "@visactor/vchart-theme-utils/@visactor/vchart/@visactor/vrender-kits": ["@visactor/vrender-kits@0.17.17", "", { "dependencies": { "@resvg/resvg-js": "2.4.1", "@visactor/vrender-core": "0.17.17", "@visactor/vutils": "~0.17.3", "roughjs": "4.5.2" } }, "sha512-noRP1hAHvPCv36nf2P6sZ930Tk+dJ8jpPWIUm1cFYmUNdcumgIS8Cug0RyeZ+saSqVt5FDTwIwifhOqupw5Zaw=="], - - "@visactor/vchart-theme-utils/@visactor/vchart/@visactor/vscale": ["@visactor/vscale@0.17.5", "", { "dependencies": { "@visactor/vutils": "0.17.5" } }, "sha512-2dkS1IlAJ/IdTp8JElbctOOv6lkHKBKPDm8KvwBo0NuGWQeYAebSeyN3QCdwKbj76gMlCub4zc+xWrS5YiA2zA=="], - - "@visactor/vchart-theme-utils/@visactor/vchart/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - - "@visactor/vchart-theme-utils/@visactor/vchart/@visactor/vutils-extension": ["@visactor/vutils-extension@1.8.11", "", { "dependencies": { "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3" } }, "sha512-Hknzpy3+xh4sdL0iSn5N93BHiMJF4FdwSwhHYEibRpriZmWKG6wBxsJ0Bll4d7oS4f+svxt8Sg2vRYKzQEcIxQ=="], - - "@visactor/vgrammar-coordinate/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "@visactor/vgrammar-core/@visactor/vdataset/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "@visactor/vgrammar-core/@visactor/vrender-kits/roughjs": ["roughjs@4.5.2", "", { "dependencies": { "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-2xSlLDKdsWyFxrveYWk9YQ/Y9UfK38EAMRNkYkMqYBJvPX8abCa9PN0x3w02H8Oa6/0bcZICJU+U95VumPqseg=="], - - "@visactor/vgrammar-core/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "@visactor/vgrammar-hierarchy/@visactor/vrender-kits/roughjs": ["roughjs@4.5.2", "", { "dependencies": { "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-2xSlLDKdsWyFxrveYWk9YQ/Y9UfK38EAMRNkYkMqYBJvPX8abCa9PN0x3w02H8Oa6/0bcZICJU+U95VumPqseg=="], - - "@visactor/vgrammar-hierarchy/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "@visactor/vgrammar-projection/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "@visactor/vgrammar-sankey/@visactor/vrender-kits/roughjs": ["roughjs@4.5.2", "", { "dependencies": { "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-2xSlLDKdsWyFxrveYWk9YQ/Y9UfK38EAMRNkYkMqYBJvPX8abCa9PN0x3w02H8Oa6/0bcZICJU+U95VumPqseg=="], - - "@visactor/vgrammar-sankey/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "@visactor/vgrammar-util/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "@visactor/vgrammar-wordcloud-shape/@visactor/vrender-kits/roughjs": ["roughjs@4.5.2", "", { "dependencies": { "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-2xSlLDKdsWyFxrveYWk9YQ/Y9UfK38EAMRNkYkMqYBJvPX8abCa9PN0x3w02H8Oa6/0bcZICJU+U95VumPqseg=="], - - "@visactor/vgrammar-wordcloud-shape/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "@visactor/vgrammar-wordcloud/@visactor/vrender-kits/roughjs": ["roughjs@4.5.2", "", { "dependencies": { "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-2xSlLDKdsWyFxrveYWk9YQ/Y9UfK38EAMRNkYkMqYBJvPX8abCa9PN0x3w02H8Oa6/0bcZICJU+U95VumPqseg=="], - - "@visactor/vgrammar-wordcloud/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], + "@dotenvx/dotenvx/open/define-lazy-prop": ["define-lazy-prop@2.0.0", "", {}, "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og=="], "accepts/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="], - "ajv-formats/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], - - "antd/scroll-into-view-if-needed/compute-scroll-into-view": ["compute-scroll-into-view@3.1.1", "", {}, "sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw=="], - "babel-plugin-macros/cosmiconfig/yaml": ["yaml@1.10.3", "", {}, "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA=="], "cross-spawn/which/isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], @@ -3390,120 +2608,30 @@ "d3-fetch/d3-dsv/iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="], - "d3-sankey/d3-array/internmap": ["internmap@1.0.1", "", {}, "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw=="], - "d3-sankey/d3-shape/d3-path": ["d3-path@1.0.9", "", {}, "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg=="], "d3/d3-dsv/commander": ["commander@7.2.0", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="], "d3/d3-dsv/iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="], + "enquirer/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + "express/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="], - "glob/minimatch/brace-expansion": ["brace-expansion@5.0.6", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g=="], - - "i18next-cli/minimatch/brace-expansion": ["brace-expansion@5.0.6", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g=="], - - "i18next-cli/ora/chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], - - "i18next-cli/ora/cli-spinners": ["cli-spinners@3.4.0", "", {}, "sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw=="], - - "i18next-cli/ora/log-symbols": ["log-symbols@7.0.1", "", { "dependencies": { "is-unicode-supported": "^2.0.0", "yoctocolors": "^2.1.1" } }, "sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg=="], - - "i18next-cli/ora/stdin-discarder": ["stdin-discarder@0.3.2", "", {}, "sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A=="], - - "i18next-cli/ora/string-width": ["string-width@8.2.1", "", { "dependencies": { "get-east-asian-width": "^1.5.0", "strip-ansi": "^7.1.2" } }, "sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA=="], - - "leva/react-dropzone/file-selector": ["file-selector@0.5.0", "", { "dependencies": { "tslib": "^2.0.3" } }, "sha512-s8KNnmIDTBoD0p9uJ9uD0XY38SCeBOtj0UMXyQSLg1Ypfrfj8+dAvwsLjYQkQ2GjhVtp2HrnF5cJzMhBjfD8HA=="], - "mermaid/katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="], "micromark-extension-math/katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="], - "ora/strip-ansi/ansi-regex": ["ansi-regex@6.2.2", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="], - - "react-template/@visactor/react-vchart/@visactor/vrender-core": ["@visactor/vrender-core@0.17.17", "", { "dependencies": { "@visactor/vutils": "~0.17.3", "color-convert": "2.0.1" } }, "sha512-pAZGaimunDAWOBdFhzPh0auH5ryxAHr+MVoz+QdASG+6RZXy8D02l8v2QYu4+e4uorxe/s2ZkdNDm81SlNkoHQ=="], - - "react-template/@visactor/react-vchart/@visactor/vrender-kits": ["@visactor/vrender-kits@0.17.17", "", { "dependencies": { "@resvg/resvg-js": "2.4.1", "@visactor/vrender-core": "0.17.17", "@visactor/vutils": "~0.17.3", "roughjs": "4.5.2" } }, "sha512-noRP1hAHvPCv36nf2P6sZ930Tk+dJ8jpPWIUm1cFYmUNdcumgIS8Cug0RyeZ+saSqVt5FDTwIwifhOqupw5Zaw=="], - - "react-template/@visactor/react-vchart/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - - "react-template/@visactor/vchart/@visactor/vdataset": ["@visactor/vdataset@0.17.5", "", { "dependencies": { "@turf/flatten": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/rewind": "^6.5.0", "@visactor/vutils": "0.17.5", "d3-dsv": "^2.0.0", "d3-geo": "^1.12.1", "d3-hexbin": "^0.2.2", "d3-hierarchy": "^3.1.1", "eventemitter3": "^4.0.7", "geobuf": "^3.0.1", "geojson-dissolve": "^3.1.0", "path-browserify": "^1.0.1", "pbf": "^3.2.1", "point-at-length": "^1.1.0", "simple-statistics": "^7.7.3", "simplify-geojson": "^1.0.4", "topojson-client": "^3.1.0" } }, "sha512-zVBdLWHWrhldGc8JDjSYF9lvpFT4ZEFQDB0b6yvfSiHzHKHiSco+rWmUFvA7r4ObT6j2QWF1vZAV9To8Ml4vHw=="], - - "react-template/@visactor/vchart/@visactor/vrender-components": ["@visactor/vrender-components@0.17.17", "", { "dependencies": { "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3" } }, "sha512-7gYFQrozvBkyGF7s/JHXdWDZnATzymxzug63CZd4EB7A0OXKatVDImXRePqwzlPD3QamF7QMVWn0CuIx3gQ2gA=="], - - "react-template/@visactor/vchart/@visactor/vrender-core": ["@visactor/vrender-core@0.17.17", "", { "dependencies": { "@visactor/vutils": "~0.17.3", "color-convert": "2.0.1" } }, "sha512-pAZGaimunDAWOBdFhzPh0auH5ryxAHr+MVoz+QdASG+6RZXy8D02l8v2QYu4+e4uorxe/s2ZkdNDm81SlNkoHQ=="], - - "react-template/@visactor/vchart/@visactor/vrender-kits": ["@visactor/vrender-kits@0.17.17", "", { "dependencies": { "@resvg/resvg-js": "2.4.1", "@visactor/vrender-core": "0.17.17", "@visactor/vutils": "~0.17.3", "roughjs": "4.5.2" } }, "sha512-noRP1hAHvPCv36nf2P6sZ930Tk+dJ8jpPWIUm1cFYmUNdcumgIS8Cug0RyeZ+saSqVt5FDTwIwifhOqupw5Zaw=="], - - "react-template/@visactor/vchart/@visactor/vscale": ["@visactor/vscale@0.17.5", "", { "dependencies": { "@visactor/vutils": "0.17.5" } }, "sha512-2dkS1IlAJ/IdTp8JElbctOOv6lkHKBKPDm8KvwBo0NuGWQeYAebSeyN3QCdwKbj76gMlCub4zc+xWrS5YiA2zA=="], - - "react-template/@visactor/vchart/@visactor/vutils": ["@visactor/vutils@0.17.5", "", { "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", "eventemitter3": "^4.0.7" } }, "sha512-HFN6Pk1Wc1RK842g02MeKOlvdri5L7/nqxMVTqxIvi0XMhHXpmoqN4+/9H+h8LmJpVohyrI/MT85TRBV/rManw=="], - - "react-template/@visactor/vchart/@visactor/vutils-extension": ["@visactor/vutils-extension@1.8.11", "", { "dependencies": { "@visactor/vrender-core": "0.17.17", "@visactor/vrender-kits": "0.17.17", "@visactor/vscale": "~0.17.3", "@visactor/vutils": "~0.17.3" } }, "sha512-Hknzpy3+xh4sdL0iSn5N93BHiMJF4FdwSwhHYEibRpriZmWKG6wBxsJ0Bll4d7oS4f+svxt8Sg2vRYKzQEcIxQ=="], - - "react-template/katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="], - - "react-template/tailwindcss/chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="], - - "react-template/tailwindcss/jiti": ["jiti@1.21.7", "", { "bin": { "jiti": "bin/jiti.js" } }, "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A=="], - - "react-template/tailwindcss/postcss-selector-parser": ["postcss-selector-parser@6.1.2", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg=="], - "rehype-katex/katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="], "send/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="], - "shiki-stream/@shikijs/core/@shikijs/types": ["@shikijs/types@3.23.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ=="], - "simplify-geojson/concat-stream/readable-stream": ["readable-stream@1.1.14", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", "isarray": "0.0.1", "string_decoder": "~0.10.x" } }, "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ=="], - "string-width/strip-ansi/ansi-regex": ["ansi-regex@6.2.2", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="], + "simplify-geojson/concat-stream/typedarray": ["typedarray@0.0.7", "", {}, "sha512-ueeb9YybpjhivjbHP2LdFDAjbS948fGEPj+ACAMs4xCMmh72OCOMQWBQKlaN4ZNQ04yfLSDLSx1tGRIoWimObQ=="], "type-is/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="], - "@lobehub/ui/@base-ui/react/@base-ui/utils/reselect": ["reselect@5.1.1", "", {}, "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w=="], - - "@lobehub/ui/motion/framer-motion/motion-dom": ["motion-dom@12.40.0", "", { "dependencies": { "motion-utils": "^12.39.0" } }, "sha512-HxU3ZaBwNPVQUBQf1xxgq+7JrPNZvjLVxgbpEZL7RrWJnsxOf0/OM+yrHG9ogLQ31Do/r57Oz2gQWPK+6q62mg=="], - - "@ts-morph/common/minimatch/brace-expansion/balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], - - "@visactor/vchart-semi-theme/@visactor/vchart/@visactor/vdataset/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "@visactor/vchart-semi-theme/@visactor/vchart/@visactor/vrender-kits/roughjs": ["roughjs@4.5.2", "", { "dependencies": { "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-2xSlLDKdsWyFxrveYWk9YQ/Y9UfK38EAMRNkYkMqYBJvPX8abCa9PN0x3w02H8Oa6/0bcZICJU+U95VumPqseg=="], - - "@visactor/vchart-semi-theme/@visactor/vchart/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "@visactor/vchart-theme-utils/@visactor/vchart/@visactor/vdataset/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "@visactor/vchart-theme-utils/@visactor/vchart/@visactor/vrender-kits/roughjs": ["roughjs@4.5.2", "", { "dependencies": { "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-2xSlLDKdsWyFxrveYWk9YQ/Y9UfK38EAMRNkYkMqYBJvPX8abCa9PN0x3w02H8Oa6/0bcZICJU+U95VumPqseg=="], - - "@visactor/vchart-theme-utils/@visactor/vchart/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "glob/minimatch/brace-expansion/balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], - - "i18next-cli/minimatch/brace-expansion/balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], - - "i18next-cli/ora/string-width/strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="], - - "react-template/@visactor/react-vchart/@visactor/vrender-kits/roughjs": ["roughjs@4.5.2", "", { "dependencies": { "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-2xSlLDKdsWyFxrveYWk9YQ/Y9UfK38EAMRNkYkMqYBJvPX8abCa9PN0x3w02H8Oa6/0bcZICJU+U95VumPqseg=="], - - "react-template/@visactor/react-vchart/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "react-template/@visactor/vchart/@visactor/vdataset/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "react-template/@visactor/vchart/@visactor/vrender-kits/roughjs": ["roughjs@4.5.2", "", { "dependencies": { "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-2xSlLDKdsWyFxrveYWk9YQ/Y9UfK38EAMRNkYkMqYBJvPX8abCa9PN0x3w02H8Oa6/0bcZICJU+U95VumPqseg=="], - - "react-template/@visactor/vchart/@visactor/vutils/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], - - "react-template/tailwindcss/chokidar/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], - - "react-template/tailwindcss/chokidar/readdirp": ["readdirp@3.6.0", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="], - "simplify-geojson/concat-stream/readable-stream/string_decoder": ["string_decoder@0.10.31", "", {}, "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ=="], - - "i18next-cli/ora/string-width/strip-ansi/ansi-regex": ["ansi-regex@6.2.2", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="], - - "react-template/tailwindcss/chokidar/readdirp/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], } } diff --git a/web/classic/.eslintrc.cjs b/web/classic/.eslintrc.cjs deleted file mode 100644 index b1afd96f5b..0000000000 --- a/web/classic/.eslintrc.cjs +++ /dev/null @@ -1,42 +0,0 @@ -module.exports = { - root: true, - env: { browser: true, es2021: true, node: true }, - parserOptions: { - ecmaVersion: 2020, - sourceType: 'module', - ecmaFeatures: { jsx: true }, - }, - plugins: ['header', 'react-hooks'], - overrides: [ - { - files: ['**/*.{js,jsx}'], - rules: { - 'header/header': [ - 2, - 'block', - [ - '', - 'Copyright (C) 2025 QuantumNous', - '', - 'This program is free software: you can redistribute it and/or modify', - 'it under the terms of the GNU Affero General Public License as', - 'published by the Free Software Foundation, either version 3 of the', - 'License, or (at your option) any later version.', - '', - 'This program is distributed in the hope that it will be useful,', - 'but WITHOUT ANY WARRANTY; without even the implied warranty of', - 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the', - 'GNU Affero General Public License for more details.', - '', - 'You should have received a copy of the GNU Affero General Public License', - 'along with this program. If not, see .', - '', - 'For commercial licensing, please contact support@quantumnous.com', - '', - ], - ], - 'no-multiple-empty-lines': ['error', { max: 1 }], - }, - }, - ], -}; diff --git a/web/classic/.gitignore b/web/classic/.gitignore deleted file mode 100644 index 2b5bba767b..0000000000 --- a/web/classic/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.idea -package-lock.json -yarn.lock \ No newline at end of file diff --git a/web/classic/.prettierrc.mjs b/web/classic/.prettierrc.mjs deleted file mode 100644 index 5140bc3e92..0000000000 --- a/web/classic/.prettierrc.mjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@so1ve/prettier-config'); diff --git a/web/classic/i18next.config.js b/web/classic/i18next.config.js deleted file mode 100644 index bb1da7d683..0000000000 --- a/web/classic/i18next.config.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -/** @type {import('i18next-cli').I18nextToolkitConfig} */ -export default { - locales: ['zh-CN', 'zh-TW', 'en', 'fr', 'ru', 'ja', 'vi'], - extract: { - input: ['src/**/*.{js,jsx,ts,tsx}'], - ignore: ['src/i18n/**/*'], - output: 'src/i18n/locales/{{language}}.json', - ignoredAttributes: [ - 'accept', - 'align', - 'aria-label', - 'autoComplete', - 'className', - 'clipRule', - 'color', - 'crossOrigin', - 'data-index', - 'data-name', - 'data-testid', - 'data-type', - 'defaultActiveKey', - 'direction', - 'editorType', - 'field', - 'fill', - 'fillRule', - 'height', - 'hoverStyle', - 'htmlType', - 'id', - 'itemKey', - 'key', - 'keyPrefix', - 'layout', - 'margin', - 'maxHeight', - 'mode', - 'name', - 'overflow', - 'placement', - 'position', - 'rel', - 'role', - 'rowKey', - 'searchPosition', - 'selectedStyle', - 'shape', - 'size', - 'style', - 'theme', - 'trigger', - 'uploadTrigger', - 'validateStatus', - 'value', - 'viewBox', - 'width', - ], - sort: true, - disablePlurals: false, - removeUnusedKeys: false, - nsSeparator: false, - keySeparator: false, - mergeNamespaces: true, - }, -}; diff --git a/web/classic/index.html b/web/classic/index.html deleted file mode 100644 index b64c64b75d..0000000000 --- a/web/classic/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - New API - - - - - - -
- - diff --git a/web/classic/jsconfig.json b/web/classic/jsconfig.json deleted file mode 100644 index 170a7cb4cb..0000000000 --- a/web/classic/jsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["src/*"] - } - }, - "include": ["src/**/*"] -} diff --git a/web/classic/package.json b/web/classic/package.json deleted file mode 100644 index ecc6971280..0000000000 --- a/web/classic/package.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "name": "react-template", - "version": "0.1.0", - "private": true, - "type": "module", - "dependencies": { - "@douyinfe/semi-illustrations": "^2.69.1", - "@douyinfe/semi-icons": "^2.63.1", - "@douyinfe/semi-ui": "^2.69.1", - "@lobehub/icons": "catalog:", - "@visactor/react-vchart": "~1.8.8", - "@visactor/vchart": "~1.8.8", - "@visactor/vchart-semi-theme": "~1.8.8", - "axios": "catalog:", - "clsx": "catalog:", - "dayjs": "catalog:", - "history": "^5.3.0", - "highlight.js": "^11.11.1", - "i18next": "^23.16.8", - "i18next-browser-languagedetector": "^7.2.0", - "katex": "^0.16.22", - "lucide-react": "^0.511.0", - "marked": "^4.1.1", - "mermaid": "^11.6.0", - "qrcode.react": "catalog:", - "react": "catalog:", - "react-dom": "catalog:", - "react-dropzone": "^14.2.3", - "react-fireworks": "^1.0.4", - "react-i18next": "^13.0.0", - "react-icons": "catalog:", - "react-markdown": "catalog:", - "react-router-dom": "^6.3.0", - "react-telegram-login": "^1.1.2", - "react-toastify": "^9.0.8", - "react-turnstile": "^1.0.5", - "rehype-highlight": "^7.0.2", - "rehype-katex": "^7.0.1", - "remark-breaks": "^4.0.0", - "remark-gfm": "catalog:", - "remark-math": "^6.0.0", - "sse.js": "catalog:", - "unist-util-visit": "^5.0.0", - "use-debounce": "^10.0.4" - }, - "scripts": { - "dev": "rsbuild dev", - "build": "rsbuild build", - "lint": "prettier . --check", - "lint:fix": "prettier . --write", - "eslint": "bunx eslint \"**/*.{js,jsx}\" --cache", - "eslint:fix": "bunx eslint \"**/*.{js,jsx}\" --fix --cache", - "preview": "rsbuild preview", - "i18n:extract": "bunx i18next-cli extract", - "i18n:status": "bunx i18next-cli status", - "i18n:sync": "bunx i18next-cli sync", - "i18n:lint": "bunx i18next-cli lint" - }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "@rsbuild/core": "catalog:", - "@rsbuild/plugin-react": "catalog:", - "@so1ve/prettier-config": "^3.1.0", - "autoprefixer": "^10.4.21", - "eslint": "8.57.0", - "eslint-plugin-header": "^3.1.1", - "eslint-plugin-react-hooks": "^5.2.0", - "i18next-cli": "^1.10.3", - "postcss": "^8.5.3", - "prop-types": "^15.8.1", - "prettier": "catalog:", - "tailwindcss": "^3", - "typescript": "4.4.2" - }, - "prettier": { - "singleQuote": true, - "jsxSingleQuote": true - }, - "proxy": "http://localhost:3000" -} diff --git a/web/classic/postcss.config.js b/web/classic/postcss.config.js deleted file mode 100644 index 5731ce76eb..0000000000 --- a/web/classic/postcss.config.js +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -export default { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -}; diff --git a/web/classic/public/azure_model_name.png b/web/classic/public/azure_model_name.png deleted file mode 100644 index 36828db217..0000000000 Binary files a/web/classic/public/azure_model_name.png and /dev/null differ diff --git a/web/classic/public/cover-4.webp b/web/classic/public/cover-4.webp deleted file mode 100644 index 0e9ecbf0d2..0000000000 Binary files a/web/classic/public/cover-4.webp and /dev/null differ diff --git a/web/classic/public/ratio.png b/web/classic/public/ratio.png deleted file mode 100644 index 9c7e02c860..0000000000 Binary files a/web/classic/public/ratio.png and /dev/null differ diff --git a/web/classic/public/robots.txt b/web/classic/public/robots.txt deleted file mode 100644 index e9e57dc4d4..0000000000 --- a/web/classic/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/web/classic/rsbuild.config.ts b/web/classic/rsbuild.config.ts deleted file mode 100644 index 3ccf1e96df..0000000000 --- a/web/classic/rsbuild.config.ts +++ /dev/null @@ -1,106 +0,0 @@ -import path from 'path' -import { createRequire } from 'module' -import { fileURLToPath } from 'url' -import { defineConfig, loadEnv } from '@rsbuild/core' -import { pluginReact } from '@rsbuild/plugin-react' - -const __dirname = path.dirname(fileURLToPath(import.meta.url)) -const require = createRequire(import.meta.url) -const semiUiDir = path.resolve( - path.dirname(require.resolve('@douyinfe/semi-ui')), - '../..', -) - -export default defineConfig(({ envMode }) => { - const env = loadEnv({ mode: envMode, prefixes: ['VITE_'] }) - const clientServerUrl = - process.env.VITE_REACT_APP_SERVER_URL || - env.rawPublicVars.VITE_REACT_APP_SERVER_URL || - '' - const proxyServerUrl = - clientServerUrl || - 'http://localhost:3000' - const isProd = envMode === 'production' - const devProxy = Object.fromEntries( - (['/api', '/mj', '/pg'] as const).map((key) => [ - key, - { target: proxyServerUrl, changeOrigin: true }, - ]), - ) as Record - - return { - plugins: [pluginReact()], - source: { - entry: { - index: './src/index.jsx', - }, - define: { - 'import.meta.env.VITE_REACT_APP_SERVER_URL': JSON.stringify( - clientServerUrl, - ), - }, - }, - resolve: { - alias: { - '@': path.resolve(__dirname, './src'), - '@douyinfe/semi-ui/dist/css/semi.css': path.resolve( - semiUiDir, - 'dist/css/semi.css', - ), - }, - }, - html: { - template: './index.html', - }, - server: { - host: '0.0.0.0', - strictPort: false, - proxy: devProxy, - }, - output: { - minify: isProd, - target: 'web', - distPath: { - root: 'dist', - }, - }, - performance: { - removeConsole: isProd ? ['log'] : false, - buildCache: { - cacheDigest: [process.env.VITE_REACT_APP_VERSION], - }, - }, - tools: { - rspack: { - module: { - rules: [ - { - test: /src[\\/].*\.js$/, - type: 'javascript/auto', - use: [ - { - loader: 'builtin:swc-loader', - options: { - jsc: { - parser: { - syntax: 'ecmascript', - jsx: true, - }, - transform: { - react: { - runtime: 'automatic', - development: !isProd, - refresh: !isProd, - }, - }, - }, - }, - }, - ], - }, - ], - }, - }, - }, - } -}) diff --git a/web/classic/src/App.jsx b/web/classic/src/App.jsx deleted file mode 100644 index 0dccb50539..0000000000 --- a/web/classic/src/App.jsx +++ /dev/null @@ -1,386 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import React, { lazy, Suspense, useContext, useMemo } from 'react'; -import { Route, Routes, useLocation, useParams } from 'react-router-dom'; -import Loading from './components/common/ui/Loading'; -import User from './pages/User'; -import { AuthRedirect, PrivateRoute, AdminRoute } from './helpers'; -import RegisterForm from './components/auth/RegisterForm'; -import LoginForm from './components/auth/LoginForm'; -import NotFound from './pages/NotFound'; -import Forbidden from './pages/Forbidden'; -import Setting from './pages/Setting'; -import { StatusContext } from './context/Status'; - -import PasswordResetForm from './components/auth/PasswordResetForm'; -import PasswordResetConfirm from './components/auth/PasswordResetConfirm'; -import Channel from './pages/Channel'; -import Token from './pages/Token'; -import Redemption from './pages/Redemption'; -import TopUp from './pages/TopUp'; -import Log from './pages/Log'; -import Chat from './pages/Chat'; -import Chat2Link from './pages/Chat2Link'; -import MjProxy from './pages/Midjourney'; -import Pricing from './pages/Pricing'; -import Task from './pages/Task'; -import ModelPage from './pages/Model'; -import ModelDeploymentPage from './pages/ModelDeployment'; -import Playground from './pages/Playground'; -import Subscription from './pages/Subscription'; -import OAuth2Callback from './components/auth/OAuth2Callback'; -import PersonalSetting from './components/settings/PersonalSetting'; -import Setup from './pages/Setup'; -import SetupCheck from './components/layout/SetupCheck'; - -const Home = lazy(() => import('./pages/Home')); -const Dashboard = lazy(() => import('./pages/Dashboard')); -const About = lazy(() => import('./pages/About')); -const UserAgreement = lazy(() => import('./pages/UserAgreement')); -const PrivacyPolicy = lazy(() => import('./pages/PrivacyPolicy')); - -function DynamicOAuth2Callback() { - const { provider } = useParams(); - return ; -} - -function App() { - const location = useLocation(); - const [statusState] = useContext(StatusContext); - - // 获取模型广场权限配置 - const pricingRequireAuth = useMemo(() => { - const headerNavModulesConfig = statusState?.status?.HeaderNavModules; - if (headerNavModulesConfig) { - try { - const modules = JSON.parse(headerNavModulesConfig); - - // 处理向后兼容性:如果pricing是boolean,默认不需要登录 - if (typeof modules.pricing === 'boolean') { - return false; // 默认不需要登录鉴权 - } - - // 如果是对象格式,使用requireAuth配置 - return modules.pricing?.requireAuth === true; - } catch (error) { - console.error('解析顶栏模块配置失败:', error); - return false; // 默认不需要登录 - } - } - return false; // 默认不需要登录 - }, [statusState?.status?.HeaderNavModules]); - - return ( - - - } key={location.pathname}> - - - } - /> - } key={location.pathname}> - - - } - /> - } /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - } key={location.pathname}> - - - } - /> - } key={location.pathname}> - - - - - } - /> - } key={location.pathname}> - - - - - } - /> - } key={location.pathname}> - - - } - /> - } key={location.pathname}> - - - } - /> - } key={location.pathname}> - - - } - /> - }> - - - } - /> - } key={location.pathname}> - - - } - /> - } key={location.pathname}> - - - } - /> - - } key={location.pathname}> - - - - } - /> - - } key={location.pathname}> - - - - } - /> - - } key={location.pathname}> - - - - } - /> - - - - } - /> - - } key={location.pathname}> - - - - } - /> - - } key={location.pathname}> - - - - } - /> - - } key={location.pathname}> - - - - } - /> - - } - key={location.pathname} - > - - - - ) : ( - } key={location.pathname}> - - - ) - } - /> - } key={location.pathname}> - - - } - /> - } key={location.pathname}> - - - } - /> - } key={location.pathname}> - - - } - /> - } key={location.pathname}> - - - } - /> - {/* 方便使用chat2link直接跳转聊天... */} - - } key={location.pathname}> - - - - } - /> - } /> - - - ); -} - -export default App; diff --git a/web/classic/src/components/auth/LoginForm.jsx b/web/classic/src/components/auth/LoginForm.jsx deleted file mode 100644 index 63305e8329..0000000000 --- a/web/classic/src/components/auth/LoginForm.jsx +++ /dev/null @@ -1,983 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import React, { useContext, useEffect, useMemo, useRef, useState } from 'react'; -import { Link, useNavigate, useSearchParams } from 'react-router-dom'; -import { UserContext } from '../../context/User'; -import { StatusContext } from '../../context/Status'; -import { - API, - getLogo, - showError, - showInfo, - showSuccess, - updateAPI, - getSystemName, - getOAuthProviderIcon, - setUserData, - onGitHubOAuthClicked, - onDiscordOAuthClicked, - onOIDCClicked, - onLinuxDOOAuthClicked, - onCustomOAuthClicked, - prepareCredentialRequestOptions, - buildAssertionResult, - isPasskeySupported, -} from '../../helpers'; -import Turnstile from 'react-turnstile'; -import { - Button, - Card, - Checkbox, - Divider, - Form, - Icon, - Modal, -} from '@douyinfe/semi-ui'; -import Title from '@douyinfe/semi-ui/lib/es/typography/title'; -import Text from '@douyinfe/semi-ui/lib/es/typography/text'; -import TelegramLoginButton from 'react-telegram-login'; - -import { - IconGithubLogo, - IconMail, - IconLock, - IconKey, -} from '@douyinfe/semi-icons'; -import OIDCIcon from '../common/logo/OIDCIcon'; -import WeChatIcon from '../common/logo/WeChatIcon'; -import LinuxDoIcon from '../common/logo/LinuxDoIcon'; -import TwoFAVerification from './TwoFAVerification'; -import { useTranslation } from 'react-i18next'; -import { SiDiscord } from 'react-icons/si'; - -const LoginForm = () => { - let navigate = useNavigate(); - const { t } = useTranslation(); - const githubButtonTextKeyByState = { - idle: '使用 GitHub 继续', - redirecting: '正在跳转 GitHub...', - timeout: '请求超时,请刷新页面后重新发起 GitHub 登录', - }; - const [inputs, setInputs] = useState({ - username: '', - password: '', - wechat_verification_code: '', - }); - const { username, password } = inputs; - const [searchParams, setSearchParams] = useSearchParams(); - const [submitted, setSubmitted] = useState(false); - const [userState, userDispatch] = useContext(UserContext); - const [statusState] = useContext(StatusContext); - const [turnstileEnabled, setTurnstileEnabled] = useState(false); - const [turnstileSiteKey, setTurnstileSiteKey] = useState(''); - const [turnstileToken, setTurnstileToken] = useState(''); - const [showWeChatLoginModal, setShowWeChatLoginModal] = useState(false); - const [showEmailLogin, setShowEmailLogin] = useState(false); - const [wechatLoading, setWechatLoading] = useState(false); - const [githubLoading, setGithubLoading] = useState(false); - const [discordLoading, setDiscordLoading] = useState(false); - const [oidcLoading, setOidcLoading] = useState(false); - const [linuxdoLoading, setLinuxdoLoading] = useState(false); - const [emailLoginLoading, setEmailLoginLoading] = useState(false); - const [loginLoading, setLoginLoading] = useState(false); - const [resetPasswordLoading, setResetPasswordLoading] = useState(false); - const [otherLoginOptionsLoading, setOtherLoginOptionsLoading] = - useState(false); - const [wechatCodeSubmitLoading, setWechatCodeSubmitLoading] = useState(false); - const [showTwoFA, setShowTwoFA] = useState(false); - const [passkeySupported, setPasskeySupported] = useState(false); - const [passkeyLoading, setPasskeyLoading] = useState(false); - const [agreedToTerms, setAgreedToTerms] = useState(false); - const [hasUserAgreement, setHasUserAgreement] = useState(false); - const [hasPrivacyPolicy, setHasPrivacyPolicy] = useState(false); - const [githubButtonState, setGithubButtonState] = useState('idle'); - const [githubButtonDisabled, setGithubButtonDisabled] = useState(false); - const githubTimeoutRef = useRef(null); - const githubButtonText = t(githubButtonTextKeyByState[githubButtonState]); - const [customOAuthLoading, setCustomOAuthLoading] = useState({}); - - const logo = getLogo(); - const systemName = getSystemName(); - - let affCode = new URLSearchParams(window.location.search).get('aff'); - if (affCode) { - localStorage.setItem('aff', affCode); - } - - const status = useMemo(() => { - if (statusState?.status) return statusState.status; - const savedStatus = localStorage.getItem('status'); - if (!savedStatus) return {}; - try { - return JSON.parse(savedStatus) || {}; - } catch (err) { - return {}; - } - }, [statusState?.status]); - const hasCustomOAuthProviders = - (status.custom_oauth_providers || []).length > 0; - const hasOAuthLoginOptions = Boolean( - status.github_oauth || - status.discord_oauth || - status.oidc_enabled || - status.wechat_login || - status.linuxdo_oauth || - status.telegram_oauth || - hasCustomOAuthProviders, - ); - - useEffect(() => { - if (status?.turnstile_check) { - setTurnstileEnabled(true); - setTurnstileSiteKey(status.turnstile_site_key); - } - - // 从 status 获取用户协议和隐私政策的启用状态 - setHasUserAgreement(status?.user_agreement_enabled || false); - setHasPrivacyPolicy(status?.privacy_policy_enabled || false); - }, [status]); - - useEffect(() => { - isPasskeySupported() - .then(setPasskeySupported) - .catch(() => setPasskeySupported(false)); - - return () => { - if (githubTimeoutRef.current) { - clearTimeout(githubTimeoutRef.current); - } - }; - }, []); - - useEffect(() => { - if (searchParams.get('expired')) { - showError(t('未登录或登录已过期,请重新登录')); - } - }, []); - - const onWeChatLoginClicked = () => { - if ((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms) { - showInfo(t('请先阅读并同意用户协议和隐私政策')); - return; - } - setWechatLoading(true); - setShowWeChatLoginModal(true); - setWechatLoading(false); - }; - - const onSubmitWeChatVerificationCode = async () => { - if (turnstileEnabled && turnstileToken === '') { - showInfo('请稍后几秒重试,Turnstile 正在检查用户环境!'); - return; - } - setWechatCodeSubmitLoading(true); - try { - const res = await API.get( - `/api/oauth/wechat?code=${inputs.wechat_verification_code}`, - ); - const { success, message, data } = res.data; - if (success) { - userDispatch({ type: 'login', payload: data }); - localStorage.setItem('user', JSON.stringify(data)); - setUserData(data); - updateAPI(); - navigate('/'); - showSuccess('登录成功!'); - setShowWeChatLoginModal(false); - } else { - showError(message); - } - } catch (error) { - showError('登录失败,请重试'); - } finally { - setWechatCodeSubmitLoading(false); - } - }; - - function handleChange(name, value) { - setInputs((inputs) => ({ ...inputs, [name]: value })); - } - - async function handleSubmit(e) { - if ((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms) { - showInfo(t('请先阅读并同意用户协议和隐私政策')); - return; - } - if (turnstileEnabled && turnstileToken === '') { - showInfo('请稍后几秒重试,Turnstile 正在检查用户环境!'); - return; - } - setSubmitted(true); - setLoginLoading(true); - try { - if (username && password) { - const res = await API.post( - `/api/user/login?turnstile=${turnstileToken}`, - { - username, - password, - }, - ); - const { success, message, data } = res.data; - if (success) { - // 检查是否需要2FA验证 - if (data && data.require_2fa) { - setShowTwoFA(true); - setLoginLoading(false); - return; - } - - userDispatch({ type: 'login', payload: data }); - setUserData(data); - updateAPI(); - showSuccess('登录成功!'); - if (username === 'root' && password === '123456') { - Modal.error({ - title: '您正在使用默认密码!', - content: '请立刻修改默认密码!', - centered: true, - }); - } - navigate('/console'); - } else { - showError(message); - } - } else { - showError('请输入用户名和密码!'); - } - } catch (error) { - showError('登录失败,请重试'); - } finally { - setLoginLoading(false); - } - } - - // 添加Telegram登录处理函数 - const onTelegramLoginClicked = async (response) => { - if ((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms) { - showInfo(t('请先阅读并同意用户协议和隐私政策')); - return; - } - const fields = [ - 'id', - 'first_name', - 'last_name', - 'username', - 'photo_url', - 'auth_date', - 'hash', - 'lang', - ]; - const params = {}; - fields.forEach((field) => { - if (response[field]) { - params[field] = response[field]; - } - }); - try { - const res = await API.get(`/api/oauth/telegram/login`, { params }); - const { success, message, data } = res.data; - if (success) { - userDispatch({ type: 'login', payload: data }); - localStorage.setItem('user', JSON.stringify(data)); - showSuccess('登录成功!'); - setUserData(data); - updateAPI(); - navigate('/'); - } else { - showError(message); - } - } catch (error) { - showError('登录失败,请重试'); - } - }; - - // 包装的GitHub登录点击处理 - const handleGitHubClick = () => { - if ((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms) { - showInfo(t('请先阅读并同意用户协议和隐私政策')); - return; - } - if (githubButtonDisabled) { - return; - } - setGithubLoading(true); - setGithubButtonDisabled(true); - setGithubButtonState('redirecting'); - if (githubTimeoutRef.current) { - clearTimeout(githubTimeoutRef.current); - } - githubTimeoutRef.current = setTimeout(() => { - setGithubLoading(false); - setGithubButtonState('timeout'); - setGithubButtonDisabled(true); - }, 20000); - try { - onGitHubOAuthClicked(status.github_client_id, { shouldLogout: true }); - } finally { - // 由于重定向,这里不会执行到,但为了完整性添加 - setTimeout(() => setGithubLoading(false), 3000); - } - }; - - // 包装的Discord登录点击处理 - const handleDiscordClick = () => { - if ((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms) { - showInfo(t('请先阅读并同意用户协议和隐私政策')); - return; - } - setDiscordLoading(true); - try { - onDiscordOAuthClicked(status.discord_client_id, { shouldLogout: true }); - } finally { - // 由于重定向,这里不会执行到,但为了完整性添加 - setTimeout(() => setDiscordLoading(false), 3000); - } - }; - - // 包装的OIDC登录点击处理 - const handleOIDCClick = () => { - if ((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms) { - showInfo(t('请先阅读并同意用户协议和隐私政策')); - return; - } - setOidcLoading(true); - try { - onOIDCClicked( - status.oidc_authorization_endpoint, - status.oidc_client_id, - false, - { shouldLogout: true }, - ); - } finally { - // 由于重定向,这里不会执行到,但为了完整性添加 - setTimeout(() => setOidcLoading(false), 3000); - } - }; - - // 包装的LinuxDO登录点击处理 - const handleLinuxDOClick = () => { - if ((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms) { - showInfo(t('请先阅读并同意用户协议和隐私政策')); - return; - } - setLinuxdoLoading(true); - try { - onLinuxDOOAuthClicked(status.linuxdo_client_id, { shouldLogout: true }); - } finally { - // 由于重定向,这里不会执行到,但为了完整性添加 - setTimeout(() => setLinuxdoLoading(false), 3000); - } - }; - - // 包装的自定义OAuth登录点击处理 - const handleCustomOAuthClick = (provider) => { - if ((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms) { - showInfo(t('请先阅读并同意用户协议和隐私政策')); - return; - } - setCustomOAuthLoading((prev) => ({ ...prev, [provider.slug]: true })); - try { - onCustomOAuthClicked(provider, { shouldLogout: true }); - } finally { - // 由于重定向,这里不会执行到,但为了完整性添加 - setTimeout(() => { - setCustomOAuthLoading((prev) => ({ ...prev, [provider.slug]: false })); - }, 3000); - } - }; - - // 包装的邮箱登录选项点击处理 - const handleEmailLoginClick = () => { - setEmailLoginLoading(true); - setShowEmailLogin(true); - setEmailLoginLoading(false); - }; - - const handlePasskeyLogin = async () => { - if ((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms) { - showInfo(t('请先阅读并同意用户协议和隐私政策')); - return; - } - if (!passkeySupported) { - showInfo('当前环境无法使用 Passkey 登录'); - return; - } - if (!window.PublicKeyCredential) { - showInfo('当前浏览器不支持 Passkey'); - return; - } - - setPasskeyLoading(true); - try { - const beginRes = await API.post('/api/user/passkey/login/begin'); - const { success, message, data } = beginRes.data; - if (!success) { - showError(message || '无法发起 Passkey 登录'); - return; - } - - const publicKeyOptions = prepareCredentialRequestOptions( - data?.options || data?.publicKey || data, - ); - const assertion = await navigator.credentials.get({ - publicKey: publicKeyOptions, - }); - const payload = buildAssertionResult(assertion); - if (!payload) { - showError('Passkey 验证失败,请重试'); - return; - } - - const finishRes = await API.post( - '/api/user/passkey/login/finish', - payload, - ); - const finish = finishRes.data; - if (finish.success) { - userDispatch({ type: 'login', payload: finish.data }); - setUserData(finish.data); - updateAPI(); - showSuccess('登录成功!'); - navigate('/console'); - } else { - showError(finish.message || 'Passkey 登录失败,请重试'); - } - } catch (error) { - if (error?.name === 'AbortError') { - showInfo('已取消 Passkey 登录'); - } else { - showError('Passkey 登录失败,请重试'); - } - } finally { - setPasskeyLoading(false); - } - }; - - // 包装的重置密码点击处理 - const handleResetPasswordClick = () => { - setResetPasswordLoading(true); - navigate('/reset'); - setResetPasswordLoading(false); - }; - - // 包装的其他登录选项点击处理 - const handleOtherLoginOptionsClick = () => { - setOtherLoginOptionsLoading(true); - setShowEmailLogin(false); - setOtherLoginOptionsLoading(false); - }; - - // 2FA验证成功处理 - const handle2FASuccess = (data) => { - userDispatch({ type: 'login', payload: data }); - setUserData(data); - updateAPI(); - showSuccess('登录成功!'); - navigate('/console'); - }; - - // 返回登录页面 - const handleBackToLogin = () => { - setShowTwoFA(false); - setInputs({ username: '', password: '', wechat_verification_code: '' }); - }; - - const renderOAuthOptions = () => { - return ( -
-
-
- Logo - - {systemName} - -
- - -
- - {t('登 录')} - -
-
-
- {status.wechat_login && ( - - )} - - {status.github_oauth && ( - - )} - - {status.discord_oauth && ( - - )} - - {status.oidc_enabled && ( - - )} - - {status.linuxdo_oauth && ( - - )} - - {status.custom_oauth_providers && - status.custom_oauth_providers.map((provider) => ( - - ))} - - {status.telegram_oauth && ( -
- -
- )} - - {status.passkey_login && passkeySupported && ( - - )} - - - {t('或')} - - - -
- - {(hasUserAgreement || hasPrivacyPolicy) && ( -
- setAgreedToTerms(e.target.checked)} - > - - {t('我已阅读并同意')} - {hasUserAgreement && ( - <> - - {t('用户协议')} - - - )} - {hasUserAgreement && hasPrivacyPolicy && t('和')} - {hasPrivacyPolicy && ( - <> - - {t('隐私政策')} - - - )} - - -
- )} - - {!status.self_use_mode_enabled && ( -
- - {t('没有账户?')}{' '} - - {t('注册')} - - -
- )} -
-
-
-
- ); - }; - - const renderEmailLoginForm = () => { - return ( -
-
-
- Logo - {systemName} -
- - -
- - {t('登 录')} - -
-
- {status.passkey_login && passkeySupported && ( - - )} -
- handleChange('username', value)} - prefix={} - /> - - handleChange('password', value)} - prefix={} - /> - - {(hasUserAgreement || hasPrivacyPolicy) && ( -
- setAgreedToTerms(e.target.checked)} - > - - {t('我已阅读并同意')} - {hasUserAgreement && ( - <> - - {t('用户协议')} - - - )} - {hasUserAgreement && hasPrivacyPolicy && t('和')} - {hasPrivacyPolicy && ( - <> - - {t('隐私政策')} - - - )} - - -
- )} - -
- - - -
- - - {hasOAuthLoginOptions && ( - <> - - {t('或')} - - -
- -
- - )} - - {!status.self_use_mode_enabled && ( -
- - {t('没有账户?')}{' '} - - {t('注册')} - - -
- )} -
-
-
-
- ); - }; - - // 微信登录模态框 - const renderWeChatLoginModal = () => { - return ( - setShowWeChatLoginModal(false)} - okText={t('登录')} - centered={true} - okButtonProps={{ - loading: wechatCodeSubmitLoading, - }} - > -
- 微信二维码 -
- -
-

- {t('微信扫码关注公众号,输入「验证码」获取验证码(三分钟内有效)')} -

-
- -
- - handleChange('wechat_verification_code', value) - } - /> - -
- ); - }; - - // 2FA验证弹窗 - const render2FAModal = () => { - return ( - -
- - - -
- 两步验证 -
- } - visible={showTwoFA} - onCancel={handleBackToLogin} - footer={null} - width={450} - centered - > - - - ); - }; - - return ( -
- {/* 背景模糊晕染球 */} -
-
-
- {showEmailLogin || - !hasOAuthLoginOptions - ? renderEmailLoginForm() - : renderOAuthOptions()} - {renderWeChatLoginModal()} - {render2FAModal()} - - {turnstileEnabled && ( -
- { - setTurnstileToken(token); - }} - /> -
- )} -
-
- ); -}; - -export default LoginForm; diff --git a/web/classic/src/components/auth/OAuth2Callback.jsx b/web/classic/src/components/auth/OAuth2Callback.jsx deleted file mode 100644 index 55a85c6b14..0000000000 --- a/web/classic/src/components/auth/OAuth2Callback.jsx +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import React, { useContext, useEffect, useRef } from 'react'; -import { useNavigate, useSearchParams } from 'react-router-dom'; -import { useTranslation } from 'react-i18next'; -import { - API, - showError, - showSuccess, - updateAPI, - setUserData, -} from '../../helpers'; -import { UserContext } from '../../context/User'; -import Loading from '../common/ui/Loading'; - -const OAuth2Callback = (props) => { - const { t } = useTranslation(); - const [searchParams] = useSearchParams(); - const [, userDispatch] = useContext(UserContext); - const navigate = useNavigate(); - - // 防止 React 18 Strict Mode 下重复执行 - const hasExecuted = useRef(false); - - // 最大重试次数 - const MAX_RETRIES = 3; - - const sendCode = async (code, state, retry = 0) => { - try { - const { data: resData } = await API.get( - `/api/oauth/${props.type}?code=${code}&state=${state}`, - ); - - const { success, message, data } = resData; - - if (!success) { - // 业务错误不重试,直接显示错误 - showError(message || t('授权失败')); - return; - } - - if (data?.action === 'bind') { - showSuccess(t('绑定成功!')); - navigate('/console/personal'); - } else { - userDispatch({ type: 'login', payload: data }); - localStorage.setItem('user', JSON.stringify(data)); - setUserData(data); - updateAPI(); - showSuccess(t('登录成功!')); - navigate('/console/token'); - } - } catch (error) { - // 网络错误等可重试 - if (retry < MAX_RETRIES) { - // 递增的退避等待 - await new Promise((resolve) => setTimeout(resolve, (retry + 1) * 2000)); - return sendCode(code, state, retry + 1); - } - - // 重试次数耗尽,提示错误并返回设置页面 - showError(error.message || t('授权失败')); - navigate('/console/personal'); - } - }; - - useEffect(() => { - // 防止 React 18 Strict Mode 下重复执行 - if (hasExecuted.current) { - return; - } - hasExecuted.current = true; - - const code = searchParams.get('code'); - const state = searchParams.get('state'); - - // 参数缺失直接返回 - if (!code) { - showError(t('未获取到授权码')); - navigate('/console/personal'); - return; - } - - sendCode(code, state); - }, []); - - return ; -}; - -export default OAuth2Callback; diff --git a/web/classic/src/components/auth/PasswordResetConfirm.jsx b/web/classic/src/components/auth/PasswordResetConfirm.jsx deleted file mode 100644 index d4f4b22862..0000000000 --- a/web/classic/src/components/auth/PasswordResetConfirm.jsx +++ /dev/null @@ -1,220 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import React, { useEffect, useState } from 'react'; -import { - API, - copy, - showError, - showNotice, - getLogo, - getSystemName, -} from '../../helpers'; -import { useSearchParams, Link } from 'react-router-dom'; -import { Button, Card, Form, Typography, Banner } from '@douyinfe/semi-ui'; -import { IconMail, IconLock, IconCopy } from '@douyinfe/semi-icons'; -import { useTranslation } from 'react-i18next'; - -const { Text, Title } = Typography; - -const PasswordResetConfirm = () => { - const { t } = useTranslation(); - const [inputs, setInputs] = useState({ - email: '', - token: '', - }); - const { email, token } = inputs; - const isValidResetLink = email && token; - - const [loading, setLoading] = useState(false); - const [disableButton, setDisableButton] = useState(false); - const [countdown, setCountdown] = useState(30); - const [newPassword, setNewPassword] = useState(''); - const [searchParams, setSearchParams] = useSearchParams(); - const [formApi, setFormApi] = useState(null); - - const logo = getLogo(); - const systemName = getSystemName(); - - useEffect(() => { - let token = searchParams.get('token'); - let email = searchParams.get('email'); - setInputs({ - token: token || '', - email: email || '', - }); - if (formApi) { - formApi.setValues({ - email: email || '', - newPassword: newPassword || '', - }); - } - }, [searchParams, newPassword, formApi]); - - useEffect(() => { - let countdownInterval = null; - if (disableButton && countdown > 0) { - countdownInterval = setInterval(() => { - setCountdown(countdown - 1); - }, 1000); - } else if (countdown === 0) { - setDisableButton(false); - setCountdown(30); - } - return () => clearInterval(countdownInterval); - }, [disableButton, countdown]); - - async function handleSubmit(e) { - if (!email || !token) { - showError(t('无效的重置链接,请重新发起密码重置请求')); - return; - } - setDisableButton(true); - setLoading(true); - const res = await API.post(`/api/user/reset`, { - email, - token, - }); - const { success, message } = res.data; - if (success) { - let password = res.data.data; - setNewPassword(password); - await copy(password); - showNotice(`${t('密码已重置并已复制到剪贴板:')} ${password}`); - } else { - showError(message); - } - setLoading(false); - } - - return ( -
- {/* 背景模糊晕染球 */} -
-
-
-
-
-
- Logo - - {systemName} - -
- - -
- - {t('密码重置确认')} - -
-
- {!isValidResetLink && ( - - )} -
setFormApi(api)} - initValues={{ - email: email || '', - newPassword: newPassword || '', - }} - className='space-y-4' - > - } - placeholder={email ? '' : t('等待获取邮箱信息...')} - /> - - {newPassword && ( - } - suffix={ - - } - /> - )} - -
- -
- - -
- - - {t('返回登录')} - - -
-
-
-
-
-
-
- ); -}; - -export default PasswordResetConfirm; diff --git a/web/classic/src/components/auth/PasswordResetForm.jsx b/web/classic/src/components/auth/PasswordResetForm.jsx deleted file mode 100644 index 4ccc8a52c2..0000000000 --- a/web/classic/src/components/auth/PasswordResetForm.jsx +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import React, { useEffect, useState } from 'react'; -import { - API, - getLogo, - showError, - showInfo, - showSuccess, - getSystemName, -} from '../../helpers'; -import Turnstile from 'react-turnstile'; -import { Button, Card, Form, Typography } from '@douyinfe/semi-ui'; -import { IconMail } from '@douyinfe/semi-icons'; -import { Link } from 'react-router-dom'; -import { useTranslation } from 'react-i18next'; - -const { Text, Title } = Typography; - -const PasswordResetForm = () => { - const { t } = useTranslation(); - const [inputs, setInputs] = useState({ - email: '', - }); - const { email } = inputs; - - const [loading, setLoading] = useState(false); - const [turnstileEnabled, setTurnstileEnabled] = useState(false); - const [turnstileSiteKey, setTurnstileSiteKey] = useState(''); - const [turnstileToken, setTurnstileToken] = useState(''); - const [disableButton, setDisableButton] = useState(false); - const [countdown, setCountdown] = useState(30); - - const logo = getLogo(); - const systemName = getSystemName(); - - useEffect(() => { - let status = localStorage.getItem('status'); - if (status) { - status = JSON.parse(status); - if (status.turnstile_check) { - setTurnstileEnabled(true); - setTurnstileSiteKey(status.turnstile_site_key); - } - } - }, []); - - useEffect(() => { - let countdownInterval = null; - if (disableButton && countdown > 0) { - countdownInterval = setInterval(() => { - setCountdown(countdown - 1); - }, 1000); - } else if (countdown === 0) { - setDisableButton(false); - setCountdown(30); - } - return () => clearInterval(countdownInterval); - }, [disableButton, countdown]); - - function handleChange(value) { - setInputs((inputs) => ({ ...inputs, email: value })); - } - - async function handleSubmit(e) { - if (!email) { - showError(t('请输入邮箱地址')); - return; - } - if (turnstileEnabled && turnstileToken === '') { - showInfo(t('请稍后几秒重试,Turnstile 正在检查用户环境!')); - return; - } - setDisableButton(true); - setLoading(true); - const res = await API.get( - `/api/reset_password?email=${email}&turnstile=${turnstileToken}`, - ); - const { success, message } = res.data; - if (success) { - showSuccess(t('重置邮件发送成功,请检查邮箱!')); - setInputs({ ...inputs, email: '' }); - } else { - showError(message); - } - setLoading(false); - } - - return ( -
- {/* 背景模糊晕染球 */} -
-
-
-
-
-
- Logo - - {systemName} - -
- - -
- - {t('密码重置')} - -
-
-
- } - /> - -
- -
- - -
- - {t('想起来了?')}{' '} - - {t('登录')} - - -
-
-
- - {turnstileEnabled && ( -
- { - setTurnstileToken(token); - }} - /> -
- )} -
-
-
-
- ); -}; - -export default PasswordResetForm; diff --git a/web/classic/src/components/auth/RegisterForm.jsx b/web/classic/src/components/auth/RegisterForm.jsx deleted file mode 100644 index 6838e4fd1e..0000000000 --- a/web/classic/src/components/auth/RegisterForm.jsx +++ /dev/null @@ -1,805 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import React, { useContext, useEffect, useMemo, useRef, useState } from 'react'; -import { Link, useNavigate } from 'react-router-dom'; -import { - API, - getLogo, - showError, - showInfo, - showSuccess, - updateAPI, - getSystemName, - getOAuthProviderIcon, - setUserData, - onDiscordOAuthClicked, - onCustomOAuthClicked, -} from '../../helpers'; -import Turnstile from 'react-turnstile'; -import { - Button, - Card, - Checkbox, - Divider, - Form, - Icon, - Modal, -} from '@douyinfe/semi-ui'; -import Title from '@douyinfe/semi-ui/lib/es/typography/title'; -import Text from '@douyinfe/semi-ui/lib/es/typography/text'; -import { - IconGithubLogo, - IconMail, - IconUser, - IconLock, - IconKey, -} from '@douyinfe/semi-icons'; -import { - onGitHubOAuthClicked, - onLinuxDOOAuthClicked, - onOIDCClicked, -} from '../../helpers'; -import OIDCIcon from '../common/logo/OIDCIcon'; -import LinuxDoIcon from '../common/logo/LinuxDoIcon'; -import WeChatIcon from '../common/logo/WeChatIcon'; -import TelegramLoginButton from 'react-telegram-login/src'; -import { UserContext } from '../../context/User'; -import { StatusContext } from '../../context/Status'; -import { useTranslation } from 'react-i18next'; -import { SiDiscord } from 'react-icons/si'; - -const RegisterForm = () => { - let navigate = useNavigate(); - const { t } = useTranslation(); - const githubButtonTextKeyByState = { - idle: '使用 GitHub 继续', - redirecting: '正在跳转 GitHub...', - timeout: '请求超时,请刷新页面后重新发起 GitHub 登录', - }; - const [inputs, setInputs] = useState({ - username: '', - password: '', - password2: '', - email: '', - verification_code: '', - wechat_verification_code: '', - }); - const { username, password, password2 } = inputs; - const [userState, userDispatch] = useContext(UserContext); - const [statusState] = useContext(StatusContext); - const [turnstileEnabled, setTurnstileEnabled] = useState(false); - const [turnstileSiteKey, setTurnstileSiteKey] = useState(''); - const [turnstileToken, setTurnstileToken] = useState(''); - const [showWeChatLoginModal, setShowWeChatLoginModal] = useState(false); - const [showEmailRegister, setShowEmailRegister] = useState(false); - const [wechatLoading, setWechatLoading] = useState(false); - const [githubLoading, setGithubLoading] = useState(false); - const [discordLoading, setDiscordLoading] = useState(false); - const [oidcLoading, setOidcLoading] = useState(false); - const [linuxdoLoading, setLinuxdoLoading] = useState(false); - const [emailRegisterLoading, setEmailRegisterLoading] = useState(false); - const [registerLoading, setRegisterLoading] = useState(false); - const [verificationCodeLoading, setVerificationCodeLoading] = useState(false); - const [otherRegisterOptionsLoading, setOtherRegisterOptionsLoading] = - useState(false); - const [wechatCodeSubmitLoading, setWechatCodeSubmitLoading] = useState(false); - const [customOAuthLoading, setCustomOAuthLoading] = useState({}); - const [disableButton, setDisableButton] = useState(false); - const [countdown, setCountdown] = useState(30); - const [agreedToTerms, setAgreedToTerms] = useState(false); - const [hasUserAgreement, setHasUserAgreement] = useState(false); - const [hasPrivacyPolicy, setHasPrivacyPolicy] = useState(false); - const [githubButtonState, setGithubButtonState] = useState('idle'); - const [githubButtonDisabled, setGithubButtonDisabled] = useState(false); - const githubTimeoutRef = useRef(null); - const githubButtonText = t(githubButtonTextKeyByState[githubButtonState]); - - const logo = getLogo(); - const systemName = getSystemName(); - - let affCode = new URLSearchParams(window.location.search).get('aff'); - if (affCode) { - localStorage.setItem('aff', affCode); - } - - const status = useMemo(() => { - if (statusState?.status) return statusState.status; - const savedStatus = localStorage.getItem('status'); - if (!savedStatus) return {}; - try { - return JSON.parse(savedStatus) || {}; - } catch (err) { - return {}; - } - }, [statusState?.status]); - const hasCustomOAuthProviders = - (status.custom_oauth_providers || []).length > 0; - const hasOAuthRegisterOptions = Boolean( - status.github_oauth || - status.discord_oauth || - status.oidc_enabled || - status.wechat_login || - status.linuxdo_oauth || - status.telegram_oauth || - hasCustomOAuthProviders, - ); - - const [showEmailVerification, setShowEmailVerification] = useState(false); - - useEffect(() => { - setShowEmailVerification(!!status?.email_verification); - if (status?.turnstile_check) { - setTurnstileEnabled(true); - setTurnstileSiteKey(status.turnstile_site_key); - } - - // 从 status 获取用户协议和隐私政策的启用状态 - setHasUserAgreement(status?.user_agreement_enabled || false); - setHasPrivacyPolicy(status?.privacy_policy_enabled || false); - }, [status]); - - useEffect(() => { - let countdownInterval = null; - if (disableButton && countdown > 0) { - countdownInterval = setInterval(() => { - setCountdown(countdown - 1); - }, 1000); - } else if (countdown === 0) { - setDisableButton(false); - setCountdown(30); - } - return () => clearInterval(countdownInterval); // Clean up on unmount - }, [disableButton, countdown]); - - useEffect(() => { - return () => { - if (githubTimeoutRef.current) { - clearTimeout(githubTimeoutRef.current); - } - }; - }, []); - - const onWeChatLoginClicked = () => { - setWechatLoading(true); - setShowWeChatLoginModal(true); - setWechatLoading(false); - }; - - const onSubmitWeChatVerificationCode = async () => { - if (turnstileEnabled && turnstileToken === '') { - showInfo('请稍后几秒重试,Turnstile 正在检查用户环境!'); - return; - } - setWechatCodeSubmitLoading(true); - try { - const res = await API.get( - `/api/oauth/wechat?code=${inputs.wechat_verification_code}`, - ); - const { success, message, data } = res.data; - if (success) { - userDispatch({ type: 'login', payload: data }); - localStorage.setItem('user', JSON.stringify(data)); - setUserData(data); - updateAPI(); - navigate('/'); - showSuccess('登录成功!'); - setShowWeChatLoginModal(false); - } else { - showError(message); - } - } catch (error) { - showError('登录失败,请重试'); - } finally { - setWechatCodeSubmitLoading(false); - } - }; - - function handleChange(name, value) { - setInputs((inputs) => ({ ...inputs, [name]: value })); - } - - async function handleSubmit(e) { - if (password.length < 8) { - showInfo('密码长度不得小于 8 位!'); - return; - } - if (password !== password2) { - showInfo('两次输入的密码不一致'); - return; - } - if (username && password) { - if (turnstileEnabled && turnstileToken === '') { - showInfo('请稍后几秒重试,Turnstile 正在检查用户环境!'); - return; - } - setRegisterLoading(true); - try { - if (!affCode) { - affCode = localStorage.getItem('aff'); - } - inputs.aff_code = affCode; - const res = await API.post( - `/api/user/register?turnstile=${turnstileToken}`, - inputs, - ); - const { success, message } = res.data; - if (success) { - navigate('/login'); - showSuccess('注册成功!'); - } else { - showError(message); - } - } catch (error) { - showError('注册失败,请重试'); - } finally { - setRegisterLoading(false); - } - } - } - - const sendVerificationCode = async () => { - if (inputs.email === '') return; - if (turnstileEnabled && turnstileToken === '') { - showInfo('请稍后几秒重试,Turnstile 正在检查用户环境!'); - return; - } - setVerificationCodeLoading(true); - try { - const res = await API.get( - `/api/verification?email=${encodeURIComponent(inputs.email)}&turnstile=${turnstileToken}`, - ); - const { success, message } = res.data; - if (success) { - showSuccess('验证码发送成功,请检查你的邮箱!'); - setDisableButton(true); // 发送成功后禁用按钮,开始倒计时 - } else { - showError(message); - } - } catch (error) { - showError('发送验证码失败,请重试'); - } finally { - setVerificationCodeLoading(false); - } - }; - - const handleGitHubClick = () => { - if (githubButtonDisabled) { - return; - } - setGithubLoading(true); - setGithubButtonDisabled(true); - setGithubButtonState('redirecting'); - if (githubTimeoutRef.current) { - clearTimeout(githubTimeoutRef.current); - } - githubTimeoutRef.current = setTimeout(() => { - setGithubLoading(false); - setGithubButtonState('timeout'); - setGithubButtonDisabled(true); - }, 20000); - try { - onGitHubOAuthClicked(status.github_client_id, { shouldLogout: true }); - } finally { - setTimeout(() => setGithubLoading(false), 3000); - } - }; - - const handleDiscordClick = () => { - setDiscordLoading(true); - try { - onDiscordOAuthClicked(status.discord_client_id, { shouldLogout: true }); - } finally { - setTimeout(() => setDiscordLoading(false), 3000); - } - }; - - const handleOIDCClick = () => { - setOidcLoading(true); - try { - onOIDCClicked( - status.oidc_authorization_endpoint, - status.oidc_client_id, - false, - { shouldLogout: true }, - ); - } finally { - setTimeout(() => setOidcLoading(false), 3000); - } - }; - - const handleLinuxDOClick = () => { - setLinuxdoLoading(true); - try { - onLinuxDOOAuthClicked(status.linuxdo_client_id, { shouldLogout: true }); - } finally { - setTimeout(() => setLinuxdoLoading(false), 3000); - } - }; - - const handleCustomOAuthClick = (provider) => { - setCustomOAuthLoading((prev) => ({ ...prev, [provider.slug]: true })); - try { - onCustomOAuthClicked(provider, { shouldLogout: true }); - } finally { - setTimeout(() => { - setCustomOAuthLoading((prev) => ({ ...prev, [provider.slug]: false })); - }, 3000); - } - }; - - const handleEmailRegisterClick = () => { - setEmailRegisterLoading(true); - setShowEmailRegister(true); - setEmailRegisterLoading(false); - }; - - const handleOtherRegisterOptionsClick = () => { - setOtherRegisterOptionsLoading(true); - setShowEmailRegister(false); - setOtherRegisterOptionsLoading(false); - }; - - const onTelegramLoginClicked = async (response) => { - const fields = [ - 'id', - 'first_name', - 'last_name', - 'username', - 'photo_url', - 'auth_date', - 'hash', - 'lang', - ]; - const params = {}; - fields.forEach((field) => { - if (response[field]) { - params[field] = response[field]; - } - }); - try { - const res = await API.get(`/api/oauth/telegram/login`, { params }); - const { success, message, data } = res.data; - if (success) { - userDispatch({ type: 'login', payload: data }); - localStorage.setItem('user', JSON.stringify(data)); - showSuccess('登录成功!'); - setUserData(data); - updateAPI(); - navigate('/'); - } else { - showError(message); - } - } catch (error) { - showError('登录失败,请重试'); - } - }; - - const renderOAuthOptions = () => { - return ( -
-
-
- Logo - - {systemName} - -
- - -
- - {t('注 册')} - -
-
-
- {status.wechat_login && ( - - )} - - {status.github_oauth && ( - - )} - - {status.discord_oauth && ( - - )} - - {status.oidc_enabled && ( - - )} - - {status.linuxdo_oauth && ( - - )} - - {status.custom_oauth_providers && - status.custom_oauth_providers.map((provider) => ( - - ))} - - {status.telegram_oauth && ( -
- -
- )} - - - {t('或')} - - - -
- -
- - {t('已有账户?')}{' '} - - {t('登录')} - - -
-
-
-
-
- ); - }; - - const renderEmailRegisterForm = () => { - return ( -
-
-
- Logo - - {systemName} - -
- - -
- - {t('注 册')} - -
-
-
- handleChange('username', value)} - prefix={} - /> - - handleChange('password', value)} - prefix={} - /> - - handleChange('password2', value)} - prefix={} - /> - - {showEmailVerification && ( - <> - handleChange('email', value)} - prefix={} - suffix={ - - } - /> - - handleChange('verification_code', value) - } - prefix={} - /> - - )} - - {(hasUserAgreement || hasPrivacyPolicy) && ( -
- setAgreedToTerms(e.target.checked)} - > - - {t('我已阅读并同意')} - {hasUserAgreement && ( - <> - - {t('用户协议')} - - - )} - {hasUserAgreement && hasPrivacyPolicy && t('和')} - {hasPrivacyPolicy && ( - <> - - {t('隐私政策')} - - - )} - - -
- )} - -
- -
- - - {hasOAuthRegisterOptions && ( - <> - - {t('或')} - - -
- -
- - )} - -
- - {t('已有账户?')}{' '} - - {t('登录')} - - -
-
-
-
-
- ); - }; - - const renderWeChatLoginModal = () => { - return ( - setShowWeChatLoginModal(false)} - okText={t('登录')} - centered={true} - okButtonProps={{ - loading: wechatCodeSubmitLoading, - }} - > -
- 微信二维码 -
- -
-

- {t('微信扫码关注公众号,输入「验证码」获取验证码(三分钟内有效)')} -

-
- -
- - handleChange('wechat_verification_code', value) - } - /> - -
- ); - }; - - return ( -
- {/* 背景模糊晕染球 */} -
-
-
- {showEmailRegister || - !hasOAuthRegisterOptions - ? renderEmailRegisterForm() - : renderOAuthOptions()} - {renderWeChatLoginModal()} - - {turnstileEnabled && ( -
- { - setTurnstileToken(token); - }} - /> -
- )} -
-
- ); -}; - -export default RegisterForm; diff --git a/web/classic/src/components/auth/TwoFAVerification.jsx b/web/classic/src/components/auth/TwoFAVerification.jsx deleted file mode 100644 index 626de74363..0000000000 --- a/web/classic/src/components/auth/TwoFAVerification.jsx +++ /dev/null @@ -1,244 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ -import { API, showError, showSuccess } from '../../helpers'; -import { - Button, - Card, - Divider, - Form, - Input, - Typography, -} from '@douyinfe/semi-ui'; -import React, { useState } from 'react'; - -const { Title, Text, Paragraph } = Typography; - -const TwoFAVerification = ({ onSuccess, onBack, isModal = false }) => { - const [loading, setLoading] = useState(false); - const [useBackupCode, setUseBackupCode] = useState(false); - const [verificationCode, setVerificationCode] = useState(''); - - const handleSubmit = async () => { - if (!verificationCode) { - showError('请输入验证码'); - return; - } - // Validate code format - if (useBackupCode && verificationCode.length !== 8) { - showError('备用码必须是8位'); - return; - } else if (!useBackupCode && !/^\d{6}$/.test(verificationCode)) { - showError('验证码必须是6位数字'); - return; - } - - setLoading(true); - try { - const res = await API.post('/api/user/login/2fa', { - code: verificationCode, - }); - - if (res.data.success) { - showSuccess('登录成功'); - // 保存用户信息到本地存储 - localStorage.setItem('user', JSON.stringify(res.data.data)); - if (onSuccess) { - onSuccess(res.data.data); - } - } else { - showError(res.data.message); - } - } catch (error) { - showError('验证失败,请重试'); - } finally { - setLoading(false); - } - }; - - const handleKeyPress = (e) => { - if (e.key === 'Enter') { - handleSubmit(); - } - }; - - if (isModal) { - return ( -
- - 请输入认证器应用显示的验证码完成登录 - - -
- - - - - - - -
- - - {onBack && ( - - )} -
- -
- - 提示: -
- • 验证码每30秒更新一次 -
- • 如果无法获取验证码,请使用备用码 -
• 每个备用码只能使用一次 -
-
-
- ); - } - - return ( -
- -
- 两步验证 - - 请输入认证器应用显示的验证码完成登录 - -
- -
- - - - - - - -
- - - {onBack && ( - - )} -
- -
- - 提示: -
- • 验证码每30秒更新一次 -
- • 如果无法获取验证码,请使用备用码 -
• 每个备用码只能使用一次 -
-
-
-
- ); -}; - -export default TwoFAVerification; diff --git a/web/classic/src/components/common/DocumentRenderer/index.jsx b/web/classic/src/components/common/DocumentRenderer/index.jsx deleted file mode 100644 index 3325b2feb8..0000000000 --- a/web/classic/src/components/common/DocumentRenderer/index.jsx +++ /dev/null @@ -1,232 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import React, { useEffect, useMemo, useState } from 'react'; -import { API, showError } from '../../../helpers'; -import { Empty, Card, Spin, Typography } from '@douyinfe/semi-ui'; -const { Title } = Typography; -import { - IllustrationConstruction, - IllustrationConstructionDark, -} from '@douyinfe/semi-illustrations'; -import { useTranslation } from 'react-i18next'; -import MarkdownRenderer from '../markdown/MarkdownRenderer'; - -// Check whether content is a URL. -const isUrl = (content) => { - try { - new URL(content.trim()); - return true; - } catch { - return false; - } -}; - -// Check whether content contains HTML. -const isHtmlContent = (content) => { - if (!content || typeof content !== 'string') return false; - - const htmlTagRegex = /<\/?[a-z][\s\S]*>/i; - return htmlTagRegex.test(content); -}; - -// Parse HTML content and extract inline styles. -const sanitizeHtml = (html) => { - const tempDiv = document.createElement('div'); - tempDiv.innerHTML = html; - - const styles = Array.from(tempDiv.querySelectorAll('style')) - .map((style) => style.innerHTML) - .join('\n'); - - const bodyContent = tempDiv.querySelector('body'); - const content = bodyContent ? bodyContent.innerHTML : html; - - return { content, styles }; -}; - -/** - * 通用文档渲染组件 - * @param {string} apiEndpoint - API 接口地址 - * @param {string} title - 文档标题 - * @param {string} cacheKey - 本地存储缓存键 - * @param {string} emptyMessage - 空内容时的提示消息 - */ -const DocumentRenderer = ({ apiEndpoint, title, cacheKey, emptyMessage }) => { - const { t } = useTranslation(); - const [content, setContent] = useState(''); - const [loading, setLoading] = useState(true); - - const loadContent = async () => { - const cachedContent = localStorage.getItem(cacheKey) || ''; - if (cachedContent) { - setContent(cachedContent); - setLoading(false); - } - - try { - const res = await API.get(apiEndpoint); - const { success, message, data } = res.data; - if (success && data) { - setContent(data); - localStorage.setItem(cacheKey, data); - } else { - if (!cachedContent) { - showError(message || emptyMessage); - setContent(''); - } - } - } catch (error) { - if (!cachedContent) { - showError(emptyMessage); - setContent(''); - } - } finally { - setLoading(false); - } - }; - - const htmlPayload = useMemo(() => { - if (!isHtmlContent(content)) { - return { content: '', styles: '' }; - } - return sanitizeHtml(content); - }, [content]); - - useEffect(() => { - loadContent(); - }, []); - - // 处理HTML样式注入 - useEffect(() => { - const styleId = `document-renderer-styles-${cacheKey}`; - const { styles } = htmlPayload; - - if (styles) { - let styleEl = document.getElementById(styleId); - if (!styleEl) { - styleEl = document.createElement('style'); - styleEl.id = styleId; - styleEl.type = 'text/css'; - document.head.appendChild(styleEl); - } - styleEl.innerHTML = styles; - } else { - const el = document.getElementById(styleId); - if (el) el.remove(); - } - - return () => { - const el = document.getElementById(styleId); - if (el) el.remove(); - }; - }, [cacheKey, htmlPayload]); - - // 显示加载状态 - if (loading) { - return ( -
- -
- ); - } - - // 如果没有内容,显示空状态 - if (!content || content.trim() === '') { - return ( -
- - } - darkModeImage={ - - } - className='p-8' - /> -
- ); - } - - // 如果是 URL,显示链接卡片 - if (isUrl(content)) { - return ( -
- -
- - {title} - -

- {t('管理员设置了外部链接,点击下方按钮访问')} -

- - {t('访问' + title)} - -
-
-
- ); - } - - // 如果是 HTML 内容,直接渲染 - if (isHtmlContent(content)) { - return ( -
-
-
- - {title} - -
-
-
-
- ); - } - - // 其他内容统一使用 Markdown 渲染器 - return ( -
-
-
- - {title} - -
- -
-
-
-
- ); -}; - -export default DocumentRenderer; diff --git a/web/classic/src/components/common/ErrorBoundary.jsx b/web/classic/src/components/common/ErrorBoundary.jsx deleted file mode 100644 index 3827969acf..0000000000 --- a/web/classic/src/components/common/ErrorBoundary.jsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; -import { Empty, Button } from '@douyinfe/semi-ui'; -import { - IllustrationFailure, - IllustrationFailureDark, -} from '@douyinfe/semi-illustrations'; -import { withTranslation } from 'react-i18next'; - -class ErrorBoundary extends React.Component { - constructor(props) { - super(props); - this.state = { hasError: false }; - } - - static getDerivedStateFromError() { - return { hasError: true }; - } - - componentDidCatch(error, errorInfo) { - console.error('[ErrorBoundary]', error, errorInfo); - } - - render() { - if (this.state.hasError) { - const { t } = this.props; - return ( -
- - } - darkModeImage={ - - } - description={t('页面渲染出错,请刷新页面重试')} - /> - -
- ); - } - return this.props.children; - } -} - -export default withTranslation()(ErrorBoundary); diff --git a/web/classic/src/components/common/examples/ChannelKeyViewExample.jsx b/web/classic/src/components/common/examples/ChannelKeyViewExample.jsx deleted file mode 100644 index 1bb2998b20..0000000000 --- a/web/classic/src/components/common/examples/ChannelKeyViewExample.jsx +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import React, { useState } from 'react'; -import { useTranslation } from 'react-i18next'; -import { Button, Modal } from '@douyinfe/semi-ui'; -import { useSecureVerification } from '../../../hooks/common/useSecureVerification'; -import { createApiCalls } from '../../../services/secureVerification'; -import SecureVerificationModal from '../modals/SecureVerificationModal'; -import ChannelKeyDisplay from '../ui/ChannelKeyDisplay'; - -/** - * 渠道密钥查看组件使用示例 - * 展示如何使用通用安全验证系统 - */ -const ChannelKeyViewExample = ({ channelId }) => { - const { t } = useTranslation(); - const [keyData, setKeyData] = useState(''); - const [showKeyModal, setShowKeyModal] = useState(false); - - // 使用通用安全验证 Hook - const { - isModalVisible, - verificationMethods, - verificationState, - startVerification, - executeVerification, - cancelVerification, - setVerificationCode, - switchVerificationMethod, - } = useSecureVerification({ - onSuccess: (result) => { - // 验证成功后处理结果 - if (result.success && result.data?.key) { - setKeyData(result.data.key); - setShowKeyModal(true); - } - }, - successMessage: t('密钥获取成功'), - }); - - // 开始查看密钥流程 - const handleViewKey = async () => { - const apiCall = createApiCalls.viewChannelKey(channelId); - - await startVerification(apiCall, { - title: t('查看渠道密钥'), - description: t('为了保护账户安全,请验证您的身份。'), - preferredMethod: 'passkey', // 可以指定首选验证方式 - }); - }; - - return ( - <> - {/* 查看密钥按钮 */} - - - {/* 安全验证模态框 */} - - - {/* 密钥显示模态框 */} - setShowKeyModal(false)} - footer={ - - } - width={700} - style={{ maxWidth: '90vw' }} - > - - - - ); -}; - -export default ChannelKeyViewExample; diff --git a/web/classic/src/components/common/logo/LinuxDoIcon.jsx b/web/classic/src/components/common/logo/LinuxDoIcon.jsx deleted file mode 100644 index 861f19d4f2..0000000000 --- a/web/classic/src/components/common/logo/LinuxDoIcon.jsx +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import React from 'react'; -import { Icon } from '@douyinfe/semi-ui'; - -const LinuxDoIcon = (props) => { - function CustomIcon() { - return ( - - - - - - - - ); - } - - return } />; -}; - -export default LinuxDoIcon; diff --git a/web/classic/src/components/common/logo/OIDCIcon.jsx b/web/classic/src/components/common/logo/OIDCIcon.jsx deleted file mode 100644 index 28d538eb06..0000000000 --- a/web/classic/src/components/common/logo/OIDCIcon.jsx +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import React from 'react'; -import { Icon } from '@douyinfe/semi-ui'; - -const OIDCIcon = (props) => { - function CustomIcon() { - return ( - - - - - ); - } - - return } />; -}; - -export default OIDCIcon; diff --git a/web/classic/src/components/common/logo/WeChatIcon.jsx b/web/classic/src/components/common/logo/WeChatIcon.jsx deleted file mode 100644 index f9f7057cf9..0000000000 --- a/web/classic/src/components/common/logo/WeChatIcon.jsx +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import React from 'react'; -import { Icon } from '@douyinfe/semi-ui'; - -const WeChatIcon = () => { - function CustomIcon() { - return ( - - - - - ); - } - - return ( -
- } /> -
- ); -}; - -export default WeChatIcon; diff --git a/web/classic/src/components/common/markdown/MarkdownRenderer.jsx b/web/classic/src/components/common/markdown/MarkdownRenderer.jsx deleted file mode 100644 index 6a71c695f8..0000000000 --- a/web/classic/src/components/common/markdown/MarkdownRenderer.jsx +++ /dev/null @@ -1,697 +0,0 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - -import ReactMarkdown from 'react-markdown'; -import 'katex/dist/katex.min.css'; -import 'highlight.js/styles/github.css'; -import './markdown.css'; -import RemarkMath from 'remark-math'; -import RemarkBreaks from 'remark-breaks'; -import RehypeKatex from 'rehype-katex'; -import RemarkGfm from 'remark-gfm'; -import RehypeHighlight from 'rehype-highlight'; -import { useRef, useState, useEffect, useMemo } from 'react'; -import mermaid from 'mermaid'; -import React from 'react'; -import { useDebouncedCallback } from 'use-debounce'; -import clsx from 'clsx'; -import { Button, Tooltip, Toast } from '@douyinfe/semi-ui'; -import { copy, rehypeSplitWordsIntoSpans } from '../../../helpers'; -import { IconCopy } from '@douyinfe/semi-icons'; -import { useTranslation } from 'react-i18next'; - -mermaid.initialize({ - startOnLoad: false, - theme: 'default', - securityLevel: 'loose', -}); - -export function Mermaid(props) { - const ref = useRef(null); - const [hasError, setHasError] = useState(false); - - useEffect(() => { - if (props.code && ref.current) { - mermaid - .run({ - nodes: [ref.current], - suppressErrors: true, - }) - .catch((e) => { - setHasError(true); - console.error('[Mermaid] ', e.message); - }); - } - }, [props.code]); - - function viewSvgInNewWindow() { - const svg = ref.current?.querySelector('svg'); - if (!svg) return; - const text = new XMLSerializer().serializeToString(svg); - const blob = new Blob([text], { type: 'image/svg+xml' }); - const url = URL.createObjectURL(blob); - window.open(url, '_blank'); - } - - if (hasError) { - return null; - } - - return ( -
viewSvgInNewWindow()} - > - {props.code} -
- ); -} - -function SandboxedHtmlPreview({ code }) { - const iframeRef = useRef(null); - const [iframeHeight, setIframeHeight] = useState(150); - - useEffect(() => { - const iframe = iframeRef.current; - if (!iframe) return; - - const handleLoad = () => { - try { - const doc = iframe.contentDocument || iframe.contentWindow?.document; - if (doc) { - const height = - doc.documentElement.scrollHeight || doc.body.scrollHeight; - setIframeHeight(Math.min(Math.max(height + 16, 60), 600)); - } - } catch { - // sandbox restrictions may prevent access, that's fine - } - }; - - iframe.addEventListener('load', handleLoad); - return () => iframe.removeEventListener('load', handleLoad); - }, [code]); - - return ( -