-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 1Password Rust SDK — initial implementation #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
fb18afa
docs: add design spec for 1Password Rust SDK port
lightcap 7b9e341
docs: add implementation plan for 1Password Rust SDK port
lightcap 0c2481f
feat: add project scaffolding, error types, core trait, and domain types
lightcap 24b792a
feat: add ExtismCore WASM runtime with embedded core.wasm
lightcap 41093de
feat: add Client, ClientBuilder, and all API implementations
lightcap 7b0b74e
feat: add SharedLibCore, examples, and CI workflow
lightcap 3ef5f3f
fix(desktop): correct SharedLibCore IPC protocol and SDK version format
lightcap 4986844
fix: address code review findings — mutex safety, FFI cleanup, error …
lightcap 1d64516
fix: cache standalone WASM core, add session retry, redact secrets in…
lightcap 98584d2
fix(ci): update deny.toml for cargo-deny v2 and fix dependency adviso…
lightcap 3e50bae
fix(desktop): harden core invocation boundaries
lightcap 1c02143
Merge pull request #4 from lightcap/fix/byte-payload-encoding-code
lightcap 3c9e021
chore(ci): harden Dependabot config for security product
lightcap 11d99ff
Merge pull request #7 from lightcap/chore/dependabot-config
lightcap ff2b4e0
fix: use Acquire/Release ordering for client_id, fix Windows home dir…
lightcap 0d1d104
fix: decode SharedLib response payload from base64, remove duplicate …
lightcap 22a34c9
fix(security): address CodeQL alerts — no secret logging, restrict CI…
lightcap 45b0ea1
fix: guard session retry with mutex to prevent client ID leak
lightcap 6cd89af
fix: preserve typed errors from init_client instead of wrapping in Co…
lightcap d04d954
fix: restrict MESSAGE_LIMIT visibility to module scope
lightcap 691247f
fix: release old client ID before storing new one in retry path
lightcap 3b4deae
fix: skip re-init if another thread already refreshed, free FFI buffe…
lightcap f245add
fix: only unmarshal transport errors in client_invoke
lightcap 613ef03
fix: replace personal vault reference in example with generic placeho…
lightcap 5212454
fix: correct return type in FFI error path
lightcap 8ee1880
fix: make extism/getrandom optional behind default 'wasm' feature
lightcap 61e3eae
fix: make chrono optional behind wasm feature
lightcap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| version: 2 | ||
|
|
||
| updates: | ||
| # Rust / Cargo dependencies | ||
| - package-ecosystem: cargo | ||
| directory: / | ||
| schedule: | ||
| interval: daily | ||
| open-pull-requests-limit: 15 | ||
| groups: | ||
| rust-minor-patch: | ||
| applies-to: version-updates | ||
| update-types: | ||
| - minor | ||
| - patch | ||
| labels: | ||
| - dependencies | ||
| - rust | ||
|
|
||
| # GitHub Actions — supply-chain risk for CI pipelines | ||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| open-pull-requests-limit: 5 | ||
| labels: | ||
| - dependencies | ||
| - ci |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: "1.93.1" | ||
| components: rustfmt, clippy | ||
|
|
||
| - name: Check formatting | ||
| run: cargo fmt --check | ||
|
|
||
| - name: Clippy (all features) | ||
| run: cargo clippy --all-features -- -D warnings | ||
|
|
||
| - name: Clippy (desktop only, no WASM) | ||
| run: cargo clippy --no-default-features --features desktop -- -D warnings | ||
|
|
||
| - name: Test | ||
| run: cargo test | ||
|
|
||
| - name: Test (desktop feature) | ||
| run: cargo test --features desktop | ||
|
|
||
| deny: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: EmbarkStudios/cargo-deny-action@v2 | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: Upstream Extism Watch | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 15 * * 1" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check-fixed-extism: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Explain watch condition | ||
| run: | | ||
| cat >> "$GITHUB_STEP_SUMMARY" <<'EOF' | ||
| This job tests whether a newer released Extism dependency clears the | ||
| temporary Wasmtime advisory ignores tracked in #2. If `cargo-deny` | ||
| fails with unused ignored advisories after the lockfile update, | ||
| update Extism, remove the stale ignores from `deny.toml`, and close #2. | ||
| EOF | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: "1.93.1" | ||
|
|
||
| - name: Try latest Extism-compatible lockfile | ||
| run: | | ||
| set -euxo pipefail | ||
| cargo update -p extism -p extism-convert -p extism-convert-macros -p extism-manifest | ||
|
|
||
| - name: Check advisories after Extism update | ||
| uses: EmbarkStudios/cargo-deny-action@v2 | ||
| with: | ||
| rust-version: "1.93.1" | ||
| command: check advisories |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /target | ||
| .DS_Store | ||
| .idea/ | ||
| *.swp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # 1Password Rust SDK | ||
|
|
||
| ## Build Commands | ||
|
|
||
| - `cargo fmt --check` — check formatting | ||
| - `cargo clippy -- -D warnings` — lint | ||
| - `cargo test` — run tests | ||
| - `cargo build` — build (default features) | ||
| - `cargo build --features desktop` — build with desktop app integration | ||
|
|
||
| ## Conventions | ||
|
|
||
| - Edition 2024, Rust 1.93.1 | ||
| - `#![deny(unsafe_code)]` at crate root; `#[allow(unsafe_code)]` only on FFI modules | ||
| - `thiserror` for error types | ||
| - `serde` for all JSON serialization | ||
| - Inline `#[cfg(test)] mod tests` blocks | ||
| - Conventional commits: `type(scope): description` | ||
| - Run `cargo fmt --check && cargo clippy -- -D warnings && cargo test` before pushing | ||
| - Do NOT add `Co-Authored-By: Claude` lines to commit messages | ||
|
|
||
| ## Architecture | ||
|
|
||
| Typed wrapper around an opaque WASM core binary. All API calls serialize params to JSON, | ||
| call `Core::invoke()`, and deserialize the response. Two core backends: | ||
| - `ExtismCore` (default) — embedded WASM via Extism | ||
| - `SharedLibCore` (feature: `desktop`) — native shared library from 1Password desktop app |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.