fix(jans-fido2): capture request IP/User-Agent on request thread for …#14481
Open
imran-ishaq wants to merge 1 commit into
Open
fix(jans-fido2): capture request IP/User-Agent on request thread for …#14481imran-ishaq wants to merge 1 commit into
imran-ishaq wants to merge 1 commit into
Conversation
…metrics Signed-off-by: imran <imranishaq7071@gmail.com>
imran-ishaq
marked this pull request as ready for review
July 2, 2026 11:48
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
👮 Files not reviewed due to content moderation or server errors (1)
📝 Walkthrough
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
imran-ishaq
had a problem deploying
to
integration-tests
July 2, 2026 11:49 — with
GitHub Actions
Failure
imran-ishaq
had a problem deploying
to
integration-tests
July 2, 2026 11:49 — with
GitHub Actions
Failure
Member
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Description
The FIDO2 Metrics API does not return the ipAddress field in its responses, even though the field is declared in the OpenAPI spec (jans-fido2/docs/jansFido2Swagger.yaml). The same problem affects userAgent and deviceInfo.
Root cause: In MetricService, metric events are recorded inside CompletableFuture.runAsync(...), and the client IP, User-Agent and device info are read there from the injected @context HttpServletRequest. That proxy is bound to the request-handling thread, so on the async ForkJoinPool thread the reads (request.getRemoteAddr() / request.getHeader(...)) throw. The exception is swallowed by the surrounding try/catch, leaving ipAddress/userAgent/deviceInfo null. Because Fido2MetricsEntry uses @JsonInclude(NON_NULL), the null fields are dropped from the serialized response.
Target issue
The metric entries returned by /metrics/entries should include the ipAddress (and userAgent/deviceInfo) captured from the originating HTTP request, as documented in the OpenAPI spec.
closes #14480
Implementation Details
Test and Document the changes
Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with
docs:to indicate documentation changes or if the below checklist is not selected.