Skip to content

Update oauth2 gem dependency to 2.0#176

Merged
karlnaden merged 2 commits into
inferno-framework:masterfrom
abhinandan2012:ID-69-update-oauth2-gem-v2
Mar 13, 2026
Merged

Update oauth2 gem dependency to 2.0#176
karlnaden merged 2 commits into
inferno-framework:masterfrom
abhinandan2012:ID-69-update-oauth2-gem-v2

Conversation

@abhinandan2012
Copy link
Copy Markdown
Contributor

Summary

This PR updates the oauth2 gem dependency from 1.1 to 2.0.

Changes

  • Updated fhir_client.gemspec to require oauth2 ~> 2.0.
  • Updated set_oauth2_auth in lib/fhir_client/client.rb to explicitly use auth_scheme: :request_body since the oauth2 v2 changed the default to :basic_auth. This preserves the existing token request behavior expected by SMART on FHIR providers.
  • Updated proxy configuration to use connection_opts: { proxy: proxy } as direct client.connection manipulation is no longer supported in the underlying Faraday 2.x dependency.
  • Fixed an invalid regex escape sequence in lib/fhir_client/fhir_api_validation.json to prevent JSON::ParserError during response validation in modern Ruby environments.

Testing Instructions

Unit Testing:

  1. Check out this branch and run bundle install to install the updated dependencies.
  2. Execute the test suite using bundle exec rake test.
  3. Verify that all tests pass, specifically noting that the OAuth2 and client logging tests complete successfully.

UI / Integration Testing:

  1. Check out an Inferno test kit locally (e.g., onc-certification-g10-test-kit).
  2. Update its Gemfile to point the fhir_client gem to this local branch (e.g., gem 'fhir_client', path: '../fhir_client').
  3. Run the test kit and navigate to the local web UI (typically http://localhost:4567).
  4. Execute a test suite that requires an OAuth2 token exchange, such as the "Standalone Patient App" suite in the ONC Certification (g)(10) test kit.
  5. Verify that the Smart App Launch token exchange completes successfully without any "Unauthorized" or connection errors.

Comment thread lib/fhir_client/fhir_api_validation.json
Comment thread lib/fhir_client/client.rb
@karlnaden karlnaden merged commit fee4a85 into inferno-framework:master Mar 13, 2026
3 checks passed
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.

2 participants