diff --git a/Gemfile b/Gemfile index dd583968..e9cf2828 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,10 @@ source "https://rubygems.org" gemspec +gem 'smart_app_launch_test_kit', + git: 'https://github.com/inferno-framework/smart-app-launch-test-kit.git', + branch: 'fi-3093-use-auth-info' + group :development, :test do gem 'debug' gem 'rack-test' diff --git a/Gemfile.lock b/Gemfile.lock index 91ada2ec..5d2437c9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,19 @@ +GIT + remote: https://github.com/inferno-framework/smart-app-launch-test-kit.git + revision: 7951cdd61c1189df1e967239707151378d72bf98 + branch: fi-3093-use-auth-info + specs: + smart_app_launch_test_kit (0.5.0) + inferno_core (>= 0.6.3) + json-jwt (~> 1.15.3) + jwt (~> 2.6) + tls_test_kit (~> 0.3.0) + PATH remote: . specs: us_core_test_kit (0.10.0) - inferno_core (>= 0.6.1) + inferno_core (>= 0.6.3) smart_app_launch_test_kit (>= 0.5.0) tls_test_kit (~> 0.3.0) @@ -137,7 +148,7 @@ GEM httpclient (2.8.3) i18n (1.14.7) concurrent-ruby (~> 1.0) - inferno_core (0.6.2) + inferno_core (0.6.3) activesupport (~> 6.1.7.5) base62-rb (= 0.3.1) blueprinter (= 0.25.2) @@ -178,12 +189,12 @@ GEM base64 kramdown (2.5.1) rexml (>= 3.3.9) - logger (1.6.5) + logger (1.6.6) method_source (1.1.0) mime-types (3.6.0) logger mime-types-data (~> 3.2015) - mime-types-data (3.2025.0107) + mime-types-data (3.2025.0204) mini_portile2 (2.8.8) minitest (5.25.4) multi_json (1.15.0) @@ -227,7 +238,7 @@ GEM puma (5.6.9) nio4r (~> 2.0) racc (1.8.1) - rack (2.2.10) + rack (2.2.11) rack-test (2.2.0) rack (>= 1.3) rake (13.2.1) @@ -264,11 +275,6 @@ GEM connection_pool (>= 2.3.0) rack (>= 2.2.4) redis-client (>= 0.19.0) - smart_app_launch_test_kit (0.5.0) - inferno_core (>= 0.6.2) - json-jwt (~> 1.15.3) - jwt (~> 2.6) - tls_test_kit (~> 0.3.0) sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) sqlite3 (1.7.3-arm64-darwin) @@ -315,6 +321,7 @@ DEPENDENCIES factory_bot (~> 6.1) rack-test rspec (~> 3.10) + smart_app_launch_test_kit! us_core_test_kit! webmock (~> 3.11) diff --git a/config/presets/inferno_reference_server_311_preset.json b/config/presets/inferno_reference_server_311_preset.json index 78bdd245..236a679f 100644 --- a/config/presets/inferno_reference_server_311_preset.json +++ b/config/presets/inferno_reference_server_311_preset.json @@ -11,41 +11,13 @@ "value": "https://inferno.healthit.gov/reference-server/r4" }, { - "name": "smart_credentials", - "type": "oauth_credentials", - "title": "OAuth Credentials", - "optional": true, - "value": "{\"access_token\":\"SAMPLE_TOKEN\"}" - }, - { - "name": "standalone_client_id", - "type": "text", - "title": "Standalone Client ID", - "description": "Client ID provided during registration of Inferno as a standalone application", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_ID" - }, - { - "name": "standalone_client_secret", - "type": "text", - "title": "Standalone Client Secret", - "description": "Client Secret provided during registration of Inferno as a standalone application", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET" - }, - { - "name": "ehr_client_id", - "type": "text", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_ID" - }, - { - "name": "ehr_client_secret", - "type": "text", - "optional": false, - "value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET" - }, - { - "name": "client_auth_type", - "type": "text", - "value": "confidential_symmetric" + "name": "smart_auth_info", + "type": "auth_info", + "value": { + "auth_type": "public", + "use_discovery": "true", + "client_id": "SAMPLE_PUBLIC_CLIENT_ID" + } }, { "name": "patient_ids", diff --git a/config/presets/inferno_reference_server_400_preset.json b/config/presets/inferno_reference_server_400_preset.json index d2b7b476..2b644677 100644 --- a/config/presets/inferno_reference_server_400_preset.json +++ b/config/presets/inferno_reference_server_400_preset.json @@ -11,41 +11,13 @@ "value": "https://inferno.healthit.gov/reference-server/r4" }, { - "name": "smart_credentials", - "type": "oauth_credentials", - "title": "OAuth Credentials", - "optional": true, - "value": "{\"access_token\":\"SAMPLE_TOKEN\"}" - }, - { - "name": "standalone_client_id", - "type": "text", - "title": "Standalone Client ID", - "description": "Client ID provided during registration of Inferno as a standalone application", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_ID" - }, - { - "name": "standalone_client_secret", - "type": "text", - "title": "Standalone Client Secret", - "description": "Client Secret provided during registration of Inferno as a standalone application", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET" - }, - { - "name": "ehr_client_id", - "type": "text", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_ID" - }, - { - "name": "ehr_client_secret", - "type": "text", - "optional": false, - "value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET" - }, - { - "name": "client_auth_type", - "type": "text", - "value": "confidential_symmetric" + "name": "smart_auth_info", + "type": "auth_info", + "value": { + "auth_type": "public", + "use_discovery": "true", + "client_id": "SAMPLE_PUBLIC_CLIENT_ID" + } }, { "name": "patient_ids", diff --git a/config/presets/inferno_reference_server_501_preset.json b/config/presets/inferno_reference_server_501_preset.json index faf0df90..81d43f6e 100644 --- a/config/presets/inferno_reference_server_501_preset.json +++ b/config/presets/inferno_reference_server_501_preset.json @@ -11,41 +11,13 @@ "value": "https://inferno.healthit.gov/reference-server/r4" }, { - "name": "smart_credentials", - "type": "oauth_credentials", - "title": "OAuth Credentials", - "optional": true, - "value": "{\"access_token\":\"SAMPLE_TOKEN\"}" - }, - { - "name": "standalone_client_id", - "type": "text", - "title": "Standalone Client ID", - "description": "Client ID provided during registration of Inferno as a standalone application", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_ID" - }, - { - "name": "standalone_client_secret", - "type": "text", - "title": "Standalone Client Secret", - "description": "Client Secret provided during registration of Inferno as a standalone application", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET" - }, - { - "name": "ehr_client_id", - "type": "text", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_ID" - }, - { - "name": "ehr_client_secret", - "type": "text", - "optional": false, - "value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET" - }, - { - "name": "client_auth_type", - "type": "text", - "value": "confidential_symmetric" + "name": "smart_auth_info", + "type": "auth_info", + "value": { + "auth_type": "public", + "use_discovery": "true", + "client_id": "SAMPLE_PUBLIC_CLIENT_ID" + } }, { "name": "patient_ids", diff --git a/config/presets/inferno_reference_server_610_preset.json b/config/presets/inferno_reference_server_610_preset.json index d1b7f8a8..99113d4a 100644 --- a/config/presets/inferno_reference_server_610_preset.json +++ b/config/presets/inferno_reference_server_610_preset.json @@ -11,41 +11,13 @@ "value": "https://inferno.healthit.gov/reference-server/r4" }, { - "name": "smart_credentials", - "type": "oauth_credentials", - "title": "OAuth Credentials", - "optional": true, - "value": "{\"access_token\":\"SAMPLE_TOKEN\"}" - }, - { - "name": "standalone_client_id", - "type": "text", - "title": "Standalone Client ID", - "description": "Client ID provided during registration of Inferno as a standalone application", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_ID" - }, - { - "name": "standalone_client_secret", - "type": "text", - "title": "Standalone Client Secret", - "description": "Client Secret provided during registration of Inferno as a standalone application", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET" - }, - { - "name": "ehr_client_id", - "type": "text", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_ID" - }, - { - "name": "ehr_client_secret", - "type": "text", - "optional": false, - "value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET" - }, - { - "name": "client_auth_type", - "type": "text", - "value": "confidential_symmetric" + "name": "smart_auth_info", + "type": "auth_info", + "value": { + "auth_type": "public", + "use_discovery": "true", + "client_id": "SAMPLE_PUBLIC_CLIENT_ID" + } }, { "name": "patient_ids", @@ -61,6 +33,24 @@ "description": "Enter the code for an Implantable Device type, or multiple codes separated by commas. If blank, Inferno will validate all Device resources against the Implantable Device profile", "optional": true, "value": null + }, + { + "name": "granular_scopes_1_auth_info", + "type": "auth_info", + "value": { + "auth_type": "public", + "use_discovery": "true", + "client_id": "SAMPLE_PUBLIC_CLIENT_ID" + } + }, + { + "name": "granular_scopes_2_auth_info", + "type": "auth_info", + "value": { + "auth_type": "public", + "use_discovery": "true", + "client_id": "SAMPLE_PUBLIC_CLIENT_ID" + } } ] } diff --git a/config/presets/inferno_reference_server_700_preset.json b/config/presets/inferno_reference_server_700_preset.json index 5b6bd1b3..034d7f56 100644 --- a/config/presets/inferno_reference_server_700_preset.json +++ b/config/presets/inferno_reference_server_700_preset.json @@ -11,41 +11,13 @@ "value": "https://inferno.healthit.gov/reference-server/r4" }, { - "name": "smart_credentials", - "type": "oauth_credentials", - "title": "OAuth Credentials", - "optional": true, - "value": "{\"access_token\":\"SAMPLE_TOKEN\"}" - }, - { - "name": "standalone_client_id", - "type": "text", - "title": "Standalone Client ID", - "description": "Client ID provided during registration of Inferno as a standalone application", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_ID" - }, - { - "name": "standalone_client_secret", - "type": "text", - "title": "Standalone Client Secret", - "description": "Client Secret provided during registration of Inferno as a standalone application", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET" - }, - { - "name": "ehr_client_id", - "type": "text", - "value": "SAMPLE_CONFIDENTIAL_CLIENT_ID" - }, - { - "name": "ehr_client_secret", - "type": "text", - "optional": false, - "value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET" - }, - { - "name": "client_auth_type", - "type": "text", - "value": "confidential_symmetric" + "name": "smart_auth_info", + "type": "auth_info", + "value": { + "auth_type": "public", + "use_discovery": "true", + "client_id": "SAMPLE_PUBLIC_CLIENT_ID" + } }, { "name": "patient_ids", @@ -61,6 +33,24 @@ "description": "Enter the code for an Implantable Device type, or multiple codes separated by commas. If blank, Inferno will validate all Device resources against the Implantable Device profile", "optional": true, "value": null + }, + { + "name": "granular_scopes_1_auth_info", + "type": "auth_info", + "value": { + "auth_type": "public", + "use_discovery": "true", + "client_id": "SAMPLE_PUBLIC_CLIENT_ID" + } + }, + { + "name": "granular_scopes_2_auth_info", + "type": "auth_info", + "value": { + "auth_type": "public", + "use_discovery": "true", + "client_id": "SAMPLE_PUBLIC_CLIENT_ID" + } } ] } diff --git a/lib/us_core_test_kit/custom_groups/base_smart_granular_scopes_group.rb b/lib/us_core_test_kit/custom_groups/base_smart_granular_scopes_group.rb index cd3939b4..5d2e8637 100644 --- a/lib/us_core_test_kit/custom_groups/base_smart_granular_scopes_group.rb +++ b/lib/us_core_test_kit/custom_groups/base_smart_granular_scopes_group.rb @@ -51,8 +51,8 @@ def self.default_group_scopes(version) config( outputs: { - smart_credentials: { - name: :granular_scopes_1_credentials + smart_auth_info: { + name: :granular_scopes_1_auth_info } } ) @@ -61,8 +61,8 @@ def self.default_group_scopes(version) optional: true, config: { inputs: { - smart_credentials: { - name: :granular_scopes_1_credentials + smart_auth_info: { + name: :granular_scopes_1_auth_info } } } do @@ -80,8 +80,8 @@ def self.default_group_scopes(version) optional: true, config: { inputs: { - smart_credentials: { - name: :granular_scopes_1_credentials + smart_auth_info: { + name: :granular_scopes_1_auth_info } } } do @@ -100,8 +100,8 @@ def self.default_group_scopes(version) optional: true, config: { inputs: { - smart_credentials: { - name: :granular_scopes_1_credentials + smart_auth_info: { + name: :granular_scopes_1_auth_info } } } do @@ -119,8 +119,8 @@ def self.default_group_scopes(version) optional: true, config: { inputs: { - smart_credentials: { - name: :granular_scopes_1_credentials + smart_auth_info: { + name: :granular_scopes_1_auth_info } } } do @@ -148,8 +148,8 @@ def self.default_group_scopes(version) config( outputs: { - smart_credentials: { - name: :granular_scopes_2_credentials + smart_auth_info: { + name: :granular_scopes_2_auth_info } } ) @@ -159,8 +159,8 @@ def self.default_group_scopes(version) optional: true, config: { inputs: { - smart_credentials: { - name: :granular_scopes_2_credentials + smart_auth_info: { + name: :granular_scopes_2_auth_info } } } do @@ -178,8 +178,8 @@ def self.default_group_scopes(version) optional: true, config: { inputs: { - smart_credentials: { - name: :granular_scopes_2_credentials + smart_auth_info: { + name: :granular_scopes_2_auth_info } } } do @@ -198,8 +198,8 @@ def self.default_group_scopes(version) optional: true, config: { inputs: { - smart_credentials: { - name: :granular_scopes_2_credentials + smart_auth_info: { + name: :granular_scopes_2_auth_info } } } do @@ -217,8 +217,8 @@ def self.default_group_scopes(version) optional: true, config: { inputs: { - smart_credentials: { - name: :granular_scopes_2_credentials + smart_auth_info: { + name: :granular_scopes_2_auth_info } } } do diff --git a/lib/us_core_test_kit/custom_groups/smart_app_launch_group.rb b/lib/us_core_test_kit/custom_groups/smart_app_launch_group.rb index 554a6dd3..9dc03d7b 100644 --- a/lib/us_core_test_kit/custom_groups/smart_app_launch_group.rb +++ b/lib/us_core_test_kit/custom_groups/smart_app_launch_group.rb @@ -12,64 +12,28 @@ class SmartAppLaunchGroup < Inferno::TestGroup id :us_core_smart_app_launch title 'SMART App Launch' - SMART_V1_RESOURCE_LEVEL_SCOPES = 'launch/patient openid fhirUser offline_access patient/Patient.read patient/AllergyIntolerance.read patient/CarePlan.read patient/CareTeam.read patient/Condition.read patient/Coverage.read patient/Device.read patient/DiagnosticReport.read patient/DocumentReference.read patient/Encounter.read patient/Goal.read patient/Immunization.read patient/Location.read patient/Media.read patient/Medication.read patient/MedicationDispense.read patient/MedicationRequest.read patient/Observation.read patient/Organization.read patient/Practitioner.read patient/PractitionerRole.read patient/Procedure.read patient/Provenance.read patient/QuestionnaireResponse.read patient/RelatedPerson.read patient/ServiceRequest.read patient/Specimen.read'.freeze - - SMART_V2_RESOURCE_LEVEL_SCOPES = 'launch/patient openid fhirUser offline_access patient/Patient.rs patient/AllergyIntolerance.rs patient/CarePlan.rs patient/CareTeam.rs patient/Condition.rs patient/Coverage.rs patient/Device.rs patient/DiagnosticReport.rs patient/DocumentReference.rs patient/Encounter.rs patient/Endpoint.rs patient/Goal.rs patient/Immunization.rs patient/Location.rs patient/Media.rs patient/Medication.rs patient/MedicationDispense.rs patient/MedicationRequest.rs patient/Observation.rs patient/Organization.rs patient/Practitioner.rs patient/PractitionerRole.rs patient/Procedure.rs patient/Provenance.rs patient/QuestionnaireResponse.rs patient/RelatedPerson.rs patient/ServiceRequest.rs patient/Specimen.rs'.freeze - - SMART_V2_2_RESOURCE_LEVEL_SCOPES = 'launch/patient openid fhirUser offline_access patient/Patient.rs patient/AllergyIntolerance.rs patient/CarePlan.rs patient/CareTeam.rs patient/Condition.rs patient/Coverage.rs patient/Device.rs patient/DiagnosticReport.rs patient/DocumentReference.rs patient/Encounter.rs patient/Endpoint.rs patient/Goal.rs patient/Immunization.rs patient/Location.rs patient/Media.rs patient/Medication.rs patient/MedicationDispense.rs patient/MedicationRequest.rs patient/Observation.rs patient/Organization.rs patient/Practitioner.rs patient/PractitionerRole.rs patient/Procedure.rs patient/Provenance.rs patient/QuestionnaireResponse.rs patient/RelatedPerson.rs patient/ServiceRequest.rs patient/Specimen.rs'.freeze - group from: :us_core_smart_standalone_launch_stu1, required_suite_options: USCoreOptions::SMART_1_REQUIREMENT, - optional: true, - config: { - inputs: { - requested_scopes: { default: SmartAppLaunchGroup::SMART_V1_RESOURCE_LEVEL_SCOPES } - } - } + optional: true group from: :us_core_smart_ehr_launch_stu1, required_suite_options: USCoreOptions::SMART_1_REQUIREMENT, - optional: true, - config: { - inputs: { - requested_scopes: { default: SmartAppLaunchGroup::SMART_V1_RESOURCE_LEVEL_SCOPES } - } - } + optional: true group from: :us_core_smart_standalone_launch_stu2, required_suite_options: USCoreOptions::SMART_2_REQUIREMENT, - optional: true, - config: { - inputs: { - requested_scopes: { default: SmartAppLaunchGroup::SMART_V2_RESOURCE_LEVEL_SCOPES } - } - } + optional: true group from: :us_core_smart_ehr_launch_stu2, required_suite_options: USCoreOptions::SMART_2_REQUIREMENT, - optional: true, - config: { - inputs: { - requested_scopes: { default: SmartAppLaunchGroup::SMART_V2_RESOURCE_LEVEL_SCOPES } - } - } + optional: true group from: :us_core_smart_standalone_launch_stu2_2, required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT, - optional: true, - config: { - inputs: { - requested_scopes: { default: SmartAppLaunchGroup::SMART_V2_2_RESOURCE_LEVEL_SCOPES } - } - } + optional: true group from: :us_core_smart_ehr_launch_stu2_2, required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT, - optional: true, - config: { - inputs: { - requested_scopes: { default: SmartAppLaunchGroup::SMART_V2_2_RESOURCE_LEVEL_SCOPES } - } - } + optional: true end end diff --git a/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu1.rb b/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu1.rb index 73b75521..47ae7717 100644 --- a/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu1.rb +++ b/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu1.rb @@ -1,10 +1,36 @@ +require_relative 'smart_scopes_constants' + module USCoreTestKit class SmartEHRLaunchSTU1 < Inferno::TestGroup + include SmartScopesConstants + id :us_core_smart_ehr_launch_stu1 title 'EHR Launch' run_as_group + config( + inputs: { + smart_auth_info: { + name: :smart_auth_info, + options: { + components: [ + { + name: :requested_scopes, + default: SMART_V1_RESOURCE_LEVEL_SCOPES + } + ] + } + }, + received_scopes: { name: :ehr_received_scopes } + }, + outputs: { + smart_auth_info: { + name: :smart_auth_info + } + } + ) + group from: :smart_discovery, run_as_group: true group from: :smart_ehr_launch, @@ -16,10 +42,6 @@ class SmartEHRLaunchSTU1 < Inferno::TestGroup config( inputs: { id_token: { name: :ehr_id_token }, - client_id: { name: :ehr_client_id }, - requested_scopes: { name: :ehr_requested_scopes }, - access_token: { name: :ehr_access_token }, - smart_credentials: { name: :ehr_smart_credentials } } ) end @@ -27,14 +49,6 @@ class SmartEHRLaunchSTU1 < Inferno::TestGroup group from: :smart_token_refresh do run_as_group optional - config( - inputs: { - refresh_token: { name: :ehr_refresh_token }, - client_id: { name: :ehr_client_id }, - client_secret: { name: :ehr_client_secret }, - received_scopes: { name: :ehr_received_scopes } - } - ) end end end diff --git a/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu2.rb b/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu2.rb index 9154b5da..8fe805e7 100644 --- a/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu2.rb +++ b/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu2.rb @@ -1,10 +1,36 @@ +require_relative 'smart_scopes_constants' + module USCoreTestKit class SmartEHRLaunchSTU2 < Inferno::TestGroup + include SmartScopesConstants + id :us_core_smart_ehr_launch_stu2 title 'EHR Launch' run_as_group + config( + inputs: { + smart_auth_info: { + name: :smart_auth_info, + options: { + components: [ + { + name: :requested_scopes, + default: SMART_V2_RESOURCE_LEVEL_SCOPES + } + ] + } + }, + received_scopes: { name: :ehr_received_scopes } + }, + outputs: { + smart_auth_info: { + name: :smart_auth_info + } + } + ) + group from: :smart_discovery_stu2, run_as_group: true group from: :smart_ehr_launch_stu2, @@ -16,10 +42,6 @@ class SmartEHRLaunchSTU2 < Inferno::TestGroup config( inputs: { id_token: { name: :ehr_id_token }, - client_id: { name: :ehr_client_id }, - requested_scopes: { name: :ehr_requested_scopes }, - access_token: { name: :ehr_access_token }, - smart_credentials: { name: :ehr_smart_credentials } } ) end @@ -27,14 +49,6 @@ class SmartEHRLaunchSTU2 < Inferno::TestGroup group from: :smart_token_refresh do run_as_group optional - config( - inputs: { - refresh_token: { name: :ehr_refresh_token }, - client_id: { name: :ehr_client_id }, - client_secret: { name: :ehr_client_secret }, - received_scopes: { name: :ehr_received_scopes } - } - ) end end end diff --git a/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu2_2.rb b/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu2_2.rb index d9457db9..ff13881e 100644 --- a/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu2_2.rb +++ b/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu2_2.rb @@ -1,10 +1,36 @@ +require_relative 'smart_scopes_constants' + module USCoreTestKit class SmartEHRLaunchSTU22 < Inferno::TestGroup + include SmartScopesConstants + id :us_core_smart_ehr_launch_stu2_2 title 'EHR Launch' run_as_group + config( + inputs: { + smart_auth_info: { + name: :smart_auth_info, + options: { + components: [ + { + name: :requested_scopes, + default: SMART_V2_2_RESOURCE_LEVEL_SCOPES + } + ] + } + }, + received_scopes: { name: :ehr_received_scopes } + }, + outputs: { + smart_auth_info: { + name: :smart_auth_info + } + } + ) + group from: :smart_discovery_stu2_2, run_as_group: true group from: :smart_ehr_launch_stu2_2, @@ -16,10 +42,6 @@ class SmartEHRLaunchSTU22 < Inferno::TestGroup config( inputs: { id_token: { name: :ehr_id_token }, - client_id: { name: :ehr_client_id }, - requested_scopes: { name: :ehr_requested_scopes }, - access_token: { name: :ehr_access_token }, - smart_credentials: { name: :ehr_smart_credentials } } ) end @@ -27,14 +49,6 @@ class SmartEHRLaunchSTU22 < Inferno::TestGroup group from: :smart_token_refresh_stu2 do run_as_group optional - config( - inputs: { - refresh_token: { name: :ehr_refresh_token }, - client_id: { name: :ehr_client_id }, - client_secret: { name: :ehr_client_secret }, - received_scopes: { name: :ehr_received_scopes } - } - ) end end end diff --git a/lib/us_core_test_kit/custom_groups/smart_scopes_constants.rb b/lib/us_core_test_kit/custom_groups/smart_scopes_constants.rb index 3c2f4f9e..61057aeb 100644 --- a/lib/us_core_test_kit/custom_groups/smart_scopes_constants.rb +++ b/lib/us_core_test_kit/custom_groups/smart_scopes_constants.rb @@ -39,5 +39,11 @@ module SmartScopesConstants 'Observation', 'ServiceRequest' ].map(&:freeze).freeze + + SMART_V1_RESOURCE_LEVEL_SCOPES = 'launch/patient openid fhirUser offline_access patient/Patient.read patient/AllergyIntolerance.read patient/CarePlan.read patient/CareTeam.read patient/Condition.read patient/Coverage.read patient/Device.read patient/DiagnosticReport.read patient/DocumentReference.read patient/Encounter.read patient/Goal.read patient/Immunization.read patient/Location.read patient/Media.read patient/Medication.read patient/MedicationDispense.read patient/MedicationRequest.read patient/Observation.read patient/Organization.read patient/Practitioner.read patient/PractitionerRole.read patient/Procedure.read patient/Provenance.read patient/QuestionnaireResponse.read patient/RelatedPerson.read patient/ServiceRequest.read patient/Specimen.read'.freeze + + SMART_V2_RESOURCE_LEVEL_SCOPES = 'launch/patient openid fhirUser offline_access patient/Patient.rs patient/AllergyIntolerance.rs patient/CarePlan.rs patient/CareTeam.rs patient/Condition.rs patient/Coverage.rs patient/Device.rs patient/DiagnosticReport.rs patient/DocumentReference.rs patient/Encounter.rs patient/Endpoint.rs patient/Goal.rs patient/Immunization.rs patient/Location.rs patient/Media.rs patient/Medication.rs patient/MedicationDispense.rs patient/MedicationRequest.rs patient/Observation.rs patient/Organization.rs patient/Practitioner.rs patient/PractitionerRole.rs patient/Procedure.rs patient/Provenance.rs patient/QuestionnaireResponse.rs patient/RelatedPerson.rs patient/ServiceRequest.rs patient/Specimen.rs'.freeze + + SMART_V2_2_RESOURCE_LEVEL_SCOPES = 'launch/patient openid fhirUser offline_access patient/Patient.rs patient/AllergyIntolerance.rs patient/CarePlan.rs patient/CareTeam.rs patient/Condition.rs patient/Coverage.rs patient/Device.rs patient/DiagnosticReport.rs patient/DocumentReference.rs patient/Encounter.rs patient/Endpoint.rs patient/Goal.rs patient/Immunization.rs patient/Location.rs patient/Media.rs patient/Medication.rs patient/MedicationDispense.rs patient/MedicationRequest.rs patient/Observation.rs patient/Organization.rs patient/Practitioner.rs patient/PractitionerRole.rs patient/Procedure.rs patient/Provenance.rs patient/QuestionnaireResponse.rs patient/RelatedPerson.rs patient/ServiceRequest.rs patient/Specimen.rs'.freeze end end diff --git a/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu1_group.rb b/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu1_group.rb index 9f16e3b7..00f91660 100644 --- a/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu1_group.rb +++ b/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu1_group.rb @@ -1,10 +1,36 @@ +require_relative 'smart_scopes_constants' + module USCoreTestKit class SmartStandaloneLaunchSTU1 < Inferno::TestGroup + include SmartScopesConstants + id :us_core_smart_standalone_launch_stu1 title 'Standalone Launch' run_as_group + config( + inputs: { + smart_auth_info: { + name: :smart_auth_info, + options: { + components: [ + { + name: :requested_scopes, + default: SMART_V1_RESOURCE_LEVEL_SCOPES + } + ] + } + }, + received_scopes: { name: :standalone_received_scopes } + }, + outputs: { + smart_auth_info: { + name: :smart_auth_info + } + } + ) + group from: :smart_discovery, run_as_group: true group from: :smart_standalone_launch, @@ -15,11 +41,7 @@ class SmartStandaloneLaunchSTU1 < Inferno::TestGroup optional config( inputs: { - id_token: { name: :standalone_id_token }, - client_id: { name: :standalone_client_id }, - requested_scopes: { name: :standalone_requested_scopes }, - access_token: { name: :standalone_access_token }, - smart_credentials: { name: :standalone_smart_credentials } + id_token: { name: :standalone_id_token } } ) end @@ -27,14 +49,6 @@ class SmartStandaloneLaunchSTU1 < Inferno::TestGroup group from: :smart_token_refresh do run_as_group optional - config( - inputs: { - refresh_token: { name: :standalone_refresh_token }, - client_id: { name: :standalone_client_id }, - client_secret: { name: :standalone_client_secret }, - received_scopes: { name: :standalone_received_scopes } - } - ) end end end diff --git a/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu2_2_group.rb b/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu2_2_group.rb index fc1ed794..429bc19d 100644 --- a/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu2_2_group.rb +++ b/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu2_2_group.rb @@ -1,10 +1,36 @@ +require_relative 'smart_scopes_constants' + module USCoreTestKit class SmartStandaloneLaunchSTU22 < Inferno::TestGroup + include SmartScopesConstants + id :us_core_smart_standalone_launch_stu2_2 title 'Standalone Launch' run_as_group + config( + inputs: { + smart_auth_info: { + name: :smart_auth_info, + options: { + components: [ + { + name: :requested_scopes, + default: SMART_V2_2_RESOURCE_LEVEL_SCOPES + } + ] + } + }, + received_scopes: { name: :standalone_received_scopes } + }, + outputs: { + smart_auth_info: { + name: :smart_auth_info + } + } + ) + group from: :smart_discovery_stu2_2, run_as_group: true group from: :smart_standalone_launch_stu2_2, @@ -15,11 +41,7 @@ class SmartStandaloneLaunchSTU22 < Inferno::TestGroup optional config( inputs: { - id_token: { name: :standalone_id_token }, - client_id: { name: :standalone_client_id }, - requested_scopes: { name: :standalone_requested_scopes }, - access_token: { name: :standalone_access_token }, - smart_credentials: { name: :standalone_smart_credentials } + id_token: { name: :standalone_id_token } } ) end @@ -27,14 +49,6 @@ class SmartStandaloneLaunchSTU22 < Inferno::TestGroup group from: :smart_token_refresh_stu2 do run_as_group optional - config( - inputs: { - refresh_token: { name: :standalone_refresh_token }, - client_id: { name: :standalone_client_id }, - client_secret: { name: :standalone_client_secret }, - received_scopes: { name: :standalone_received_scopes } - } - ) end end end diff --git a/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu2_group.rb b/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu2_group.rb index 4e91150e..de95f1dd 100644 --- a/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu2_group.rb +++ b/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu2_group.rb @@ -1,10 +1,36 @@ +require_relative 'smart_scopes_constants' + module USCoreTestKit class SmartStandaloneLaunchSTU2 < Inferno::TestGroup + include SmartScopesConstants + id :us_core_smart_standalone_launch_stu2 title 'Standalone Launch' run_as_group + config( + inputs: { + smart_auth_info: { + name: :smart_auth_info, + options: { + components: [ + { + name: :requested_scopes, + default: SMART_V2_RESOURCE_LEVEL_SCOPES + } + ] + } + }, + received_scopes: { name: :standalone_received_scopes } + }, + outputs: { + smart_auth_info: { + name: :smart_auth_info + } + } + ) + group from: :smart_discovery_stu2, run_as_group: true group from: :smart_standalone_launch_stu2, @@ -15,11 +41,7 @@ class SmartStandaloneLaunchSTU2 < Inferno::TestGroup optional config( inputs: { - id_token: { name: :standalone_id_token }, - client_id: { name: :standalone_client_id }, - requested_scopes: { name: :standalone_requested_scopes }, - access_token: { name: :standalone_access_token }, - smart_credentials: { name: :standalone_smart_credentials } + id_token: { name: :standalone_id_token } } ) end @@ -27,14 +49,6 @@ class SmartStandaloneLaunchSTU2 < Inferno::TestGroup group from: :smart_token_refresh do run_as_group optional - config( - inputs: { - refresh_token: { name: :standalone_refresh_token }, - client_id: { name: :standalone_client_id }, - client_secret: { name: :standalone_client_secret }, - received_scopes: { name: :standalone_received_scopes } - } - ) end end end diff --git a/lib/us_core_test_kit/custom_groups/v6.1.0/smart_granular_scopes_group.rb b/lib/us_core_test_kit/custom_groups/v6.1.0/smart_granular_scopes_group.rb index 8b207502..c9f71d6f 100644 --- a/lib/us_core_test_kit/custom_groups/v6.1.0/smart_granular_scopes_group.rb +++ b/lib/us_core_test_kit/custom_groups/v6.1.0/smart_granular_scopes_group.rb @@ -31,9 +31,17 @@ def self.scopes_string(scopes) .first .config( inputs: { - requested_scopes: { - name: :requested_scopes_group1, - default: groups.first.default_group_scopes('v610') + smart_auth_info: { + name: :granular_scopes_1_auth_info, + title: 'Granular Scopes 1 Credentials', + options: { + components: [ + { + name: :requested_scopes, + default: groups.first.default_group_scopes('v610') + } + ] + } } }, options: { @@ -61,9 +69,17 @@ def self.scopes_string(scopes) .last .config( inputs: { - requested_scopes: { - name: :requested_scopes_group2, - default: groups.last.default_group_scopes('v610') + smart_auth_info: { + name: :granular_scopes_2_auth_info, + title: 'Granular Scopes 2 Credentials', + options: { + components: [ + { + name: :requested_scopes, + default: groups.last.default_group_scopes('v610') + } + ] + } } }, options: { diff --git a/lib/us_core_test_kit/custom_groups/v7.0.0/smart_granular_scopes_group.rb b/lib/us_core_test_kit/custom_groups/v7.0.0/smart_granular_scopes_group.rb index c9cb54b3..a4336c8b 100644 --- a/lib/us_core_test_kit/custom_groups/v7.0.0/smart_granular_scopes_group.rb +++ b/lib/us_core_test_kit/custom_groups/v7.0.0/smart_granular_scopes_group.rb @@ -31,9 +31,17 @@ def self.scopes_string(scopes) .first .config( inputs: { - requested_scopes: { - name: :requested_scopes_group1, - default: groups.first.default_group_scopes('v700') + smart_auth_info: { + name: :granular_scopes_1_auth_info, + title: 'Granular Scopes 1 Credentials', + options: { + components: [ + { + name: :requested_scopes, + default: groups.first.default_group_scopes('v700') + } + ] + } } }, options: { @@ -61,9 +69,17 @@ def self.scopes_string(scopes) .last .config( inputs: { - requested_scopes: { - name: :requested_scopes_group2, - default: groups.last.default_group_scopes('v700') + smart_auth_info: { + name: :granular_scopes_2_auth_info, + title: 'Granular Scopes 2 Credentials', + options: { + components: [ + { + name: :requested_scopes, + default: groups.last.default_group_scopes('v700') + } + ] + } } }, options: { diff --git a/lib/us_core_test_kit/generated/v3.1.1/us_core_test_suite.rb b/lib/us_core_test_kit/generated/v3.1.1/us_core_test_suite.rb index 3ce7e60b..7eac14a9 100644 --- a/lib/us_core_test_kit/generated/v3.1.1/us_core_test_suite.rb +++ b/lib/us_core_test_kit/generated/v3.1.1/us_core_test_suite.rb @@ -118,14 +118,14 @@ def self.metadata group from: :us_core_smart_app_launch group do - input :smart_credentials, + input :smart_auth_info, title: 'OAuth Credentials', - type: :oauth_credentials, + type: :auth_info, optional: true fhir_client do url :url - oauth_credentials :smart_credentials + auth_info :smart_auth_info end title 'US Core FHIR API' diff --git a/lib/us_core_test_kit/generated/v4.0.0/us_core_test_suite.rb b/lib/us_core_test_kit/generated/v4.0.0/us_core_test_suite.rb index 7d72b3c6..410ec672 100644 --- a/lib/us_core_test_kit/generated/v4.0.0/us_core_test_suite.rb +++ b/lib/us_core_test_kit/generated/v4.0.0/us_core_test_suite.rb @@ -120,14 +120,14 @@ def self.metadata group from: :us_core_smart_app_launch group do - input :smart_credentials, + input :smart_auth_info, title: 'OAuth Credentials', - type: :oauth_credentials, + type: :auth_info, optional: true fhir_client do url :url - oauth_credentials :smart_credentials + auth_info :smart_auth_info end title 'US Core FHIR API' diff --git a/lib/us_core_test_kit/generated/v5.0.1/us_core_test_suite.rb b/lib/us_core_test_kit/generated/v5.0.1/us_core_test_suite.rb index 1ca883e8..2f452e76 100644 --- a/lib/us_core_test_kit/generated/v5.0.1/us_core_test_suite.rb +++ b/lib/us_core_test_kit/generated/v5.0.1/us_core_test_suite.rb @@ -130,14 +130,14 @@ def self.metadata group from: :us_core_smart_app_launch group do - input :smart_credentials, + input :smart_auth_info, title: 'OAuth Credentials', - type: :oauth_credentials, + type: :auth_info, optional: true fhir_client do url :url - oauth_credentials :smart_credentials + auth_info :smart_auth_info end title 'US Core FHIR API' diff --git a/lib/us_core_test_kit/generated/v6.1.0/granular_scopes1_group.rb b/lib/us_core_test_kit/generated/v6.1.0/granular_scopes1_group.rb index 2a499ace..d6ab01d5 100644 --- a/lib/us_core_test_kit/generated/v6.1.0/granular_scopes1_group.rb +++ b/lib/us_core_test_kit/generated/v6.1.0/granular_scopes1_group.rb @@ -19,9 +19,9 @@ class SmartGranularScopes1Group < Inferno::TestGroup ) - input :granular_scopes_1_credentials, + input :granular_scopes_1_auth_info, title: 'SMART Credentials for Granular Scopes 1', - type: :oauth_credentials, + type: :auth_info, locked: true config( @@ -40,7 +40,7 @@ class SmartGranularScopes1Group < Inferno::TestGroup ) fhir_client do - oauth_credentials :granular_scopes_1_credentials + auth_info :granular_scopes_1_auth_info url :url end diff --git a/lib/us_core_test_kit/generated/v6.1.0/granular_scopes2_group.rb b/lib/us_core_test_kit/generated/v6.1.0/granular_scopes2_group.rb index 7c838111..20df3d41 100644 --- a/lib/us_core_test_kit/generated/v6.1.0/granular_scopes2_group.rb +++ b/lib/us_core_test_kit/generated/v6.1.0/granular_scopes2_group.rb @@ -19,9 +19,9 @@ class SmartGranularScopes2Group < Inferno::TestGroup ) - input :granular_scopes_2_credentials, + input :granular_scopes_2_auth_info, title: 'SMART Credentials for Granular Scopes 2', - type: :oauth_credentials, + type: :auth_info, locked: true config( @@ -40,7 +40,7 @@ class SmartGranularScopes2Group < Inferno::TestGroup ) fhir_client do - oauth_credentials :granular_scopes_2_credentials + auth_info :granular_scopes_2_auth_info url :url end diff --git a/lib/us_core_test_kit/generated/v6.1.0/us_core_test_suite.rb b/lib/us_core_test_kit/generated/v6.1.0/us_core_test_suite.rb index 150ccc3c..c16f1375 100644 --- a/lib/us_core_test_kit/generated/v6.1.0/us_core_test_suite.rb +++ b/lib/us_core_test_kit/generated/v6.1.0/us_core_test_suite.rb @@ -141,14 +141,14 @@ def self.metadata group from: :us_core_smart_app_launch group do - input :smart_credentials, + input :smart_auth_info, title: 'OAuth Credentials', - type: :oauth_credentials, + type: :auth_info, optional: true fhir_client do url :url - oauth_credentials :smart_credentials + auth_info :smart_auth_info end title 'US Core FHIR API' diff --git a/lib/us_core_test_kit/generated/v7.0.0/granular_scopes1_group.rb b/lib/us_core_test_kit/generated/v7.0.0/granular_scopes1_group.rb index d2b67103..ec917754 100644 --- a/lib/us_core_test_kit/generated/v7.0.0/granular_scopes1_group.rb +++ b/lib/us_core_test_kit/generated/v7.0.0/granular_scopes1_group.rb @@ -19,9 +19,9 @@ class SmartGranularScopes1Group < Inferno::TestGroup ) - input :granular_scopes_1_credentials, + input :granular_scopes_1_auth_info, title: 'SMART Credentials for Granular Scopes 1', - type: :oauth_credentials, + type: :auth_info, locked: true config( @@ -40,7 +40,7 @@ class SmartGranularScopes1Group < Inferno::TestGroup ) fhir_client do - oauth_credentials :granular_scopes_1_credentials + auth_info :granular_scopes_1_auth_info url :url end diff --git a/lib/us_core_test_kit/generated/v7.0.0/granular_scopes2_group.rb b/lib/us_core_test_kit/generated/v7.0.0/granular_scopes2_group.rb index 88aca4f3..9a9cbd9e 100644 --- a/lib/us_core_test_kit/generated/v7.0.0/granular_scopes2_group.rb +++ b/lib/us_core_test_kit/generated/v7.0.0/granular_scopes2_group.rb @@ -19,9 +19,9 @@ class SmartGranularScopes2Group < Inferno::TestGroup ) - input :granular_scopes_2_credentials, + input :granular_scopes_2_auth_info, title: 'SMART Credentials for Granular Scopes 2', - type: :oauth_credentials, + type: :auth_info, locked: true config( @@ -40,7 +40,7 @@ class SmartGranularScopes2Group < Inferno::TestGroup ) fhir_client do - oauth_credentials :granular_scopes_2_credentials + auth_info :granular_scopes_2_auth_info url :url end diff --git a/lib/us_core_test_kit/generated/v7.0.0/us_core_test_suite.rb b/lib/us_core_test_kit/generated/v7.0.0/us_core_test_suite.rb index 245b0c47..c14b796f 100644 --- a/lib/us_core_test_kit/generated/v7.0.0/us_core_test_suite.rb +++ b/lib/us_core_test_kit/generated/v7.0.0/us_core_test_suite.rb @@ -149,14 +149,14 @@ def self.metadata required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT group do - input :smart_credentials, + input :smart_auth_info, title: 'OAuth Credentials', - type: :oauth_credentials, + type: :auth_info, optional: true fhir_client do url :url - oauth_credentials :smart_credentials + auth_info :smart_auth_info end title 'US Core FHIR API' diff --git a/lib/us_core_test_kit/generator/templates/granular_scope_group.rb.erb b/lib/us_core_test_kit/generator/templates/granular_scope_group.rb.erb index af73567b..72c80608 100644 --- a/lib/us_core_test_kit/generator/templates/granular_scope_group.rb.erb +++ b/lib/us_core_test_kit/generator/templates/granular_scope_group.rb.erb @@ -10,9 +10,9 @@ module USCoreTestKit <%= description %> ) - input :granular_scopes_<%= group_number %>_credentials, + input :granular_scopes_<%= group_number %>_auth_info, title: 'SMART Credentials for Granular Scopes <%= group_number %>', - type: :oauth_credentials, + type: :auth_info, locked: true config( @@ -31,7 +31,7 @@ module USCoreTestKit ) fhir_client do - oauth_credentials :granular_scopes_<%= group_number %>_credentials + auth_info :granular_scopes_<%= group_number %>_auth_info url :url end <% group_id_list.each do |group_id| %> diff --git a/lib/us_core_test_kit/generator/templates/suite.rb.erb b/lib/us_core_test_kit/generator/templates/suite.rb.erb index ff5e51f9..643019ba 100644 --- a/lib/us_core_test_kit/generator/templates/suite.rb.erb +++ b/lib/us_core_test_kit/generator/templates/suite.rb.erb @@ -104,14 +104,14 @@ module USCoreTestKit required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT<% end %> group do - input :smart_credentials, + input :smart_auth_info, title: 'OAuth Credentials', - type: :oauth_credentials, + type: :auth_info, optional: true fhir_client do url :url - oauth_credentials :smart_credentials + auth_info :smart_auth_info end title 'US Core FHIR API' diff --git a/us_core_test_kit.gemspec b/us_core_test_kit.gemspec index ceb79c75..899a6c53 100644 --- a/us_core_test_kit.gemspec +++ b/us_core_test_kit.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |spec| spec.description = 'US Core Inferno tests' spec.homepage = 'https://github.com/inferno-framework/us-core-test-kit' spec.license = 'Apache-2.0' - spec.add_runtime_dependency 'inferno_core', '>= 0.6.1' + spec.add_runtime_dependency 'inferno_core', '>= 0.6.3' spec.add_runtime_dependency 'smart_app_launch_test_kit', '>= 0.5.0' spec.add_runtime_dependency 'tls_test_kit', '~> 0.3.0' spec.add_development_dependency 'database_cleaner-sequel', '~> 1.8'