Repository navigation
fix(auth): Google's signing-key fetch shows up in sign-in traces - #309
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Instrument SDK HTTP exchanges crates/auth-sdk/Cargo.toml, crates/auth-sdk/src/http.rs, crates/auth-sdk/src/lib.rs |
The SDK adds tracing as an unconditional dependency. Http::send runs the exchange inside an http.client span, records method, host, and response status, and marks exchange errors and 4xx/5xx responses as errors. Documentation describes the span fields and behavior. |
Configure and verify auth-service telemetry apps/auth-service/src/lib.rs, apps/auth-service/src/federation/tests.rs, docs/architecture/telemetry.md |
The auth-service filter includes piquel_auth=info. A federation test checks the Google signing-key request span’s parent, method, integer status, server address, and omission of the path and query. Telemetry guidance notes that SDK requests receive spans from the SDK. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant FederationTest
participant KeyCache
participant AuthSdkHttp
participant GoogleKeyEndpoint
FederationTest->>KeyCache: Verify signed token
KeyCache->>AuthSdkHttp: Fetch Google signing keys
AuthSdkHttp->>GoogleKeyEndpoint: Send GET request inside http.client span
GoogleKeyEndpoint-->>AuthSdkHttp: Return response status
AuthSdkHttp-->>KeyCache: Return signing-key response
Suggested labels: apps/auth-service
Merge Risk: 
Minimal · previous review 6d508
-
The SDK adds outbound request tracing without an identified merge-blocking issue.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 4 files. (2 skipped: 2 unsupported.)
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit watched the requests flow,
With spans to mark the fields they show.
Method, host, and status appear,
While paths and queries stay unclear.
The keys return; the traces glow.
… call The Rust SDK now sends each request in an http.client span recording only method, host and status, so KeyCache's JWKS fetches appear in sign-in traces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edaa6a7 to
6d508e6
Compare
tracing-opentelemetry records unsigned integers as strings, unlike the i64 send_traced exports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6d508e6 to
73a4711
Compare
…can't drift apart (#310) Stacked on #309. #309 left two copies of the client span code: auth's `SendTraced` and the one the Rust SDK grew for itself. They can drift apart, and reviewing #309 showed they already had: both recorded the status code as a `u16`, which tracing-opentelemetry exports as a string. That's fixed in #309. This PR leaves a single copy so it can't happen again. `SendTraced` now lives in `piquel-common`, behind a new `client-spans` feature, which both auth and the SDK already depend on. `piquel-telemetry` re-exports it, so auth's `.send_traced()` callers don't change. The SDK's `Http::send` now calls it too. **Changes in behavior:** - The SDK's span now ends when the headers arrive, like every other provider call. - Apps using the SDK find its spans under the `piquel_common` target rather than `piquel_auth`. The SDK docs say so. - `piquel-telemetry` enables that target itself, so the `piquel_auth=info` filter that #309 added to auth is gone again. **Proof:** the test from #309, `google_key_fetch_is_a_client_span_of_its_request`, now exercises the shared `SendTraced`. It checks that the span sits under its request, records method, host and status (as an integer), and contains no path or query. It passes. `piquel-telemetry` and `piquel-auth` tests pass, clippy is clean, and `cargo doc` with `-D warnings` is clean with and without the feature. The net change removes code: 60 lines added, 76 removed. Reviewed with review-loop: 2 rounds with 2× GPT-6.1 Sol and Claude Opus 5.5. Verdict: approved > [!NOTE] > Written by Claude Opus 5.5 in Claude Code and reviewed by GPT-6.1 Sol and Claude Opus 5.5 (via T3 Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signing in with Google left a gap in the trace: every GitHub and Google call had a client span except the fetch of Google's signing keys. That fetch goes through the Rust SDK's
KeyCache, not auth'ssend_traced(), so it never showed up.Now the SDK sends every request in an
http.clientspan of its own, with the same attributes assend_traced(): method, host, status and duration. It never records the path, query or headers. The span sits under the request that needed the keys. The SDK still depends only ontracing, not on auth's telemetry crates, so any app using it gets these spans too. Auth's filter now letspiquel_authspans through.The span goes in the SDK rather than around auth's call to
keys.verify(), becauseverify()only sometimes reaches the network. A span there would also appear when the cached keys were used.Proof: a new test,
google_key_fetch_is_a_client_span_of_its_request, fetches keys from a URL with a secret query string. It checks that the span is a child of the request's span, has method, host and status, exports the status as an integer likesend_traced()does, and contains no path or query. It fails without the SDK change and passes with it.cargo test -p piquel-authand clippy are clean.Reviewed with review-loop: 2 rounds with 2× GPT-6.1 Sol and Claude Opus 5.5. Verdict: approved
Note
Written by Claude Opus 5.5 in Claude Code and reviewed by GPT-6.1 Sol and Claude Opus 5.5 (via T3 Code)
🤖 Generated with Claude Code
Authentication SDK
The SDK now creates an
http.clienttracing span for each outbound request. The span records the HTTP method, host, and response status as an integer. It does not record the request path or query. The SDK recordsERRORfor 4xx and 5xx responses and for exchange errors.The span is emitted when the SDK sends the request, including when
KeyCachefetches Google signing keys. It is therefore a child of the span for the request that needed those keys, and appears only when the keys are fetched over the network. The SDK now depends ontracingunconditionally instead of enabling it through theaxumfeature.Tests
A federation test checks that a Google signing-key fetch creates a child
GETclient span. It checks the integer status and server address attributes, and confirms that the path and query are absent.Auth service telemetry
The auth service telemetry filter now includes
piquel_auth=info, allowing the SDK spans through the configured filter.Documentation
The SDK documentation describes the client span and its recorded attributes. The telemetry guidance clarifies that the Rust SDK creates spans for outbound requests, including Google signing-key fetches through
KeyCache.Validation
The supplied context reports that
cargo test -p piquel-authand clippy pass. It also reports that the new test fails without the SDK change and passes with it. Current review finding counts were not supplied.