-
-
Notifications
You must be signed in to change notification settings - Fork 158
✨ Support JSON body #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Support JSON body #108
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #108 +/- ##
==========================================
+ Coverage 96.79% 96.81% +0.02%
==========================================
Files 4 4
Lines 312 314 +2
Branches 116 116
==========================================
+ Hits 302 304 +2
Misses 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for JSON-encoded POST bodies in the LDAP authentication strategy, complementing the existing form-encoded support. Rails applications automatically parse JSON request bodies into action_dispatch.request.request_parameters, which the strategy now reads via a new request_data helper method.
- Introduced a
request_datamethod that checks for Rails-parsed JSON parameters before falling back to standard form parameters - Updated all parameter accesses throughout the strategy to use
request_datainstead of directly accessingrequest.params - Added comprehensive test coverage for JSON authentication flows
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/omniauth/strategies/ldap.rb | Implemented request_data helper and updated parameter access to support JSON bodies |
| spec/omniauth/strategies/ldap_spec.rb | Added test case for JSON POST with Rails environment variables |
| spec/integration/middleware_spec.rb | Added integration tests for JSON authentication flows and missing credentials scenarios |
| README.md | Added documentation on JSON body usage with examples; fixed Discord link reference; added copyright entry |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Builds on and replaces #47