Repository navigation
Conversation
Reworked the pending OAuth state tracking to make the flow easier to follow and less error-prone. The change keeps the same external behaviour while tidying up how entries are stored and looked up. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce an OAuth authorization code flow that generates PKCE challenge and verifier pairs, builds the authorization URL, and exchanges the returned code for tokens. This gives the registry a standards-compliant way to obtain user-scoped credentials. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds tests for the OAuth host store and registry operations modules to exercise the new code paths. The added cases cover host persistence and the registry op handlers so regressions surface in CI. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Drop an unused import from the registry module to keep the build warning-free. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds test coverage for the OAuth host store in the registry, exercising the storage and lookup behaviour that was previously untested. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted long function signatures and assertions in the OAuth pending store and its tests to satisfy line width limits, and reordered the pending imports in flow.rs and mod_tests.rs. No behaviour changed. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a crate-level allow for clippy's unwrap, expect, and panic lints in the pending store test module, since panicking is the expected failure mode in tests. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Tiny Sweeper reviewTiny Sweeper completed its review; deterministic results follow. State: Incomplete Review snapshot
Completeness: Incomplete What changed`crates/tinymcp/src/registry/oauth/pending.rs` is a new module defining `PendingAuthorization` (now public, serde-serializable, with a redacted `Debug` and an `expired_at` helper), the object-safe `PendingAuthorizationStore` trait with atomic `take`, and the default `MemoryPendingStore`, which prunes expired entries whenever touched and whose `Debug` shows only a parked count. `crates/tinymcp/src/registry/oauth/flow.rs` replaces the in-process `Mutex<HashMap<String, PendingAuthorization>>` with an `Arc<dyn PendingAuthorizationStore>` defaulting to `MemoryPendingStore`, adds `with_pending_store` for shared stores, routes `begin` through async `park`, and makes `complete` atomically `take` the state and reject entries that the flow itself judges expired — so a lazy store still cannot complete a stale sign-in. `pending_server` and `pending_count` become async, `Result`-returning methods, a breaking signature change reflected in all call sites. The `PendingAuthorization` struct is removed from `crates/tinymcp/src/registry/oauth/types.rs` in favor of the new public one, and the new items plus `PENDING_TTL_SECS` (replacing the private `PENDING_TTL`) are re-exported through `crates/tinymcp/src/registry/mod.rs` and `crates/tinymcp/src/lib.rs`. Features
Tests
FindingsNo active actionable findings. Could not review: crates/tinymcp/src/registry/oauth/mod.rs, crates/tinymcp/src/registry/oauth/mod_tests.rs Before merge
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc3aea6cec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: crates/tinymcp/src/registry/mod.rs, crates/tinymcp/src/registry/oauth/flow.rs, crates/tinymcp/src/registry/oauth/mod.rs, crates/tinymcp/src/registry/oauth/mod_tests.rs, crates/tinymcp/src/registry/oauth/pending.rs, crates/tinymcp/src/registry/oauth/pending_tests.rs, crates/tinymcp/src/registry/ops/mod_tests.rs.
$0.0196 · 445,548 in / 27,818 out · 8,960 cached (2%) · ladder/vectors-oai3, glm-5.3-flash, · 760 embedded
critique: $0.0175 · 233,240 in / 23,428 out · 0 cached (0%) · glm-5.3-flash,
security: $0.0014 · 156,666 in / 2,811 out · 8,960 cached (6%) · glm-5.3-flash,
tests: $0.0002 · 22,787 in / 240 out · 0 cached (0%) · glm-5.3-flash
description: $0.0003 · 32,855 in / 1,339 out · 0 cached (0%) · glm-5.3-flash
|
The |
Re-export the pending authorization store, its in-memory implementation, and the pending TTL constant from the crate root so downstream users can access them without reaching into the registry module. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a test asserting the pending authorization store API resolves at the crate root, exercising the store trait, in-memory implementation, flow wiring, and TTL expiry so the public surface stays reachable. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds an allow attribute for clippy's unwrap, expect, and panic lints to the public reexports test, since assertions in tests legitimately panic. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40080aa060
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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.
tinysweeper found nothing blocking. Approving.
$0.0019 · 175,954 in / 8,836 out · 8,960 cached (5%) · ladder/vectors-oai3, glm-5.3-flash · 763 embedded
critique: $0.0006 · 48,492 in / 4,330 out · 0 cached (0%) · glm-5.3-flash
security: $0.0004 · 44,714 in / 889 out · 0 cached (0%) · glm-5.3-flash
tests: $0.0005 · 47,943 in / 3,049 out · 0 cached (0%) · glm-5.3-flash
description: $0.0003 · 34,805 in / 568 out · 8,960 cached (26%) · glm-5.3-flash
The memory pending store derived Debug, which printed the map keys and therefore leaked the state bearer secret while a sign-in was open. It now has a hand-written Debug that reports only how many authorizations are parked, with a test pinning that no state or verifier value appears. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
tinysweeper found nothing blocking. Approving.
$0.0031 · 163,878 in / 9,903 out · 0 cached (0%) · ladder/vectors-oai3, glm-5.3-flash · 748 embedded
critique: $0.0005 · 54,691 in / 1,069 out · 0 cached (0%) · glm-5.3-flash
security: $0.0006 · 53,959 in / 3,879 out · 0 cached (0%) · glm-5.3-flash
tests: $0.0002 · 23,862 in / 1,035 out · 0 cached (0%) · glm-5.3-flash
description: $0.0002 · 15,893 in / 923 out · 0 cached (0%) · glm-5.3-flash
tinysweeper could not review the latest push, so its earlier approval no longer speaks for this pull request.
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: crates/tinymcp/src/registry/oauth/mod.rs, crates/tinymcp/src/registry/oauth/mod_tests.rs.
$0.0237 · 787,336 in / 28,666 out · 71,104 cached (9%) · ladder/vectors-oai3, glm-5.3-flash, deepseek-v4.1-flash · 748 embedded
critique: $0.0042 · 249,194 in / 6,201 out · 15,488 cached (6%) · glm-5.3-flash
security: $0.0192 · 422,458 in / 19,257 out · 49,216 cached (12%) · glm-5.3-flash, deepseek-v4.1-flash
tests: $0.0000 · 49,876 in / 519 out · 4,352 cached (9%) · deepseek-v4.1-flash
description: $0.0000 · 34,331 in / 405 out · 2,048 cached (6%) · deepseek-v4.1-flash
Summary
OAuthFlowparked each sign-in's PKCE verifier and registered client in aMutex<HashMap>inside the flow. The redirect could only be completed by the process that began it. A host running several instances behind one callback URL lands the redirect on whichever instance the load balancer picks, and the sign-in fails with "unknown or expired oauth state".This makes the pending store pluggable:
PendingAuthorizationStore(object-safe:park, atomictake,peek,count). A host backs it with a store all its instances share.MemoryPendingStoreis the default, so existing hosts behave as before.OAuthFlow::with_pending_store(Arc<dyn PendingAuthorizationStore>).PendingAuthorizationis now public, with serde, so a host can persist it. ItsDebugredacts the verifier and client secret.PENDING_TTL_SECSis public so a store can expire entries itself (a TTL index). The flow also refuses any entry older than that, so a store that never expires cannot complete a stale sign-in.Related issue
None.
API or behavior changes
OAuthFlow::pending_serverandOAuthFlow::pending_countare nowasyncand returnResult, because they read the store. No caller outside this crate's tests uses them (checked in OpenHuman).PendingAuthorizationStore,MemoryPendingStore,PendingAuthorization,PENDING_TTL_SECS,OAuthFlow::with_pending_store. They are re-exported fromregistry.Validation
cargo fmt --all -- --check: okcargo clippy --all-targets --all-features -- -D warnings: okcargo build --all-targets --all-features: okcargo test --all-features: all passRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features: okTests
registry/oauth/pending_tests.rscovers the memory store: take once, peek does not consume, unknown state, expiry drop, expiry boundary, redactedDebug, and the pinned serde form.mod_host_store_tests.rs:pending_*.Documentation
Module docs on
registry/oauth/pending.rsand theoauthmodule overview.Checklist
#[allow(...)],#[ignore], or relaxed lints. The test file uses the same test-only#![allow(clippy::unwrap_used, ...)]header as every other*_tests.rs.envcontents in the diff or the descriptionSummary by CodeRabbit