Skip to content

Refactor Bulk Data Auth specs to support imported SMART tests#739

Closed
abhinandan2012 wants to merge 6 commits intoonc-healthit:mainfrom
abhinandan2012:ID-10-import-smart-backend-services-tests
Closed

Refactor Bulk Data Auth specs to support imported SMART tests#739
abhinandan2012 wants to merge 6 commits intoonc-healthit:mainfrom
abhinandan2012:ID-10-import-smart-backend-services-tests

Conversation

@abhinandan2012
Copy link
Contributor

@abhinandan2012 abhinandan2012 commented Jan 26, 2026

Summary

This PR removes duplicated SMART Backend Services authorization tests from the (g)(10) Bulk Data Authorization group and imports the canonical SMART tests instead.

Background

The (g)(10) test kit previously reimplemented SMART Backend Services authorization logic, which caused spec drift and required fixes such as #721.

Changes

  • Replaced inline backend services authorization tests with canonical SMART test imports
  • Mapped smart_auth_info inputs/outputs to existing bulk_smart_auth_info
  • Updated specs to inject authentication_response input directly, matching SMART test semantics
  • Removed duplicated test logic

Benefits

  • SMART backend services tests become the single source of truth
  • Prevents future spec drift between SMART and (g)(10)
  • Improves test maintainability and correctness
  • Keeps UI and workflow unchanged

Testing

  • Ran Inferno locally
  • Executed Multi-Patient API STU2 => Authorization tests
  • Verified no additional UI inputs appear
  • All specs pass

@abhinandan2012
Copy link
Contributor Author

@karlnaden After the latest commit (requirements coverage update), GitHub reset the workflow approval. Whenever convenient, could you please approve the workflow so CI can run? Thanks!

Copy link
Contributor

@karlnaden karlnaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One piece of this that we need to be careful about the is the jwks set. Currently, g10 has its own jwks set that is hosts for these bulk auth tests, with a configuration key in the environment to use a different one.

SMART has its own jwks set, and a different configuration key to override it. It just so happens that the default jwks sets in the two repositories are the same, so everything is fine as long as neither default is changed and no updates are made to one but not the other. That seems like a risky situation to leave ourselves in, so I think we need to come up with some kind of solution.

One solution that probably would work would be to list the g10 jwks url in the jwks component of the bulk_smart_auth_info input. It is locked so it can't be changed and that would force the SMART logic to use the g10 configured jwks instead of its configured one.

Copy link
Contributor

@karlnaden karlnaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default URL wasn't correct. Please also provide instructions for how to test the case where the G10_BULK_DATA_JWKS environment variable is set to a different file that contains a different jwks than the current one in the g10 and SMART test kits. Otherwise, we won't be sure that the change to use the default jwks setting worked.

inputs: { smart_auth_info: { name: :bulk_smart_auth_info } },
outputs: {
smart_auth_info: { name: :bulk_smart_auth_info },
authentication_response: { name: :authentication_response }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line not needed since you are not renaming the input. The previous line is. Same issue in the next test. Remove both.

},
{
name: :jwks,
default: "#{Inferno::Application['base_url']}/custom/g10_certification/jwks",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong url

Suggested change
default: "#{Inferno::Application['base_url']}/custom/g10_certification/jwks",
default: "#{Inferno::Application['base_url']}/custom//g10_certification/.well-known/jwks.json",

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