onc_certification_g10_test_kit 7.0.3 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/config/presets/g10_reference_server_preset.json +1467 -0
  3. data/lib/inferno/ext/bloomer.rb +1 -1
  4. data/lib/inferno/terminology/tasks/process_umls.rb +1 -1
  5. data/lib/onc_certification_g10_test_kit/bulk_data_authorization.rb +73 -67
  6. data/lib/onc_certification_g10_test_kit/bulk_data_group_export_cancel_stu1.rb +1 -2
  7. data/lib/onc_certification_g10_test_kit/bulk_data_group_export_cancel_stu2.rb +7 -1
  8. data/lib/onc_certification_g10_test_kit/bulk_data_group_export_parameters.rb +1 -1
  9. data/lib/onc_certification_g10_test_kit/bulk_data_group_export_stu1.rb +10 -2
  10. data/lib/onc_certification_g10_test_kit/bulk_data_group_export_validation.rb +6 -2
  11. data/lib/onc_certification_g10_test_kit/bulk_export_validation_tester.rb +7 -3
  12. data/lib/onc_certification_g10_test_kit/configuration_checker.rb +5 -13
  13. data/lib/onc_certification_g10_test_kit/encounter_context_test.rb +3 -3
  14. data/lib/onc_certification_g10_test_kit/export_kick_off_performer.rb +7 -3
  15. data/lib/onc_certification_g10_test_kit/feature.rb +5 -4
  16. data/lib/onc_certification_g10_test_kit/igs/01-us-core-v400.tgz +0 -0
  17. data/lib/onc_certification_g10_test_kit/igs/03-us-core-v311.tgz +0 -0
  18. data/lib/onc_certification_g10_test_kit/igs/04-us-core-610.tgz +0 -0
  19. data/lib/onc_certification_g10_test_kit/metadata.rb +103 -0
  20. data/lib/onc_certification_g10_test_kit/multi_patient_api_stu1.rb +0 -4
  21. data/lib/onc_certification_g10_test_kit/multi_patient_api_stu2.rb +8 -4
  22. data/lib/onc_certification_g10_test_kit/patient_context_test.rb +3 -3
  23. data/lib/onc_certification_g10_test_kit/patient_scope_test.rb +1 -1
  24. data/lib/onc_certification_g10_test_kit/restricted_resource_type_access_group.rb +3 -10
  25. data/lib/onc_certification_g10_test_kit/scope_constants.rb +52 -0
  26. data/lib/onc_certification_g10_test_kit/short_id_map.yml +11 -20
  27. data/lib/onc_certification_g10_test_kit/single_patient_api_group.rb +18 -17
  28. data/lib/onc_certification_g10_test_kit/single_patient_us_core_4_api_group.rb +18 -17
  29. data/lib/onc_certification_g10_test_kit/single_patient_us_core_5_api_group.rb +18 -17
  30. data/lib/onc_certification_g10_test_kit/single_patient_us_core_6_api_group.rb +20 -19
  31. data/lib/onc_certification_g10_test_kit/single_patient_us_core_7_api_group.rb +20 -19
  32. data/lib/onc_certification_g10_test_kit/smart_app_launch_invalid_aud_group.rb +108 -65
  33. data/lib/onc_certification_g10_test_kit/smart_asymmetric_launch_group.rb +42 -89
  34. data/lib/onc_certification_g10_test_kit/smart_ehr_patient_launch_group.rb +33 -43
  35. data/lib/onc_certification_g10_test_kit/smart_ehr_patient_launch_group_stu2.rb +32 -54
  36. data/lib/onc_certification_g10_test_kit/smart_ehr_patient_launch_group_stu2_2.rb +34 -55
  37. data/lib/onc_certification_g10_test_kit/smart_ehr_practitioner_app_group.rb +103 -146
  38. data/lib/onc_certification_g10_test_kit/smart_fine_grained_scopes_group.rb +17 -55
  39. data/lib/onc_certification_g10_test_kit/smart_fine_grained_scopes_group_stu2_2.rb +17 -55
  40. data/lib/onc_certification_g10_test_kit/smart_fine_grained_scopes_us_core_7_group.rb +17 -55
  41. data/lib/onc_certification_g10_test_kit/smart_fine_grained_scopes_us_core_7_group_stu2_2.rb +17 -55
  42. data/lib/onc_certification_g10_test_kit/smart_granular_scope_selection_group.rb +33 -68
  43. data/lib/onc_certification_g10_test_kit/smart_granular_scope_selection_test.rb +4 -3
  44. data/lib/onc_certification_g10_test_kit/smart_invalid_pkce_group.rb +45 -89
  45. data/lib/onc_certification_g10_test_kit/smart_invalid_token_group.rb +45 -89
  46. data/lib/onc_certification_g10_test_kit/smart_invalid_token_group_stu2.rb +53 -91
  47. data/lib/onc_certification_g10_test_kit/smart_invalid_token_refresh_test.rb +9 -6
  48. data/lib/onc_certification_g10_test_kit/smart_limited_app_group.rb +86 -278
  49. data/lib/onc_certification_g10_test_kit/smart_public_standalone_launch_group.rb +32 -59
  50. data/lib/onc_certification_g10_test_kit/smart_public_standalone_launch_group_stu2.rb +36 -75
  51. data/lib/onc_certification_g10_test_kit/smart_public_standalone_launch_group_stu2_2.rb +36 -75
  52. data/lib/onc_certification_g10_test_kit/smart_scopes_test.rb +6 -1
  53. data/lib/onc_certification_g10_test_kit/smart_standalone_patient_app_group.rb +90 -118
  54. data/lib/onc_certification_g10_test_kit/smart_v1_scopes_group.rb +62 -116
  55. data/lib/onc_certification_g10_test_kit/tasks/generate_matrix.rb +3 -12
  56. data/lib/onc_certification_g10_test_kit/token_introspection_group.rb +12 -25
  57. data/lib/onc_certification_g10_test_kit/token_introspection_group_stu2_2.rb +12 -14
  58. data/lib/onc_certification_g10_test_kit/token_revocation_group.rb +44 -33
  59. data/lib/onc_certification_g10_test_kit/unrestricted_resource_type_access_group.rb +3 -3
  60. data/lib/onc_certification_g10_test_kit/urls.rb +4 -0
  61. data/lib/onc_certification_g10_test_kit/version.rb +2 -1
  62. data/lib/onc_certification_g10_test_kit.rb +119 -65
  63. metadata +20 -68
@@ -1,11 +1,15 @@
1
+ require_relative 'scope_constants'
2
+
1
3
  module ONCCertificationG10TestKit
2
4
  class SMARTPublicStandaloneLaunchGroupSTU2 < SMARTAppLaunch::StandaloneLaunchGroupSTU2
5
+ include ScopeConstants
6
+
3
7
  title 'Public Client Standalone Launch with OpenID Connect'
4
8
  short_title 'Public Client Launch'
5
9
  input_instructions %(
6
10
  Register Inferno as a standalone application using the following information:
7
11
 
8
- * Redirect URI: `#{SMARTAppLaunch::AppRedirectTest.config.options[:redirect_uri]}`
12
+ * Redirect URI: `#{REDIRECT_URI}`
9
13
 
10
14
  Enter in the appropriate scope to enable patient-level access to all
11
15
  relevant resources. In addition, support for the OpenID Connect (openid
@@ -22,7 +26,7 @@ module ONCCertificationG10TestKit
22
26
  Prior to executing this test, register Inferno as a public standalone
23
27
  application using the following information:
24
28
 
25
- * Redirect URI: `#{SMARTAppLaunch::AppRedirectTest.config.options[:redirect_uri]}`
29
+ * Redirect URI: `#{REDIRECT_URI}`
26
30
 
27
31
  Inferno will act as a public client redirect the tester to the the
28
32
  authorization endpoint so that they may provide any required credentials
@@ -38,31 +42,28 @@ module ONCCertificationG10TestKit
38
42
 
39
43
  config(
40
44
  inputs: {
41
- client_id: {
42
- name: :public_client_id,
43
- title: 'Public Launch Client ID'
44
- },
45
- client_secret: {
46
- name: :public_client_secret,
47
- title: 'Public Launch Client Secret',
48
- default: nil,
49
- optional: true,
50
- locked: true
51
- },
52
- requested_scopes: {
53
- name: :public_requested_scopes,
54
- title: 'Public Launch Scope',
55
- default: %(
56
- launch/patient openid fhirUser offline_access patient/Medication.rs
57
- patient/AllergyIntolerance.rs patient/CarePlan.rs
58
- patient/CareTeam.rs patient/Condition.rs patient/Device.rs
59
- patient/DiagnosticReport.rs patient/DocumentReference.rs
60
- patient/Encounter.rs patient/Goal.rs patient/Immunization.rs
61
- patient/Location.rs patient/MedicationRequest.rs
62
- patient/Observation.rs patient/Organization.rs patient/Patient.rs
63
- patient/Practitioner.rs patient/Procedure.rs patient/Provenance.rs
64
- patient/PractitionerRole.rs
65
- ).gsub(/\s{2,}/, ' ').strip
45
+ smart_auth_info: {
46
+ name: :public_smart_auth_info,
47
+ title: 'Public Launch Credentials',
48
+ options: {
49
+ mode: 'auth',
50
+ components: [
51
+ {
52
+ name: :auth_type,
53
+ default: 'public',
54
+ locked: true
55
+ },
56
+ {
57
+ name: :auth_request_method,
58
+ default: 'GET',
59
+ locked: true
60
+ },
61
+ {
62
+ name: :requested_scopes,
63
+ default: STANDALONE_SMART_2_SCOPES
64
+ }
65
+ ]
66
+ }
66
67
  },
67
68
  url: {
68
69
  title: 'Public Launch FHIR Endpoint',
@@ -74,43 +75,19 @@ module ONCCertificationG10TestKit
74
75
  state: {
75
76
  name: :public_state
76
77
  },
77
- smart_authorization_url: {
78
- title: 'OAuth 2.0 Authorize Endpoint',
79
- description: 'OAuth 2.0 Authorize Endpoint provided during the patient standalone launch'
80
- },
81
- smart_token_url: {
82
- title: 'OAuth 2.0 Token Endpoint',
83
- description: 'OAuth 2.0 Token Endpoint provided during the patient standalone launch'
84
- },
85
- smart_credentials: {
86
- name: :public_smart_credentials
87
- },
88
- use_pkce: {
89
- default: 'true',
90
- locked: true
91
- },
92
- pkce_code_challenge_method: {
93
- locked: true
94
- },
95
- client_auth_type: {
96
- name: :public_client_auth_type,
97
- locked: true,
98
- default: 'public'
78
+ patient_id: {
79
+ name: :public_patient_id
99
80
  }
100
81
  },
101
82
  outputs: {
102
83
  code: { name: :public_code },
103
- token_retrieval_time: { name: :public_token_retrieval_time },
104
84
  state: { name: :public_state },
105
85
  id_token: { name: :public_id_token },
106
- refresh_token: { name: :public_refresh_token },
107
- access_token: { name: :public_access_token },
108
- expires_in: { name: :public_expires_in },
109
86
  patient_id: { name: :public_patient_id },
110
87
  encounter_id: { name: :public_encounter_id },
111
88
  received_scopes: { name: :public_received_scopes },
112
89
  intent: { name: :public_intent },
113
- smart_credentials: { name: :public_smart_credentials }
90
+ smart_auth_info: { name: :public_smart_auth_info }
114
91
  },
115
92
  requests: {
116
93
  redirect: { name: :public_redirect },
@@ -118,24 +95,7 @@ module ONCCertificationG10TestKit
118
95
  }
119
96
  )
120
97
 
121
- input_order :url,
122
- :public_client_id,
123
- :public_client_secret,
124
- :public_requested_scopes,
125
- :use_pkce,
126
- :pkce_code_challenge_method,
127
- :smart_authorization_url,
128
- :smart_token_url,
129
- :authorization_method,
130
- :public_client_auth_type
131
-
132
- test from: :g10_patient_context,
133
- config: {
134
- inputs: {
135
- patient_id: { name: :public_patient_id },
136
- smart_credentials: { name: :public_smart_credentials }
137
- }
138
- }
98
+ test from: :g10_patient_context
139
99
 
140
100
  test do
141
101
  title 'OAuth token exchange response contains OpenID Connect id_token'
@@ -155,8 +115,9 @@ module ONCCertificationG10TestKit
155
115
  end
156
116
  end
157
117
 
158
- children.each do |child|
159
- child.inputs.delete(:client_auth_encryption_method)
160
- end
118
+ test from: :well_known_endpoint
119
+
120
+ # Move the well-known endpoint test to the beginning
121
+ children.prepend(children.pop)
161
122
  end
162
123
  end
@@ -1,11 +1,15 @@
1
+ require_relative 'scope_constants'
2
+
1
3
  module ONCCertificationG10TestKit
2
4
  class SMARTPublicStandaloneLaunchGroupTestSTU22 < SMARTAppLaunch::StandaloneLaunchGroupSTU2
5
+ include ScopeConstants
6
+
3
7
  title 'Public Client Standalone Launch with OpenID Connect'
4
8
  short_title 'Public Client Launch'
5
9
  input_instructions %(
6
10
  Register Inferno as a standalone application using the following information:
7
11
 
8
- * Redirect URI: `#{SMARTAppLaunch::AppRedirectTest.config.options[:redirect_uri]}`
12
+ * Redirect URI: `#{REDIRECT_URI}`
9
13
 
10
14
  Enter in the appropriate scope to enable patient-level access to all
11
15
  relevant resources. In addition, support for the OpenID Connect (openid
@@ -22,7 +26,7 @@ module ONCCertificationG10TestKit
22
26
  Prior to executing this test, register Inferno as a public standalone
23
27
  application using the following information:
24
28
 
25
- * Redirect URI: `#{SMARTAppLaunch::AppRedirectTest.config.options[:redirect_uri]}`
29
+ * Redirect URI: `#{REDIRECT_URI}`
26
30
 
27
31
  Inferno will act as a public client redirect the tester to the the
28
32
  authorization endpoint so that they may provide any required credentials
@@ -38,31 +42,28 @@ module ONCCertificationG10TestKit
38
42
 
39
43
  config(
40
44
  inputs: {
41
- client_id: {
42
- name: :public_client_id,
43
- title: 'Public Launch Client ID'
44
- },
45
- client_secret: {
46
- name: :public_client_secret,
47
- title: 'Public Launch Client Secret',
48
- default: nil,
49
- optional: true,
50
- locked: true
51
- },
52
- requested_scopes: {
53
- name: :public_requested_scopes,
54
- title: 'Public Launch Scope',
55
- default: %(
56
- launch/patient openid fhirUser offline_access patient/Medication.rs
57
- patient/AllergyIntolerance.rs patient/CarePlan.rs
58
- patient/CareTeam.rs patient/Condition.rs patient/Device.rs
59
- patient/DiagnosticReport.rs patient/DocumentReference.rs
60
- patient/Encounter.rs patient/Goal.rs patient/Immunization.rs
61
- patient/Location.rs patient/MedicationRequest.rs
62
- patient/Observation.rs patient/Organization.rs patient/Patient.rs
63
- patient/Practitioner.rs patient/Procedure.rs patient/Provenance.rs
64
- patient/PractitionerRole.rs
65
- ).gsub(/\s{2,}/, ' ').strip
45
+ smart_auth_info: {
46
+ name: :public_smart_auth_info,
47
+ title: 'Public Launch Credentials',
48
+ options: {
49
+ mode: 'auth',
50
+ components: [
51
+ {
52
+ name: :auth_type,
53
+ default: 'public',
54
+ locked: true
55
+ },
56
+ {
57
+ name: :auth_request_method,
58
+ default: 'GET',
59
+ locked: true
60
+ },
61
+ {
62
+ name: :requested_scopes,
63
+ default: STANDALONE_SMART_2_SCOPES
64
+ }
65
+ ]
66
+ }
66
67
  },
67
68
  url: {
68
69
  title: 'Public Launch FHIR Endpoint',
@@ -74,43 +75,19 @@ module ONCCertificationG10TestKit
74
75
  state: {
75
76
  name: :public_state
76
77
  },
77
- smart_authorization_url: {
78
- title: 'OAuth 2.0 Authorize Endpoint',
79
- description: 'OAuth 2.0 Authorize Endpoint provided during the patient standalone launch'
80
- },
81
- smart_token_url: {
82
- title: 'OAuth 2.0 Token Endpoint',
83
- description: 'OAuth 2.0 Token Endpoint provided during the patient standalone launch'
84
- },
85
- smart_credentials: {
86
- name: :public_smart_credentials
87
- },
88
- use_pkce: {
89
- default: 'true',
90
- locked: true
91
- },
92
- pkce_code_challenge_method: {
93
- locked: true
94
- },
95
- client_auth_type: {
96
- name: :public_client_auth_type,
97
- locked: true,
98
- default: 'public'
78
+ patient_id: {
79
+ name: :public_patient_id
99
80
  }
100
81
  },
101
82
  outputs: {
102
83
  code: { name: :public_code },
103
- token_retrieval_time: { name: :public_token_retrieval_time },
104
84
  state: { name: :public_state },
105
85
  id_token: { name: :public_id_token },
106
- refresh_token: { name: :public_refresh_token },
107
- access_token: { name: :public_access_token },
108
- expires_in: { name: :public_expires_in },
109
86
  patient_id: { name: :public_patient_id },
110
87
  encounter_id: { name: :public_encounter_id },
111
88
  received_scopes: { name: :public_received_scopes },
112
89
  intent: { name: :public_intent },
113
- smart_credentials: { name: :public_smart_credentials }
90
+ smart_auth_info: { name: :public_smart_auth_info }
114
91
  },
115
92
  requests: {
116
93
  redirect: { name: :public_redirect },
@@ -118,24 +95,7 @@ module ONCCertificationG10TestKit
118
95
  }
119
96
  )
120
97
 
121
- input_order :url,
122
- :public_client_id,
123
- :public_client_secret,
124
- :public_requested_scopes,
125
- :use_pkce,
126
- :pkce_code_challenge_method,
127
- :smart_authorization_url,
128
- :smart_token_url,
129
- :authorization_method,
130
- :public_client_auth_type
131
-
132
- test from: :g10_patient_context,
133
- config: {
134
- inputs: {
135
- patient_id: { name: :public_patient_id },
136
- smart_credentials: { name: :public_smart_credentials }
137
- }
138
- }
98
+ test from: :g10_patient_context
139
99
 
140
100
  test do
141
101
  title 'OAuth token exchange response contains OpenID Connect id_token'
@@ -155,8 +115,9 @@ module ONCCertificationG10TestKit
155
115
  end
156
116
  end
157
117
 
158
- children.each do |child|
159
- child.inputs.delete(:client_auth_encryption_method)
160
- end
118
+ test from: :well_known_endpoint
119
+
120
+ # Move the well-known endpoint test to the beginning
121
+ children.prepend(children.pop)
161
122
  end
162
123
  end
@@ -8,7 +8,8 @@ module ONCCertificationG10TestKit
8
8
  smart-app-launch guide. All scopes requested are expected to be granted.
9
9
  )
10
10
  id :g10_smart_scopes
11
- input :requested_scopes, :received_scopes
11
+ input :smart_auth_info, type: 'auth_info'
12
+ input :received_scopes
12
13
  uses_request :token
13
14
 
14
15
  VALID_RESOURCE_TYPES = [
@@ -95,6 +96,10 @@ module ONCCertificationG10TestKit
95
96
  VALID_RESOURCE_TYPES
96
97
  end
97
98
 
99
+ def requested_scopes
100
+ smart_auth_info.requested_scopes
101
+ end
102
+
98
103
  def required_scope_type
99
104
  config.options[:required_scope_type]
100
105
  end