smart_app_launch_test_kit 0.5.1 → 0.6.1
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.
- checksums.yaml +4 -4
- data/config/presets/SMART_RunClientAgainstServer.json.erb +31 -0
- data/config/presets/SMART_RunServerAgainstClient.json.erb +42 -0
- data/config/presets/inferno_reference_server_preset.json +15 -86
- data/config/presets/inferno_reference_server_stu2_2_preset.json +20 -69
- data/config/presets/inferno_reference_server_stu2_preset.json +20 -69
- data/lib/smart_app_launch/app_redirect_test.rb +12 -44
- data/lib/smart_app_launch/app_redirect_test_stu2.rb +2 -17
- data/lib/smart_app_launch/backend_services_authorization_group.rb +33 -59
- data/lib/smart_app_launch/backend_services_authorization_request_builder.rb +22 -9
- data/lib/smart_app_launch/backend_services_authorization_request_success_test.rb +32 -24
- data/lib/smart_app_launch/backend_services_authorization_response_body_test.rb +23 -5
- data/lib/smart_app_launch/backend_services_invalid_client_assertion_test.rb +30 -25
- data/lib/smart_app_launch/backend_services_invalid_grant_type_test.rb +30 -24
- data/lib/smart_app_launch/backend_services_invalid_jwt_test.rb +31 -26
- data/lib/smart_app_launch/client_assertion_builder.rb +27 -12
- data/lib/smart_app_launch/client_stu2_2_suite.rb +79 -0
- data/lib/smart_app_launch/client_suite/client_access_group.rb +26 -0
- data/lib/smart_app_launch/client_suite/client_access_interaction_test.rb +64 -0
- data/lib/smart_app_launch/client_suite/client_registration_group.rb +15 -0
- data/lib/smart_app_launch/client_suite/client_registration_verification_test.rb +52 -0
- data/lib/smart_app_launch/client_suite/client_token_request_verification_test.rb +146 -0
- data/lib/smart_app_launch/client_suite/client_token_use_verification_test.rb +47 -0
- data/lib/smart_app_launch/cors_openid_fhir_user_claim_test.rb +2 -2
- data/lib/smart_app_launch/cors_token_exchange_test.rb +2 -2
- data/lib/smart_app_launch/discovery_stu1_group.rb +6 -2
- data/lib/smart_app_launch/docs/demo/FHIR Request.postman_collection.json +81 -0
- data/lib/smart_app_launch/docs/smart_stu2_2_client_suite_description.md +121 -0
- data/lib/smart_app_launch/ehr_launch_group.rb +41 -24
- data/lib/smart_app_launch/ehr_launch_group_stu2.rb +26 -10
- data/lib/smart_app_launch/ehr_launch_group_stu2_2.rb +0 -16
- data/lib/smart_app_launch/endpoints/echoing_fhir_responder.rb +52 -0
- data/lib/smart_app_launch/endpoints/mock_smart_server/token.rb +27 -0
- data/lib/smart_app_launch/endpoints/mock_smart_server.rb +217 -0
- data/lib/smart_app_launch/metadata.rb +2 -2
- data/lib/smart_app_launch/openid_fhir_user_claim_test.rb +5 -4
- data/lib/smart_app_launch/openid_token_payload_test.rb +6 -8
- data/lib/smart_app_launch/smart_stu1_suite.rb +32 -24
- data/lib/smart_app_launch/smart_stu2_2_suite.rb +57 -30
- data/lib/smart_app_launch/smart_stu2_suite.rb +57 -31
- data/lib/smart_app_launch/smart_tls_test.rb +14 -0
- data/lib/smart_app_launch/standalone_launch_group.rb +42 -25
- data/lib/smart_app_launch/standalone_launch_group_stu2.rb +26 -10
- data/lib/smart_app_launch/standalone_launch_group_stu2_2.rb +0 -16
- data/lib/smart_app_launch/tags.rb +7 -0
- data/lib/smart_app_launch/token_exchange_stu2_2_test.rb +5 -17
- data/lib/smart_app_launch/token_exchange_stu2_test.rb +8 -67
- data/lib/smart_app_launch/token_exchange_test.rb +18 -38
- data/lib/smart_app_launch/token_introspection_access_token_group.rb +12 -4
- data/lib/smart_app_launch/token_introspection_access_token_group_stu2_2.rb +9 -1
- data/lib/smart_app_launch/token_introspection_group.rb +2 -4
- data/lib/smart_app_launch/token_introspection_request_group.rb +2 -4
- data/lib/smart_app_launch/token_introspection_response_group.rb +64 -49
- data/lib/smart_app_launch/token_refresh_body_test.rb +9 -2
- data/lib/smart_app_launch/token_refresh_stu2_test.rb +10 -17
- data/lib/smart_app_launch/token_refresh_test.rb +19 -20
- data/lib/smart_app_launch/token_response_body_test.rb +14 -4
- data/lib/smart_app_launch/token_response_body_test_stu2_2.rb +3 -2
- data/lib/smart_app_launch/urls.rb +40 -0
- data/lib/smart_app_launch/version.rb +2 -2
- data/lib/smart_app_launch/well_known_endpoint_test.rb +11 -1
- data/lib/smart_app_launch_test_kit.rb +1 -0
- metadata +21 -4
@@ -14,7 +14,7 @@ module SMARTAppLaunch
|
|
14
14
|
)
|
15
15
|
id :smart_token_response_body_stu2_2
|
16
16
|
|
17
|
-
input :
|
17
|
+
input :smart_auth_info, type: :auth_info, options: { mode: 'auth' }
|
18
18
|
output :id_token,
|
19
19
|
:refresh_token,
|
20
20
|
:access_token,
|
@@ -22,7 +22,8 @@ module SMARTAppLaunch
|
|
22
22
|
:patient_id,
|
23
23
|
:encounter_id,
|
24
24
|
:received_scopes,
|
25
|
-
:intent
|
25
|
+
:intent,
|
26
|
+
:smart_auth_info
|
26
27
|
uses_request :token
|
27
28
|
|
28
29
|
def validate_fhir_context(fhir_context)
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SMARTAppLaunch
|
4
|
+
FHIR_PATH = '/fhir'
|
5
|
+
RESUME_PASS_PATH = '/resume_pass'
|
6
|
+
RESUME_FAIL_PATH = '/resume_fail'
|
7
|
+
AUTH_SERVER_PATH = '/auth'
|
8
|
+
SMART_DISCOVERY_PATH = "#{FHIR_PATH}/.well-known/smart-configuration".freeze
|
9
|
+
TOKEN_PATH = "#{AUTH_SERVER_PATH}/token".freeze
|
10
|
+
|
11
|
+
module URLs
|
12
|
+
def client_base_url
|
13
|
+
@client_base_url ||= "#{Inferno::Application['base_url']}/custom/#{client_suite_id}"
|
14
|
+
end
|
15
|
+
|
16
|
+
def client_fhir_base_url
|
17
|
+
@client_fhir_base_url ||= client_base_url + FHIR_PATH
|
18
|
+
end
|
19
|
+
|
20
|
+
def client_resume_pass_url
|
21
|
+
@client_resume_pass_url ||= client_base_url + RESUME_PASS_PATH
|
22
|
+
end
|
23
|
+
|
24
|
+
def client_resume_fail_url
|
25
|
+
@client_resume_fail_url ||= client_base_url + RESUME_FAIL_PATH
|
26
|
+
end
|
27
|
+
|
28
|
+
def client_smart_discovery_url
|
29
|
+
@client_smart_discovery_url ||= client_base_url + SMART_DISCOVERY_PATH
|
30
|
+
end
|
31
|
+
|
32
|
+
def client_token_url
|
33
|
+
@client_token_url ||= client_base_url + TOKEN_PATH
|
34
|
+
end
|
35
|
+
|
36
|
+
def client_suite_id
|
37
|
+
SMARTAppLaunch::SMARTClientSTU22Suite.id
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -13,6 +13,8 @@ module SMARTAppLaunch
|
|
13
13
|
input :url,
|
14
14
|
title: 'FHIR Endpoint',
|
15
15
|
description: 'URL of the FHIR endpoint used by SMART applications'
|
16
|
+
input :smart_auth_info,
|
17
|
+
type: :auth_info
|
16
18
|
|
17
19
|
output :well_known_configuration,
|
18
20
|
:well_known_authorization_url,
|
@@ -20,7 +22,8 @@ module SMARTAppLaunch
|
|
20
22
|
:well_known_management_url,
|
21
23
|
:well_known_registration_url,
|
22
24
|
:well_known_revocation_url,
|
23
|
-
:well_known_token_url
|
25
|
+
:well_known_token_url,
|
26
|
+
:smart_auth_info
|
24
27
|
makes_request :smart_well_known_configuration
|
25
28
|
|
26
29
|
run do
|
@@ -46,6 +49,13 @@ module SMARTAppLaunch
|
|
46
49
|
well_known_revocation_url: make_url_absolute(base_url, config['revocation_endpoint']),
|
47
50
|
well_known_token_url: make_url_absolute(base_url, config['token_endpoint'])
|
48
51
|
|
52
|
+
if smart_auth_info.use_discovery
|
53
|
+
smart_auth_info.auth_url = well_known_authorization_url
|
54
|
+
smart_auth_info.token_url = well_known_token_url
|
55
|
+
|
56
|
+
output smart_auth_info: smart_auth_info
|
57
|
+
end
|
58
|
+
|
49
59
|
content_type = request.response_header('Content-Type')&.value
|
50
60
|
|
51
61
|
assert content_type.present?, 'No `Content-Type` header received.'
|
@@ -5,3 +5,4 @@ require_relative 'smart_app_launch/smart_stu1_suite'
|
|
5
5
|
require_relative 'smart_app_launch/smart_stu2_suite'
|
6
6
|
require_relative 'smart_app_launch/smart_stu2_2_suite'
|
7
7
|
require_relative 'smart_app_launch/smart_access_brands_suite'
|
8
|
+
require_relative 'smart_app_launch/client_stu2_2_suite'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_app_launch_test_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen MacVicar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inferno_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.6.
|
19
|
+
version: 0.6.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.6.
|
26
|
+
version: 0.6.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json-jwt
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,6 +145,8 @@ extensions: []
|
|
145
145
|
extra_rdoc_files: []
|
146
146
|
files:
|
147
147
|
- LICENSE
|
148
|
+
- config/presets/SMART_RunClientAgainstServer.json.erb
|
149
|
+
- config/presets/SMART_RunServerAgainstClient.json.erb
|
148
150
|
- config/presets/inferno_reference_server_preset.json
|
149
151
|
- config/presets/inferno_reference_server_stu2_2_preset.json
|
150
152
|
- config/presets/inferno_reference_server_stu2_preset.json
|
@@ -164,6 +166,13 @@ files:
|
|
164
166
|
- lib/smart_app_launch/backend_services_invalid_grant_type_test.rb
|
165
167
|
- lib/smart_app_launch/backend_services_invalid_jwt_test.rb
|
166
168
|
- lib/smart_app_launch/client_assertion_builder.rb
|
169
|
+
- lib/smart_app_launch/client_stu2_2_suite.rb
|
170
|
+
- lib/smart_app_launch/client_suite/client_access_group.rb
|
171
|
+
- lib/smart_app_launch/client_suite/client_access_interaction_test.rb
|
172
|
+
- lib/smart_app_launch/client_suite/client_registration_group.rb
|
173
|
+
- lib/smart_app_launch/client_suite/client_registration_verification_test.rb
|
174
|
+
- lib/smart_app_launch/client_suite/client_token_request_verification_test.rb
|
175
|
+
- lib/smart_app_launch/client_suite/client_token_use_verification_test.rb
|
167
176
|
- lib/smart_app_launch/code_received_test.rb
|
168
177
|
- lib/smart_app_launch/cors_metadata_request_test.rb
|
169
178
|
- lib/smart_app_launch/cors_openid_fhir_user_claim_test.rb
|
@@ -172,9 +181,14 @@ files:
|
|
172
181
|
- lib/smart_app_launch/discovery_stu1_group.rb
|
173
182
|
- lib/smart_app_launch/discovery_stu2_2_group.rb
|
174
183
|
- lib/smart_app_launch/discovery_stu2_group.rb
|
184
|
+
- lib/smart_app_launch/docs/demo/FHIR Request.postman_collection.json
|
185
|
+
- lib/smart_app_launch/docs/smart_stu2_2_client_suite_description.md
|
175
186
|
- lib/smart_app_launch/ehr_launch_group.rb
|
176
187
|
- lib/smart_app_launch/ehr_launch_group_stu2.rb
|
177
188
|
- lib/smart_app_launch/ehr_launch_group_stu2_2.rb
|
189
|
+
- lib/smart_app_launch/endpoints/echoing_fhir_responder.rb
|
190
|
+
- lib/smart_app_launch/endpoints/mock_smart_server.rb
|
191
|
+
- lib/smart_app_launch/endpoints/mock_smart_server/token.rb
|
178
192
|
- lib/smart_app_launch/jwks.rb
|
179
193
|
- lib/smart_app_launch/launch_received_test.rb
|
180
194
|
- lib/smart_app_launch/metadata.rb
|
@@ -203,9 +217,11 @@ files:
|
|
203
217
|
- lib/smart_app_launch/smart_stu1_suite.rb
|
204
218
|
- lib/smart_app_launch/smart_stu2_2_suite.rb
|
205
219
|
- lib/smart_app_launch/smart_stu2_suite.rb
|
220
|
+
- lib/smart_app_launch/smart_tls_test.rb
|
206
221
|
- lib/smart_app_launch/standalone_launch_group.rb
|
207
222
|
- lib/smart_app_launch/standalone_launch_group_stu2.rb
|
208
223
|
- lib/smart_app_launch/standalone_launch_group_stu2_2.rb
|
224
|
+
- lib/smart_app_launch/tags.rb
|
209
225
|
- lib/smart_app_launch/token_exchange_stu2_2_test.rb
|
210
226
|
- lib/smart_app_launch/token_exchange_stu2_test.rb
|
211
227
|
- lib/smart_app_launch/token_exchange_test.rb
|
@@ -225,6 +241,7 @@ files:
|
|
225
241
|
- lib/smart_app_launch/token_response_body_test_stu2_2.rb
|
226
242
|
- lib/smart_app_launch/token_response_headers_test.rb
|
227
243
|
- lib/smart_app_launch/url_helpers.rb
|
244
|
+
- lib/smart_app_launch/urls.rb
|
228
245
|
- lib/smart_app_launch/version.rb
|
229
246
|
- lib/smart_app_launch/well_known_capabilities_stu1_test.rb
|
230
247
|
- lib/smart_app_launch/well_known_capabilities_stu2_test.rb
|