Skip to content

Commit

Permalink
FI-3102/FI-3393/FI-3431: Integrate SMART v2.2/Integrate smart-app-lau…
Browse files Browse the repository at this point in the history
…nch test kit 0.4.6/Integrate us_core test kit 0.9.0 (#581)

* Add US Core 7 to g(10) test kit

* Remove Location from unrestricted resource test and update description

* Remove line in terminology loader that should be included in different PR, and fix wording in a test description

* Fix linting issues and remove file that was added by mistake

* Integrate SMART v2.2 into G10 Test Kit

* Update Gemfile and update reference server preset to incorporate SMART v2.2

* Update short id map to include new SMART v2.2 tests

* Fixes after rebase

* Revert Gemfile.lock back to what it originally was

* Fix linting issues

* Fix Location typo in single patient us core 7

* Add SMART 0.4.6 changes, update short_ids, add US Core 0.9.0 changes

* Fix gemspec typos

* bundle install after rebase

* Fix terminology_binding_validator failed on PrimitiveType element

* Add self.short_id method

* Restore short_id .yaml file

* Update short_id yaml file to have correct id incrementation, and remove hard coded short id from smart standalone patient app group file

* update short_ids

* update to us_core 0.9.1

---------

Co-authored-by: Yunwei Wang <>
  • Loading branch information
emichaud998 authored Nov 11, 2024
1 parent 61562f7 commit 96935ee
Show file tree
Hide file tree
Showing 26 changed files with 2,879 additions and 273 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# frozen_string_literal: true

source "https://rubygems.org"
source 'https://rubygems.org'

gemspec

group :development, :test do
gem 'debug'
gem 'rubocop', '~> 1.9'
gem 'rubocop-rspec', require: false
gem 'rubyXL'
gem 'debug'
end
48 changes: 24 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ PATH
onc_certification_g10_test_kit (6.0.3)
bloomer (~> 1.0.0)
colorize (~> 0.8.1)
inferno_core (~> 0.4.34)
inferno_core (~> 0.5.0)
json-jwt (~> 1.15.3)
mime-types (~> 3.4.0)
ndjson (~> 1.0.0)
rubyzip (~> 2.3.2)
smart_app_launch_test_kit (= 0.4.5)
smart_app_launch_test_kit (= 0.4.6)
tls_test_kit (= 0.2.3)
us_core_test_kit (= 0.8.2)
us_core_test_kit (= 0.9.1)

GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.7.10)
activesupport (6.1.7.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand All @@ -40,7 +40,7 @@ GEM
byebug (11.1.3)
coderay (1.1.3)
colorize (0.8.1)
concurrent-ruby (1.3.4)
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
crack (0.4.5)
rexml
Expand Down Expand Up @@ -101,11 +101,11 @@ GEM
faraday-retry (1.0.3)
faraday_middleware (1.2.1)
faraday (~> 1.0)
fhir_client (6.0.0)
fhir_client (5.0.3)
activesupport (>= 3)
addressable (>= 2.3)
fhir_dstu2_models (>= 1.1.1)
fhir_models (>= 5.0.0)
fhir_models (>= 4.2.1)
fhir_stu3_models (>= 3.1.1)
nokogiri (>= 1.10.4)
oauth2 (~> 1.1)
Expand All @@ -117,7 +117,7 @@ GEM
date_time_precision (>= 0.8)
mime-types (>= 3.0)
nokogiri (>= 1.11.4)
fhir_models (5.0.0)
fhir_models (4.3.0)
bcp47 (>= 0.3)
date_time_precision (>= 0.8)
mime-types (>= 3.0)
Expand Down Expand Up @@ -147,9 +147,9 @@ GEM
http-cookie (1.0.7)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.14.6)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
inferno_core (0.4.44)
inferno_core (0.5.0)
activesupport (~> 6.1.7.5)
base62-rb (= 0.3.1)
blueprinter (= 0.25.2)
Expand Down Expand Up @@ -194,7 +194,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2024.1001)
mini_portile2 (2.8.7)
minitest (5.25.1)
minitest (5.24.1)
msgpack (1.7.3)
multi_json (1.15.0)
multi_xml (0.7.1)
Expand All @@ -207,15 +207,15 @@ GEM
mustermann (= 1.1.2)
ndjson (1.0.0)
netrc (0.11.0)
nio4r (2.7.4)
nokogiri (1.16.7)
nio4r (2.7.3)
nokogiri (1.16.6)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.7-arm64-darwin)
nokogiri (1.16.6-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
nokogiri (1.16.6-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
nokogiri (1.16.6-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.11)
faraday (>= 0.17.3, < 3.0)
Expand All @@ -238,8 +238,8 @@ GEM
public_suffix (6.0.1)
puma (5.6.9)
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.10)
racc (1.8.0)
rack (2.2.9)
rainbow (3.1.1)
rake (13.2.1)
redis-client (0.22.2)
Expand All @@ -252,7 +252,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.9)
rexml (3.3.7)
rouge (4.4.0)
rspec (3.12.0)
rspec-core (~> 3.12.0)
Expand Down Expand Up @@ -293,7 +293,7 @@ GEM
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.19.0)
smart_app_launch_test_kit (0.4.5)
smart_app_launch_test_kit (0.4.6)
inferno_core (>= 0.4.2)
json-jwt (~> 1.15.3)
jwt (~> 2.6)
Expand Down Expand Up @@ -323,17 +323,17 @@ GEM
tty-screen (0.8.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
unicode-display_width (2.5.0)
unicode_utils (1.4.0)
us_core_test_kit (0.8.2)
us_core_test_kit (0.9.1)
inferno_core (>= 0.4.37)
smart_app_launch_test_kit (>= 0.4.0)
smart_app_launch_test_kit (>= 0.4.6)
tls_test_kit (~> 0.2.0)
webmock (3.18.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
zeitwerk (2.6.18)
zeitwerk (2.6.16)

PLATFORMS
arm64-darwin-21
Expand Down
204 changes: 204 additions & 0 deletions config/presets/g10_reference_server_preset.json

Large diffs are not rendered by default.

48 changes: 47 additions & 1 deletion lib/onc_certification_g10_test_kit.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'smart_app_launch/smart_stu1_suite'
require 'smart_app_launch/smart_stu2_suite'
require 'smart_app_launch/smart_stu2_2_suite'
require 'us_core_test_kit'

require_relative 'onc_certification_g10_test_kit/configuration_checker'
Expand All @@ -24,14 +25,19 @@
require_relative 'onc_certification_g10_test_kit/smart_standalone_patient_app_group'
require_relative 'onc_certification_g10_test_kit/smart_public_standalone_launch_group'
require_relative 'onc_certification_g10_test_kit/smart_public_standalone_launch_group_stu2'
require_relative 'onc_certification_g10_test_kit/smart_public_standalone_launch_group_stu2_2'
require_relative 'onc_certification_g10_test_kit/smart_ehr_patient_launch_group'
require_relative 'onc_certification_g10_test_kit/smart_ehr_patient_launch_group_stu2'
require_relative 'onc_certification_g10_test_kit/smart_ehr_patient_launch_group_stu2_2'
require_relative 'onc_certification_g10_test_kit/smart_ehr_practitioner_app_group'
require_relative 'onc_certification_g10_test_kit/smart_fine_grained_scopes_group'
require_relative 'onc_certification_g10_test_kit/smart_fine_grained_scopes_group_stu2_2'
require_relative 'onc_certification_g10_test_kit/smart_fine_grained_scopes_us_core_7_group'
require_relative 'onc_certification_g10_test_kit/smart_fine_grained_scopes_us_core_7_group_stu2_2'
require_relative 'onc_certification_g10_test_kit/smart_v1_scopes_group'
require_relative 'onc_certification_g10_test_kit/terminology_binding_validator'
require_relative 'onc_certification_g10_test_kit/token_introspection_group'
require_relative 'onc_certification_g10_test_kit/token_introspection_group_stu2_2'
require_relative 'onc_certification_g10_test_kit/token_revocation_group'
require_relative 'onc_certification_g10_test_kit/visual_inspection_and_attestations_group'

Expand Down Expand Up @@ -236,6 +242,10 @@ def self.well_known_route_handler
{
label: 'SMART App Launch 2.0.0',
value: G10Options::SMART_2
},
{
label: 'SMART App Launch 2.2.0',
value: G10Options::SMART_2_2
}
]

Expand Down Expand Up @@ -399,9 +409,11 @@ def self.well_known_route_handler
group from: :g10_public_standalone_launch_stu2,
required_suite_options: G10Options::SMART_2_REQUIREMENT,
config: { options: { redirect_message_proc: default_redirect_message_proc } }
group from: :g10_public_standalone_launch_stu2_2, # rubocop:disable Naming/VariableNumber
required_suite_options: G10Options::SMART_2_2_REQUIREMENT,
config: { options: { redirect_message_proc: default_redirect_message_proc } }

group from: :g10_token_revocation

group from: :g10_smart_invalid_aud,
config: { options: { redirect_message_proc: default_redirect_message_proc } }

Expand All @@ -411,20 +423,34 @@ def self.well_known_route_handler
group from: :g10_smart_invalid_token_request_stu2,
required_suite_options: G10Options::SMART_2_REQUIREMENT,
config: { options: { redirect_message_proc: default_redirect_message_proc } }
group from: :g10_smart_invalid_token_request_stu2,
id: :g10_smart_invalid_token_request_stu2_2, # rubocop:disable Naming/VariableNumber
required_suite_options: G10Options::SMART_2_2_REQUIREMENT,
config: { options: { redirect_message_proc: default_redirect_message_proc } }

group from: :g10_smart_invalid_pkce_code_verifier_group,
required_suite_options: G10Options::SMART_2_REQUIREMENT
group from: :g10_smart_invalid_pkce_code_verifier_group,
id: :g10_smart_invalid_pkce_code_verifier_group_stu2_2, # rubocop:disable Naming/VariableNumber
required_suite_options: G10Options::SMART_2_2_REQUIREMENT

group from: :g10_ehr_patient_launch,
required_suite_options: G10Options::SMART_1_REQUIREMENT
group from: :g10_ehr_patient_launch_stu2,
required_suite_options: G10Options::SMART_2_REQUIREMENT
group from: :g10_ehr_patient_launch_stu2_2, # rubocop:disable Naming/VariableNumber
required_suite_options: G10Options::SMART_2_2_REQUIREMENT

group from: :g10_token_introspection,
required_suite_options: G10Options::SMART_2_REQUIREMENT
group from: :g10_token_introspection_stu2_2, # rubocop:disable Naming/VariableNumber
required_suite_options: G10Options::SMART_2_2_REQUIREMENT

group from: :g10_asymmetric_launch,
required_suite_options: G10Options::SMART_2_REQUIREMENT
group from: :g10_asymmetric_launch,
id: :g10_asymmetric_launch_stu2_2, # rubocop:disable Naming/VariableNumber
required_suite_options: G10Options::SMART_2_2_REQUIREMENT

group from: :g10_smart_v1_scopes,
required_suite_options: G10Options::SMART_2_REQUIREMENT,
Expand All @@ -433,21 +459,41 @@ def self.well_known_route_handler
client_auth_encryption_method: { locked: true }
}
}
group from: :g10_smart_v1_scopes,
id: :g10_smart_v1_scopes_stu2_2, # rubocop:disable Naming/VariableNumber
required_suite_options: G10Options::SMART_2_2_REQUIREMENT,
config: {
inputs: {
client_auth_encryption_method: { locked: true }
}
}

group from: :g10_smart_fine_grained_scopes,
required_suite_options: G10Options::SMART_2_REQUIREMENT.merge(G10Options::US_CORE_6_REQUIREMENT),
exclude_optional: true
group from: :g10_smart_fine_grained_scopes_stu2_2, # rubocop:disable Naming/VariableNumber
required_suite_options: G10Options::SMART_2_2_REQUIREMENT.merge(G10Options::US_CORE_6_REQUIREMENT),
exclude_optional: true

group from: :g10_us_core_7_smart_fine_grained_scopes,
required_suite_options: G10Options::SMART_2_REQUIREMENT.merge(G10Options::US_CORE_7_REQUIREMENT),
exclude_optional: true
group from: :g10_us_core_7_smart_fine_grained_scopes_stu2_2, # rubocop:disable Naming/VariableNumber
required_suite_options: G10Options::SMART_2_2_REQUIREMENT.merge(G10Options::US_CORE_7_REQUIREMENT),
exclude_optional: true

group from: :g10_smart_granular_scope_selection,
required_suite_options: G10Options::SMART_2_REQUIREMENT.merge(G10Options::US_CORE_6_REQUIREMENT)
group from: :g10_smart_granular_scope_selection,
id: :g10_smart_granular_scope_selection_stu2_2, # rubocop:disable Naming/VariableNumber
required_suite_options: G10Options::SMART_2_2_REQUIREMENT.merge(G10Options::US_CORE_6_REQUIREMENT)

group from: :g10_smart_granular_scope_selection,
id: :g10_us_core_7_smart_granular_scope_selection,
required_suite_options: G10Options::SMART_2_REQUIREMENT.merge(G10Options::US_CORE_7_REQUIREMENT)
group from: :g10_smart_granular_scope_selection,
id: :g10_us_core_7_smart_granular_scope_selection_stu2_2, # rubocop:disable Naming/VariableNumber
required_suite_options: G10Options::SMART_2_2_REQUIREMENT.merge(G10Options::US_CORE_7_REQUIREMENT)
end

group from: :g10_visual_inspection_and_attestations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ def resource_type

required_suite_options G10Options::US_CORE_3_REQUIREMENT

id :g10_us_core_3_bulk_location_validation

include BulkExportValidationTester

def resource_type
Expand All @@ -582,6 +584,8 @@ def resource_type

required_suite_options G10Options::US_CORE_4_REQUIREMENT

id :g10_us_core_4_bulk_location_validation

include BulkExportValidationTester

def resource_type
Expand All @@ -606,6 +610,8 @@ def resource_type

required_suite_options G10Options::US_CORE_5_REQUIREMENT

id :g10_us_core_5_bulk_location_validation

include BulkExportValidationTester

def resource_type
Expand All @@ -630,6 +636,8 @@ def resource_type

required_suite_options G10Options::US_CORE_6_REQUIREMENT

id :g10_us_core_6_bulk_location_validation

include BulkExportValidationTester

def resource_type
Expand Down Expand Up @@ -673,6 +681,8 @@ def resource_type

required_suite_options G10Options::US_CORE_5_REQUIREMENT

id :g10_us_core_5_bulk_service_request_validation

include BulkExportValidationTester

def resource_type
Expand All @@ -694,6 +704,8 @@ def resource_type

required_suite_options G10Options::US_CORE_5_REQUIREMENT

id :g10_us_core_5_bulk_related_person_validation

include BulkExportValidationTester

def resource_type
Expand All @@ -717,6 +729,8 @@ def resource_type

required_suite_options G10Options::US_CORE_5_REQUIREMENT

id :g10_us_core_5_bulk_questionnaire_response_validation

include BulkExportValidationTester

def resource_type
Expand All @@ -740,6 +754,8 @@ def resource_type

required_suite_options G10Options::US_CORE_5_REQUIREMENT

id :g10_us_core_5_bulk_practitioner_role_validation

include BulkExportValidationTester

def resource_type
Expand Down
2 changes: 2 additions & 0 deletions lib/onc_certification_g10_test_kit/g10_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module G10Options

SMART_1 = 'smart_app_launch_1'.freeze
SMART_2 = 'smart_app_launch_2'.freeze
SMART_2_2 = 'smart_app_launch_2_2'.freeze

US_CORE_3_REQUIREMENT = { us_core_version: US_CORE_3 }.freeze
US_CORE_4_REQUIREMENT = { us_core_version: US_CORE_4 }.freeze
Expand All @@ -31,6 +32,7 @@ module G10Options

SMART_1_REQUIREMENT = { smart_app_launch_version: SMART_1 }.freeze
SMART_2_REQUIREMENT = { smart_app_launch_version: SMART_2 }.freeze
SMART_2_2_REQUIREMENT = { smart_app_launch_version: SMART_2_2 }.freeze

def us_core_version
suite_options[:us_core_version]
Expand Down
2 changes: 1 addition & 1 deletion lib/onc_certification_g10_test_kit/patient_scope_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def scope_version

run do
expected_scopes =
if scope_version == :v2
if scope_version == :v2 || scope_version == :v22
[
Regexp.new(scope_regex_string('patient/Patient.rs').gsub('.rs', '.r?s')),
Regexp.new(scope_regex_string('patient/Patient.rs').gsub('.rs', '.rs?'))
Expand Down
Loading

0 comments on commit 96935ee

Please sign in to comment.