bulk_data_test_kit 0.12.1 → 0.12.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ceddce8ba19edeb7ed0ea293d3993c30913a442f0be9233feea63b93bf77a2d
4
- data.tar.gz: 57a3ae1fe54c29739c661e002d9bd210eae7c7352cbc0a8c8b8632b92fd9eab6
3
+ metadata.gz: 4eacd2aaf76d78362df7d5c38ed1bc0fa9442f0e0220b7f313c7f010e65a3862
4
+ data.tar.gz: 6c6f356e9498f9ec75d867519ffe1a68816ec3b84a5c6717e6013c97b23a02a8
5
5
  SHA512:
6
- metadata.gz: aab3e80d059a130ef908bf9fdf719802ae5a30091a78b088db3dc3d53a79e2c2ec81369af9b31dff4fb518fa867c16395b5665354faeb583db16b3e38608efb0
7
- data.tar.gz: b659894cfff0f1f8a91ff4a71083d7fae008f370d470a5e7ceaf96ec8a74ab4a7af5a0a3d065199393a5b5535e85e2220ea727407e7da6648c3ff9c819dde5d6
6
+ metadata.gz: 324e9ecabb57d015668492caa5aa0c2fc2111aaaf240a9ea5de4219ba44e04c79bd71c373c5baa0a5109eebbf4b8807fdd2a7d98f3b8e5a91fd62bb31a123fd2
7
+ data.tar.gz: 44128142c560c2e64d099233fddfbdcf8c0a2a123dae07f0ffd2114b18f40dbfd48a7db8ea5a9d66c372e08d7de764dbeb27abf0b67da76e6714cdad20fd62ad
@@ -0,0 +1,19 @@
1
+ require 'smart_app_launch_test_kit'
2
+ require_relative 'bulk_data_client_token_verification_test'
3
+
4
+ module BulkDataTestKit
5
+ module BulkDataV200Client
6
+ class BulkClientDataAuthVerification < Inferno::TestGroup
7
+ id :bulk_data_client_auth_verification
8
+ title 'Review Authentication Interactions'
9
+ run_as_group
10
+
11
+ test from: :bulk_data_client_token_smart_bsca_verification
12
+ test from: :smart_client_token_use_verification,
13
+ config: {
14
+ options: { access_request_tags: [KICKOFF_TAG, STATUS_TAG, OUTPUT_TAG, DELETE_TAG] }
15
+ }
16
+
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ require 'smart_app_launch_test_kit'
2
+
3
+ module BulkDataTestKit
4
+ module BulkDataV200Client
5
+ class BulkClientDataRegistration < Inferno::TestGroup
6
+ id :bulk_data_client_registration
7
+ title 'Client Registration'
8
+ run_as_group
9
+
10
+ test from: :smart_client_registration_bsca_verification
11
+ end
12
+ end
13
+ end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ require 'smart_app_launch_test_kit'
2
3
 
3
4
  require_relative '../version'
4
5
  require_relative 'tags'
@@ -11,7 +12,9 @@ require_relative 'endpoints/kick_off'
11
12
  require_relative 'endpoints/output'
12
13
  require_relative 'endpoints/status'
13
14
 
15
+ require_relative 'bulk_data_client_registration_group'
14
16
  require_relative 'bulk_data_client_export_group'
17
+ require_relative 'bulk_data_client_auth_verification_group'
15
18
 
16
19
  module BulkDataTestKit
17
20
  module BulkDataV200Client
@@ -41,10 +44,6 @@ module BulkDataTestKit
41
44
  }
42
45
  ]
43
46
 
44
- input :access_token,
45
- title: 'Access Token',
46
- description: 'The access token that will be included in all client requests during testing.'
47
-
48
47
  input :export_type,
49
48
  title: 'Export Type',
50
49
  description: 'The export endpoint type to test against.',
@@ -92,6 +91,12 @@ module BulkDataTestKit
92
91
  ]
93
92
  }
94
93
 
94
+ # SMART Backend Services server simulation
95
+ route(:get, SMARTAppLaunch::SMART_DISCOVERY_PATH, lambda { |_env|
96
+ SMARTAppLaunch::MockSMARTServer.smart_server_metadata(id)
97
+ })
98
+ suite_endpoint :post, SMARTAppLaunch::TOKEN_PATH, SMARTAppLaunch::MockSMARTServer::TokenEndpoint
99
+
95
100
  suite_endpoint :get, PATIENT_KICKOFF_ROUTE, Endpoints::KickOff
96
101
  suite_endpoint :get, GROUP_KICKOFF_ROUTE, Endpoints::KickOff
97
102
  suite_endpoint :get, SYSTEM_KICKOFF_ROUTE, Endpoints::KickOff
@@ -103,7 +108,9 @@ module BulkDataTestKit
103
108
  request.query_parameters['id']
104
109
  end
105
110
 
111
+ group from: :bulk_data_client_registration
106
112
  group from: :bulk_data_client_export_group
113
+ group from: :bulk_data_client_auth_verification
107
114
  end
108
115
  end
109
116
  end
@@ -0,0 +1,14 @@
1
+ require 'smart_app_launch_test_kit'
2
+
3
+ module BulkDataTestKit
4
+ module BulkDataV200Client
5
+ class BulkClientDataTokenSMARTConfidentialAsymmetricVerification <
6
+ SMARTAppLaunch::SMARTClientTokenRequestBackendServicesConfidentialAsymmetricVerification
7
+ id :bulk_data_client_token_smart_bsca_verification
8
+
9
+ def client_suite_id
10
+ BulkDataClientTestSuite.id
11
+ end
12
+ end
13
+ end
14
+ end
@@ -13,11 +13,17 @@ module BulkDataTestKit
13
13
 
14
14
  id :bulk_data_client_wait
15
15
 
16
- input :access_token, :export_type, :group_id
16
+ input :client_id,
17
+ title: 'Client Id',
18
+ type: 'text',
19
+ optional: true,
20
+ locked: true,
21
+ description: SMARTAppLaunch::INPUT_CLIENT_ID_DESCRIPTION_LOCKED
22
+ input :export_type, :group_id
17
23
 
18
24
  run do
19
25
  wait(
20
- identifier: access_token,
26
+ identifier: client_id,
21
27
  message: %(
22
28
  Perform a **#{export_type}** endpoint type bulk export kick-off using the following base URL:
23
29
 
@@ -25,7 +31,8 @@ module BulkDataTestKit
25
31
 
26
32
  #{export_type == GROUP_EXPORT_TYPE ? "Ensure the Group ID is set to **#{group_id}**." : ''}
27
33
 
28
- Include the following bearer access token with all requests: **#{access_token}**
34
+ Use client id `#{client_id}` to obtain a backend services access token from the SMART authorization
35
+ server for this FHIR server and include the access token on all subsequent requests.
29
36
 
30
37
  After the kick-off is made, subsequent status request(s) (using the URL provided in the response
31
38
  to the kick-off request), a download request (using the URL provided in the response to
@@ -34,7 +41,7 @@ module BulkDataTestKit
34
41
  The entire request sequence will be recorded and verified to check conformance to the
35
42
  [Bulk Data IG](https://build.fhir.org/ig/HL7/bulk-data/export.html#sequence-overview).
36
43
 
37
- [Click here](#{resume_pass_url}?id=#{access_token}) when finished.
44
+ [Click here](#{resume_pass_url}?id=#{client_id}) when finished.
38
45
  ),
39
46
  timeout: 900
40
47
  )
@@ -13,20 +13,48 @@ requirements and may change the test verification logic.
13
13
 
14
14
  ### Quick Start
15
15
 
16
- Inferno needs to be able to identify when requests come from the client under test. Testers must provide a bearer access token that will be provided within the Authentication header (Bearer <token>) on all requests made to Inferno endpoints during the test. Inferno uses this information to associate the message with the test session and determine how to respond. How the token provided to Inferno is generated is up to the tester.
16
+ Bulk data access requires the use of SMART Backend Services for authentication.
17
+ In order to interact with Inferno's simulated bulk server, the tester must provide
18
+ the JSON Web Key Set (JWKS) containing the asymmetric signing key in the
19
+ **SMART JSON Web Key Set (JWKS)** input as either a URL that resolves
20
+ to a JWKS or a raw JWKS in JSON format. Additionally, testers may provide
21
+ a **Client Id** if they want their client assigned a specific one.
17
22
 
18
- Note: authentication options for these tests have not been finalized and are subject to change as the requirements evolve. If the implemented approach prevents you from using these tests, please provide feedback so the limitations can be addressed.
23
+ Once the client has been registered, it will need to obtain an access token
24
+ following the SMART Backend Services flow and use it when making bulk data requests.
25
+ f the client is not able to obtain an access token, see the *Demonstration* section
26
+ below for how to use the SMART server tests to obtain an access token that the client can use.
19
27
 
20
- ### Sample Execution - Postman
28
+ ### Demonstration
21
29
 
22
30
  To try out these tests without a Bulk Data client implementation, you may
23
- run them using the [`Bulk Data Client - System Export Postman`](https://github.com/inferno-framework/bulk-data-test-kit/blob/main/lib/bulk_data_test_kit/v2.0.0_client/postman/collection.json) collection. This will kick-off an export, poll the status endpoint (respecting the `retry-after` header), download the first output result, and then delete the export.
31
+ run them using
32
+ - The SMART App Launch test suite to obtain an access token
33
+ - The [`Bulk Data Client - System Export Postman`](https://github.com/inferno-framework/bulk-data-test-kit/blob/main/lib/bulk_data_test_kit/v2.0.0_client/postman/collection.json)
34
+ collection for making bulk data requests.
24
35
 
25
- To run client tests against this Postman collection:
36
+ This collection includes requests to kick-off an export, poll the status endpoint
37
+ (respecting the `retry-after` header), download the first output result, and then delete the export.
38
+
39
+ To run the demonstration:
26
40
  1. Start an Inferno session of the Bulk Data Client test suite.
27
- 2. Click the "Run All Tests" button in the upper right, enter any value (e.g. `SAMPLE_TOKEN`) as the access token, and select the "System Level Export" option for export type.
28
- 3. Click the "Submit" button. The simulated server will start waiting for requests.
29
- 4. Open Postman and import the relevant Postman collection.
30
- 5. Set the `access_token` variable equal to the value entered in step 2 (the value is also displayed on the test modal in the Inferno UI for reference).
31
- 6. Run the collection.
32
- 7. Once the postman collection has run, click the "Click here" link in the Inferno wait dialog modal to evaluate the requests and generate the results.
41
+ 1. In a second tab, start an instance of the SMART App Launch STU2.2 test suite and select the "Demo: Run Against the SMART
42
+ Client Suite (Confidential Asymmetric)" preset.
43
+ 1. Select the "Backend Services" group and click the "RUN TESTS" button, but don't run the tests yet.
44
+ 1. Back in the Bulk Data test session, click the "RUN ALL TESTS" button and fill in the following inputs
45
+ using the values from the SMART App Tests:
46
+ - **Client Id**: from the SMART **Client ID** input
47
+ - **SMART Confidential Asymmetric JSON Web Key Set (JWKS)**: from the "JWK Set URL" in the top of the open input
48
+ dialog in the SMART test session.
49
+ 1. Click the "Submit" button. The simulated server will start waiting for requests.
50
+ 1. Copy the base url that appears in the bulk data wait dialog and put it into the **FHIR Endpoint** input in the
51
+ SMART test session and click the "SUBMIT" button. The tests should complete with some failures and some passes.
52
+ 1. Copy the access token from the `bearer_token` output of test **3.2.06** "Authorization request response body
53
+ contains required information encoded in JSON".
54
+ 1. Open Postman and import the [Postman collection](https://github.com/inferno-framework/bulk-data-test-kit/blob/main/lib/bulk_data_test_kit/v2.0.0_client/postman/collection.json)
55
+ if not already done.
56
+ 1. Set the `access_token` variable equal to the value extracted from the SMART tests.
57
+ 1. Run the collection.
58
+ 1. Once the postman collection has run, click the "Click here" link in the Inferno wait dialog modal to evaluate the requests and generate the results.
59
+
60
+ The tests should pass except for expected errors in the "Verify SMART Token Requests" test.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ require 'smart_app_launch_test_kit'
2
3
 
3
4
  module BulkDataTestKit
4
5
  module BulkDataV200Client
@@ -7,7 +8,11 @@ module BulkDataTestKit
7
8
  include ServerProxy
8
9
 
9
10
  def test_run_identifier
10
- request.get_header('HTTP_AUTHORIZATION')&.split&.last
11
+ return request.params[:session_path] if request.params[:session_path].present?
12
+
13
+ SMARTAppLaunch::MockSMARTServer.issued_token_to_client_id(
14
+ request.headers['authorization']&.delete_prefix('Bearer ')
15
+ )
11
16
  end
12
17
 
13
18
  def make_response
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ require 'smart_app_launch_test_kit'
2
3
 
3
4
  module BulkDataTestKit
4
5
  module BulkDataV200Client
@@ -8,7 +9,11 @@ module BulkDataTestKit
8
9
  include ServerProxy
9
10
 
10
11
  def test_run_identifier
11
- request.get_header('HTTP_AUTHORIZATION')&.split&.last
12
+ return request.params[:session_path] if request.params[:session_path].present?
13
+
14
+ SMARTAppLaunch::MockSMARTServer.issued_token_to_client_id(
15
+ request.headers['authorization']&.delete_prefix('Bearer ')
16
+ )
12
17
  end
13
18
 
14
19
  # Proxy the request to the reference server, and re-use the returned '_jobId' as
@@ -29,11 +34,11 @@ module BulkDataTestKit
29
34
  def tags
30
35
  case request_type
31
36
  when PATIENT_EXPORT_TYPE
32
- [PATIENT_KICKOFF_TAG]
37
+ [KICKOFF_TAG, PATIENT_KICKOFF_TAG]
33
38
  when GROUP_EXPORT_TYPE
34
- [GROUP_KICKOFF_TAG]
39
+ [KICKOFF_TAG, GROUP_KICKOFF_TAG]
35
40
  when SYSTEM_EXPORT_TYPE
36
- [SYSTEM_KICKOFF_TAG]
41
+ [KICKOFF_TAG, SYSTEM_KICKOFF_TAG]
37
42
  end
38
43
  end
39
44
 
@@ -54,7 +59,14 @@ module BulkDataTestKit
54
59
  end
55
60
 
56
61
  def request_type
57
- (request.params[:type] || SYSTEM_EXPORT_TYPE).titleize
62
+ path_component_before_export = request.path_info.split('/')[-2].downcase
63
+ if path_component_before_export == 'fhir'
64
+ SYSTEM_EXPORT_TYPE
65
+ elsif path_component_before_export == 'patient'
66
+ PATIENT_EXPORT_TYPE
67
+ else
68
+ GROUP_EXPORT_TYPE
69
+ end
58
70
  end
59
71
 
60
72
  def group_id
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ require 'smart_app_launch_test_kit'
2
3
 
3
4
  module BulkDataTestKit
4
5
  module BulkDataV200Client
@@ -7,7 +8,11 @@ module BulkDataTestKit
7
8
  include ServerProxy
8
9
 
9
10
  def test_run_identifier
10
- request.get_header('HTTP_AUTHORIZATION')&.split&.last
11
+ return request.params[:session_path] if request.params[:session_path].present?
12
+
13
+ SMARTAppLaunch::MockSMARTServer.issued_token_to_client_id(
14
+ request.headers['authorization']&.delete_prefix('Bearer ')
15
+ )
11
16
  end
12
17
 
13
18
  # Proxy the request to the reference server for a completed output file,
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ require 'smart_app_launch_test_kit'
2
3
 
3
4
  module BulkDataTestKit
4
5
  module BulkDataV200Client
@@ -8,7 +9,11 @@ module BulkDataTestKit
8
9
  include ServerProxy
9
10
 
10
11
  def test_run_identifier
11
- request.get_header('HTTP_AUTHORIZATION')&.split&.last
12
+ return request.params[:session_path] if request.params[:session_path].present?
13
+
14
+ SMARTAppLaunch::MockSMARTServer.issued_token_to_client_id(
15
+ request.headers['authorization']&.delete_prefix('Bearer ')
16
+ )
12
17
  end
13
18
 
14
19
  # Proxy the request to the reference server using the same `_jobId`` we received
@@ -3,6 +3,7 @@
3
3
  module BulkDataTestKit
4
4
  module BulkDataV200Client
5
5
  METADATA_TAG = 'bulk_data_metadata'
6
+ KICKOFF_TAG = 'bulk_data_kickoff'
6
7
  PATIENT_KICKOFF_TAG = 'bulk_data_kickoff_patient'
7
8
  GROUP_KICKOFF_TAG = 'bulk_data_kickoff_group'
8
9
  SYSTEM_KICKOFF_TAG = 'bulk_data_kickoff_system'
@@ -4,8 +4,8 @@ module BulkDataTestKit
4
4
  module BulkDataV200Client
5
5
  RESUME_PASS_ROUTE = '/resume_pass'
6
6
  BASE_ROUTE = '/fhir'
7
- PATIENT_KICKOFF_ROUTE = "#{BASE_ROUTE}/:type/$export".freeze
8
- GROUP_KICKOFF_ROUTE = "#{BASE_ROUTE}/:type/:group_id/$export".freeze
7
+ PATIENT_KICKOFF_ROUTE = "#{BASE_ROUTE}/Patient/$export".freeze
8
+ GROUP_KICKOFF_ROUTE = "#{BASE_ROUTE}/Group/:group_id/$export".freeze
9
9
  SYSTEM_KICKOFF_ROUTE = "#{BASE_ROUTE}/$export".freeze
10
10
  STATUS_ROUTE = '/status/:job_id'
11
11
  OUTPUT_ROUTE = "#{BASE_ROUTE}/Binary/:binary_id".freeze
@@ -13,7 +13,7 @@ module BulkDataTestKit
13
13
  # URLs for use in Bulk Data Client tests and endpoints
14
14
  module URLs
15
15
  def base_url
16
- "#{Inferno::Application['base_url']}/custom/bulk_data_v200_client"
16
+ "#{Inferno::Application['base_url']}/custom/#{suite_id}"
17
17
  end
18
18
 
19
19
  def resume_pass_url
@@ -31,6 +31,10 @@ module BulkDataTestKit
31
31
  def output_url
32
32
  base_url + OUTPUT_ROUTE
33
33
  end
34
+
35
+ def suite_id
36
+ BulkDataClientTestSuite.id
37
+ end
34
38
  end
35
39
  end
36
40
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BulkDataTestKit
4
- VERSION = '0.12.1'
5
- LAST_UPDATED = '2025-03-31'
4
+ VERSION = '0.12.2'
5
+ LAST_UPDATED = '2025-05-20'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulk_data_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inferno Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-31 00:00:00.000000000 Z
11
+ date: 2025-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bloomer
@@ -112,16 +112,16 @@ dependencies:
112
112
  name: smart_app_launch_test_kit
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.6.0
117
+ version: 0.6.3
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.6.0
124
+ version: 0.6.3
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: tls_test_kit
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -264,12 +264,15 @@ files:
264
264
  - lib/bulk_data_test_kit/v2.0.0/patient/bulk_data_patient_export_parameters_group.rb
265
265
  - lib/bulk_data_test_kit/v2.0.0/system_export/bulk_data_system_export_cancel_group.rb
266
266
  - lib/bulk_data_test_kit/v2.0.0/system_export/bulk_data_system_export_parameters_group.rb
267
+ - lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_auth_verification_group.rb
267
268
  - lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_delete_test.rb
268
269
  - lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_export_group.rb
269
270
  - lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_kick_off_test.rb
270
271
  - lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_output_test.rb
272
+ - lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_registration_group.rb
271
273
  - lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_status_test.rb
272
274
  - lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_test_suite.rb
275
+ - lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_token_verification_test.rb
273
276
  - lib/bulk_data_test_kit/v2.0.0_client/bulk_data_client_wait_test.rb
274
277
  - lib/bulk_data_test_kit/v2.0.0_client/docs/suite_description.md
275
278
  - lib/bulk_data_test_kit/v2.0.0_client/endpoints/delete.rb