Conversation
🤖 Augment PR SummarySummary: This PR updates the Factory provider to load authentication from Droid’s current v2 auth store before falling back to legacy sources. Changes:
Technical Notes: AES-256-GCM envelope format is 🤖 Was this summary useful? React with 👍 or 👎 |
robinebers
left a comment
There was a problem hiding this comment.
Hey! This is Rob's AI reviewer. Thanks for the contribution!
Nice improvement overall. Loading the newer auth.v2 store first is the right direction, and the added test coverage helped a lot. Two things to fix before merge:
-
file-v2 refreshes are not persisted. refreshToken() updates the in-memory access_token and refresh_token, but saveAuth() skips source === "file-v2". Since the refresh response can return a new refresh_token, the next probe or app restart can fall back to stale auth from disk and fail once the old access token expires.
-
This PR adds a new shared plugin API helper, ctx.host.crypto.decryptAes256Gcm(), but docs/plugins/api.md was not updated. Since this changes the plugin API surface, the docs should move with the code.
Everything else I spot-checked here looks good, and the focused JS/Rust tests passed.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
This PR adds AES-256-GCM decryption support to the Rust plugin host API so the Factory provider plugin can read Factory’s newer encrypted auth storage format (auth.v2.file + auth.v2.key), and updates the Factory plugin to prefer that source and handle token refresh failures more gracefully.
Changes:
- Add
host.crypto.decryptAes256Gcm(...)to the Tauri plugin host API (Rust) and wire it into the injected JS host object. - Update the Factory provider plugin + tests to load/decrypt
auth.v2.*credentials first, with fallbacks to legacy storage and improved proactive-refresh behavior. - Apply various Rust formatting/refactor-only adjustments (no functional change intended) and update Factory docs.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src-tauri/src/webkit_config.rs | Refactors the WebKit suspension-disabling closure formatting. |
| src-tauri/src/tray.rs | Rustfmt-style formatting for tray menu item creation. |
| src-tauri/src/plugin_engine/runtime.rs | Formatting + minor control-flow style adjustments in probe runtime and parsing. |
| src-tauri/src/plugin_engine/mod.rs | Log formatting adjustments during plugin installation/copy steps. |
| src-tauri/src/plugin_engine/manifest.rs | Import ordering + minor log formatting in link sanitization. |
| src-tauri/src/plugin_engine/host_api.rs | Introduces AES-256-GCM decrypt helper, injects host.crypto API, and adds tests. |
| src-tauri/src/panel.rs | Import/log formatting and minor formatting of config parsing. |
| src-tauri/Cargo.toml | Adds direct openssl dependency needed by the new crypto helper. |
| src-tauri/Cargo.lock | Updates OpenSSL-related versions and records new direct dependency usage. |
| plugins/test-helpers.js | Adds a test double for host.crypto.decryptAes256Gcm using Node crypto. |
| plugins/factory/plugin.test.js | Adds coverage for v2 auth loading/decryption and refresh edge-cases. |
| plugins/factory/plugin.js | Implements v2 auth loading preference + safer proactive refresh fallback behavior. |
| docs/providers/factory.md | Documents the new v2 auth storage locations and precedence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
I can approve this after you resolve @robinebers's comment (if relevant). I don't use droid so I can't test this though. |
|
Addressing the AI review feedback:
Verification:
|
|
Addressing the two Copilot review comments:
Verification:
|
Summary
auth.v2.file+auth.v2.keystore before falling back to legacy auth sourcesTesting
bun run test --run plugins/factory/plugin.test.jscargo test --manifest-path src-tauri/Cargo.toml plugin_engine::host_api::testsbun run test:coverage(fails: global branch coverage is89.58%, below the90%threshold; PR created anyway per explicit user instruction)