diff --git a/.changes/config.json b/.changes/config.json new file mode 100644 index 00000000..70ddfdd5 --- /dev/null +++ b/.changes/config.json @@ -0,0 +1,159 @@ +{ + "gitSiteUrl": "https://github.com/tauri-apps/plugins-workspace/", + "pkgManagers": { + "javascript": { + "version": true, + "getPublishedVersion": "node ../../.scripts/covector/package-latest-version.cjs npm ${ pkgFile.pkg.name } ${ pkgFile.pkg.version }", + "publish": ["pnpm build", "pnpm publish --access public --no-git-checks"] + }, + "rust": { + "version": true, + "getPublishedVersion": "node ../../.scripts/covector/package-latest-version.cjs cargo ${ pkgFile.pkg.package.name } ${ pkgFile.pkg.package.version }", + "publish": [ + { + "command": "cargo package --no-verify", + "dryRunCommand": true + }, + { + "command": "echo '
\n

Cargo Publish

\n\n```'", + "dryRunCommand": true, + "pipe": true + }, + { + "command": "cargo publish", + "dryRunCommand": "cargo publish --dry-run", + "pipe": true + }, + { + "command": "echo '```\n\n
\n'", + "dryRunCommand": true, + "pipe": true + } + ] + } + }, + "packages": { + "authenticator": { + "path": "./plugins/authenticator", + "manager": "rust-disabled" + }, + "authenticator-js": { + "path": "./plugins/authenticator", + "manager": "javascript-disabled" + }, + + "autostart": { + "path": "./plugins/autostart", + "manager": "rust-disabled" + }, + "autostart-js": { + "path": "./plugins/autostart", + "manager": "javascript-disabled" + }, + + "fs-extra": { + "path": "./plugins/fs-extra", + "manager": "rust-disabled" + }, + "fs-extra-js": { + "path": "./plugins/fs-extra", + "manager": "javascript-disabled" + }, + + "fs-watch": { + "path": "./plugins/fs-watch", + "manager": "rust-disabled" + }, + "fs-watch-js": { + "path": "./plugins/fs-watch", + "manager": "javascript-disabled" + }, + + "localhost": { + "path": "./plugins/localhost", + "manager": "rust" + }, + + "log": { + "path": "./plugins/log", + "manager": "rust-disabled" + }, + "log-js": { + "path": "./plugins/log", + "manager": "javascript-disabled" + }, + + "persisted-scope": { + "path": "./plugins/persisted-scope", + "manager": "rust" + }, + + "positioner": { + "path": "./plugins/positioner", + "manager": "rust" + }, + "positioner-js": { + "path": "./plugins/positioner", + "manager": "javascript-disabled" + }, + + "single-instance": { + "path": "./plugins/single-instance", + "manager": "rust-disabled" + }, + + "sql": { + "path": "./plugins/sql", + "manager": "rust-disabled" + }, + "sql-js": { + "path": "./plugins/sql", + "manager": "javascript-disabled" + }, + + "store": { + "path": "./plugins/store", + "manager": "rust-disabled" + }, + "store-js": { + "path": "./plugins/store", + "manager": "javascript-disabled" + }, + + "stronghold": { + "path": "./plugins/stronghold", + "manager": "rust-disabled" + }, + "stronghold-js": { + "path": "./plugins/stronghold", + "manager": "javascript-disabled" + }, + + "upload": { + "path": "./plugins/upload", + "manager": "rust-disabled" + }, + "upload-js": { + "path": "./plugins/upload", + "manager": "javascript-disabled" + }, + + "websocket": { + "path": "./plugins/websocket", + "manager": "rust-disabled" + }, + "websocket-js": { + "path": "./plugins/websocket", + "manager": "javascript-disabled" + }, + + "window-state": { + "path": "./plugins/window-state", + "manager": "rust" + }, + "window-state-js": { + "path": "./plugins/window-state", + "manager": "javascript-disabled" + } + } +} diff --git a/.changes/readme.md b/.changes/readme.md new file mode 100644 index 00000000..002f4643 --- /dev/null +++ b/.changes/readme.md @@ -0,0 +1,30 @@ +# Changes + +##### via https://github.com/jbolda/covector + +As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend that it represents the overall change for organizational purposes. + +When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process. + +Use the following format: + +```md +--- +"package-a": patch +"package-b": minor +--- + +Change summary goes here +``` + +Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed. + +Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/). + +Given a version number MAJOR.MINOR.PATCH, increment the: + +- MAJOR version when you make incompatible API changes, +- MINOR version when you add functionality in a backwards compatible manner, and +- PATCH version when you make backwards compatible bug fixes. + +Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing). diff --git a/.eslintignore b/.eslintignore index 2c6d35b6..1c120ff5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ target node_modules -dist \ No newline at end of file +dist +dist-js diff --git a/.eslintrc.json b/.eslintrc.json index 4cc47de1..96b58264 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,7 +6,8 @@ "extends": [ "prettier", "eslint:recommended", - "plugin:@typescript-eslint/recommended" + "plugin:@typescript-eslint/recommended", + "plugin:security/recommended" ], "overrides": [], "parser": "@typescript-eslint/parser", diff --git a/.github/sync-to-mirrors.sh b/.github/sync-to-mirrors.sh index 1a65bf2d..52d4c27f 100755 --- a/.github/sync-to-mirrors.sh +++ b/.github/sync-to-mirrors.sh @@ -38,9 +38,10 @@ fi if [[ -z "$COMMIT_MESSAGE" ]]; then MONOREPO_COMMIT_MESSAGE=$(cd "${SOURCE_DIR:-.}" && git show -s --format=%B $GITHUB_SHA) - COMMIT_MESSAGE=$( printf "%s\n\nCommitted via a GitHub action: https://github.com/%s/actions/runs/%s\n" "$MONOREPO_COMMIT_MESSAGE" "$GITHUB_REPOSITORY" "$GITHUB_RUN_ID" ) + COMMIT_MESSAGE=$( printf "%s\n\nCommitted via a GitHub action: https://github.com/%s/actions/runs/%s" "$MONOREPO_COMMIT_MESSAGE" "$GITHUB_REPOSITORY" "$GITHUB_RUN_ID" ) fi -COMMIT_ORIGINAL_AUTHOR="${GITHUB_ACTOR} <${GITHUB_ACTOR}@users.noreply.github.com>" +COMMIT_ACTOR="${GITHUB_ACTOR} <${GITHUB_ACTOR}@users.noreply.github.com>" +COMMIT_AUTHOR=$(cd "${SOURCE_DIR:-.}" &&git show -s --format="%an <%ae>" $GITHUB_SHA) if [[ "$GITHUB_REF" =~ ^refs/heads/ ]]; then BRANCH=${GITHUB_REF#refs/heads/} @@ -59,6 +60,9 @@ fi # : > "$BUILD_BASE/changes.diff" +# Collect tags of current commit +readarray -t COMMIT_TAGS < <(git tag --points-at HEAD) + EXIT=0 while read -r PLUGIN_NAME; do printf "\n\n\e[7m Mirror: %s \e[0m\n" "$PLUGIN_NAME" @@ -98,12 +102,24 @@ while read -r PLUGIN_NAME; do if [[ -n "$FORCE_COMMIT" || -n "$(git status --porcelain)" ]]; then echo "Committing to $PLUGIN_NAME" - if git commit $FORCE_COMMIT --author="${COMMIT_ORIGINAL_AUTHOR}" -m "${COMMIT_MESSAGE}" && + GIT_CLI_COMMIT_MESSAGE=$( printf "%s \n\nCo-authored-by: %s" "$COMMIT_MESSAGE" "$COMMIT_ACTOR" ) + if git commit $FORCE_COMMIT --author="${COMMIT_AUTHOR}" -m "${GIT_CLI_COMMIT_MESSAGE}" && { [[ -z "$CI" ]] || git push origin "$BRANCH"; } # Only do the actual push from the GitHub Action then # echo "$BUILD_BASE/changes.diff" # git show --pretty= --src-prefix="a/$PLUGIN_NAME/" --dst-prefix="b/$PLUGIN_NAME/" >> "$BUILD_BASE/changes.diff" echo "https://github.com/tauri-apps/tauri-plugin-$PLUGIN_NAME/commit/$(git rev-parse HEAD)" + + # Add new tags + for FULL_TAG in "${COMMIT_TAGS[@]}"; do + if [[ "$FULL_TAG" =~ ^"$PLUGIN_NAME-js-v" ]]; then + TAG_NAME="${FULL_TAG#"$PLUGIN_NAME-js-"}" + echo "Creating tag $TAG_NAME" + git tag "${TAG_NAME}" -m "${GIT_CLI_COMMIT_MESSAGE}" + git push origin "${TAG_NAME}" + fi + done + echo "Completed $PLUGIN_NAME" else echo "::error::Commit of ${PLUGIN_NAME} failed" @@ -114,4 +130,4 @@ while read -r PLUGIN_NAME; do fi done < "$BUILD_BASE/mirrors.txt" -exit $EXIT \ No newline at end of file +exit $EXIT diff --git a/.github/workflows/audit-javascript.yml b/.github/workflows/audit-javascript.yml index 5d971450..19a7f4c8 100644 --- a/.github/workflows/audit-javascript.yml +++ b/.github/workflows/audit-javascript.yml @@ -6,14 +6,16 @@ on: - cron: "0 0 * * *" push: branches: - - dev + - v1 + - v2 paths: - ".github/workflows/audit-javascript.yml" - "**/pnpm-lock.yaml" - "**/package.json" pull_request: branches: - - dev + - v1 + - v2 paths: - ".github/workflows/audit-javascript.yml" - "**/pnpm-lock.yaml" @@ -38,8 +40,9 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: pnpm/action-setup@v2.2.4 + - uses: pnpm/action-setup@v2 with: + version: 7.x.x run_install: true - name: audit run: pnpm audit diff --git a/.github/workflows/audit-rust.yml b/.github/workflows/audit-rust.yml index f3ae64e2..1ec0225e 100644 --- a/.github/workflows/audit-rust.yml +++ b/.github/workflows/audit-rust.yml @@ -6,14 +6,16 @@ on: - cron: "0 0 * * *" push: branches: - - dev + - v1 + - v2 paths: - ".github/workflows/audit-rust.yml" - "**/Cargo.lock" - "**/Cargo.toml" pull_request: branches: - - dev + - v1 + - v2 paths: - ".github/workflows/audit-rust.yml" - "**/Cargo.lock" @@ -28,6 +30,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/audit-check@v1 + - uses: rustsec/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/covector-status.yml b/.github/workflows/covector-status.yml new file mode 100644 index 00000000..cb5a344a --- /dev/null +++ b/.github/workflows/covector-status.yml @@ -0,0 +1,16 @@ +name: covector status +on: [pull_request] + +jobs: + covector: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # required for use of git history + - name: covector status + uses: jbolda/covector/packages/action@covector-v0.8 + id: covector + with: + command: "status" diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml new file mode 100644 index 00000000..f6a67724 --- /dev/null +++ b/.github/workflows/covector-version-or-publish.yml @@ -0,0 +1,64 @@ +name: version or publish + +on: + push: + branches: + - v1 + +jobs: + version-or-publish: + runs-on: ubuntu-latest + timeout-minutes: 65 + outputs: + change: ${{ steps.covector.outputs.change }} + commandRan: ${{ steps.covector.outputs.commandRan }} + successfulPublish: ${{ steps.covector.outputs.successfulPublish }} + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # required for use of git history + + - uses: actions/setup-node@v3 + with: + node-version: "lts/*" + registry-url: "https://registry.npmjs.org" + + - uses: pnpm/action-setup@v2 + with: + version: 7.x.x + run_install: true + + - name: install webkit2gtk and libudev for [authenticator] + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev + + - name: cargo login + run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }} + + - name: git config + run: | + git config --global user.name "${{ github.event.pusher.name }}" + git config --global user.email "${{ github.event.pusher.email }}" + + - name: covector version or publish (publish when no change files present) + uses: jbolda/covector/packages/action@covector-v0.8 + id: covector + env: + NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} + with: + token: ${{ secrets.GITHUB_TOKEN }} + command: "version-or-publish" + createRelease: true + + - name: Create Pull Request With Versions Bumped + id: cpr + uses: tauri-apps/create-pull-request@v3 + if: steps.covector.outputs.commandRan == 'version' + with: + title: "Publish New Versions" + commit-message: "publish new versions" + labels: "version updates" + branch: "release" + body: ${{ steps.covector.outputs.change }} diff --git a/.github/workflows/lint-javascript.yml b/.github/workflows/lint-javascript.yml index 3fbe96e3..c2c0a1d3 100644 --- a/.github/workflows/lint-javascript.yml +++ b/.github/workflows/lint-javascript.yml @@ -3,7 +3,8 @@ name: Lint JavaScript on: push: branches: - - dev + - v1 + - v2 paths: - ".github/workflows/lint-javascript.yml" - "plugins/*/guest-js/**" @@ -13,7 +14,8 @@ on: - "**/package.json" pull_request: branches: - - dev + - v1 + - v2 paths: - ".github/workflows/lint-javascript.yml" - "plugins/*/guest-js/**" @@ -41,8 +43,9 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: pnpm/action-setup@v2.2.4 + - uses: pnpm/action-setup@v2 with: + version: 7.x.x run_install: true - name: eslint run: pnpm lint @@ -60,8 +63,9 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - uses: pnpm/action-setup@v2.2.4 + - uses: pnpm/action-setup@v2 with: + version: 7.x.x run_install: true - name: prettier check run: pnpm format-check diff --git a/.github/workflows/lint-rust.yml b/.github/workflows/lint-rust.yml index da353a56..f724e838 100644 --- a/.github/workflows/lint-rust.yml +++ b/.github/workflows/lint-rust.yml @@ -3,14 +3,16 @@ name: Lint Rust on: push: branches: - - dev + - v1 + - v2 paths: - ".github/workflows/lint-rust.yml" - "plugins/*/src/**" - "**/Cargo.toml" pull_request: branches: - - dev + - v1 + - v2 paths: - ".github/workflows/lint-rust.yml" - "plugins/*/src/**" @@ -32,7 +34,7 @@ jobs: - name: install webkit2gtk and libudev for [authenticator] run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 libudev-dev + sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev - name: Install clippy with stable toolchain uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/msrv-check.yml b/.github/workflows/msrv-check.yml new file mode 100644 index 00000000..807bbcad --- /dev/null +++ b/.github/workflows/msrv-check.yml @@ -0,0 +1,55 @@ +name: Check MSRV + +on: + push: + branches: + - v1 + - v2 + paths: + - ".github/workflows/msrv-check.yml" + - "plugins/*/src/**" + - "**/Cargo.toml" + - "**/Cargo.lock" + pull_request: + branches: + - v1 + - v2 + paths: + - ".github/workflows/msrv-check.yml" + - "plugins/*/src/**" + - "**/Cargo.toml" + - "**/Cargo.lock" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + msrv: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v3 + + - name: install webkit2gtk and libudev for [authenticator] + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev + + - uses: dtolnay/rust-toolchain@1.64.0 + + - uses: Swatinem/rust-cache@v2 + + - name: build + run: cargo build --workspace --exclude 'tauri-plugin-sql' --all-targets --all-features + + - name: build sql:sqlite + run: cargo build --package 'tauri-plugin-sql' --all-targets --features sqlite + + - name: build sql:mysql + run: cargo build --package 'tauri-plugin-sql' --all-targets --features mysql + + - name: build sql:postgres + run: cargo build --package 'tauri-plugin-sql' --all-targets --features postgres diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 51521aab..82da46fc 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -4,7 +4,8 @@ on: workflow_dispatch: push: branches: - - dev + - v1 + - v2 concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,6 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + + - name: Fetch git tags + run: git fetch origin 'refs/tags/*:refs/tags/*' + - name: Cache pnpm modules uses: actions/cache@v3 with: @@ -22,14 +27,19 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}- + - uses: actions/setup-node@v3 with: node-version: 18 - - uses: pnpm/action-setup@v2.2.4 + + - uses: pnpm/action-setup@v2 with: + version: 7.x.x run_install: true + - name: Build packages run: pnpm build + - name: Sync run: .github/sync-to-mirrors.sh env: diff --git a/.scripts/covector/package-latest-version.cjs b/.scripts/covector/package-latest-version.cjs new file mode 100644 index 00000000..9ff107c3 --- /dev/null +++ b/.scripts/covector/package-latest-version.cjs @@ -0,0 +1,56 @@ +#!/usr/bin/env node +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +/* +This script is solely intended to be run as part of the `covector publish` step to +check the latest version of a crate, considering the current minor version. +*/ + +const https = require("https"); + +const kind = process.argv[2]; +const packageName = process.argv[3]; +const packageVersion = process.argv[4]; +const target = packageVersion.substring(0, packageVersion.lastIndexOf(".")); + +let url = null; +switch (kind) { + case "cargo": + url = `https://crates.io/api/v1/crates/${packageName}`; + break; + case "npm": + url = `https://registry.npmjs.org/${packageName}`; + break; + default: + throw new Error("unexpected kind " + kind); +} + +const options = { + headers: { + "Content-Type": "application/json", + Accept: "application/json", + "User-Agent": "tauri (https://github.com/tauri-apps/tauri)", + }, +}; + +https.get(url, options, (response) => { + let chunks = []; + response.on("data", function (chunk) { + chunks.push(chunk); + }); + + response.on("end", function () { + const data = JSON.parse(chunks.join("")); + if (kind === "cargo") { + const versions = data.versions.filter((v) => v.num.startsWith(target)); + console.log(versions.length ? versions[0].num : "0.0.0"); + } else if (kind === "npm") { + const versions = Object.keys(data.versions).filter((v) => + v.startsWith(target) + ); + console.log(versions[versions.length - 1] || "0.0.0"); + } + }); +}); diff --git a/Cargo.lock b/Cargo.lock index 75568883..28de7d51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,6 +63,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -153,7 +162,7 @@ dependencies = [ "slab", "socket2", "waker-fn", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -174,7 +183,7 @@ checksum = "3b015a331cc64ebd1774ba119538573603427eaace0a1950c423ab971f903796" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -191,7 +200,7 @@ checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -201,7 +210,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" dependencies = [ "atk-sys", - "bitflags", + "bitflags 1.3.2", "glib", "libc", ] @@ -244,7 +253,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08cee7a0952628fde958e149507c2bb321ab4fccfafd225da0b20adc956ef88a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "devd-rs", "libc", @@ -311,6 +320,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f6e5df9abedba5099a01a6567c6086a6fbcff57af07c360d356737f9e0c644" + [[package]] name = "blake2" version = "0.10.6" @@ -436,7 +451,7 @@ version = "0.15.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cairo-sys-rs", "glib", "libc", @@ -561,7 +576,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "block", "cocoa-foundation", "core-foundation", @@ -577,7 +592,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" dependencies = [ - "bitflags", + "bitflags 1.3.2", "block", "core-foundation", "core-graphics-types", @@ -672,7 +687,7 @@ version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-graphics-types", "foreign-types", @@ -685,7 +700,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "foreign-types", "libc", @@ -787,7 +802,7 @@ dependencies = [ "proc-macro2", "quote", "smallvec", - "syn", + "syn 1.0.107", ] [[package]] @@ -797,7 +812,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e" dependencies = [ "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -807,7 +822,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -862,7 +877,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.107", ] [[package]] @@ -879,7 +894,7 @@ checksum = "357f40d1f06a24b60ae1fe122542c1fb05d28d32acb2aed064e84bc2ad1e252e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -903,7 +918,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.107", ] [[package]] @@ -914,9 +929,15 @@ checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.107", ] +[[package]] +name = "data-encoding" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" + [[package]] name = "der" version = "0.5.1" @@ -936,7 +957,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -949,7 +970,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn", + "syn 1.0.107", ] [[package]] @@ -1109,7 +1130,7 @@ checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1156,7 +1177,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1247,9 +1268,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -1257,9 +1278,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" @@ -1285,9 +1306,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" @@ -1306,32 +1327,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.16", ] [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -1360,7 +1381,7 @@ version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cairo-rs", "gdk-pixbuf", "gdk-sys", @@ -1376,7 +1397,7 @@ version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "gdk-pixbuf-sys", "gio", "glib", @@ -1489,7 +1510,7 @@ version = "0.15.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "futures-channel", "futures-core", "futures-io", @@ -1519,7 +1540,7 @@ version = "0.15.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "futures-channel", "futures-core", "futures-executor", @@ -1545,7 +1566,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1570,7 +1591,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" dependencies = [ - "aho-corasick", + "aho-corasick 0.7.20", "bstr", "fnv", "log", @@ -1595,7 +1616,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" dependencies = [ "atk", - "bitflags", + "bitflags 1.3.2", "cairo-rs", "field-offset", "futures-channel", @@ -1640,7 +1661,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1751,7 +1772,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1937,7 +1958,7 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" dependencies = [ - "bitflags", + "bitflags 1.3.2", "inotify-sys", "libc", ] @@ -1986,6 +2007,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "iota-crypto" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67d2bc02591d8a0427a8650204c259d0cad04d6cde0b6a4683906dc0b6dd3887" +dependencies = [ + "autocfg", +] + [[package]] name = "iota_stronghold" version = "1.0.5" @@ -1994,7 +2024,7 @@ checksum = "6c5baaa2460627283f54b968db7a38c9c754dc6059157cae64550ed1b79c91aa" dependencies = [ "bincode", "hkdf", - "iota-crypto", + "iota-crypto 0.15.3", "rust-argon2", "serde", "stronghold-derive", @@ -2046,7 +2076,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf053e7843f2812ff03ef5afe34bb9c06ffee120385caad4f6b9967fcd37d41c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "glib", "javascriptcore-rs-sys", ] @@ -2119,7 +2149,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libc", ] @@ -2384,7 +2414,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2411,7 +2441,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" dependencies = [ - "bitflags", + "bitflags 1.3.2", "jni-sys", "ndk-sys", "num_enum", @@ -2445,7 +2475,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset", @@ -2458,7 +2488,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ "autocfg", - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset", @@ -2492,11 +2522,11 @@ dependencies = [ [[package]] name = "notify" -version = "5.1.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ea850aa68a06e48fdb069c0ec44d0d64c8dbffa49bf3b6f7f0a901fdea1ba9" +checksum = "4d9ba6c734de18ca27c8cef5cd7058aa4ac9f63596131e4c7e41e579319032a2" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crossbeam-channel", "filetime", "fsevent-sys", @@ -2506,14 +2536,14 @@ dependencies = [ "mio", "serde", "walkdir", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] name = "notify-debouncer-mini" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e23e9fa24f094b143c1eb61f90ac6457de87be6987bc70746e0179f7dbc9007b" +checksum = "e55ee272914f4563a2f8b8553eb6811f3c0caea81c756346bad15b7e3ef969f0" dependencies = [ "crossbeam-channel", "notify", @@ -2628,7 +2658,16 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", ] [[package]] @@ -2677,7 +2716,7 @@ version = "0.10.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "foreign-types", "libc", @@ -2694,7 +2733,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2738,7 +2777,7 @@ version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" dependencies = [ - "bitflags", + "bitflags 1.3.2", "glib", "libc", "once_cell", @@ -2808,7 +2847,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2914,7 +2953,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2928,7 +2967,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2966,7 +3005,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -3020,7 +3059,7 @@ dependencies = [ "line-wrap", "quick-xml", "serde", - "time 0.3.17", + "time 0.3.20", ] [[package]] @@ -3029,7 +3068,7 @@ version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crc32fast", "flate2", "miniz_oxide", @@ -3046,7 +3085,7 @@ dependencies = [ "libc", "log", "wepoll-ffi", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -3103,7 +3142,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.107", "version_check", ] @@ -3126,9 +3165,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "c4ec6d5fe0b140acb27c9a0444118cf55bfbb4e0b259739429abb4521dd67c16" dependencies = [ "unicode-ident", ] @@ -3150,9 +3189,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" dependencies = [ "proc-macro2", ] @@ -3264,7 +3303,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -3284,7 +3323,7 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ - "aho-corasick", + "aho-corasick 0.7.20", "memchr", "regex-syntax", ] @@ -3489,7 +3528,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -3526,7 +3565,7 @@ version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -3549,7 +3588,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cssparser", "derive_more", "fxhash", @@ -3607,7 +3646,7 @@ checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -3629,7 +3668,7 @@ checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -3663,7 +3702,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -3685,7 +3724,7 @@ checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -3779,7 +3818,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0" dependencies = [ - "bitflags", + "bitflags 1.3.2", "gio", "glib", "libc", @@ -3793,7 +3832,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf" dependencies = [ - "bitflags", + "bitflags 1.3.2", "gio-sys", "glib-sys", "gobject-sys", @@ -3856,7 +3895,7 @@ dependencies = [ "ahash", "atoi", "base64 0.13.1", - "bitflags", + "bitflags 1.3.2", "byteorder", "bytes 1.4.0", "crc", @@ -3901,6 +3940,7 @@ dependencies = [ "sqlx-rt", "stringprep", "thiserror", + "time 0.3.20", "tokio-stream", "url", "webpki-roots", @@ -3923,7 +3963,7 @@ dependencies = [ "sha2 0.10.6", "sqlx-core", "sqlx-rt", - "syn", + "syn 1.0.107", "url", ] @@ -4003,7 +4043,7 @@ checksum = "2835db23c4724c05a2f85b81c4681f4aa8ea158edc8a7f4ad791c916fb766c2e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -4013,7 +4053,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d93abb10fbd11335d31c33a70b2523c0caab348215caa2ce6da04a268c30afcb" dependencies = [ "dirs", - "iota-crypto", + "iota-crypto 0.15.3", "libc", "libsodium-sys", "log", @@ -4044,7 +4084,7 @@ dependencies = [ "anyhow", "dirs-next", "hex", - "iota-crypto", + "iota-crypto 0.15.3", "once_cell", "paste", "serde", @@ -4076,6 +4116,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -4084,7 +4135,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", "unicode-xid", ] @@ -4120,7 +4171,7 @@ version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac8e6399427c8494f9849b58694754d7cc741293348a6836b6c8d2c5aa82d8e6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cairo-rs", "cc", "cocoa", @@ -4238,7 +4289,7 @@ dependencies = [ "sha2 0.10.6", "tauri-utils", "thiserror", - "time 0.3.17", + "time 0.3.20", "uuid 1.3.0", "walkdir", ] @@ -4252,17 +4303,17 @@ dependencies = [ "heck 0.4.0", "proc-macro2", "quote", - "syn", + "syn 1.0.107", "tauri-codegen", "tauri-utils", ] [[package]] name = "tauri-plugin-authenticator" -version = "0.1.0" +version = "0.0.0" dependencies = [ "authenticator", - "base64 0.13.1", + "base64 0.21.0", "chrono", "log", "once_cell", @@ -4278,7 +4329,7 @@ dependencies = [ [[package]] name = "tauri-plugin-autostart" -version = "0.1.0" +version = "0.0.0" dependencies = [ "auto-launch", "log", @@ -4290,7 +4341,7 @@ dependencies = [ [[package]] name = "tauri-plugin-fs-extra" -version = "0.1.0" +version = "0.0.0" dependencies = [ "log", "serde", @@ -4301,7 +4352,7 @@ dependencies = [ [[package]] name = "tauri-plugin-fs-watch" -version = "0.1.0" +version = "0.0.0" dependencies = [ "log", "notify", @@ -4327,7 +4378,7 @@ dependencies = [ [[package]] name = "tauri-plugin-log" -version = "0.1.0" +version = "0.0.0" dependencies = [ "byte-unit", "fern", @@ -4336,13 +4387,14 @@ dependencies = [ "serde_json", "serde_repr", "tauri", - "time 0.3.17", + "time 0.3.20", ] [[package]] name = "tauri-plugin-persisted-scope" version = "0.1.0" dependencies = [ + "aho-corasick 1.0.1", "bincode", "log", "serde", @@ -4353,7 +4405,7 @@ dependencies = [ [[package]] name = "tauri-plugin-positioner" -version = "0.2.7" +version = "1.0.4" dependencies = [ "log", "serde", @@ -4365,34 +4417,35 @@ dependencies = [ [[package]] name = "tauri-plugin-single-instance" -version = "0.1.0" +version = "0.0.0" dependencies = [ "log", "serde", "serde_json", "tauri", "thiserror", - "windows-sys", + "windows-sys 0.48.0", "zbus", ] [[package]] name = "tauri-plugin-sql" -version = "0.1.0" +version = "0.0.0" dependencies = [ - "futures", + "futures-core", "log", "serde", "serde_json", "sqlx", "tauri", "thiserror", + "time 0.3.20", "tokio", ] [[package]] name = "tauri-plugin-store" -version = "0.1.0" +version = "0.0.0" dependencies = [ "log", "serde", @@ -4403,10 +4456,10 @@ dependencies = [ [[package]] name = "tauri-plugin-stronghold" -version = "0.1.0" +version = "0.0.0" dependencies = [ "hex", - "iota-crypto", + "iota-crypto 0.19.0", "iota_stronghold", "log", "rand 0.8.5", @@ -4420,9 +4473,9 @@ dependencies = [ [[package]] name = "tauri-plugin-upload" -version = "0.1.0" +version = "0.0.0" dependencies = [ - "futures", + "futures-util", "log", "read-progress-stream", "reqwest", @@ -4436,7 +4489,7 @@ dependencies = [ [[package]] name = "tauri-plugin-websocket" -version = "0.1.0" +version = "0.0.0" dependencies = [ "futures-util", "log", @@ -4454,7 +4507,7 @@ name = "tauri-plugin-window-state" version = "0.1.0" dependencies = [ "bincode", - "bitflags", + "bitflags 2.0.0", "log", "serde", "serde_json", @@ -4587,7 +4640,7 @@ checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -4612,11 +4665,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.17" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" dependencies = [ "itoa 1.0.5", + "libc", + "num_threads", "serde", "time-core", "time-macros", @@ -4630,9 +4685,9 @@ checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" [[package]] name = "time-macros" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" dependencies = [ "time-core", ] @@ -4678,14 +4733,14 @@ dependencies = [ "num_cpus", "pin-project-lite", "socket2", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -4715,9 +4770,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" +checksum = "ec509ac96e9a0c43427c74f003127d953a265737636129424288d27cb5c4b12c" dependencies = [ "futures-util", "log", @@ -4793,7 +4848,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -4852,13 +4907,13 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" +checksum = "15fba1a6d6bb030745759a9a2a588bfe8490fc8b4751a277db3a0be1c9ebbf67" dependencies = [ - "base64 0.13.1", "byteorder", "bytes 1.4.0", + "data-encoding", "http", "httparse", "log", @@ -5124,7 +5179,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.107", "wasm-bindgen-shared", ] @@ -5158,7 +5213,7 @@ checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5198,7 +5253,7 @@ version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cairo-rs", "gdk", "gdk-sys", @@ -5223,7 +5278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3" dependencies = [ "atk-sys", - "bitflags", + "bitflags 1.3.2", "cairo-sys-rs", "gdk-pixbuf-sys", "gdk-sys", @@ -5278,7 +5333,7 @@ checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -5389,7 +5444,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7" dependencies = [ - "syn", + "syn 1.0.107", "windows-tokens", ] @@ -5405,13 +5460,61 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] [[package]] @@ -5422,9 +5525,15 @@ checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" [[package]] name = "windows_aarch64_msvc" @@ -5440,9 +5549,15 @@ checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" @@ -5458,9 +5573,15 @@ checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" [[package]] name = "windows_i686_msvc" @@ -5476,9 +5597,15 @@ checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" @@ -5494,15 +5621,27 @@ checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" [[package]] name = "windows_x86_64_msvc" @@ -5518,9 +5657,15 @@ checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winreg" @@ -5658,7 +5803,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn", + "syn 1.0.107", ] [[package]] @@ -5689,7 +5834,7 @@ checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", "synstructure", ] @@ -5716,5 +5861,5 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] diff --git a/README.md b/README.md index 57583af9..cc7541ae 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,12 @@ | [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ | | [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? | | [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ? | ? | +| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ? | ✅ | ? | ? | | [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ? | ? | | [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ? | ? | | [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? | | [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ? | ? | -| [websocket](plugins/websocket) | | ✅ | ✅ | ✅ | ? | ? | +| [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? | | [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ? | ? | + +_This repo and all plugins require a Rust version of at least **1.64**_ diff --git a/package.json b/package.json index 9ad65f84..8a842919 100644 --- a/package.json +++ b/package.json @@ -4,26 +4,29 @@ "license": "MIT or APACHE-2.0", "type": "module", "scripts": { - "build": "pnpm run -r --parallel --filter !plugins-workspace build", + "build": "pnpm run -r --parallel --filter !plugins-workspace --filter !\"./plugins/*/examples/**\" build", "lint": "eslint .", "format": "prettier --write .", "format-check": "prettier --check ." }, "devDependencies": { - "@rollup/plugin-node-resolve": "^15.0.1", - "@rollup/plugin-terser": "^0.4.0", - "@rollup/plugin-typescript": "^11.0.0", - "@typescript-eslint/eslint-plugin": "^5.0.0", - "@typescript-eslint/parser": "^5.46.1", - "eslint": "^8.0.1", - "eslint-config-prettier": "^8.5.0", - "eslint-config-standard-with-typescript": "^34.0.0", - "eslint-plugin-import": "^2.25.2", - "eslint-plugin-n": "^15.0.0", - "eslint-plugin-promise": "^6.0.0", - "prettier": "^2.8.1", - "rollup": "^3.7.4", - "typescript": "^4.9.4" + "@rollup/plugin-node-resolve": "^15.0.2", + "@rollup/plugin-terser": "^0.4.1", + "@rollup/plugin-typescript": "^11.1.0", + "@typescript-eslint/eslint-plugin": "^5.58.0", + "@typescript-eslint/parser": "^5.58.0", + "eslint": "^8.38.0", + "eslint-config-prettier": "^8.8.0", + "eslint-config-standard-with-typescript": "^34.0.1", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-n": "^16.0.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-security": "^1.7.1", + "prettier": "^2.8.7", + "rollup": "^3.20.4", + "typescript": "^5.0.4" }, - "packageManager": "pnpm@7.18.1" + "engines": { + "pnpm": ">=7.24.2" + } } diff --git a/plugins/authenticator/Cargo.toml b/plugins/authenticator/Cargo.toml index 0df4e4b1..007e63f4 100644 --- a/plugins/authenticator/Cargo.toml +++ b/plugins/authenticator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-authenticator" -version = "0.1.0" +version = "0.0.0" description = "Use hardware security-keys in your Tauri App." authors.workspace = true license.workspace = true @@ -18,7 +18,7 @@ thiserror.workspace = true authenticator = "0.3.1" once_cell = "1" sha2 = "0.10" -base64 = { version = "^0.13" } +base64 = "0.21" u2f = "0.2" chrono = "0.4" diff --git a/plugins/authenticator/README.md b/plugins/authenticator/README.md index 884d81b9..89fa6e29 100644 --- a/plugins/authenticator/README.md +++ b/plugins/authenticator/README.md @@ -4,6 +4,8 @@ Use hardware security-keys in your Tauri App. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -18,7 +20,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: [dependencies] tauri-plugin-authenticator = "0.1" # or through git -tauri-plugin-authenticator = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } +tauri-plugin-authenticator = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: diff --git a/plugins/authenticator/package.json b/plugins/authenticator/package.json index d859eef4..7374695f 100644 --- a/plugins/authenticator/package.json +++ b/plugins/authenticator/package.json @@ -25,7 +25,7 @@ "LICENSE" ], "devDependencies": { - "tslib": "^2.4.1" + "tslib": "^2.5.0" }, "dependencies": { "@tauri-apps/api": "^1.2.0" diff --git a/plugins/authenticator/src/auth.rs b/plugins/authenticator/src/auth.rs index d7508478..c334173d 100644 --- a/plugins/authenticator/src/auth.rs +++ b/plugins/authenticator/src/auth.rs @@ -6,7 +6,7 @@ use authenticator::{ authenticatorservice::AuthenticatorService, statecallback::StateCallback, AuthenticatorTransports, KeyHandle, RegisterFlags, SignFlags, StatusUpdate, }; -use base64::{decode_config, encode_config, URL_SAFE_NO_PAD}; +use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; use once_cell::sync::Lazy; use serde::Serialize; use sha2::{Digest, Sha256}; @@ -75,9 +75,9 @@ pub fn register(application: String, timeout: u64, challenge: String) -> crate:: let (key_handle, public_key) = _u2f_get_key_handle_and_public_key_from_register_response(®ister_data).unwrap(); - let key_handle_base64 = encode_config(key_handle, URL_SAFE_NO_PAD); - let public_key_base64 = encode_config(public_key, URL_SAFE_NO_PAD); - let register_data_base64 = encode_config(®ister_data, URL_SAFE_NO_PAD); + let key_handle_base64 = URL_SAFE_NO_PAD.encode(key_handle); + let public_key_base64 = URL_SAFE_NO_PAD.encode(public_key); + let register_data_base64 = URL_SAFE_NO_PAD.encode(®ister_data); println!("Key Handle: {}", &key_handle_base64); println!("Public Key: {}", &public_key_base64); @@ -108,7 +108,7 @@ pub fn sign( challenge: String, key_handle: String, ) -> crate::Result { - let credential = match decode_config(key_handle, URL_SAFE_NO_PAD) { + let credential = match URL_SAFE_NO_PAD.decode(key_handle) { Ok(v) => v, Err(e) => { return Err(e.into()); @@ -152,19 +152,16 @@ pub fn sign( let (_, handle_used, sign_data, device_info) = sign_result.unwrap(); - let sig = encode_config(sign_data, URL_SAFE_NO_PAD); + let sig = URL_SAFE_NO_PAD.encode(sign_data); println!("Sign result: {sig}"); - println!( - "Key handle used: {}", - encode_config(&handle_used, URL_SAFE_NO_PAD) - ); + println!("Key handle used: {}", URL_SAFE_NO_PAD.encode(&handle_used)); println!("Device info: {}", &device_info); println!("Done."); let res = serde_json::to_string(&Signature { sign_data: sig, - key_handle: encode_config(&handle_used, URL_SAFE_NO_PAD), + key_handle: URL_SAFE_NO_PAD.encode(&handle_used), })?; Ok(res) } diff --git a/plugins/authenticator/src/u2f.rs b/plugins/authenticator/src/u2f.rs index 026917ca..e8bd5de9 100644 --- a/plugins/authenticator/src/u2f.rs +++ b/plugins/authenticator/src/u2f.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use base64::{decode_config, encode_config, URL_SAFE_NO_PAD}; +use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; use chrono::prelude::*; use serde::Serialize; use std::convert::Into; @@ -15,7 +15,7 @@ static VERSION: &str = "U2F_V2"; pub fn make_challenge(app_id: &str, challenge_bytes: Vec) -> Challenge { let utc: DateTime = Utc::now(); Challenge { - challenge: encode_config(challenge_bytes, URL_SAFE_NO_PAD), + challenge: URL_SAFE_NO_PAD.encode(challenge_bytes), timestamp: format!("{utc:?}"), app_id: app_id.to_string(), } @@ -35,10 +35,10 @@ pub fn verify_registration( register_data: String, client_data: String, ) -> crate::Result { - let challenge_bytes = decode_config(challenge, URL_SAFE_NO_PAD)?; + let challenge_bytes = URL_SAFE_NO_PAD.decode(challenge)?; let challenge = make_challenge(&app_id, challenge_bytes); let client_data_bytes: Vec = client_data.as_bytes().into(); - let client_data_base64 = encode_config(client_data_bytes, URL_SAFE_NO_PAD); + let client_data_base64 = URL_SAFE_NO_PAD.encode(client_data_bytes); let client = U2f::new(app_id); match client.register_response( challenge, @@ -50,8 +50,8 @@ pub fn verify_registration( ) { Ok(v) => { let rv = RegistrationVerification { - key_handle: encode_config(&v.key_handle, URL_SAFE_NO_PAD), - pubkey: encode_config(&v.pub_key, URL_SAFE_NO_PAD), + key_handle: URL_SAFE_NO_PAD.encode(&v.key_handle), + pubkey: URL_SAFE_NO_PAD.encode(&v.pub_key), device_name: v.device_name, }; Ok(serde_json::to_string(&rv)?) @@ -74,12 +74,12 @@ pub fn verify_signature( key_handle: String, pub_key: String, ) -> crate::Result { - let challenge_bytes = decode_config(challenge, URL_SAFE_NO_PAD)?; + let challenge_bytes = URL_SAFE_NO_PAD.decode(challenge)?; let chal = make_challenge(&app_id, challenge_bytes); let client_data_bytes: Vec = client_data.as_bytes().into(); - let client_data_base64 = encode_config(client_data_bytes, URL_SAFE_NO_PAD); - let key_handle_bytes = decode_config(&key_handle, URL_SAFE_NO_PAD)?; - let pubkey_bytes = decode_config(pub_key, URL_SAFE_NO_PAD)?; + let client_data_base64 = URL_SAFE_NO_PAD.encode(client_data_bytes); + let key_handle_bytes = URL_SAFE_NO_PAD.decode(&key_handle)?; + let pubkey_bytes = URL_SAFE_NO_PAD.decode(pub_key)?; let client = U2f::new(app_id); let mut _counter: u32 = 0; match client.sign_response( diff --git a/plugins/autostart/Cargo.toml b/plugins/autostart/Cargo.toml index dc42168d..8d0abc50 100644 --- a/plugins/autostart/Cargo.toml +++ b/plugins/autostart/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-autostart" -version = "0.1.0" +version = "0.0.0" description = "Automatically launch your application at startup." authors.workspace = true license.workspace = true diff --git a/plugins/autostart/README.md b/plugins/autostart/README.md index 78859423..7c9f8ddb 100644 --- a/plugins/autostart/README.md +++ b/plugins/autostart/README.md @@ -4,6 +4,8 @@ Automatically launch your application at startup. Supports Windows, Mac (via App ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -16,7 +18,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } +tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: diff --git a/plugins/autostart/package.json b/plugins/autostart/package.json index dd530467..f8cf56cb 100644 --- a/plugins/autostart/package.json +++ b/plugins/autostart/package.json @@ -24,7 +24,7 @@ "LICENSE" ], "devDependencies": { - "tslib": "^2.4.1" + "tslib": "^2.5.0" }, "dependencies": { "@tauri-apps/api": "^1.2.0" diff --git a/plugins/autostart/src/lib.rs b/plugins/autostart/src/lib.rs index 509e6b3f..3c76c34a 100644 --- a/plugins/autostart/src/lib.rs +++ b/plugins/autostart/src/lib.rs @@ -3,6 +3,8 @@ // SPDX-License-Identifier: MIT use auto_launch::{AutoLaunch, AutoLaunchBuilder}; +#[cfg(target_os = "macos")] +use log::info; use serde::{ser::Serializer, Serialize}; use tauri::{ command, @@ -98,7 +100,6 @@ pub fn init( .invoke_handler(tauri::generate_handler![enable, disable, is_enabled]) .setup(move |app| { let mut builder = AutoLaunchBuilder::new(); - builder.set_app_name(&app.package_info().name); if let Some(args) = args { builder.set_args(&args); @@ -110,7 +111,22 @@ pub fn init( #[cfg(windows)] builder.set_app_path(¤t_exe.display().to_string()); #[cfg(target_os = "macos")] - builder.set_app_path(¤t_exe.canonicalize()?.display().to_string()); + { + // on macOS, current_exe gives path to /Applications/Example.app/MacOS/Example + // but this results in seeing a Unix Executable in macOS login items + // It must be: /Applications/Example.app + // If it didn't find exactly a single occurance of .app, it will default to + // exe path to not break it. + let exe_path = current_exe.canonicalize()?.display().to_string(); + let parts: Vec<&str> = exe_path.split(".app/").collect(); + let app_path = if parts.len() == 2 { + format!("{}.app", parts.get(0).unwrap().to_string()) + } else { + exe_path + }; + info!("auto_start path {}", &app_path); + builder.set_app_path(&app_path); + } #[cfg(target_os = "linux")] if let Some(appimage) = app .env() diff --git a/plugins/fs-extra/Cargo.toml b/plugins/fs-extra/Cargo.toml index 79b0e7ce..3904ec59 100644 --- a/plugins/fs-extra/Cargo.toml +++ b/plugins/fs-extra/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-fs-extra" -version = "0.1.0" +version = "0.0.0" description = "Additional file system methods not included in the core API." authors.workspace = true license.workspace = true diff --git a/plugins/fs-extra/README.md b/plugins/fs-extra/README.md index 6ea6ea1c..3eeaf003 100644 --- a/plugins/fs-extra/README.md +++ b/plugins/fs-extra/README.md @@ -4,6 +4,8 @@ Additional file system methods not included in the core API. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -16,7 +18,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-fs-extra = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } +tauri-plugin-fs-extra = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: diff --git a/plugins/fs-extra/package.json b/plugins/fs-extra/package.json index d6a32f42..b5d5eda5 100644 --- a/plugins/fs-extra/package.json +++ b/plugins/fs-extra/package.json @@ -25,7 +25,7 @@ "LICENSE" ], "devDependencies": { - "tslib": "^2.4.1" + "tslib": "^2.5.0" }, "dependencies": { "@tauri-apps/api": "^1.2.0" diff --git a/plugins/fs-watch/Cargo.toml b/plugins/fs-watch/Cargo.toml index f939dd2b..07a4b0d8 100644 --- a/plugins/fs-watch/Cargo.toml +++ b/plugins/fs-watch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-fs-watch" -version = "0.1.0" +version = "0.0.0" description = "Watch files and directories for changes." authors.workspace = true license.workspace = true @@ -15,5 +15,5 @@ serde_json.workspace = true tauri.workspace = true log.workspace = true thiserror.workspace = true -notify = { version = "5" , features = ["serde"] } -notify-debouncer-mini = { version = "0.2.1" , features = ["serde"] } +notify = { version = "6" , features = ["serde"] } +notify-debouncer-mini = { version = "0.3" , features = ["serde"] } diff --git a/plugins/fs-watch/README.md b/plugins/fs-watch/README.md index 26ee5bfc..29f6cc11 100644 --- a/plugins/fs-watch/README.md +++ b/plugins/fs-watch/README.md @@ -4,6 +4,8 @@ Watch files and directories for changes using [notify](https://github.com/notify ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -16,7 +18,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-fs-watch = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } +tauri-plugin-fs-watch = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: @@ -54,18 +56,18 @@ import { watch, watchImmediate } from "tauri-plugin-fs-watch-api"; // can also watch an array of paths const stopWatching = await watch( "/path/to/something", - { recursive: true }, (event) => { const { type, payload } = event; - } + }, + { recursive: true } ); const stopRawWatcher = await watchImmediate( ["/path/a", "/path/b"], - {}, (event) => { const { path, operation, cookie } = event; - } + }, + {} ); ``` diff --git a/plugins/fs-watch/guest-js/index.ts b/plugins/fs-watch/guest-js/index.ts index 31d333b2..05ed07e5 100644 --- a/plugins/fs-watch/guest-js/index.ts +++ b/plugins/fs-watch/guest-js/index.ts @@ -44,8 +44,8 @@ async function unwatch(id: number): Promise { export async function watch( paths: string | string[], - options: DebouncedWatchOptions, - cb: (event: DebouncedEvent) => void + cb: (event: DebouncedEvent) => void, + options: DebouncedWatchOptions = {} ): Promise { const opts = { recursive: false, @@ -82,8 +82,8 @@ export async function watch( export async function watchImmediate( paths: string | string[], - options: WatchOptions, - cb: (event: RawEvent) => void + cb: (event: RawEvent) => void, + options: WatchOptions = {} ): Promise { const opts = { recursive: false, diff --git a/plugins/fs-watch/package.json b/plugins/fs-watch/package.json index 2f080773..4ac45241 100644 --- a/plugins/fs-watch/package.json +++ b/plugins/fs-watch/package.json @@ -25,7 +25,7 @@ "LICENSE" ], "devDependencies": { - "tslib": "^2.4.1" + "tslib": "^2.5.0" }, "dependencies": { "@tauri-apps/api": "^1.2.0" diff --git a/plugins/localhost/README.md b/plugins/localhost/README.md index 23b07577..3fd7797a 100644 --- a/plugins/localhost/README.md +++ b/plugins/localhost/README.md @@ -6,6 +6,8 @@ Expose your apps assets through a localhost server instead of the default custom ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -18,7 +20,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } +tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } portpicker = "0.1" # used in the example to pick a random free port ``` diff --git a/plugins/log/Cargo.toml b/plugins/log/Cargo.toml index 41a1457a..dfa72341 100644 --- a/plugins/log/Cargo.toml +++ b/plugins/log/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-log" -version = "0.1.0" +version = "0.0.0" description = "Configurable logging for your Tauri app." authors.workspace = true license.workspace = true @@ -17,7 +17,7 @@ serde_repr = "0.1" byte-unit = "4.0" fern = "0.6" log = { workspace = true, features = ["kv_unstable"] } -time = { version = "0.3", features = ["formatting"] } +time = { version = "0.3", features = ["formatting", "local-offset"] } [features] colored = ["fern/colored"] \ No newline at end of file diff --git a/plugins/log/README.md b/plugins/log/README.md index f49c2c7b..e4326f38 100644 --- a/plugins/log/README.md +++ b/plugins/log/README.md @@ -4,6 +4,8 @@ Configurable logging for your Tauri app. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -16,7 +18,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } +tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: diff --git a/plugins/log/guest-js/index.ts b/plugins/log/guest-js/index.ts index bf67c16b..77ab7009 100644 --- a/plugins/log/guest-js/index.ts +++ b/plugins/log/guest-js/index.ts @@ -4,7 +4,8 @@ import { listen, UnlistenFn } from "@tauri-apps/api/event"; export type LogOptions = { file?: string; line?: number; -} & Record; + keyValues?: Record; +}; enum LogLevel { /** @@ -50,12 +51,17 @@ async function log( return name.length > 0 && location !== "[native code]"; }); - const { file, line, ...keyValues } = options ?? {}; + const { file, line, keyValues } = options ?? {}; + + let location = filtered?.[0]?.filter((v) => v.length > 0).join("@"); + if (location === "Error") { + location = "webview::unknown"; + } await invoke("plugin:log|log", { level, message, - location: filtered?.[0]?.filter((v) => v.length > 0).join("@"), + location, file, line, keyValues, @@ -184,7 +190,8 @@ export async function attachConsole(): Promise { // Strip ANSI escape codes const message = payload.message.replace( - // eslint-disable-next-line no-control-regex + // TODO: Investigate security/detect-unsafe-regex + // eslint-disable-next-line no-control-regex, security/detect-unsafe-regex /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, "" ); diff --git a/plugins/log/package.json b/plugins/log/package.json index fefd3c33..b610090d 100644 --- a/plugins/log/package.json +++ b/plugins/log/package.json @@ -25,7 +25,7 @@ "LICENSE" ], "devDependencies": { - "tslib": "^2.4.1" + "tslib": "^2.5.0" }, "dependencies": { "@tauri-apps/api": "^1.2.0" diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs index 2ab8ced9..9db4aa4e 100644 --- a/plugins/log/src/lib.rs +++ b/plugins/log/src/lib.rs @@ -21,9 +21,11 @@ use tauri::{ }; pub use fern; +use time::OffsetDateTime; const DEFAULT_MAX_FILE_SIZE: u128 = 40000; const DEFAULT_ROTATION_STRATEGY: RotationStrategy = RotationStrategy::KeepOne; +const DEFAULT_TIMEZONE_STRATEGY: TimezoneStrategy = TimezoneStrategy::UseUtc; const DEFAULT_LOG_TARGETS: [LogTarget; 2] = [LogTarget::Stdout, LogTarget::LogDir]; /// An enum representing the available verbosity levels of the logger. @@ -83,6 +85,23 @@ pub enum RotationStrategy { KeepOne, } +#[derive(Debug, Clone)] +pub enum TimezoneStrategy { + UseUtc, + UseLocal, +} + +impl TimezoneStrategy { + pub fn get_now(&self) -> OffsetDateTime { + match self { + TimezoneStrategy::UseUtc => OffsetDateTime::now_utc(), + TimezoneStrategy::UseLocal => { + OffsetDateTime::now_local().unwrap_or_else(|_| OffsetDateTime::now_utc()) + } // Fallback to UTC since Rust cannot determine local timezone + } + } +} + #[derive(Debug, Serialize, Clone)] struct RecordPayload { message: String, @@ -127,8 +146,8 @@ fn log( let location = location.unwrap_or("webview"); let mut builder = RecordBuilder::new(); builder - .target(location) .level(level.into()) + .target(location) .file(file) .line(line); @@ -145,6 +164,7 @@ fn log( pub struct Builder { dispatch: fern::Dispatch, rotation_strategy: RotationStrategy, + timezone_strategy: TimezoneStrategy, max_file_size: u128, targets: Vec, } @@ -157,15 +177,16 @@ impl Default for Builder { let dispatch = fern::Dispatch::new().format(move |out, message, record| { out.finish(format_args!( "{}[{}][{}] {}", - time::OffsetDateTime::now_utc().format(&format).unwrap(), - record.target(), + DEFAULT_TIMEZONE_STRATEGY.get_now().format(&format).unwrap(), record.level(), + record.target(), message )) }); Self { dispatch, rotation_strategy: DEFAULT_ROTATION_STRATEGY, + timezone_strategy: DEFAULT_TIMEZONE_STRATEGY, max_file_size: DEFAULT_MAX_FILE_SIZE, targets: DEFAULT_LOG_TARGETS.into(), } @@ -182,6 +203,24 @@ impl Builder { self } + pub fn timezone_strategy(mut self, timezone_strategy: TimezoneStrategy) -> Self { + self.timezone_strategy = timezone_strategy.clone(); + + let format = + time::format_description::parse("[[[year]-[month]-[day]][[[hour]:[minute]:[second]]") + .unwrap(); + self.dispatch = fern::Dispatch::new().format(move |out, message, record| { + out.finish(format_args!( + "{}[{}][{}] {}", + timezone_strategy.get_now().format(&format).unwrap(), + record.level(), + record.target(), + message + )) + }); + self + } + pub fn max_file_size(mut self, max_file_size: u128) -> Self { self.max_file_size = max_file_size; self @@ -228,12 +267,14 @@ impl Builder { let format = time::format_description::parse("[[[year]-[month]-[day]][[[hour]:[minute]:[second]]") .unwrap(); + + let timezone_strategy = self.timezone_strategy.clone(); self.format(move |out, message, record| { out.finish(format_args!( "{}[{}][{}] {}", - time::OffsetDateTime::now_utc().format(&format).unwrap(), - record.target(), + timezone_strategy.get_now().format(&format).unwrap(), colors.color(record.level()), + record.target(), message )) }) @@ -259,6 +300,7 @@ impl Builder { &path, app_name, &self.rotation_strategy, + &self.timezone_strategy, self.max_file_size, )?)? .into() @@ -273,6 +315,7 @@ impl Builder { &path, app_name, &self.rotation_strategy, + &self.timezone_strategy, self.max_file_size, )?)? .into() @@ -306,6 +349,7 @@ fn get_log_file_path( dir: &impl AsRef, app_name: &str, rotation_strategy: &RotationStrategy, + timezone_strategy: &TimezoneStrategy, max_file_size: u128, ) -> plugin::Result { let path = dir.as_ref().join(format!("{app_name}.log")); @@ -318,7 +362,8 @@ fn get_log_file_path( let to = dir.as_ref().join(format!( "{}_{}.log", app_name, - time::OffsetDateTime::now_utc() + timezone_strategy + .get_now() .format( &time::format_description::parse( "[year]-[month]-[day]_[hour]-[minute]-[second]" diff --git a/plugins/persisted-scope/CHANGELOG.md b/plugins/persisted-scope/CHANGELOG.md new file mode 100644 index 00000000..d1991b01 --- /dev/null +++ b/plugins/persisted-scope/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## \[0.1.1] + +- The MSRV was raised to 1.64! +- The plugin now recursively unescapes saved patterns before allowing/forbidding them. This effectively prevents `.persisted-scope` files from blowing up, which caused Out-Of-Memory issues, while automatically fixing existing broken files seamlessly. + - [ebb2eb2](https://github.com/tauri-apps/plugins-workspace/commit/ebb2eb2fe2ebfbb70530d16a983d396aa5829aa1) fix(persisted-scope): Prevent out-of-memory issues, fixes [#274](https://github.com/tauri-apps/plugins-workspace/pull/274) ([#328](https://github.com/tauri-apps/plugins-workspace/pull/328)) on 2023-04-26 diff --git a/plugins/persisted-scope/Cargo.toml b/plugins/persisted-scope/Cargo.toml index 7bc30228..5e25f178 100644 --- a/plugins/persisted-scope/Cargo.toml +++ b/plugins/persisted-scope/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-persisted-scope" -version = "0.1.0" +version = "0.1.1" description = "Save filesystem and asset scopes and restore them when the app is reopened." authors.workspace = true license.workspace = true @@ -15,7 +15,8 @@ serde_json.workspace = true tauri.workspace = true log.workspace = true thiserror.workspace = true +aho-corasick = "1.0" bincode = "1" [features] -protocol-asset = [ "tauri/protocol-asset" ] \ No newline at end of file +protocol-asset = [ "tauri/protocol-asset" ] diff --git a/plugins/persisted-scope/README.md b/plugins/persisted-scope/README.md index 43dd5909..4c38450a 100644 --- a/plugins/persisted-scope/README.md +++ b/plugins/persisted-scope/README.md @@ -4,6 +4,8 @@ Save filesystem and asset scopes and restore them when the app is reopened. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -16,7 +18,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-persisted-scope = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } +tauri-plugin-persisted-scope = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } ``` ## Usage diff --git a/plugins/persisted-scope/src/lib.rs b/plugins/persisted-scope/src/lib.rs index ef0625ba..fe2cddf1 100644 --- a/plugins/persisted-scope/src/lib.rs +++ b/plugins/persisted-scope/src/lib.rs @@ -2,19 +2,34 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use aho_corasick::AhoCorasick; use serde::{Deserialize, Serialize}; use tauri::{ plugin::{Builder, TauriPlugin}, - FsScopeEvent, Manager, Runtime, + AppHandle, FsScopeEvent, Manager, Runtime, }; use std::{ fs::{create_dir_all, File}, io::Write, + path::Path, }; const SCOPE_STATE_FILENAME: &str = ".persisted-scope"; +// Most of these patterns are just added to try to fix broken files in the wild. +// After a while we can hopefully reduce it to something like [r"[?]", r"[*]", r"\\?\\\?\"] +const PATTERNS: &[&str] = &[ + r"[[]", + r"[]]", + r"[?]", + r"[*]", + r"\?\?", + r"\\?\\?\", + r"\\?\\\?\", +]; +const REPLACE_WITH: &[&str] = &[r"[", r"]", r"?", r"*", r"\?", r"\\?\", r"\\?\"]; + #[derive(Debug, thiserror::Error)] enum Error { #[error(transparent)] @@ -33,6 +48,41 @@ struct Scope { forbidden_patterns: Vec, } +fn fix_pattern(ac: &AhoCorasick, s: &str) -> String { + let s = ac.replace_all(s, REPLACE_WITH); + + if ac.find(&s).is_some() { + return fix_pattern(ac, &s); + } + + s +} + +fn save_scopes(app: &AppHandle, app_dir: &Path, scope_state_path: &Path) { + let fs_scope = app.fs_scope(); + + let scope = Scope { + allowed_paths: fs_scope + .allowed_patterns() + .into_iter() + .map(|p| p.to_string()) + .collect(), + forbidden_patterns: fs_scope + .forbidden_patterns() + .into_iter() + .map(|p| p.to_string()) + .collect(), + }; + + let _ = create_dir_all(app_dir) + .and_then(|_| File::create(scope_state_path)) + .map_err(Error::Io) + .and_then(|mut f| { + f.write_all(&bincode::serialize(&scope).map_err(Error::from)?) + .map_err(Into::into) + }); +} + pub fn init() -> TauriPlugin { Builder::new("persisted-scope") .setup(|app| { @@ -49,49 +99,38 @@ pub fn init() -> TauriPlugin { #[cfg(feature = "protocol-asset")] let _ = asset_protocol_scope.forbid_file(&scope_state_path); + // We're trying to fix broken .persisted-scope files seamlessly, so we'll be running this on the values read on the saved file. + // We will still save some semi-broken values because the scope events are quite spammy and we don't want to reduce runtime performance any further. + let ac = AhoCorasick::new(PATTERNS).unwrap(/* This should be impossible to fail since we're using a small static input */); + if scope_state_path.exists() { let scope: Scope = tauri::api::file::read_binary(&scope_state_path) .map_err(Error::from) .and_then(|scope| bincode::deserialize(&scope).map_err(Into::into)) .unwrap_or_default(); for allowed in &scope.allowed_paths { - // allows the path as is - let _ = fs_scope.allow_file(allowed); + let allowed = fix_pattern(&ac, allowed); + + let _ = fs_scope.allow_file(&allowed); #[cfg(feature = "protocol-asset")] - let _ = asset_protocol_scope.allow_file(allowed); + let _ = asset_protocol_scope.allow_file(&allowed); } for forbidden in &scope.forbidden_patterns { - // forbid the path as is - let _ = fs_scope.forbid_file(forbidden); + let forbidden = fix_pattern(&ac, forbidden); + + let _ = fs_scope.forbid_file(&forbidden); #[cfg(feature = "protocol-asset")] - let _ = asset_protocol_scope.forbid_file(forbidden); + let _ = asset_protocol_scope.forbid_file(&forbidden); } + + // Manually save the fixed scopes to disk once. + // This is needed to fix broken .peristed-scope files in case the app doesn't update the scope itself. + save_scopes(&app, &app_dir, &scope_state_path); } fs_scope.listen(move |event| { - let fs_scope = app.fs_scope(); if let FsScopeEvent::PathAllowed(_) = event { - let scope = Scope { - allowed_paths: fs_scope - .allowed_patterns() - .into_iter() - .map(|p| p.to_string()) - .collect(), - forbidden_patterns: fs_scope - .forbidden_patterns() - .into_iter() - .map(|p| p.to_string()) - .collect(), - }; - let scope_state_path = scope_state_path.clone(); - - let _ = create_dir_all(&app_dir) - .and_then(|_| File::create(scope_state_path)) - .map_err(Error::Io) - .and_then(|mut f| { - f.write_all(&bincode::serialize(&scope).map_err(Error::from)?) - .map_err(Into::into) - }); + save_scopes(&app, &app_dir, &scope_state_path); } }); } diff --git a/plugins/positioner/Cargo.toml b/plugins/positioner/Cargo.toml index 08155a5d..dcab86c9 100644 --- a/plugins/positioner/Cargo.toml +++ b/plugins/positioner/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-positioner" -version = "0.2.7" +version = "1.0.4" description = "Position your windows at well-known locations." authors.workspace = true license.workspace = true diff --git a/plugins/positioner/README.md b/plugins/positioner/README.md index 54332ddc..464e3cfb 100644 --- a/plugins/positioner/README.md +++ b/plugins/positioner/README.md @@ -6,6 +6,8 @@ This plugin is a port of [electron-positioner](https://github.com/jenslind/elect ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -20,7 +22,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: [dependencies] tauri-plugin-positioner = "1.0" # or through git -tauri-plugin-positioner = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } +tauri-plugin-positioner = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: @@ -28,11 +30,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa > Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. ```sh -pnpm add tauri-plugin-positioner +pnpm add tauri-plugin-positioner-api # or -npm add tauri-plugin-positioner +npm add tauri-plugin-positioner-api # or -yarn add tauri-plugin-positioner +yarn add tauri-plugin-positioner-api ``` Or through git: diff --git a/plugins/positioner/package.json b/plugins/positioner/package.json index 0cc58428..83acb56f 100644 --- a/plugins/positioner/package.json +++ b/plugins/positioner/package.json @@ -1,6 +1,6 @@ { "name": "tauri-plugin-positioner-api", - "version": "0.0.0", + "version": "0.2.7", "description": "Position your windows at well-known locations.", "license": "MIT or APACHE-2.0", "authors": [ @@ -25,7 +25,7 @@ "LICENSE" ], "devDependencies": { - "tslib": "^2.4.1" + "tslib": "^2.5.0" }, "dependencies": { "@tauri-apps/api": "^1.2.0" diff --git a/plugins/single-instance/Cargo.toml b/plugins/single-instance/Cargo.toml index 4762e033..be46f3aa 100644 --- a/plugins/single-instance/Cargo.toml +++ b/plugins/single-instance/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-single-instance" -version = "0.1.0" +version = "0.0.0" description = "Ensure a single instance of your tauri app is running." authors.workspace = true license.workspace = true @@ -18,7 +18,7 @@ log.workspace = true thiserror.workspace = true [target.'cfg(target_os = "windows")'.dependencies.windows-sys] -version = "0.42" +version = "0.48" features = [ "Win32_System_Threading", "Win32_System_DataExchange", diff --git a/plugins/single-instance/README.md b/plugins/single-instance/README.md index 75d985e9..7b265c59 100644 --- a/plugins/single-instance/README.md +++ b/plugins/single-instance/README.md @@ -1,9 +1,11 @@ -![tauri-plugin-single-instance](banner.jpg) +![tauri-plugin-single-instance](banner.png) Ensure a single instance of your tauri app is running. ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -16,7 +18,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } +tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } ``` ## Usage @@ -36,7 +38,7 @@ struct Payload { fn main() { tauri::Builder::default() - .plugin(auri_plugin_single_instance::init(|app, argv, cwd| { + .plugin(tauri_plugin_single_instance::init(|app, argv, cwd| { println!("{}, {argv:?}, {cwd}", app.package_info().name); app.emit_all("single-instance", Payload { args: argv, cwd }).unwrap(); diff --git a/plugins/single-instance/examples/vanilla/package.json b/plugins/single-instance/examples/vanilla/package.json index 89a97c06..0712c2f7 100644 --- a/plugins/single-instance/examples/vanilla/package.json +++ b/plugins/single-instance/examples/vanilla/package.json @@ -8,7 +8,7 @@ }, "author": "", "license": "MIT", - "dependencies": { - "@tauri-apps/cli": "^1.0.0" + "devDependencies": { + "@tauri-apps/cli": "^1.2.3" } } diff --git a/plugins/sql/Cargo.toml b/plugins/sql/Cargo.toml index c72e237c..91a839ac 100644 --- a/plugins/sql/Cargo.toml +++ b/plugins/sql/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-sql" -version = "0.1.0" +version = "0.0.0" description = "Interface with SQL databases." authors.workspace = true license.workspace = true @@ -15,9 +15,10 @@ serde_json.workspace = true tauri.workspace = true log.workspace = true thiserror.workspace = true -sqlx = { version = "0.6", features = ["runtime-tokio-rustls", "json"] } +futures-core = "0.3" +sqlx = { version = "0.6", features = ["runtime-tokio-rustls", "json", "time"] } +time = "0.3" tokio = { version = "1", features = ["sync"] } -futures = "0.3" [features] sqlite = ["sqlx/sqlite"] diff --git a/plugins/sql/README.md b/plugins/sql/README.md index 6b034f7c..2522848d 100644 --- a/plugins/sql/README.md +++ b/plugins/sql/README.md @@ -4,6 +4,8 @@ Interface with SQL databases through [sqlx](https://github.com/launchbadge/sqlx) ## Install +_This plugin requires a Rust version of at least **1.64**_ + There are three general methods of installation that we can recommend. 1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) @@ -17,7 +19,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies.tauri-plugin-sql] git = "https://github.com/tauri-apps/plugins-workspace" -branch = "dev" +branch = "v1" features = ["sqlite"] # or "postgres", or "mysql" ``` diff --git a/plugins/sql/package.json b/plugins/sql/package.json index f60d8116..a5607cd6 100644 --- a/plugins/sql/package.json +++ b/plugins/sql/package.json @@ -25,7 +25,7 @@ "LICENSE" ], "devDependencies": { - "tslib": "^2.4.1" + "tslib": "^2.5.0" }, "dependencies": { "@tauri-apps/api": "^1.2.0" diff --git a/plugins/sql/src/decode/mod.rs b/plugins/sql/src/decode/mod.rs new file mode 100644 index 00000000..415c99b8 --- /dev/null +++ b/plugins/sql/src/decode/mod.rs @@ -0,0 +1,15 @@ +#[cfg(feature = "mysql")] +mod mysql; +#[cfg(feature = "postgres")] +mod postgres; +#[cfg(feature = "sqlite")] +mod sqlite; + +#[cfg(feature = "mysql")] +pub(crate) use mysql::to_json; + +#[cfg(feature = "postgres")] +pub(crate) use postgres::to_json; + +#[cfg(feature = "sqlite")] +pub(crate) use sqlite::to_json; diff --git a/plugins/sql/src/decode/mysql.rs b/plugins/sql/src/decode/mysql.rs new file mode 100644 index 00000000..e68bd1ac --- /dev/null +++ b/plugins/sql/src/decode/mysql.rs @@ -0,0 +1,90 @@ +use serde_json::Value as JsonValue; +use sqlx::{mysql::MySqlValueRef, TypeInfo, Value, ValueRef}; +use time::{Date, OffsetDateTime, PrimitiveDateTime, Time}; + +use crate::Error; + +pub(crate) fn to_json(v: MySqlValueRef) -> Result { + if v.is_null() { + return Ok(JsonValue::Null); + } + + let res = match v.type_info().name() { + "CHAR" | "VARCHAR" | "TINYTEXT" | "TEXT" | "MEDIUMTEXT" | "LONGTEXT" | "ENUM" => { + if let Ok(v) = ValueRef::to_owned(&v).try_decode() { + JsonValue::String(v) + } else { + JsonValue::Null + } + } + "FLOAT" | "DOUBLE" => { + if let Ok(v) = ValueRef::to_owned(&v).try_decode::() { + JsonValue::from(v) + } else { + JsonValue::Null + } + } + "TINYINT" | "SMALLINT" | "INT" | "MEDIUMINT" | "BIGINT" => { + if let Ok(v) = ValueRef::to_owned(&v).try_decode::() { + JsonValue::Number(v.into()) + } else { + JsonValue::Null + } + } + "TINYINT UNSIGNED" | "SMALLINT UNSIGNED" | "INT UNSIGNED" | "MEDIUMINT UNSIGNED" + | "BIGINT UNSIGNED" | "YEAR" => { + if let Ok(v) = ValueRef::to_owned(&v).try_decode::() { + JsonValue::Number(v.into()) + } else { + JsonValue::Null + } + } + "BOOLEAN" => { + if let Ok(v) = ValueRef::to_owned(&v).try_decode() { + JsonValue::Bool(v) + } else { + JsonValue::Null + } + } + "DATE" => { + if let Ok(v) = ValueRef::to_owned(&v).try_decode::() { + JsonValue::String(v.to_string()) + } else { + JsonValue::Null + } + } + "TIME" => { + if let Ok(v) = ValueRef::to_owned(&v).try_decode::