From 90301ca2f55ba6c2144c7ebb1cb61bef01c8afaa Mon Sep 17 00:00:00 2001 From: Andres Gonzalez <17816698+agonzalezv@users.noreply.github.com> Date: Wed, 12 Nov 2025 12:07:19 +1300 Subject: [PATCH 1/2] fix: add telegram bot, codeowners, PR template, release workflow --- .github/CODEOWNERS | 3 + .github/pull_request_template.md | 25 +++++++ .github/workflows/build.yaml | 19 +++++ .github/workflows/release.yaml | 27 +++++++ .github/workflows/telegram-notification.yml | 22 ++++++ README.md | 80 ++++++++++++++++++++- 6 files changed, 173 insertions(+), 3 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/telegram-notification.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..36c0da0 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# Global owners + +* @Metasig/devs diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..f302a23 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,25 @@ +# Summary + +- One-line summary of the change and why it matters. + +## Context + +- Links: issue, ticket, or related PRs. + +## Changes + +- Short bullet list of the key changes made. + +## Checklist + +- [ ] Tests added/updated +- [ ] Docs updated (if needed) + +## Risks + +- Brief note about possible risks or impact. + +## How to test + +- Short, reproducible steps to verify the change. +z \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..4529130 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,19 @@ +name: build + +on: + workflow_dispatch: + pull_request: + +jobs: + cargo_build: + name: cargo build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: apt-get install + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.1-dev + - run: cargo build diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..efaaaa1 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,27 @@ +name: release + +on: + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + + permissions: + contents: write # publish a GitHub release + issues: write # comment on released issues + pull-requests: write # comment on released pull requests + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: "lts/*" + + - name: semantic-release + run: npx semantic-release@24 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/telegram-notification.yml b/.github/workflows/telegram-notification.yml new file mode 100644 index 0000000..e05c79a --- /dev/null +++ b/.github/workflows/telegram-notification.yml @@ -0,0 +1,22 @@ +name: Telegram notification + +on: + pull_request: + types: [opened, reopened] + +jobs: + telegram-bot: + name: Telegram Bot + runs-on: ubuntu-latest + steps: + - name: Telegram Notify + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_TO }} + token: ${{ secrets.TELEGRAM_TOKEN }} + format: markdown + disable_web_page_preview: true + message: | + ${{ github.event.pull_request.draft && '📝 New draft PR' || '🔔 New PR' }} by: *${{ github.event.pull_request.user.login }}* + *${{ github.event.pull_request.title }}* + 🔍 ${{ github.event.pull_request.html_url }} diff --git a/README.md b/README.md index d1cbac3..a3d2636 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,78 @@ -# Tauri Plugin p256-signer +# Tauri Plugin: p256-signer -Sign messages from Tauri using passkeys to create a viem webauthnp256 account to use as an owner in 4337 wallets. -Requires configuration in your consuming application via asset links, verifying the package sha256 hash and package name etc. \ No newline at end of file +Sign messages from a Tauri app using platform passkeys (WebAuthn). This plugin exposes a small JS API +that serializes WebAuthn requests to be handled by the native layer and returns a parsed +PublicKeyCredential which can be used to build viem/web3-style accounts (for example a webauthn-p256 +owner for account abstraction / 4337 flows). + +This repository contains: + +- Rust plugin code for Tauri (the native implementation). +- JS bindings (lightweight helpers) in `guest-js/` and a distributable bundle in `dist-js/`. + +Key notes + +- The plugin does not bypass the platform security model: you must configure the consuming Android/iOS + application to allow WebAuthn/passkey use. On Android this normally means adding an assetlinks JSON + entry hosted at your domain and verifying your package name / signing certificate. On iOS you need + properly configured Associated Domains and, where relevant, App Clip/entitlements. + +Use this plugin when you want to let a Tauri desktop/mobile app create and use WebAuthn passkeys +and surface the resulting signatures/public keys to a JS layer (for example to construct viem accounts). + +## Quick install + +This project publishes JS bindings as the package `@metasig/tauri-plugin-p256-signer-api` (see +`package.json`). To use the JS helpers in your Tauri app, install the package (npm / pnpm / yarn): + +```bash +# from your app's frontend +pnpm add @metasig/tauri-plugin-p256-signer-api +``` + +The native plugin is a standard Tauri plugin. Include it in your Tauri Rust plugin list and enable +the plugin during build. See "Build & develop" below for local build instructions. + +## Usage (JS example) + +The JS bindings expose two high-level helpers: `createCredential` and `getCredential`. +They serialize WebAuthn options into a JSON-friendly form, invoke the native plugin and return +a parsed `PublicKeyCredential` object that behaves like the browser API. + +Example (browser/guest code): + +```ts +import { createCredential, getCredential } from '@metasig/tauri-plugin-p256-signer-api'; + +// Create a credential from PublicKeyCredentialCreationOptions +const created = await createCredential(creationOptions); + +// Request an assertion +const asserted = await getCredential({ publicKey: requestOptions }); + +// Use asserted.response.signature and asserted.rawId in your app (for example to register a +// viem webauthn-p256 account or to verify a signature server-side). +``` + +For more advanced usage and the exact serialization/parsing behavior, see `guest-js/index.ts` in +this repository. + +## Build & develop + +From the repository root you can build both the JS bundle and the Rust plugin. + +- Build JS bundle: + +```bash +pnpm build +``` + +- Build Rust plugin (requires Rust >= 1.77.2): + +```bash +cargo build --release +``` + +## License + +This repository is licensed under Apache-2.0 (see `package.json`). From baeda92ec23b8f7de788381ae50a0964963aadfb Mon Sep 17 00:00:00 2001 From: Andres Gonzalez <17816698+agonzalezv@users.noreply.github.com> Date: Wed, 12 Nov 2025 12:09:14 +1300 Subject: [PATCH 2/2] 0.3.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0d5e765..834a0bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@metasig/tauri-plugin-p256-signer-api", - "version": "0.2.0", + "version": "0.3.0", "author": "0x330a", "description": "JS Bindings for the tauri-plugin-p256-signer Tauri plugin", "type": "module", @@ -38,4 +38,4 @@ "type": "git", "url": "git+https://github.com/Metasig/tauri-plugin-keystore.git" } -} \ No newline at end of file +}