Skip to content

Resolve RPC auth follow-up comments#2

Draft
YellowSnnowmann wants to merge 1 commit into
mainfrom
feat/core-rpc-auth-15793745111021328236
Draft

Resolve RPC auth follow-up comments#2
YellowSnnowmann wants to merge 1 commit into
mainfrom
feat/core-rpc-auth-15793745111021328236

Conversation

@YellowSnnowmann
Copy link
Copy Markdown
Owner

Resolved the remaining follow-up comments from the PR review:

  1. Auth Middleware Tightening: Updated rpc_auth_middleware to use an explicit (method, path) allowlist, ensuring only GET requests to public paths and OPTIONS requests are bypassed.
  2. Documentation Accuracy: Corrected the module-level documentation in src/core/auth.rs to accurately reflect how the Tauri shell and frontend handle the RPC token.
  3. Frontend Robustness: Implemented a single-retry mechanism with a 100ms delay in coreRpcClient.ts when fetching the token via the core_rpc_token Tauri command.
  4. Test Safety: Addressed potential unsoundness in tests by moving std::env::set_var into one-time initialization closures, wrapping them in unsafe blocks, and ensuring they are serialized by existing environment locks.
  5. Observability: Added a success log message upon successful bearer token initialization in the core server.
  6. Maintainability: Added comments explaining manual header construction in the core updater and improved the robustness of init_rpc_token.

All tests in json_rpc_e2e and core auth unit tests passed.


PR created automatically by Jules for task 15793745111021328236 started by @YellowSnnowmann

- Add initialization log in `src/core/jsonrpc.rs`.
- Tighten `rpc_auth_middleware` method+path allowlist in `src/core/auth.rs`.
- Update module-level documentation in `src/core/auth.rs` for accuracy.
- Add retry mechanism to `getCoreRpcToken` in `coreRpcClient.ts`.
- Fix thread-unsafe `std::env::set_var` in E2E tests with `unsafe` blocks and serialization.
- Add explanatory comments for manual auth header construction.
- Improve `init_rpc_token` idempotency and error handling.

Co-authored-by: YellowSnnowmann <167776381+YellowSnnowmann@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant