From c8a02fb4683ac1f618b302a1ba4741a5244f7b3b Mon Sep 17 00:00:00 2001 From: Rodrigo Pinto Date: Tue, 19 Nov 2024 01:46:59 -0300 Subject: [PATCH 1/9] Navigation bar and empty login page - Added nav bar; - Added an empty login page - Fixed .gitignore, which had been overwritten on previous commit. --- .gitignore | 8 +- packages/.svelte-kit/ambient.d.ts | 263 ------ packages/.svelte-kit/generated/client/app.js | 21 - .../.svelte-kit/generated/client/matchers.js | 1 - .../.svelte-kit/generated/client/nodes/0.js | 1 - .../.svelte-kit/generated/client/nodes/1.js | 1 - .../.svelte-kit/generated/client/nodes/2.js | 1 - packages/.svelte-kit/generated/root.js | 3 - packages/.svelte-kit/generated/root.svelte | 66 -- .../.svelte-kit/generated/server/internal.js | 34 - packages/.svelte-kit/non-ambient.d.ts | 25 - packages/.svelte-kit/tsconfig.json | 49 - packages/eslint.config.js | 23 - packages/package.json | 9 +- packages/pnpm-lock.yaml | 864 ++---------------- packages/src/lib/components/nav-bar.svelte | 66 ++ packages/src/routes/+error.svelte | 25 + packages/src/routes/+layout.svelte | 56 ++ packages/src/routes/+page.svelte | 16 +- packages/src/routes/auth/login/+page.svelte | 8 + 20 files changed, 232 insertions(+), 1308 deletions(-) delete mode 100644 packages/.svelte-kit/ambient.d.ts delete mode 100644 packages/.svelte-kit/generated/client/app.js delete mode 100644 packages/.svelte-kit/generated/client/matchers.js delete mode 100644 packages/.svelte-kit/generated/client/nodes/0.js delete mode 100644 packages/.svelte-kit/generated/client/nodes/1.js delete mode 100644 packages/.svelte-kit/generated/client/nodes/2.js delete mode 100644 packages/.svelte-kit/generated/root.js delete mode 100644 packages/.svelte-kit/generated/root.svelte delete mode 100644 packages/.svelte-kit/generated/server/internal.js delete mode 100644 packages/.svelte-kit/non-ambient.d.ts delete mode 100644 packages/.svelte-kit/tsconfig.json delete mode 100644 packages/eslint.config.js create mode 100644 packages/src/lib/components/nav-bar.svelte create mode 100644 packages/src/routes/+error.svelte create mode 100644 packages/src/routes/+layout.svelte create mode 100644 packages/src/routes/auth/login/+page.svelte diff --git a/.gitignore b/.gitignore index 79518f7..b02f060 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,14 @@ node_modules +introducer +storage0 +storage1 +webapp # Output .output .vercel -/.svelte-kit +.svelte-kit +packages/.svelte-kit /build # OS @@ -11,6 +16,7 @@ node_modules Thumbs.db # Env +.venv .env .env.* !.env.example diff --git a/packages/.svelte-kit/ambient.d.ts b/packages/.svelte-kit/ambient.d.ts deleted file mode 100644 index d8f6f52..0000000 --- a/packages/.svelte-kit/ambient.d.ts +++ /dev/null @@ -1,263 +0,0 @@ - -// this file is generated — do not edit it - - -/// - -/** - * Environment variables [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env`. Like [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), this module cannot be imported into client-side code. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured). - * - * _Unlike_ [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), the values exported from this module are statically injected into your bundle at build time, enabling optimisations like dead code elimination. - * - * ```ts - * import { API_KEY } from '$env/static/private'; - * ``` - * - * Note that all environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed: - * - * ``` - * MY_FEATURE_FLAG="" - * ``` - * - * You can override `.env` values from the command line like so: - * - * ```bash - * MY_FEATURE_FLAG="enabled" npm run dev - * ``` - */ -declare module '$env/static/private' { - export const NVM_INC: string; - export const COREPACK_ROOT: string; - export const npm_package_devDependencies_prettier: string; - export const TERM_PROGRAM: string; - export const npm_package_devDependencies_eslint_plugin_svelte: string; - export const NODE: string; - export const NVM_CD_FLAGS: string; - export const npm_package_devDependencies_prettier_plugin_svelte: string; - export const INIT_CWD: string; - export const SHELL: string; - export const TERM: string; - export const npm_package_devDependencies_vite: string; - export const TMPDIR: string; - export const HOMEBREW_REPOSITORY: string; - export const RIPGREP_CONFIG_PATH: string; - export const npm_package_scripts_lint: string; - export const TERM_PROGRAM_VERSION: string; - export const npm_package_scripts_dev: string; - export const TERM_SESSION_ID: string; - export const npm_package_devDependencies__sveltejs_kit: string; - export const npm_config_registry: string; - export const ZSH: string; - export const npm_package_devDependencies_globals: string; - export const USER: string; - export const NVM_DIR: string; - export const LS_COLORS: string; - export const COMMAND_MODE: string; - export const npm_package_devDependencies_mdsvex: string; - export const PNPM_SCRIPT_SRC_DIR: string; - export const SSH_AUTH_SOCK: string; - export const __CF_USER_TEXT_ENCODING: string; - export const npm_package_devDependencies_eslint: string; - export const TERM_FEATURES: string; - export const npm_execpath: string; - export const PAGER: string; - export const FZF_DEFAULT_OPTS: string; - export const npm_package_devDependencies_svelte: string; - export const LSCOLORS: string; - export const npm_config_frozen_lockfile: string; - export const PATH: string; - export const TERMINFO_DIRS: string; - export const FZF_COMPLETION_TRIGGER: string; - export const npm_config_engine_strict: string; - export const __CFBundleIdentifier: string; - export const PWD: string; - export const npm_command: string; - export const JAVA_HOME: string; - export const npm_package_scripts_preview: string; - export const EDITOR: string; - export const npm_lifecycle_event: string; - export const LANG: string; - export const npm_package_name: string; - export const npm_package_devDependencies__sveltejs_vite_plugin_svelte: string; - export const ITERM_PROFILE: string; - export const NODE_PATH: string; - export const npm_package_scripts_build: string; - export const XPC_FLAGS: string; - export const npm_package_devDependencies_vitest: string; - export const FZF_COMPLETION_OPTS: string; - export const NVM_LAZY_LOAD: string; - export const npm_package_devDependencies_eslint_config_prettier: string; - export const npm_config_node_gyp: string; - export const XPC_SERVICE_NAME: string; - export const npm_package_version: string; - export const npm_package_devDependencies__sveltejs_adapter_auto: string; - export const COLORFGBG: string; - export const HOME: string; - export const SHLVL: string; - export const PYENV_SHELL: string; - export const npm_package_type: string; - export const npm_package_scripts_test: string; - export const LC_TERMINAL_VERSION: string; - export const HOMEBREW_PREFIX: string; - export const ITERM_SESSION_ID: string; - export const LOGNAME: string; - export const LESS: string; - export const npm_package_scripts_format: string; - export const VISUAL: string; - export const npm_lifecycle_script: string; - export const FZF_DEFAULT_COMMAND: string; - export const NVM_BIN: string; - export const npm_config_user_agent: string; - export const HOMEBREW_CELLAR: string; - export const INFOPATH: string; - export const DISPLAY: string; - export const LC_TERMINAL: string; - export const npm_package_devDependencies__types_eslint: string; - export const COLORTERM: string; - export const npm_package_scripts_test_unit: string; - export const npm_node_execpath: string; - export const NODE_ENV: string; -} - -/** - * Similar to [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private), except that it only includes environment variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code. - * - * Values are replaced statically at build time. - * - * ```ts - * import { PUBLIC_BASE_URL } from '$env/static/public'; - * ``` - */ -declare module '$env/static/public' { - -} - -/** - * This module provides access to runtime environment variables, as defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://svelte.dev/docs/kit/cli)), this is equivalent to `process.env`. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured). - * - * This module cannot be imported into client-side code. - * - * Dynamic environment variables cannot be used during prerendering. - * - * ```ts - * import { env } from '$env/dynamic/private'; - * console.log(env.DEPLOYMENT_SPECIFIC_VARIABLE); - * ``` - * - * > In `dev`, `$env/dynamic` always includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter. - */ -declare module '$env/dynamic/private' { - export const env: { - NVM_INC: string; - COREPACK_ROOT: string; - npm_package_devDependencies_prettier: string; - TERM_PROGRAM: string; - npm_package_devDependencies_eslint_plugin_svelte: string; - NODE: string; - NVM_CD_FLAGS: string; - npm_package_devDependencies_prettier_plugin_svelte: string; - INIT_CWD: string; - SHELL: string; - TERM: string; - npm_package_devDependencies_vite: string; - TMPDIR: string; - HOMEBREW_REPOSITORY: string; - RIPGREP_CONFIG_PATH: string; - npm_package_scripts_lint: string; - TERM_PROGRAM_VERSION: string; - npm_package_scripts_dev: string; - TERM_SESSION_ID: string; - npm_package_devDependencies__sveltejs_kit: string; - npm_config_registry: string; - ZSH: string; - npm_package_devDependencies_globals: string; - USER: string; - NVM_DIR: string; - LS_COLORS: string; - COMMAND_MODE: string; - npm_package_devDependencies_mdsvex: string; - PNPM_SCRIPT_SRC_DIR: string; - SSH_AUTH_SOCK: string; - __CF_USER_TEXT_ENCODING: string; - npm_package_devDependencies_eslint: string; - TERM_FEATURES: string; - npm_execpath: string; - PAGER: string; - FZF_DEFAULT_OPTS: string; - npm_package_devDependencies_svelte: string; - LSCOLORS: string; - npm_config_frozen_lockfile: string; - PATH: string; - TERMINFO_DIRS: string; - FZF_COMPLETION_TRIGGER: string; - npm_config_engine_strict: string; - __CFBundleIdentifier: string; - PWD: string; - npm_command: string; - JAVA_HOME: string; - npm_package_scripts_preview: string; - EDITOR: string; - npm_lifecycle_event: string; - LANG: string; - npm_package_name: string; - npm_package_devDependencies__sveltejs_vite_plugin_svelte: string; - ITERM_PROFILE: string; - NODE_PATH: string; - npm_package_scripts_build: string; - XPC_FLAGS: string; - npm_package_devDependencies_vitest: string; - FZF_COMPLETION_OPTS: string; - NVM_LAZY_LOAD: string; - npm_package_devDependencies_eslint_config_prettier: string; - npm_config_node_gyp: string; - XPC_SERVICE_NAME: string; - npm_package_version: string; - npm_package_devDependencies__sveltejs_adapter_auto: string; - COLORFGBG: string; - HOME: string; - SHLVL: string; - PYENV_SHELL: string; - npm_package_type: string; - npm_package_scripts_test: string; - LC_TERMINAL_VERSION: string; - HOMEBREW_PREFIX: string; - ITERM_SESSION_ID: string; - LOGNAME: string; - LESS: string; - npm_package_scripts_format: string; - VISUAL: string; - npm_lifecycle_script: string; - FZF_DEFAULT_COMMAND: string; - NVM_BIN: string; - npm_config_user_agent: string; - HOMEBREW_CELLAR: string; - INFOPATH: string; - DISPLAY: string; - LC_TERMINAL: string; - npm_package_devDependencies__types_eslint: string; - COLORTERM: string; - npm_package_scripts_test_unit: string; - npm_node_execpath: string; - NODE_ENV: string; - [key: `PUBLIC_${string}`]: undefined; - [key: `${string}`]: string | undefined; - } -} - -/** - * Similar to [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), but only includes variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code. - * - * Note that public dynamic environment variables must all be sent from the server to the client, causing larger network requests — when possible, use `$env/static/public` instead. - * - * Dynamic environment variables cannot be used during prerendering. - * - * ```ts - * import { env } from '$env/dynamic/public'; - * console.log(env.PUBLIC_DEPLOYMENT_SPECIFIC_VARIABLE); - * ``` - */ -declare module '$env/dynamic/public' { - export const env: { - [key: `PUBLIC_${string}`]: string | undefined; - } -} diff --git a/packages/.svelte-kit/generated/client/app.js b/packages/.svelte-kit/generated/client/app.js deleted file mode 100644 index 07f0692..0000000 --- a/packages/.svelte-kit/generated/client/app.js +++ /dev/null @@ -1,21 +0,0 @@ -export { matchers } from './matchers.js'; - -export const nodes = [ - () => import('./nodes/0'), - () => import('./nodes/1'), - () => import('./nodes/2') -]; - -export const server_loads = []; - -export const dictionary = { - "/": [2] - }; - -export const hooks = { - handleError: (({ error }) => { console.error(error) }), - - reroute: (() => {}) -}; - -export { default as root } from '../root.js'; \ No newline at end of file diff --git a/packages/.svelte-kit/generated/client/matchers.js b/packages/.svelte-kit/generated/client/matchers.js deleted file mode 100644 index f6bd30a..0000000 --- a/packages/.svelte-kit/generated/client/matchers.js +++ /dev/null @@ -1 +0,0 @@ -export const matchers = {}; \ No newline at end of file diff --git a/packages/.svelte-kit/generated/client/nodes/0.js b/packages/.svelte-kit/generated/client/nodes/0.js deleted file mode 100644 index 7da755f..0000000 --- a/packages/.svelte-kit/generated/client/nodes/0.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../node_modules/.pnpm/@sveltejs+kit@2.8.0_@sveltejs+vite-plugin-svelte@4.0.0_svelte@5.1.15_vite@5.4.11__svelte@5.1.15_vite@5.4.11/node_modules/@sveltejs/kit/src/runtime/components/svelte-5/layout.svelte"; \ No newline at end of file diff --git a/packages/.svelte-kit/generated/client/nodes/1.js b/packages/.svelte-kit/generated/client/nodes/1.js deleted file mode 100644 index 7ad9b87..0000000 --- a/packages/.svelte-kit/generated/client/nodes/1.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../node_modules/.pnpm/@sveltejs+kit@2.8.0_@sveltejs+vite-plugin-svelte@4.0.0_svelte@5.1.15_vite@5.4.11__svelte@5.1.15_vite@5.4.11/node_modules/@sveltejs/kit/src/runtime/components/svelte-5/error.svelte"; \ No newline at end of file diff --git a/packages/.svelte-kit/generated/client/nodes/2.js b/packages/.svelte-kit/generated/client/nodes/2.js deleted file mode 100644 index 1cb4f85..0000000 --- a/packages/.svelte-kit/generated/client/nodes/2.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/+page.svelte"; \ No newline at end of file diff --git a/packages/.svelte-kit/generated/root.js b/packages/.svelte-kit/generated/root.js deleted file mode 100644 index 4d1e892..0000000 --- a/packages/.svelte-kit/generated/root.js +++ /dev/null @@ -1,3 +0,0 @@ -import { asClassComponent } from 'svelte/legacy'; -import Root from './root.svelte'; -export default asClassComponent(Root); \ No newline at end of file diff --git a/packages/.svelte-kit/generated/root.svelte b/packages/.svelte-kit/generated/root.svelte deleted file mode 100644 index 8f82bae..0000000 --- a/packages/.svelte-kit/generated/root.svelte +++ /dev/null @@ -1,66 +0,0 @@ - - - - -{#if constructors[1]} - {@const Pyramid_0 = constructors[0]} - - - - - - -{:else} - {@const Pyramid_0 = constructors[0]} - - - -{/if} - -{#if mounted} -
- {#if navigated} - {title} - {/if} -
-{/if} \ No newline at end of file diff --git a/packages/.svelte-kit/generated/server/internal.js b/packages/.svelte-kit/generated/server/internal.js deleted file mode 100644 index fcfc5ee..0000000 --- a/packages/.svelte-kit/generated/server/internal.js +++ /dev/null @@ -1,34 +0,0 @@ - -import root from '../root.js'; -import { set_building, set_prerendering } from '__sveltekit/environment'; -import { set_assets } from '__sveltekit/paths'; -import { set_manifest, set_read_implementation } from '__sveltekit/server'; -import { set_private_env, set_public_env, set_safe_public_env } from '../../../node_modules/.pnpm/@sveltejs+kit@2.8.0_@sveltejs+vite-plugin-svelte@4.0.0_svelte@5.1.15_vite@5.4.11__svelte@5.1.15_vite@5.4.11/node_modules/@sveltejs/kit/src/runtime/shared-server.js'; - -export const options = { - app_dir: "_app", - app_template_contains_nonce: false, - csp: {"mode":"auto","directives":{"upgrade-insecure-requests":false,"block-all-mixed-content":false},"reportOnly":{"upgrade-insecure-requests":false,"block-all-mixed-content":false}}, - csrf_check_origin: true, - embedded: false, - env_public_prefix: 'PUBLIC_', - env_private_prefix: '', - hooks: null, // added lazily, via `get_hooks` - preload_strategy: "modulepreload", - root, - service_worker: false, - templates: { - app: ({ head, body, assets, nonce, env }) => "\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t" + head + "\n\t\n\t\n\t\t
" + body + "
\n\t\n\n", - error: ({ status, message }) => "\n\n\t\n\t\t\n\t\t" + message + "\n\n\t\t\n\t\n\t\n\t\t
\n\t\t\t" + status + "\n\t\t\t
\n\t\t\t\t

" + message + "

\n\t\t\t
\n\t\t
\n\t\n\n" - }, - version_hash: "1vvcu4z" -}; - -export async function get_hooks() { - return { - - - }; -} - -export { set_assets, set_building, set_manifest, set_prerendering, set_private_env, set_public_env, set_read_implementation, set_safe_public_env }; diff --git a/packages/.svelte-kit/non-ambient.d.ts b/packages/.svelte-kit/non-ambient.d.ts deleted file mode 100644 index 46bd7fb..0000000 --- a/packages/.svelte-kit/non-ambient.d.ts +++ /dev/null @@ -1,25 +0,0 @@ - -// this file is generated — do not edit it - - -declare module "svelte/elements" { - export interface HTMLAttributes { - 'data-sveltekit-keepfocus'?: true | '' | 'off' | undefined | null; - 'data-sveltekit-noscroll'?: true | '' | 'off' | undefined | null; - 'data-sveltekit-preload-code'?: - | true - | '' - | 'eager' - | 'viewport' - | 'hover' - | 'tap' - | 'off' - | undefined - | null; - 'data-sveltekit-preload-data'?: true | '' | 'hover' | 'tap' | 'off' | undefined | null; - 'data-sveltekit-reload'?: true | '' | 'off' | undefined | null; - 'data-sveltekit-replacestate'?: true | '' | 'off' | undefined | null; - } -} - -export {}; diff --git a/packages/.svelte-kit/tsconfig.json b/packages/.svelte-kit/tsconfig.json deleted file mode 100644 index a2a7665..0000000 --- a/packages/.svelte-kit/tsconfig.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "$lib": [ - "../src/lib" - ], - "$lib/*": [ - "../src/lib/*" - ] - }, - "rootDirs": [ - "..", - "./types" - ], - "verbatimModuleSyntax": true, - "isolatedModules": true, - "lib": [ - "esnext", - "DOM", - "DOM.Iterable" - ], - "moduleResolution": "bundler", - "module": "esnext", - "noEmit": true, - "target": "esnext" - }, - "include": [ - "ambient.d.ts", - "non-ambient.d.ts", - "./types/**/$types.d.ts", - "../vite.config.js", - "../vite.config.ts", - "../src/**/*.js", - "../src/**/*.ts", - "../src/**/*.svelte", - "../tests/**/*.js", - "../tests/**/*.ts", - "../tests/**/*.svelte" - ], - "exclude": [ - "../node_modules/**", - "../src/service-worker.js", - "../src/service-worker/**/*.js", - "../src/service-worker.ts", - "../src/service-worker/**/*.ts", - "../src/service-worker.d.ts", - "../src/service-worker/**/*.d.ts" - ] -} \ No newline at end of file diff --git a/packages/eslint.config.js b/packages/eslint.config.js deleted file mode 100644 index dae2fad..0000000 --- a/packages/eslint.config.js +++ /dev/null @@ -1,23 +0,0 @@ -import prettier from 'eslint-config-prettier'; -import js from '@eslint/js'; -import svelte from 'eslint-plugin-svelte'; -import globals from 'globals'; - -/** @type {import('eslint').Linter.Config[]} */ -export default [ - js.configs.recommended, - ...svelte.configs['flat/recommended'], - prettier, - ...svelte.configs['flat/prettier'], - { - languageOptions: { - globals: { - ...globals.browser, - ...globals.node - } - } - }, - { - ignores: ['build/', '.svelte-kit/', 'dist/'] - } -]; diff --git a/packages/package.json b/packages/package.json index d023a70..e4e9082 100644 --- a/packages/package.json +++ b/packages/package.json @@ -7,7 +7,7 @@ "build": "vite build", "preview": "vite preview", "format": "prettier --write .", - "lint": "prettier --check . && eslint .", + "lint": "prettier --check .", "test:unit": "vitest", "test": "npm run test:unit -- --run" }, @@ -15,10 +15,6 @@ "@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^4.0.0", - "@types/eslint": "^9.6.0", - "eslint": "^9.7.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.36.0", "globals": "^15.0.0", "mdsvex": "^0.11.2", "prettier": "^3.3.2", @@ -26,5 +22,8 @@ "svelte": "^5.0.0", "vite": "^5.0.3", "vitest": "^2.0.4" + }, + "dependencies": { + "otplib": "^12.0.1" } } diff --git a/packages/pnpm-lock.yaml b/packages/pnpm-lock.yaml index 4a10164..62ff74e 100644 --- a/packages/pnpm-lock.yaml +++ b/packages/pnpm-lock.yaml @@ -7,6 +7,10 @@ settings: importers: .: + dependencies: + otplib: + specifier: ^12.0.1 + version: 12.0.1 devDependencies: '@sveltejs/adapter-auto': specifier: ^3.0.0 @@ -17,18 +21,6 @@ importers: '@sveltejs/vite-plugin-svelte': specifier: ^4.0.0 version: 4.0.0(svelte@5.1.15)(vite@5.4.11) - '@types/eslint': - specifier: ^9.6.0 - version: 9.6.1 - eslint: - specifier: ^9.7.0 - version: 9.14.0 - eslint-config-prettier: - specifier: ^9.1.0 - version: 9.1.0(eslint@9.14.0) - eslint-plugin-svelte: - specifier: ^2.36.0 - version: 2.46.0(eslint@9.14.0)(svelte@5.1.15) globals: specifier: ^15.0.0 version: 15.12.0 @@ -195,60 +187,6 @@ packages: cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.4.1': - resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - - '@eslint-community/regexpp@4.12.1': - resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - - '@eslint/config-array@0.18.0': - resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/core@0.7.0': - resolution: {integrity: sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/eslintrc@3.1.0': - resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/js@9.14.0': - resolution: {integrity: sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/object-schema@2.1.4': - resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/plugin-kit@0.2.2': - resolution: {integrity: sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@humanfs/core@0.19.1': - resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} - engines: {node: '>=18.18.0'} - - '@humanfs/node@0.16.6': - resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} - engines: {node: '>=18.18.0'} - - '@humanwhocodes/module-importer@1.0.1': - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} - - '@humanwhocodes/retry@0.3.1': - resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} - engines: {node: '>=18.18'} - - '@humanwhocodes/retry@0.4.1': - resolution: {integrity: sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==} - engines: {node: '>=18.18'} - '@jridgewell/gen-mapping@0.3.5': resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} @@ -267,6 +205,21 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@otplib/core@12.0.1': + resolution: {integrity: sha512-4sGntwbA/AC+SbPhbsziRiD+jNDdIzsZ3JUyfZwjtKyc/wufl1pnSIaG4Uqx8ymPagujub0o92kgBnB89cuAMA==} + + '@otplib/plugin-crypto@12.0.1': + resolution: {integrity: sha512-qPuhN3QrT7ZZLcLCyKOSNhuijUi9G5guMRVrxq63r9YNOxxQjPm59gVxLM+7xGnHnM6cimY57tuKsjK7y9LM1g==} + + '@otplib/plugin-thirty-two@12.0.1': + resolution: {integrity: sha512-MtT+uqRso909UkbrrYpJ6XFjj9D+x2Py7KjTO9JDPhL0bJUYVu5kFP4TFZW4NFAywrAtFRxOVY261u0qwb93gA==} + + '@otplib/preset-default@12.0.1': + resolution: {integrity: sha512-xf1v9oOJRyXfluBhMdpOkr+bsE+Irt+0D5uHtvg6x1eosfmHCsCC6ej/m7FXiWqdo0+ZUI6xSKDhJwc8yfiOPQ==} + + '@otplib/preset-v11@12.0.1': + resolution: {integrity: sha512-9hSetMI7ECqbFiKICrNa4w70deTUfArtwXykPUvSHWOdzOlfa9ajglu7mNCntlvxycTiOAXkQGwjQCzzDEMRMg==} + '@polka/url@1.0.0-next.28': resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} @@ -392,15 +345,9 @@ packages: '@types/cookie@0.6.0': resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} - '@types/eslint@9.6.1': - resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} - '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} - '@types/json-schema@7.0.15': - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/unist@2.0.11': resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} @@ -433,11 +380,6 @@ packages: '@vitest/utils@2.1.4': resolution: {integrity: sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg==} - acorn-jsx@5.3.2: - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn-typescript@1.4.13: resolution: {integrity: sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==} peerDependencies: @@ -448,16 +390,6 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - aria-query@5.3.2: resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} engines: {node: '>= 0.4'} @@ -470,55 +402,22 @@ packages: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} - callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - chai@5.1.2: resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} engines: {node: '>=12'} - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - check-error@2.1.1: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - cookie@0.6.0: resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} engines: {node: '>= 0.6'} - cross-spawn@7.0.5: - resolution: {integrity: sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==} - engines: {node: '>= 8'} - - cssesc@3.0.0: - resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} - engines: {node: '>=4'} - hasBin: true - debug@4.3.7: resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} engines: {node: '>=6.0'} @@ -532,9 +431,6 @@ packages: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} - deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} @@ -547,132 +443,24 @@ packages: engines: {node: '>=12'} hasBin: true - escape-string-regexp@4.0.0: - resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} - engines: {node: '>=10'} - - eslint-compat-utils@0.5.1: - resolution: {integrity: sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==} - engines: {node: '>=12'} - peerDependencies: - eslint: '>=6.0.0' - - eslint-config-prettier@9.1.0: - resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} - hasBin: true - peerDependencies: - eslint: '>=7.0.0' - - eslint-plugin-svelte@2.46.0: - resolution: {integrity: sha512-1A7iEMkzmCZ9/Iz+EAfOGYL8IoIG6zeKEq1SmpxGeM5SXmoQq+ZNnCpXFVJpsxPWYx8jIVGMerQMzX20cqUl0g==} - engines: {node: ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0-0 || ^9.0.0-0 - svelte: ^3.37.0 || ^4.0.0 || ^5.0.0 - peerDependenciesMeta: - svelte: - optional: true - - eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - eslint-scope@8.2.0: - resolution: {integrity: sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - eslint-visitor-keys@4.2.0: - resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - eslint@9.14.0: - resolution: {integrity: sha512-c2FHsVBr87lnUtjP4Yhvk4yEhKrQavGafRA/Se1ouse8PfbfC/Qh9Mxa00yWsZRlqeUB9raXip0aiiUZkgnr9g==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - hasBin: true - peerDependencies: - jiti: '*' - peerDependenciesMeta: - jiti: - optional: true - esm-env@1.1.4: resolution: {integrity: sha512-oO82nKPHKkzIj/hbtuDYy/JHqBHFlMIW36SDiPCVsj87ntDLcWN+sJ1erdVryd4NxODacFTsdrIE3b7IamqbOg==} - espree@10.3.0: - resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - esquery@1.6.0: - resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} - engines: {node: '>=0.10'} - esrap@1.2.2: resolution: {integrity: sha512-F2pSJklxx1BlQIQgooczXCPHmcWpn6EsP5oo73LQfonG9fIlIENQ8vMmfGXeojP9MrkzUNAfyU5vdFlR9shHAw==} - esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - - estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - expect-type@1.1.0: resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} engines: {node: '>=12.0.0'} - fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - - fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - - fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - - file-entry-cache@8.0.0: - resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} - engines: {node: '>=16.0.0'} - - find-up@5.0.0: - resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} - engines: {node: '>=10'} - - flat-cache@4.0.1: - resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} - engines: {node: '>=16'} - - flatted@3.3.1: - resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} - fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] - glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} - - globals@14.0.0: - resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} - engines: {node: '>=18'} - globals@15.12.0: resolution: {integrity: sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==} engines: {node: '>=18'} @@ -683,80 +471,19 @@ packages: globrex@0.1.2: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - ignore@5.3.2: - resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} - engines: {node: '>= 4'} - - import-fresh@3.3.0: - resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} - engines: {node: '>=6'} - import-meta-resolve@4.1.0: resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - is-reference@3.0.2: resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} - isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - - json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - - json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - - keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - kleur@4.1.5: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} - known-css-properties@0.35.0: - resolution: {integrity: sha512-a/RAk2BfKk+WFGhhOCAYqSiFLc34k8Mt/6NWRI4joER0EYUzXIcFivjjnoD3+XU1DggLn/tZc3DOAgke7l8a4A==} - - levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} - - lilconfig@2.1.0: - resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} - engines: {node: '>=10'} - locate-character@3.0.0: resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} - locate-path@6.0.0: - resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} - engines: {node: '>=10'} - - lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - loupe@3.1.2: resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} @@ -768,9 +495,6 @@ packages: peerDependencies: svelte: ^3.56.0 || ^4.0.0 || ^5.0.0-next.120 - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -787,32 +511,8 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - - optionator@0.9.4: - resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} - engines: {node: '>= 0.8.0'} - - p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} - - p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} - - parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} - - path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - - path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} + otplib@12.0.1: + resolution: {integrity: sha512-xDGvUOQjop7RDgxTQ+o4pOol0/3xSZzawTiPKRrHnQWAy0WjhNs/5HdIDJCrqC4MBynmjXgULc6YfioaxZeFgg==} pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} @@ -824,42 +524,10 @@ packages: picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - postcss-load-config@3.1.4: - resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} - engines: {node: '>= 10'} - peerDependencies: - postcss: '>=8.0.9' - ts-node: '>=9.0.0' - peerDependenciesMeta: - postcss: - optional: true - ts-node: - optional: true - - postcss-safe-parser@6.0.0: - resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==} - engines: {node: '>=12.0'} - peerDependencies: - postcss: ^8.3.3 - - postcss-scss@4.0.9: - resolution: {integrity: sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A==} - engines: {node: '>=12.0'} - peerDependencies: - postcss: ^8.4.29 - - postcss-selector-parser@6.1.2: - resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} - engines: {node: '>=4'} - postcss@8.4.49: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} - prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - prettier-plugin-svelte@3.2.8: resolution: {integrity: sha512-PAHmmU5cGZdnhW4mWhmvxuG2PVbbHIxUuPOdUKvfE+d4Qt2d29iU5VWrPdsaW5YqVEE0nqhlvN4eoKmVMpIF3Q==} peerDependencies: @@ -878,14 +546,6 @@ packages: resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} engines: {node: '>=6'} - punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} - - resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - rollup@4.25.0: resolution: {integrity: sha512-uVbClXmR6wvx5R1M3Od4utyLUxrmOcEm3pAtMphn73Apq19PDtHpgZoEvqH2YnnaNUuvKmg2DgRd2Sqv+odyqg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -895,22 +555,9 @@ packages: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} engines: {node: '>=6'} - semver@7.6.3: - resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} - engines: {node: '>=10'} - hasBin: true - set-cookie-parser@2.7.1: resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} - shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - - shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -928,29 +575,13 @@ packages: std-env@3.8.0: resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==} - strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - svelte-eslint-parser@0.43.0: - resolution: {integrity: sha512-GpU52uPKKcVnh8tKN5P4UZpJ/fUDndmq7wfsvoVXsyP+aY0anol7Yqo01fyrlaWGMFfm4av5DyrjlaXdLRJvGA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - svelte: ^3.37.0 || ^4.0.0 || ^5.0.0 - peerDependenciesMeta: - svelte: - optional: true - svelte@5.1.15: resolution: {integrity: sha512-cs2JYADrEorRCB4AUCHMvwperwAKcn/mz7w1xzVOv3fG6TmAS2n13JYHH8/uDCFbqVyRSXXlL+vA5RDwGUXEZg==} engines: {node: '>=18'} - text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + thirty-two@1.0.2: + resolution: {integrity: sha512-OEI0IWCe+Dw46019YLl6V10Us5bi574EvlJEOcAkB29IzQ/mYD1A6RyNHLjZPiHCmuodxvgF6U+vZO1L15lxVA==} + engines: {node: '>=0.2.6'} tiny-glob@0.2.9: resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} @@ -977,19 +608,9 @@ packages: resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} engines: {node: '>=6'} - type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} - unist-util-stringify-position@2.0.3: resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} - uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - vfile-message@2.0.4: resolution: {integrity: sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==} @@ -1062,28 +683,11 @@ packages: jsdom: optional: true - which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - why-is-node-running@2.3.0: resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} engines: {node: '>=8'} hasBin: true - word-wrap@1.2.5: - resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} - engines: {node: '>=0.10.0'} - - yaml@1.10.2: - resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} - engines: {node: '>= 6'} - - yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - zimmerframe@1.1.2: resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==} @@ -1163,58 +767,6 @@ snapshots: '@esbuild/win32-x64@0.21.5': optional: true - '@eslint-community/eslint-utils@4.4.1(eslint@9.14.0)': - dependencies: - eslint: 9.14.0 - eslint-visitor-keys: 3.4.3 - - '@eslint-community/regexpp@4.12.1': {} - - '@eslint/config-array@0.18.0': - dependencies: - '@eslint/object-schema': 2.1.4 - debug: 4.3.7 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - - '@eslint/core@0.7.0': {} - - '@eslint/eslintrc@3.1.0': - dependencies: - ajv: 6.12.6 - debug: 4.3.7 - espree: 10.3.0 - globals: 14.0.0 - ignore: 5.3.2 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - - '@eslint/js@9.14.0': {} - - '@eslint/object-schema@2.1.4': {} - - '@eslint/plugin-kit@0.2.2': - dependencies: - levn: 0.4.1 - - '@humanfs/core@0.19.1': {} - - '@humanfs/node@0.16.6': - dependencies: - '@humanfs/core': 0.19.1 - '@humanwhocodes/retry': 0.3.1 - - '@humanwhocodes/module-importer@1.0.1': {} - - '@humanwhocodes/retry@0.3.1': {} - - '@humanwhocodes/retry@0.4.1': {} - '@jridgewell/gen-mapping@0.3.5': dependencies: '@jridgewell/set-array': 1.2.1 @@ -1232,6 +784,29 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 + '@otplib/core@12.0.1': {} + + '@otplib/plugin-crypto@12.0.1': + dependencies: + '@otplib/core': 12.0.1 + + '@otplib/plugin-thirty-two@12.0.1': + dependencies: + '@otplib/core': 12.0.1 + thirty-two: 1.0.2 + + '@otplib/preset-default@12.0.1': + dependencies: + '@otplib/core': 12.0.1 + '@otplib/plugin-crypto': 12.0.1 + '@otplib/plugin-thirty-two': 12.0.1 + + '@otplib/preset-v11@12.0.1': + dependencies: + '@otplib/core': 12.0.1 + '@otplib/plugin-crypto': 12.0.1 + '@otplib/plugin-thirty-two': 12.0.1 + '@polka/url@1.0.0-next.28': {} '@rollup/rollup-android-arm-eabi@4.25.0': @@ -1335,15 +910,8 @@ snapshots: '@types/cookie@0.6.0': {} - '@types/eslint@9.6.1': - dependencies: - '@types/estree': 1.0.6 - '@types/json-schema': 7.0.15 - '@types/estree@1.0.6': {} - '@types/json-schema@7.0.15': {} - '@types/unist@2.0.11': {} '@vitest/expect@2.1.4': @@ -1386,46 +954,20 @@ snapshots: loupe: 3.1.2 tinyrainbow: 1.2.0 - acorn-jsx@5.3.2(acorn@8.14.0): - dependencies: - acorn: 8.14.0 - acorn-typescript@1.4.13(acorn@8.14.0): dependencies: acorn: 8.14.0 acorn@8.14.0: {} - ajv@6.12.6: - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - argparse@2.0.1: {} - aria-query@5.3.2: {} assertion-error@2.0.1: {} axobject-query@4.1.0: {} - balanced-match@1.0.2: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - cac@6.7.14: {} - callsites@3.1.0: {} - chai@5.1.2: dependencies: assertion-error: 2.0.1 @@ -1434,39 +976,16 @@ snapshots: loupe: 3.1.2 pathval: 2.0.0 - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - check-error@2.1.1: {} - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - concat-map@0.0.1: {} - cookie@0.6.0: {} - cross-spawn@7.0.5: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - - cssesc@3.0.0: {} - debug@4.3.7: dependencies: ms: 2.1.3 deep-eql@5.0.2: {} - deep-is@0.1.4: {} - deepmerge@4.3.1: {} devalue@5.1.1: {} @@ -1497,222 +1016,38 @@ snapshots: '@esbuild/win32-ia32': 0.21.5 '@esbuild/win32-x64': 0.21.5 - escape-string-regexp@4.0.0: {} - - eslint-compat-utils@0.5.1(eslint@9.14.0): - dependencies: - eslint: 9.14.0 - semver: 7.6.3 - - eslint-config-prettier@9.1.0(eslint@9.14.0): - dependencies: - eslint: 9.14.0 - - eslint-plugin-svelte@2.46.0(eslint@9.14.0)(svelte@5.1.15): - dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@9.14.0) - '@jridgewell/sourcemap-codec': 1.5.0 - eslint: 9.14.0 - eslint-compat-utils: 0.5.1(eslint@9.14.0) - esutils: 2.0.3 - known-css-properties: 0.35.0 - postcss: 8.4.49 - postcss-load-config: 3.1.4(postcss@8.4.49) - postcss-safe-parser: 6.0.0(postcss@8.4.49) - postcss-selector-parser: 6.1.2 - semver: 7.6.3 - svelte-eslint-parser: 0.43.0(svelte@5.1.15) - optionalDependencies: - svelte: 5.1.15 - transitivePeerDependencies: - - ts-node - - eslint-scope@7.2.2: - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - - eslint-scope@8.2.0: - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - - eslint-visitor-keys@3.4.3: {} - - eslint-visitor-keys@4.2.0: {} - - eslint@9.14.0: - dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@9.14.0) - '@eslint-community/regexpp': 4.12.1 - '@eslint/config-array': 0.18.0 - '@eslint/core': 0.7.0 - '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.14.0 - '@eslint/plugin-kit': 0.2.2 - '@humanfs/node': 0.16.6 - '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.4.1 - '@types/estree': 1.0.6 - '@types/json-schema': 7.0.15 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.5 - debug: 4.3.7 - escape-string-regexp: 4.0.0 - eslint-scope: 8.2.0 - eslint-visitor-keys: 4.2.0 - espree: 10.3.0 - esquery: 1.6.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 8.0.0 - find-up: 5.0.0 - glob-parent: 6.0.2 - ignore: 5.3.2 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - json-stable-stringify-without-jsonify: 1.0.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.4 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - esm-env@1.1.4: {} - espree@10.3.0: - dependencies: - acorn: 8.14.0 - acorn-jsx: 5.3.2(acorn@8.14.0) - eslint-visitor-keys: 4.2.0 - - espree@9.6.1: - dependencies: - acorn: 8.14.0 - acorn-jsx: 5.3.2(acorn@8.14.0) - eslint-visitor-keys: 3.4.3 - - esquery@1.6.0: - dependencies: - estraverse: 5.3.0 - esrap@1.2.2: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 '@types/estree': 1.0.6 - esrecurse@4.3.0: - dependencies: - estraverse: 5.3.0 - - estraverse@5.3.0: {} - estree-walker@3.0.3: dependencies: '@types/estree': 1.0.6 - esutils@2.0.3: {} - expect-type@1.1.0: {} - fast-deep-equal@3.1.3: {} - - fast-json-stable-stringify@2.1.0: {} - - fast-levenshtein@2.0.6: {} - - file-entry-cache@8.0.0: - dependencies: - flat-cache: 4.0.1 - - find-up@5.0.0: - dependencies: - locate-path: 6.0.0 - path-exists: 4.0.0 - - flat-cache@4.0.1: - dependencies: - flatted: 3.3.1 - keyv: 4.5.4 - - flatted@3.3.1: {} - fsevents@2.3.3: optional: true - glob-parent@6.0.2: - dependencies: - is-glob: 4.0.3 - - globals@14.0.0: {} - globals@15.12.0: {} globalyzer@0.1.0: {} globrex@0.1.2: {} - has-flag@4.0.0: {} - - ignore@5.3.2: {} - - import-fresh@3.3.0: - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - import-meta-resolve@4.1.0: {} - imurmurhash@0.1.4: {} - - is-extglob@2.1.1: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - is-reference@3.0.2: dependencies: '@types/estree': 1.0.6 - isexe@2.0.0: {} - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - json-buffer@3.0.1: {} - - json-schema-traverse@0.4.1: {} - - json-stable-stringify-without-jsonify@1.0.1: {} - - keyv@4.5.4: - dependencies: - json-buffer: 3.0.1 - kleur@4.1.5: {} - known-css-properties@0.35.0: {} - - levn@0.4.1: - dependencies: - prelude-ls: 1.2.1 - type-check: 0.4.0 - - lilconfig@2.1.0: {} - locate-character@3.0.0: {} - locate-path@6.0.0: - dependencies: - p-locate: 5.0.0 - - lodash.merge@4.6.2: {} - loupe@3.1.2: {} magic-string@0.30.12: @@ -1727,10 +1062,6 @@ snapshots: svelte: 5.1.15 vfile-message: 2.0.4 - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - mri@1.2.0: {} mrmime@2.0.0: {} @@ -1739,32 +1070,11 @@ snapshots: nanoid@3.3.7: {} - natural-compare@1.4.0: {} - - optionator@0.9.4: + otplib@12.0.1: dependencies: - deep-is: 0.1.4 - fast-levenshtein: 2.0.6 - levn: 0.4.1 - prelude-ls: 1.2.1 - type-check: 0.4.0 - word-wrap: 1.2.5 - - p-limit@3.1.0: - dependencies: - yocto-queue: 0.1.0 - - p-locate@5.0.0: - dependencies: - p-limit: 3.1.0 - - parent-module@1.0.1: - dependencies: - callsites: 3.1.0 - - path-exists@4.0.0: {} - - path-key@3.1.1: {} + '@otplib/core': 12.0.1 + '@otplib/preset-default': 12.0.1 + '@otplib/preset-v11': 12.0.1 pathe@1.1.2: {} @@ -1772,34 +1082,12 @@ snapshots: picocolors@1.1.1: {} - postcss-load-config@3.1.4(postcss@8.4.49): - dependencies: - lilconfig: 2.1.0 - yaml: 1.10.2 - optionalDependencies: - postcss: 8.4.49 - - postcss-safe-parser@6.0.0(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - - postcss-scss@4.0.9(postcss@8.4.49): - dependencies: - postcss: 8.4.49 - - postcss-selector-parser@6.1.2: - dependencies: - cssesc: 3.0.0 - util-deprecate: 1.0.2 - postcss@8.4.49: dependencies: nanoid: 3.3.7 picocolors: 1.1.1 source-map-js: 1.2.1 - prelude-ls@1.2.1: {} - prettier-plugin-svelte@3.2.8(prettier@3.3.3)(svelte@5.1.15): dependencies: prettier: 3.3.3 @@ -1811,10 +1099,6 @@ snapshots: prismjs@1.29.0: {} - punycode@2.3.1: {} - - resolve-from@4.0.0: {} - rollup@4.25.0: dependencies: '@types/estree': 1.0.6 @@ -1843,16 +1127,8 @@ snapshots: dependencies: mri: 1.2.0 - semver@7.6.3: {} - set-cookie-parser@2.7.1: {} - shebang-command@2.0.0: - dependencies: - shebang-regex: 3.0.0 - - shebang-regex@3.0.0: {} - siginfo@2.0.0: {} sirv@3.0.0: @@ -1867,22 +1143,6 @@ snapshots: std-env@3.8.0: {} - strip-json-comments@3.1.1: {} - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - svelte-eslint-parser@0.43.0(svelte@5.1.15): - dependencies: - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - postcss: 8.4.49 - postcss-scss: 4.0.9(postcss@8.4.49) - optionalDependencies: - svelte: 5.1.15 - svelte@5.1.15: dependencies: '@ampproject/remapping': 2.3.0 @@ -1899,7 +1159,7 @@ snapshots: magic-string: 0.30.12 zimmerframe: 1.1.2 - text-table@0.2.0: {} + thirty-two@1.0.2: {} tiny-glob@0.2.9: dependencies: @@ -1918,20 +1178,10 @@ snapshots: totalist@3.0.1: {} - type-check@0.4.0: - dependencies: - prelude-ls: 1.2.1 - unist-util-stringify-position@2.0.3: dependencies: '@types/unist': 2.0.11 - uri-js@4.4.1: - dependencies: - punycode: 2.3.1 - - util-deprecate@1.0.2: {} - vfile-message@2.0.4: dependencies: '@types/unist': 2.0.11 @@ -1999,19 +1249,9 @@ snapshots: - supports-color - terser - which@2.0.2: - dependencies: - isexe: 2.0.0 - why-is-node-running@2.3.0: dependencies: siginfo: 2.0.0 stackback: 0.0.2 - word-wrap@1.2.5: {} - - yaml@1.10.2: {} - - yocto-queue@0.1.0: {} - zimmerframe@1.1.2: {} diff --git a/packages/src/lib/components/nav-bar.svelte b/packages/src/lib/components/nav-bar.svelte new file mode 100644 index 0000000..3ab1b74 --- /dev/null +++ b/packages/src/lib/components/nav-bar.svelte @@ -0,0 +1,66 @@ + + + + + diff --git a/packages/src/routes/+error.svelte b/packages/src/routes/+error.svelte new file mode 100644 index 0000000..363b3d8 --- /dev/null +++ b/packages/src/routes/+error.svelte @@ -0,0 +1,25 @@ + + +
+

Supawiki

+ +

Oops... Something went wrong!

+ + {#if $page.status === 401} +

Error {$page.status}: {$page.error?.message}

+

+ Go to log in page. +

+ {:else} +

{$page.status}: {$page.error?.message}

+

We are looking into it.

+ {/if} +
+ + diff --git a/packages/src/routes/+layout.svelte b/packages/src/routes/+layout.svelte new file mode 100644 index 0000000..5876c9f --- /dev/null +++ b/packages/src/routes/+layout.svelte @@ -0,0 +1,56 @@ + + +
+ + + +
+ + diff --git a/packages/src/routes/+page.svelte b/packages/src/routes/+page.svelte index cc88df0..fbe11e5 100644 --- a/packages/src/routes/+page.svelte +++ b/packages/src/routes/+page.svelte @@ -1,2 +1,14 @@ -

Welcome to SvelteKit

-

Visit svelte.dev/docs/kit to read the documentation

+ + + + Home page + + + +
+

Private facts

+ + +
diff --git a/packages/src/routes/auth/login/+page.svelte b/packages/src/routes/auth/login/+page.svelte new file mode 100644 index 0000000..f20220b --- /dev/null +++ b/packages/src/routes/auth/login/+page.svelte @@ -0,0 +1,8 @@ + + Login page + + + + From ec1ed9e487b3f3d2f55a03569efa3fe818f2dc1e Mon Sep 17 00:00:00 2001 From: Rodrigo Pinto Date: Sun, 24 Nov 2024 01:23:54 -0300 Subject: [PATCH 2/9] One time password TOTP implementation (incomplete. Token is generated, but not verified.) --- packages/package.json | 3 +- packages/pnpm-lock.yaml | 278 ++++++++++++++---- packages/src/lib/index.js | 1 - packages/src/lib/utils.js | 17 ++ packages/src/routes/+error.svelte | 2 +- packages/src/routes/+layout.svelte | 5 +- .../src/routes/auth/login/+page.server.js | 16 + packages/src/routes/auth/login/+page.svelte | 27 ++ packages/vite.config.js | 18 +- 9 files changed, 307 insertions(+), 60 deletions(-) delete mode 100644 packages/src/lib/index.js create mode 100644 packages/src/lib/utils.js create mode 100644 packages/src/routes/auth/login/+page.server.js diff --git a/packages/package.json b/packages/package.json index e4e9082..b194197 100644 --- a/packages/package.json +++ b/packages/package.json @@ -24,6 +24,7 @@ "vitest": "^2.0.4" }, "dependencies": { - "otplib": "^12.0.1" + "otpauth": "^9.3.5", + "qrcode": "^1.5.4" } } diff --git a/packages/pnpm-lock.yaml b/packages/pnpm-lock.yaml index 62ff74e..ce62954 100644 --- a/packages/pnpm-lock.yaml +++ b/packages/pnpm-lock.yaml @@ -8,9 +8,12 @@ importers: .: dependencies: - otplib: - specifier: ^12.0.1 - version: 12.0.1 + otpauth: + specifier: ^9.3.5 + version: 9.3.5 + qrcode: + specifier: ^1.5.4 + version: 1.5.4 devDependencies: '@sveltejs/adapter-auto': specifier: ^3.0.0 @@ -205,20 +208,9 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@otplib/core@12.0.1': - resolution: {integrity: sha512-4sGntwbA/AC+SbPhbsziRiD+jNDdIzsZ3JUyfZwjtKyc/wufl1pnSIaG4Uqx8ymPagujub0o92kgBnB89cuAMA==} - - '@otplib/plugin-crypto@12.0.1': - resolution: {integrity: sha512-qPuhN3QrT7ZZLcLCyKOSNhuijUi9G5guMRVrxq63r9YNOxxQjPm59gVxLM+7xGnHnM6cimY57tuKsjK7y9LM1g==} - - '@otplib/plugin-thirty-two@12.0.1': - resolution: {integrity: sha512-MtT+uqRso909UkbrrYpJ6XFjj9D+x2Py7KjTO9JDPhL0bJUYVu5kFP4TFZW4NFAywrAtFRxOVY261u0qwb93gA==} - - '@otplib/preset-default@12.0.1': - resolution: {integrity: sha512-xf1v9oOJRyXfluBhMdpOkr+bsE+Irt+0D5uHtvg6x1eosfmHCsCC6ej/m7FXiWqdo0+ZUI6xSKDhJwc8yfiOPQ==} - - '@otplib/preset-v11@12.0.1': - resolution: {integrity: sha512-9hSetMI7ECqbFiKICrNa4w70deTUfArtwXykPUvSHWOdzOlfa9ajglu7mNCntlvxycTiOAXkQGwjQCzzDEMRMg==} + '@noble/hashes@1.5.0': + resolution: {integrity: sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==} + engines: {node: ^14.21.3 || >=16} '@polka/url@1.0.0-next.28': resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} @@ -390,6 +382,14 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + aria-query@5.3.2: resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} engines: {node: '>= 0.4'} @@ -406,6 +406,10 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + chai@5.1.2: resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} engines: {node: '>=12'} @@ -414,6 +418,16 @@ packages: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} + cliui@6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + cookie@0.6.0: resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} engines: {node: '>= 0.6'} @@ -427,6 +441,10 @@ packages: supports-color: optional: true + decamelize@1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + deep-eql@5.0.2: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} @@ -438,6 +456,12 @@ packages: devalue@5.1.1: resolution: {integrity: sha512-maua5KUiapvEwiEAe+XnlZ3Rh0GD+qI1J/nb9vrJc3muPXvcF/8gXYTWF76+5DAqHyDUtOIImEuo0YKE9mshVw==} + dijkstrajs@1.0.3: + resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} @@ -456,11 +480,19 @@ packages: resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} engines: {node: '>=12.0.0'} + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + globals@15.12.0: resolution: {integrity: sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==} engines: {node: '>=18'} @@ -474,6 +506,10 @@ packages: import-meta-resolve@4.1.0: resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + is-reference@3.0.2: resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} @@ -484,6 +520,10 @@ packages: locate-character@3.0.0: resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + loupe@3.1.2: resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} @@ -511,8 +551,24 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - otplib@12.0.1: - resolution: {integrity: sha512-xDGvUOQjop7RDgxTQ+o4pOol0/3xSZzawTiPKRrHnQWAy0WjhNs/5HdIDJCrqC4MBynmjXgULc6YfioaxZeFgg==} + otpauth@9.3.5: + resolution: {integrity: sha512-jQyqOuQExeIl4YIiOUz4TdEcamgAgPX6UYeeS9Iit4lkvs7bwHb0JNDqchGRccbRfvWHV6oRwH36tOsVmc+7hQ==} + + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} @@ -524,6 +580,10 @@ packages: picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + pngjs@5.0.0: + resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} + engines: {node: '>=10.13.0'} + postcss@8.4.49: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} @@ -546,6 +606,18 @@ packages: resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} engines: {node: '>=6'} + qrcode@1.5.4: + resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==} + engines: {node: '>=10.13.0'} + hasBin: true + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + rollup@4.25.0: resolution: {integrity: sha512-uVbClXmR6wvx5R1M3Od4utyLUxrmOcEm3pAtMphn73Apq19PDtHpgZoEvqH2YnnaNUuvKmg2DgRd2Sqv+odyqg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -555,6 +627,9 @@ packages: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} engines: {node: '>=6'} + set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + set-cookie-parser@2.7.1: resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} @@ -575,14 +650,18 @@ packages: std-env@3.8.0: resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==} + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + svelte@5.1.15: resolution: {integrity: sha512-cs2JYADrEorRCB4AUCHMvwperwAKcn/mz7w1xzVOv3fG6TmAS2n13JYHH8/uDCFbqVyRSXXlL+vA5RDwGUXEZg==} engines: {node: '>=18'} - thirty-two@1.0.2: - resolution: {integrity: sha512-OEI0IWCe+Dw46019YLl6V10Us5bi574EvlJEOcAkB29IzQ/mYD1A6RyNHLjZPiHCmuodxvgF6U+vZO1L15lxVA==} - engines: {node: '>=0.2.6'} - tiny-glob@0.2.9: resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} @@ -683,11 +762,29 @@ packages: jsdom: optional: true + which-module@2.0.1: + resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + why-is-node-running@2.3.0: resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} engines: {node: '>=8'} hasBin: true + wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + + y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + + yargs-parser@18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + + yargs@15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} + zimmerframe@1.1.2: resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==} @@ -784,28 +881,7 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@otplib/core@12.0.1': {} - - '@otplib/plugin-crypto@12.0.1': - dependencies: - '@otplib/core': 12.0.1 - - '@otplib/plugin-thirty-two@12.0.1': - dependencies: - '@otplib/core': 12.0.1 - thirty-two: 1.0.2 - - '@otplib/preset-default@12.0.1': - dependencies: - '@otplib/core': 12.0.1 - '@otplib/plugin-crypto': 12.0.1 - '@otplib/plugin-thirty-two': 12.0.1 - - '@otplib/preset-v11@12.0.1': - dependencies: - '@otplib/core': 12.0.1 - '@otplib/plugin-crypto': 12.0.1 - '@otplib/plugin-thirty-two': 12.0.1 + '@noble/hashes@1.5.0': {} '@polka/url@1.0.0-next.28': {} @@ -960,6 +1036,12 @@ snapshots: acorn@8.14.0: {} + ansi-regex@5.0.1: {} + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + aria-query@5.3.2: {} assertion-error@2.0.1: {} @@ -968,6 +1050,8 @@ snapshots: cac@6.7.14: {} + camelcase@5.3.1: {} + chai@5.1.2: dependencies: assertion-error: 2.0.1 @@ -978,18 +1062,36 @@ snapshots: check-error@2.1.1: {} + cliui@6.0.0: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + cookie@0.6.0: {} debug@4.3.7: dependencies: ms: 2.1.3 + decamelize@1.2.0: {} + deep-eql@5.0.2: {} deepmerge@4.3.1: {} devalue@5.1.1: {} + dijkstrajs@1.0.3: {} + + emoji-regex@8.0.0: {} + esbuild@0.21.5: optionalDependencies: '@esbuild/aix-ppc64': 0.21.5 @@ -1029,9 +1131,16 @@ snapshots: expect-type@1.1.0: {} + find-up@4.1.0: + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + fsevents@2.3.3: optional: true + get-caller-file@2.0.5: {} + globals@15.12.0: {} globalyzer@0.1.0: {} @@ -1040,6 +1149,8 @@ snapshots: import-meta-resolve@4.1.0: {} + is-fullwidth-code-point@3.0.0: {} + is-reference@3.0.2: dependencies: '@types/estree': 1.0.6 @@ -1048,6 +1159,10 @@ snapshots: locate-character@3.0.0: {} + locate-path@5.0.0: + dependencies: + p-locate: 4.1.0 + loupe@3.1.2: {} magic-string@0.30.12: @@ -1070,11 +1185,21 @@ snapshots: nanoid@3.3.7: {} - otplib@12.0.1: + otpauth@9.3.5: dependencies: - '@otplib/core': 12.0.1 - '@otplib/preset-default': 12.0.1 - '@otplib/preset-v11': 12.0.1 + '@noble/hashes': 1.5.0 + + p-limit@2.3.0: + dependencies: + p-try: 2.2.0 + + p-locate@4.1.0: + dependencies: + p-limit: 2.3.0 + + p-try@2.2.0: {} + + path-exists@4.0.0: {} pathe@1.1.2: {} @@ -1082,6 +1207,8 @@ snapshots: picocolors@1.1.1: {} + pngjs@5.0.0: {} + postcss@8.4.49: dependencies: nanoid: 3.3.7 @@ -1099,6 +1226,16 @@ snapshots: prismjs@1.29.0: {} + qrcode@1.5.4: + dependencies: + dijkstrajs: 1.0.3 + pngjs: 5.0.0 + yargs: 15.4.1 + + require-directory@2.1.1: {} + + require-main-filename@2.0.0: {} + rollup@4.25.0: dependencies: '@types/estree': 1.0.6 @@ -1127,6 +1264,8 @@ snapshots: dependencies: mri: 1.2.0 + set-blocking@2.0.0: {} + set-cookie-parser@2.7.1: {} siginfo@2.0.0: {} @@ -1143,6 +1282,16 @@ snapshots: std-env@3.8.0: {} + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + svelte@5.1.15: dependencies: '@ampproject/remapping': 2.3.0 @@ -1159,8 +1308,6 @@ snapshots: magic-string: 0.30.12 zimmerframe: 1.1.2 - thirty-two@1.0.2: {} - tiny-glob@0.2.9: dependencies: globalyzer: 0.1.0 @@ -1249,9 +1396,38 @@ snapshots: - supports-color - terser + which-module@2.0.1: {} + why-is-node-running@2.3.0: dependencies: siginfo: 2.0.0 stackback: 0.0.2 + wrap-ansi@6.2.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + y18n@4.0.3: {} + + yargs-parser@18.1.3: + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + + yargs@15.4.1: + dependencies: + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 4.2.3 + which-module: 2.0.1 + y18n: 4.0.3 + yargs-parser: 18.1.3 + zimmerframe@1.1.2: {} diff --git a/packages/src/lib/index.js b/packages/src/lib/index.js deleted file mode 100644 index 856f2b6..0000000 --- a/packages/src/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// place files you want to import through the `$lib` alias in this folder. diff --git a/packages/src/lib/utils.js b/packages/src/lib/utils.js new file mode 100644 index 0000000..3b57df3 --- /dev/null +++ b/packages/src/lib/utils.js @@ -0,0 +1,17 @@ +import * as OTPAuth from 'otpauth' + +export const totp = () => { + let totp = new OTPAuth.TOTP({ + issuer: 'Private data', + label: 'otp', + algorithm: 'SHA1', + digits: 6, + period: 300, + }) + + let token = totp.generate() + let seconds = totp.period - (Math.floor(Date.now() / 1000) % totp.period) + let uri = totp.toString() + + return { token, seconds, uri } +} diff --git a/packages/src/routes/+error.svelte b/packages/src/routes/+error.svelte index 363b3d8..ab33839 100644 --- a/packages/src/routes/+error.svelte +++ b/packages/src/routes/+error.svelte @@ -3,7 +3,7 @@
-

Supawiki

+

Private facts

Oops... Something went wrong!

diff --git a/packages/src/routes/+layout.svelte b/packages/src/routes/+layout.svelte index 5876c9f..cec6efe 100644 --- a/packages/src/routes/+layout.svelte +++ b/packages/src/routes/+layout.svelte @@ -14,13 +14,14 @@ --font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif; --navbar-height: 3em; --theme-background: white; - --theme-color: #555555; + --theme-color: #444; } .content { text-align: center; margin: auto; height: calc(100vh - 6em); + max-width: 60em; overflow: clip; overflow-y: auto; } @@ -34,7 +35,7 @@ overflow: clip; } - :global(button){ + :global(button) { margin: 1em; width: 10em; height: 3em; diff --git a/packages/src/routes/auth/login/+page.server.js b/packages/src/routes/auth/login/+page.server.js new file mode 100644 index 0000000..d2135a1 --- /dev/null +++ b/packages/src/routes/auth/login/+page.server.js @@ -0,0 +1,16 @@ +import qrcode from 'qrcode' +import { totp } from '$lib/utils' + +export const load = () => { + const { token, seconds, uri } = totp() + + return { token, seconds, uri } +} + +export const actions = { + getTotp: async ({ request }) => { + const { token, seconds, uri } = totp() + + return { token, seconds, uri } + } +} diff --git a/packages/src/routes/auth/login/+page.svelte b/packages/src/routes/auth/login/+page.svelte index f20220b..1b033c8 100644 --- a/packages/src/routes/auth/login/+page.svelte +++ b/packages/src/routes/auth/login/+page.svelte @@ -1,3 +1,24 @@ + + Login page @@ -5,4 +26,10 @@ diff --git a/packages/vite.config.js b/packages/vite.config.js index d76fc8a..f2866e7 100644 --- a/packages/vite.config.js +++ b/packages/vite.config.js @@ -2,9 +2,19 @@ import { defineConfig } from 'vitest/config'; import { sveltekit } from '@sveltejs/kit/vite'; export default defineConfig({ - plugins: [sveltekit()], + plugins: [sveltekit()], - test: { - include: ['src/**/*.{test,spec}.{js,ts}'] - } + server:{ + port:5555, + strictPort:false, + }, + + preview:{ + port:5554, + strictPort:false, + }, + + test: { + include: ['src/**/*.{test,spec}.{js,ts}'] + } }); From 70a92cb0e6bc27bcb9e2294eae8871909d0e7fea Mon Sep 17 00:00:00 2001 From: Rodrigo Pinto Date: Fri, 29 Nov 2024 17:22:29 -0300 Subject: [PATCH 3/9] QR code generator, update readme Added a QR code code generator that might be used for auth. Updated README with better instructions for setting up Tahoe grid. --- .gitignore | 1 + README.md | 61 +++-- packages/package.json | 4 +- packages/pnpm-lock.yaml | 224 +----------------- packages/src/lib/utils.js | 5 +- .../src/routes/auth/login/+page.server.js | 1 - packages/src/routes/auth/login/+page.svelte | 15 ++ 7 files changed, 75 insertions(+), 236 deletions(-) diff --git a/.gitignore b/.gitignore index b02f060..c30a259 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules +gm0 introducer storage0 storage1 diff --git a/README.md b/README.md index 8553018..f677fa0 100644 --- a/README.md +++ b/README.md @@ -60,37 +60,66 @@ The project issue tracker is getting migrated. For now, feel free to open an iss Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. -### Set up the developer environment +### Install dependencies -Initiate Tahoe-LAFS servers (one introducer, two storage servers and a client server): +```sh +uv venv +source .venv/bin/activate +uv pip install -r pyproject.toml +``` + +### Set up developer environment + +Setup a grid: + +```sh +grid-manager --config ./gm0 create +``` + +Initiate Tahoe-LAFS servers (one introducer, two storage servers and a client server, each in a separate terminal window): Introducer server: ```sh -.venv/bin/tahoe create-introducer --listen=tcp --port=5555 --location=tcp:localhost:5555 ./introducer -.venv/bin/tahoe -d introducer run &>/dev/null & +.venv/bin/tahoe create-introducer --listen=tcp --port=6001 --location=tcp:localhost:6001 ./introducer +.venv/bin/tahoe -d introducer run ``` Two storage servers: ```sh -.venv/bin/tahoe create-node --introducer $(cat introducer/private/introducer.furl) --nickname storage0 --webport 6001 --location tcp:localhost:6003 --port 6003 ./storage0 -.venv/bin/tahoe create-node --introducer $(cat introducer/private/introducer.furl) --nickname storage1 --webport 6101 --location tcp:localhost:6103 --port 6103 ./storage1 -.venv/bin/tahoe -d storage0 run &>/dev/null & -.venv/bin/tahoe -d storage1 run &>/dev/null & +.venv/bin/tahoe create-node --introducer $(cat introducer/private/introducer.furl) --nickname storage0 --webport 6101 --location tcp:localhost:6102 --port 6102 ./storage0 +.venv/bin/tahoe create-node --introducer $(cat introducer/private/introducer.furl) --nickname storage1 --webport 6201 --location tcp:localhost:6202 --port 6202 ./storage1 +.venv/bin/tahoe -d storage0 run +.venv/bin/tahoe -d storage1 run ``` +Add storage servers to grid and create certificates: + +```sh +grid-manager --config ./gm0 add storage0 $(cat storage0/node.pubkey) +grid-manager --config ./gm0 add storage1 $(cat storage1/node.pubkey) +grid-manager --config ./gm0 sign storage0 > ./storage0/gridmanager.cert 30 +grid-manager --config ./gm0 sign storage1 > ./storage1/gridmanager.cert 30 +``` + +Edit storage servers to make them announce their certificates to the grid. Edit the `tahoe.cfg` file in `storage0` and `storage1`: + +```sh +[storage] +grid_management = true + +[grid_manager_certificates] +default = gridmanager.cert +``` + +Re-start storage servers. + Client: ```sh -.venv/bin/tahoe create-client --introducer $(cat introducer/private/introducer.furl) --nickname webapp --webport 6401 --shares-total=3 --shares-needed=2 --shares-happy=3 ./webapp -.venv/bin/tahoe -d webapp run &>/dev/null & -``` - -The commands should return four PIDs. Note them down to kill them later, when finished, with: - -```sh -kill -9 +.venv/bin/tahoe create-client --introducer $(cat introducer/private/introducer.furl) --nickname webapp --webport 6301 --shares-total=3 --shares-needed=2 --shares-happy=3 ./webapp +.venv/bin/tahoe -d webapp run ``` ### Getting ready for your first pull request diff --git a/packages/package.json b/packages/package.json index b194197..1f26553 100644 --- a/packages/package.json +++ b/packages/package.json @@ -24,7 +24,7 @@ "vitest": "^2.0.4" }, "dependencies": { - "otpauth": "^9.3.5", - "qrcode": "^1.5.4" + "@paulmillr/qr": "^0.3.0", + "otpauth": "^9.3.5" } } diff --git a/packages/pnpm-lock.yaml b/packages/pnpm-lock.yaml index ce62954..7292531 100644 --- a/packages/pnpm-lock.yaml +++ b/packages/pnpm-lock.yaml @@ -8,12 +8,12 @@ importers: .: dependencies: + '@paulmillr/qr': + specifier: ^0.3.0 + version: 0.3.0 otpauth: specifier: ^9.3.5 version: 9.3.5 - qrcode: - specifier: ^1.5.4 - version: 1.5.4 devDependencies: '@sveltejs/adapter-auto': specifier: ^3.0.0 @@ -212,6 +212,9 @@ packages: resolution: {integrity: sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==} engines: {node: ^14.21.3 || >=16} + '@paulmillr/qr@0.3.0': + resolution: {integrity: sha512-3s/cagXuoXTA2gWSfSfJNanNgm2ifmqgoX8WLOs5//3qrIJ3WWHFjqFqCxvYGf46Afwv6PctT9eAOXLDGwp96Q==} + '@polka/url@1.0.0-next.28': resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} @@ -382,14 +385,6 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - aria-query@5.3.2: resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} engines: {node: '>= 0.4'} @@ -406,10 +401,6 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} - camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - chai@5.1.2: resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} engines: {node: '>=12'} @@ -418,16 +409,6 @@ packages: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} - cliui@6.0.0: - resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - cookie@0.6.0: resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} engines: {node: '>= 0.6'} @@ -441,10 +422,6 @@ packages: supports-color: optional: true - decamelize@1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} - deep-eql@5.0.2: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} @@ -456,12 +433,6 @@ packages: devalue@5.1.1: resolution: {integrity: sha512-maua5KUiapvEwiEAe+XnlZ3Rh0GD+qI1J/nb9vrJc3muPXvcF/8gXYTWF76+5DAqHyDUtOIImEuo0YKE9mshVw==} - dijkstrajs@1.0.3: - resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} @@ -480,19 +451,11 @@ packages: resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} engines: {node: '>=12.0.0'} - find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} - fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - globals@15.12.0: resolution: {integrity: sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==} engines: {node: '>=18'} @@ -506,10 +469,6 @@ packages: import-meta-resolve@4.1.0: resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - is-reference@3.0.2: resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} @@ -520,10 +479,6 @@ packages: locate-character@3.0.0: resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} - locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} - loupe@3.1.2: resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} @@ -554,22 +509,6 @@ packages: otpauth@9.3.5: resolution: {integrity: sha512-jQyqOuQExeIl4YIiOUz4TdEcamgAgPX6UYeeS9Iit4lkvs7bwHb0JNDqchGRccbRfvWHV6oRwH36tOsVmc+7hQ==} - p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} - - p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} - - p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - - path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} @@ -580,10 +519,6 @@ packages: picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - pngjs@5.0.0: - resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} - engines: {node: '>=10.13.0'} - postcss@8.4.49: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} @@ -606,18 +541,6 @@ packages: resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} engines: {node: '>=6'} - qrcode@1.5.4: - resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==} - engines: {node: '>=10.13.0'} - hasBin: true - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - require-main-filename@2.0.0: - resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} - rollup@4.25.0: resolution: {integrity: sha512-uVbClXmR6wvx5R1M3Od4utyLUxrmOcEm3pAtMphn73Apq19PDtHpgZoEvqH2YnnaNUuvKmg2DgRd2Sqv+odyqg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -627,9 +550,6 @@ packages: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} engines: {node: '>=6'} - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - set-cookie-parser@2.7.1: resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} @@ -650,14 +570,6 @@ packages: std-env@3.8.0: resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==} - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - svelte@5.1.15: resolution: {integrity: sha512-cs2JYADrEorRCB4AUCHMvwperwAKcn/mz7w1xzVOv3fG6TmAS2n13JYHH8/uDCFbqVyRSXXlL+vA5RDwGUXEZg==} engines: {node: '>=18'} @@ -762,29 +674,11 @@ packages: jsdom: optional: true - which-module@2.0.1: - resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - why-is-node-running@2.3.0: resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} engines: {node: '>=8'} hasBin: true - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - y18n@4.0.3: - resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} - - yargs-parser@18.1.3: - resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} - engines: {node: '>=6'} - - yargs@15.4.1: - resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} - engines: {node: '>=8'} - zimmerframe@1.1.2: resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==} @@ -883,6 +777,8 @@ snapshots: '@noble/hashes@1.5.0': {} + '@paulmillr/qr@0.3.0': {} + '@polka/url@1.0.0-next.28': {} '@rollup/rollup-android-arm-eabi@4.25.0': @@ -1036,12 +932,6 @@ snapshots: acorn@8.14.0: {} - ansi-regex@5.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - aria-query@5.3.2: {} assertion-error@2.0.1: {} @@ -1050,8 +940,6 @@ snapshots: cac@6.7.14: {} - camelcase@5.3.1: {} - chai@5.1.2: dependencies: assertion-error: 2.0.1 @@ -1062,36 +950,18 @@ snapshots: check-error@2.1.1: {} - cliui@6.0.0: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - cookie@0.6.0: {} debug@4.3.7: dependencies: ms: 2.1.3 - decamelize@1.2.0: {} - deep-eql@5.0.2: {} deepmerge@4.3.1: {} devalue@5.1.1: {} - dijkstrajs@1.0.3: {} - - emoji-regex@8.0.0: {} - esbuild@0.21.5: optionalDependencies: '@esbuild/aix-ppc64': 0.21.5 @@ -1131,16 +1001,9 @@ snapshots: expect-type@1.1.0: {} - find-up@4.1.0: - dependencies: - locate-path: 5.0.0 - path-exists: 4.0.0 - fsevents@2.3.3: optional: true - get-caller-file@2.0.5: {} - globals@15.12.0: {} globalyzer@0.1.0: {} @@ -1149,8 +1012,6 @@ snapshots: import-meta-resolve@4.1.0: {} - is-fullwidth-code-point@3.0.0: {} - is-reference@3.0.2: dependencies: '@types/estree': 1.0.6 @@ -1159,10 +1020,6 @@ snapshots: locate-character@3.0.0: {} - locate-path@5.0.0: - dependencies: - p-locate: 4.1.0 - loupe@3.1.2: {} magic-string@0.30.12: @@ -1189,26 +1046,12 @@ snapshots: dependencies: '@noble/hashes': 1.5.0 - p-limit@2.3.0: - dependencies: - p-try: 2.2.0 - - p-locate@4.1.0: - dependencies: - p-limit: 2.3.0 - - p-try@2.2.0: {} - - path-exists@4.0.0: {} - pathe@1.1.2: {} pathval@2.0.0: {} picocolors@1.1.1: {} - pngjs@5.0.0: {} - postcss@8.4.49: dependencies: nanoid: 3.3.7 @@ -1226,16 +1069,6 @@ snapshots: prismjs@1.29.0: {} - qrcode@1.5.4: - dependencies: - dijkstrajs: 1.0.3 - pngjs: 5.0.0 - yargs: 15.4.1 - - require-directory@2.1.1: {} - - require-main-filename@2.0.0: {} - rollup@4.25.0: dependencies: '@types/estree': 1.0.6 @@ -1264,8 +1097,6 @@ snapshots: dependencies: mri: 1.2.0 - set-blocking@2.0.0: {} - set-cookie-parser@2.7.1: {} siginfo@2.0.0: {} @@ -1282,16 +1113,6 @@ snapshots: std-env@3.8.0: {} - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - svelte@5.1.15: dependencies: '@ampproject/remapping': 2.3.0 @@ -1396,38 +1217,9 @@ snapshots: - supports-color - terser - which-module@2.0.1: {} - why-is-node-running@2.3.0: dependencies: siginfo: 2.0.0 stackback: 0.0.2 - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - y18n@4.0.3: {} - - yargs-parser@18.1.3: - dependencies: - camelcase: 5.3.1 - decamelize: 1.2.0 - - yargs@15.4.1: - dependencies: - cliui: 6.0.0 - decamelize: 1.2.0 - find-up: 4.1.0 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - require-main-filename: 2.0.0 - set-blocking: 2.0.0 - string-width: 4.2.3 - which-module: 2.0.1 - y18n: 4.0.3 - yargs-parser: 18.1.3 - zimmerframe@1.1.2: {} diff --git a/packages/src/lib/utils.js b/packages/src/lib/utils.js index 3b57df3..7108523 100644 --- a/packages/src/lib/utils.js +++ b/packages/src/lib/utils.js @@ -1,12 +1,15 @@ import * as OTPAuth from 'otpauth' +let secret = new OTPAuth.Secret({ size: 20 }) + export const totp = () => { let totp = new OTPAuth.TOTP({ issuer: 'Private data', label: 'otp', - algorithm: 'SHA1', + algorithm: 'SHA256', digits: 6, period: 300, + secret }) let token = totp.generate() diff --git a/packages/src/routes/auth/login/+page.server.js b/packages/src/routes/auth/login/+page.server.js index d2135a1..687058e 100644 --- a/packages/src/routes/auth/login/+page.server.js +++ b/packages/src/routes/auth/login/+page.server.js @@ -1,4 +1,3 @@ -import qrcode from 'qrcode' import { totp } from '$lib/utils' export const load = () => { diff --git a/packages/src/routes/auth/login/+page.svelte b/packages/src/routes/auth/login/+page.svelte index 1b033c8..3ab596a 100644 --- a/packages/src/routes/auth/login/+page.svelte +++ b/packages/src/routes/auth/login/+page.svelte @@ -1,5 +1,6 @@ - - - Login page - - - - - - diff --git a/packages/src/routes/dashboard/+page.server.js b/packages/src/routes/dashboard/+page.server.js new file mode 100644 index 0000000..31d7b35 --- /dev/null +++ b/packages/src/routes/dashboard/+page.server.js @@ -0,0 +1,12 @@ +import { fail } from '@sveltejs/kit' + +export const actions = { + createCapKey: async ({ request }) => { + try { + return { success: true, endpoint: 'createCapKey', capKey: 123 } + } catch (err) { + console.log({ err }) + return fail(500, { endpoint: 'createCapKey', error: err }) + } + } +} diff --git a/packages/src/routes/dashboard/+page.svelte b/packages/src/routes/dashboard/+page.svelte new file mode 100644 index 0000000..12e2e50 --- /dev/null +++ b/packages/src/routes/dashboard/+page.svelte @@ -0,0 +1,136 @@ + + + + Private Facts dashboard + + +

Dashboard

+ +{#if !capKey && !newCapKey} +
+
+ + + +
+ +
+ +
+
+{:else if !capKey && newCapKey} +
+ + + +
+

Attention!

+ +

This is your new cap key. You need it to access your folders and files. It will not be saved nor ever shown again.

+ +

Copy it now and save it somewhere safe.

+ +

If you lose your cap key you will not be able to access your files anymore. You will have to create a new cap key and upload new files and folders.

+ +
+ + +
+ + +
+
+{:else} +

File tree

+

{capKey}

+{/if} + + From 463e18015fdaa07975e2ff03801f29ed7c23feaa Mon Sep 17 00:00:00 2001 From: Rodrigo Pinto Date: Mon, 2 Dec 2024 01:48:51 -0300 Subject: [PATCH 5/9] API API with first two endpoint to fetch information from Tahoe to SvelteKit. --- packages/.env.example | 1 + packages/package.json | 3 ++ packages/pnpm-lock.yaml | 10 +++++ packages/src/routes/api/[slug]/+server.js | 41 +++++++++++++++++++ packages/src/routes/dashboard/+page.server.js | 28 ++++++++++++- packages/src/routes/dashboard/+page.svelte | 34 +++++++++++---- 6 files changed, 107 insertions(+), 10 deletions(-) create mode 100644 packages/.env.example create mode 100644 packages/src/routes/api/[slug]/+server.js diff --git a/packages/.env.example b/packages/.env.example new file mode 100644 index 0000000..735a2f8 --- /dev/null +++ b/packages/.env.example @@ -0,0 +1 @@ +TAHOE_API=http://x.x.x.x:xxxx diff --git a/packages/package.json b/packages/package.json index 1aa2ec1..2667812 100644 --- a/packages/package.json +++ b/packages/package.json @@ -22,5 +22,8 @@ "svelte": "^5.0.0", "vite": "^5.0.3", "vitest": "^2.0.4" + }, + "dependencies": { + "dotenv": "^16.4.5" } } diff --git a/packages/pnpm-lock.yaml b/packages/pnpm-lock.yaml index 500f8fc..8011f10 100644 --- a/packages/pnpm-lock.yaml +++ b/packages/pnpm-lock.yaml @@ -7,6 +7,10 @@ settings: importers: .: + dependencies: + dotenv: + specifier: ^16.4.5 + version: 16.4.5 devDependencies: '@sveltejs/adapter-auto': specifier: ^3.0.0 @@ -419,6 +423,10 @@ packages: devalue@5.1.1: resolution: {integrity: sha512-maua5KUiapvEwiEAe+XnlZ3Rh0GD+qI1J/nb9vrJc3muPXvcF/8gXYTWF76+5DAqHyDUtOIImEuo0YKE9mshVw==} + dotenv@16.4.5: + resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} + engines: {node: '>=12'} + esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} @@ -941,6 +949,8 @@ snapshots: devalue@5.1.1: {} + dotenv@16.4.5: {} + esbuild@0.21.5: optionalDependencies: '@esbuild/aix-ppc64': 0.21.5 diff --git a/packages/src/routes/api/[slug]/+server.js b/packages/src/routes/api/[slug]/+server.js new file mode 100644 index 0000000..5fb2ed2 --- /dev/null +++ b/packages/src/routes/api/[slug]/+server.js @@ -0,0 +1,41 @@ +import { json } from '@sveltejs/kit' +import { env } from '$env/dynamic/private' + +export const POST = async ({ params, request }) => { + const { slug } = params + const body = await request.json() + + switch (slug) { + case 'createAlias': { + try { + const url = `${env.TAHOE_API}/uri?t=mkdir` + const response = await fetch(url, { method: 'POST' }) + const capKey = await response.json() + + return json({ success: true, capKey }) + } catch (err) { + console.log({ err }) + return json({ success: false, code: 500, error: err }) + } + } + + case 'listDirectories': { + try { + const encodedCapKey = body.capKey.replace(/:/g, '%3A') + const url = `${env.TAHOE_API}/uri/${encodedCapKey}?t=json` + const response = await fetch(url, { method: 'GET' }) + const list = await response.json() + console.log({ url, list }) + + return json({ success: true, list }) + } catch (err) { + console.log({ err }) + return json({ success: false, code: 500, error: err }) + } + } + + default: { + return json({ success: true }) + } + } +} diff --git a/packages/src/routes/dashboard/+page.server.js b/packages/src/routes/dashboard/+page.server.js index 31d7b35..9022ddb 100644 --- a/packages/src/routes/dashboard/+page.server.js +++ b/packages/src/routes/dashboard/+page.server.js @@ -1,12 +1,36 @@ import { fail } from '@sveltejs/kit' export const actions = { - createCapKey: async ({ request }) => { + createCapKey: async ({ request, fetch }) => { try { - return { success: true, endpoint: 'createCapKey', capKey: 123 } + const response = await fetch('/api/createAlias', { method: 'POST' }) + const jsonResponse = await response.json() + + return { endpoint: 'createCapKey', capKey: jsonResponse.capKey } } catch (err) { console.log({ err }) return fail(500, { endpoint: 'createCapKey', error: err }) } + }, + + listDirectories: async ({ request, fetch }) => { + const formData = await request.formData() + const capKey = formData.get('capKeyInput') + const encoded = encodeURIComponent(capKey) + + try { + const response = await fetch('/api/listDirectories', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ capKey: encoded }) + }) + const jsonResponse = await response.json() + if (!jsonResponse.success) throw new Error(jsonResponse.error) + + return { endpoint: 'listDirectories', list: jsonResponse.list, capKey } + } catch (err) { + console.log({ err }) + return fail(500, { endpoint: 'listDirectories', error: err }) + } } } diff --git a/packages/src/routes/dashboard/+page.svelte b/packages/src/routes/dashboard/+page.svelte index 12e2e50..5f61d7d 100644 --- a/packages/src/routes/dashboard/+page.svelte +++ b/packages/src/routes/dashboard/+page.svelte @@ -2,6 +2,7 @@ import { enhance } from '$app/forms' import { beforeNavigate } from '$app/navigation' + let { form } = $props() let capKey = $state() let capKeyInput = $state() let newCapKey = $state() @@ -19,7 +20,17 @@ const enhanceForm = () => { return async ({ result, update }) => { await update() - newCapKey = result.data.capKey + + if (result.status === 200) { + switch (result.data.endpoint) { + case 'createCapKey': { + newCapKey = result.data.capKey + } + case 'listDirectories': { + capKey = result.data.capKey + } + } + } } } @@ -29,6 +40,12 @@ alert('Please confirm you copied and saved the cap key.') } }) + + $effect(() => { + if (form?.error) console.log({ error: form.error }) + }) + + $effect(() => console.log({ form })) @@ -37,19 +54,20 @@

Dashboard

-{#if !capKey && !newCapKey} +{#if !form?.capKey && !newCapKey}
-
+
- - -
+ + + +
-{:else if !capKey && newCapKey} +{:else if !form?.capKey && newCapKey}
@@ -73,7 +91,7 @@
{:else}

File tree

-

{capKey}

+

{form.capKey}

{/if} diff --git a/packages/src/routes/+layout.svelte b/packages/src/routes/+layout.svelte index ca6ba13..04f4a13 100644 --- a/packages/src/routes/+layout.svelte +++ b/packages/src/routes/+layout.svelte @@ -10,10 +10,11 @@ From 5072a69333f57ca9cd24063fa7d4f9705cbd38fb Mon Sep 17 00:00:00 2001 From: Rodrigo Pinto Date: Tue, 3 Dec 2024 13:24:57 -0300 Subject: [PATCH 7/9] Improving error handling --- packages/src/lib/components/nav-bar.svelte | 1 - packages/src/routes/+layout.svelte | 1 + packages/src/routes/api/[slug]/+server.js | 13 +++---- packages/src/routes/dashboard/+page.server.js | 9 ++++- packages/src/routes/dashboard/+page.svelte | 38 ++++++++----------- 5 files changed, 30 insertions(+), 32 deletions(-) diff --git a/packages/src/lib/components/nav-bar.svelte b/packages/src/lib/components/nav-bar.svelte index 0b4e043..324fc91 100644 --- a/packages/src/lib/components/nav-bar.svelte +++ b/packages/src/lib/components/nav-bar.svelte @@ -24,7 +24,6 @@ border-bottom: solid thin var(--border-color); position: sticky; top: 0; - z-index: 10; } ul { diff --git a/packages/src/routes/+layout.svelte b/packages/src/routes/+layout.svelte index 04f4a13..c993c27 100644 --- a/packages/src/routes/+layout.svelte +++ b/packages/src/routes/+layout.svelte @@ -14,6 +14,7 @@ --button-color: #f6f6f6; --font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif; --navbar-height: 3em; + --shade-background: rgba(0, 0, 0, 0.2); --shade-color: #eee; --theme-background: white; --theme-color: #444; diff --git a/packages/src/routes/api/[slug]/+server.js b/packages/src/routes/api/[slug]/+server.js index 5fb2ed2..5bf9371 100644 --- a/packages/src/routes/api/[slug]/+server.js +++ b/packages/src/routes/api/[slug]/+server.js @@ -13,9 +13,9 @@ export const POST = async ({ params, request }) => { const capKey = await response.json() return json({ success: true, capKey }) - } catch (err) { - console.log({ err }) - return json({ success: false, code: 500, error: err }) + } catch (error) { + console.log({ error }) + return json({ success: false, code: 500, error }) } } @@ -25,12 +25,11 @@ export const POST = async ({ params, request }) => { const url = `${env.TAHOE_API}/uri/${encodedCapKey}?t=json` const response = await fetch(url, { method: 'GET' }) const list = await response.json() - console.log({ url, list }) return json({ success: true, list }) - } catch (err) { - console.log({ err }) - return json({ success: false, code: 500, error: err }) + } catch (error) { + console.log({ error }) + return json({ success: false, code: 500, error, message: error.cause.message }) } } diff --git a/packages/src/routes/dashboard/+page.server.js b/packages/src/routes/dashboard/+page.server.js index 9022ddb..6ac93d3 100644 --- a/packages/src/routes/dashboard/+page.server.js +++ b/packages/src/routes/dashboard/+page.server.js @@ -25,7 +25,14 @@ export const actions = { body: JSON.stringify({ capKey: encoded }) }) const jsonResponse = await response.json() - if (!jsonResponse.success) throw new Error(jsonResponse.error) + + if (!jsonResponse.success) { + if (jsonResponse.message.includes('ECONNREFUSED')) { + return { error: 'Tahoe server may be offline.' } + } else { + throw new Error(jsonResponse.error) + } + } return { endpoint: 'listDirectories', list: jsonResponse.list, capKey } } catch (err) { diff --git a/packages/src/routes/dashboard/+page.svelte b/packages/src/routes/dashboard/+page.svelte index 266932e..478e1e3 100644 --- a/packages/src/routes/dashboard/+page.svelte +++ b/packages/src/routes/dashboard/+page.svelte @@ -7,6 +7,8 @@ let capKey = $state() let capKeyInput = $state() let newCapKey = $state() + let modalTitle = $state() + let modalText = $state() let checked = $state(false) let showModal = $state(false) @@ -39,7 +41,9 @@ beforeNavigate(({ cancel }) => { if (newCapKey && !capKey) { cancel() - alert('Please confirm you copied and saved the cap key.') + modalTitle = 'Warning' + modalText = 'Please confirm you copied and saved the cap key.' + showModal = true } }) @@ -48,6 +52,14 @@ }) $effect(() => console.log({ form })) + + $effect(() => { + if (form?.error) { + modalTitle = 'Error' + modalText = form.error + showModal = true + } + }) @@ -56,8 +68,6 @@

Dashboard

- - {#if !capKey && !newCapKey}
@@ -112,7 +122,8 @@ {/if} showModal = false}> -

Modal

+

{modalTitle}

+

{modalText}

@@ -131,25 +142,6 @@ margin: 1em 0; } - .cap-key { - display: flex; - margin: auto 0 2em 0; - } - - .cap-key label { - min-width: 5em; - margin: auto 0; - } - - .cap-key input { - width: 100%; - } - - .cap-key button { - min-width: 10em; - margin: auto 0 auto 1em; - } - .cap-key-div { max-width: 45em; margin: 0 auto; From 1885d43fa642d321643e2fd3bd7155b684a55be7 Mon Sep 17 00:00:00 2001 From: Rodrigo Pinto Date: Thu, 5 Dec 2024 18:25:20 -0300 Subject: [PATCH 8/9] Added more endpoints and modals - Added endpoints to create folders, upload files and unlink files and folders; - Added modals to show loading indicators, confirmation and warnings. --- packages/src/lib/components/loading.svelte | 34 ++++ packages/src/lib/utils/tahoe.js | 79 ++++++++++ packages/src/routes/+layout.svelte | 1 + packages/src/routes/api/[slug]/+server.js | 40 ----- packages/src/routes/dashboard/+page.server.js | 103 +++++++++--- packages/src/routes/dashboard/+page.svelte | 148 +++++++++++++++--- 6 files changed, 324 insertions(+), 81 deletions(-) create mode 100644 packages/src/lib/components/loading.svelte create mode 100644 packages/src/lib/utils/tahoe.js delete mode 100644 packages/src/routes/api/[slug]/+server.js diff --git a/packages/src/lib/components/loading.svelte b/packages/src/lib/components/loading.svelte new file mode 100644 index 0000000..f5b5af4 --- /dev/null +++ b/packages/src/lib/components/loading.svelte @@ -0,0 +1,34 @@ +
+ +
+ + + + + +
+ + diff --git a/packages/src/lib/utils/tahoe.js b/packages/src/lib/utils/tahoe.js new file mode 100644 index 0000000..7c6051a --- /dev/null +++ b/packages/src/lib/utils/tahoe.js @@ -0,0 +1,79 @@ +import { env } from '$env/dynamic/private' + +export const createAlias = () => { + return new Promise(async (resolve, reject) => { + try { + const url = `${env.TAHOE_API}/uri?t=mkdir` + const response = await fetch(url, { method: 'POST' }) + const capKey = await response.json() + + return resolve({ capKey }) + } catch (error) { + return reject(error) + } + }) +} + +export const listDirectories = (capKey) => { + return new Promise(async (resolve, reject) => { + try { + const url = `${env.TAHOE_API}/uri/${capKey}?t=json` + const response = await fetch(url, { method: 'GET' }) + const list = await response.json() + + return resolve({ list }) + } catch (error) { + return reject(error) + } + }) +} + +export const createDirectory = (path, dirName) => { + return new Promise(async (resolve, reject) => { + try { + const url = `${env.TAHOE_API}/uri/${path}?t=mkdir&name=${dirName}` + const response = await fetch(url, { method: 'POST' }) + + if (response.status !== 200) { + return json({ success: false, status: response.status, message: response.statusText }) + } + + const cap = await response.json() + + return resolve({ cap }) + } catch (error) { + return reject(error) + } + }) +} + +export const uploadFile = (path, file) => { + return new Promise(async (resolve, reject) => { + const url = `${env.TAHOE_API}/uri/${path}` + + try { + const response = await fetch(url, { + method: 'PUT', + body: file + }) + + return resolve() + } catch (error) { + console.log({ error }) + return reject(error) + } + }) +} + +export const unlink = (path) => { + return new Promise(async (resolve, reject) => { + try { + const url = `${env.TAHOE_API}/uri/${path}` + const response = await fetch(url, { method: 'DELETE' }) + + return resolve() + } catch (error) { + return reject(error) + } + }) +} diff --git a/packages/src/routes/+layout.svelte b/packages/src/routes/+layout.svelte index c993c27..e660e59 100644 --- a/packages/src/routes/+layout.svelte +++ b/packages/src/routes/+layout.svelte @@ -16,6 +16,7 @@ --navbar-height: 3em; --shade-background: rgba(0, 0, 0, 0.2); --shade-color: #eee; + --shade-loading: rgba(0, 0, 0, 0.3); --theme-background: white; --theme-color: #444; } diff --git a/packages/src/routes/api/[slug]/+server.js b/packages/src/routes/api/[slug]/+server.js deleted file mode 100644 index 5bf9371..0000000 --- a/packages/src/routes/api/[slug]/+server.js +++ /dev/null @@ -1,40 +0,0 @@ -import { json } from '@sveltejs/kit' -import { env } from '$env/dynamic/private' - -export const POST = async ({ params, request }) => { - const { slug } = params - const body = await request.json() - - switch (slug) { - case 'createAlias': { - try { - const url = `${env.TAHOE_API}/uri?t=mkdir` - const response = await fetch(url, { method: 'POST' }) - const capKey = await response.json() - - return json({ success: true, capKey }) - } catch (error) { - console.log({ error }) - return json({ success: false, code: 500, error }) - } - } - - case 'listDirectories': { - try { - const encodedCapKey = body.capKey.replace(/:/g, '%3A') - const url = `${env.TAHOE_API}/uri/${encodedCapKey}?t=json` - const response = await fetch(url, { method: 'GET' }) - const list = await response.json() - - return json({ success: true, list }) - } catch (error) { - console.log({ error }) - return json({ success: false, code: 500, error, message: error.cause.message }) - } - } - - default: { - return json({ success: true }) - } - } -} diff --git a/packages/src/routes/dashboard/+page.server.js b/packages/src/routes/dashboard/+page.server.js index 6ac93d3..0f18f43 100644 --- a/packages/src/routes/dashboard/+page.server.js +++ b/packages/src/routes/dashboard/+page.server.js @@ -1,15 +1,15 @@ import { fail } from '@sveltejs/kit' +import { createAlias, createDirectory, listDirectories, unlink, uploadFile } from '$lib/utils/tahoe' export const actions = { createCapKey: async ({ request, fetch }) => { try { - const response = await fetch('/api/createAlias', { method: 'POST' }) - const jsonResponse = await response.json() + const { capKey } = await createAlias() - return { endpoint: 'createCapKey', capKey: jsonResponse.capKey } - } catch (err) { - console.log({ err }) - return fail(500, { endpoint: 'createCapKey', error: err }) + return { endpoint: 'createCapKey', capKey } + } catch (error) { + console.log({ error }) + return fail(500, { endpoint: 'createCapKey', error }) } }, @@ -19,25 +19,84 @@ export const actions = { const encoded = encodeURIComponent(capKey) try { - const response = await fetch('/api/listDirectories', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ capKey: encoded }) - }) - const jsonResponse = await response.json() + const { list } = await listDirectories(capKey) - if (!jsonResponse.success) { - if (jsonResponse.message.includes('ECONNREFUSED')) { - return { error: 'Tahoe server may be offline.' } - } else { - throw new Error(jsonResponse.error) - } + return { endpoint: 'listDirectories', list, capKey } + } catch (error) { + if (error.cause.message.includes('ECONNREFUSED')) { + return { error: 'Tahoe server may be offline.' } } - return { endpoint: 'listDirectories', list: jsonResponse.list, capKey } - } catch (err) { - console.log({ err }) - return fail(500, { endpoint: 'listDirectories', error: err }) + console.log({ error }) + return fail(500, { endpoint: 'listDirectories', error }) + } + }, + + createDirectory: async ({ request, fetch }) => { + const formData = await request.formData() + const capKey = formData.get('capKey') + const encoded = encodeURIComponent(capKey) + const dirName= formData.get('dirName') + let path = formData.get('path') + + if (path.length === 0) path = '/' + if (path.slice(0, 1) !== '/') path = '/' + path + if (path.slice(-1) !== '/') path = path + '/' + + path = encoded + encodeURI(path) + + try { + const { cap } = await createDirectory(path, dirName) + + return { success: true, endpoint: 'uploadFile' } + } catch (error) { + console.log({ error }) + return fail(500, { endpoint: 'uploadFile', error}) + } + }, + + uploadFile: async ({ request, fetch }) => { + const formData = await request.formData() + const capKey = formData.get('capKey') + const encoded = encodeURIComponent(capKey) + const file = formData.get('file') + let path = formData.get('path') + + if (path.length === 0) path = '/' + if (path.slice(0, 1) !== '/') path = '/' + path + if (path.slice(-1) !== '/') path = path + '/' + + path = encoded + encodeURI(path + file.name) + + try { + await uploadFile(path, file.name, file) + + return { success: true, endpoint: 'uploadFile' } + } catch (error) { + console.log({ error }) + return fail(500, { endpoint: 'uploadFile', error}) + } + }, + + deletePath: async ({ request, fetch }) => { + const formData = await request.formData() + const capKey = formData.get('capKey') + const encoded = encodeURIComponent(capKey) + const partialPath = formData.get('path') + const slash = partialPath.slice(0, 1) === '/' ? '' : '/' + const path = encoded + slash + partialPath + + if (partialPath.length === 0) { + return { success: false, endpoint: 'deletePath', error: 'Path cannot be empty.'} + } + + try { + await unlink(path) + + return { success: true, endpoint: 'deletePath' } + } catch (error) { + console.log({ error }) + return json({ success: false, code: 500, error }) } } } diff --git a/packages/src/routes/dashboard/+page.svelte b/packages/src/routes/dashboard/+page.svelte index 478e1e3..78a3799 100644 --- a/packages/src/routes/dashboard/+page.svelte +++ b/packages/src/routes/dashboard/+page.svelte @@ -1,16 +1,25 @@