smart_health_cards_test_kit 0.10.0 → 0.10.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/lib/smart_health_cards_test_kit/metadata.rb +6 -3
- data/lib/smart_health_cards_test_kit/shc_fhir_validation.rb +7 -21
- data/lib/smart_health_cards_test_kit/shc_payload_verification.rb +7 -3
- data/lib/smart_health_cards_test_kit/smart_health_cards_test_suite.rb +10 -9
- data/lib/smart_health_cards_test_kit/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51f6dab0372c9503ccc8799beabcf00a7d1a704ca4ea3a22571a36629ccd2721
|
4
|
+
data.tar.gz: '086956b67891836434dc0239778db343c1d562b2d6ab12b33078fd397ca7781a'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a96c251549bb37ecc945d883d9bfe332bac72af5de889c700f5a0485aeef2cc8e50992a96cc9a699636d613dcb0aa0581fadad3449f8530bac7d94fc28ab640d
|
7
|
+
data.tar.gz: 98299d46294ac055880916481945d1316163c6d8e6a8bd2aa784de2281886c85dcc252434d570a8229c1f595068a129d1cd41c996c1f79aef749a317d509d5a0
|
@@ -21,9 +21,12 @@ module SmartHealthCardsTestKit
|
|
21
21
|
These tests are intended to allow server implementers to perform checks of their server against SMART Health Cards Framework requrirements.
|
22
22
|
|
23
23
|
The test kit currently tests the following requirements:
|
24
|
-
- Download and validate a health card via file
|
25
|
-
- Download and validate a health card via FHIR $health-cards-issue operation
|
26
|
-
- Download and validate a health card via QR Code
|
24
|
+
- Download and validate a health card [via File Download](https://spec.smarthealth.cards/#via-file-download)
|
25
|
+
- Download and validate a health card [via FHIR $health-cards-issue Operation](https://spec.smarthealth.cards/#via-fhir-health-cards-issue-operation)
|
26
|
+
- Download and validate a health card [via QR Code](https://spec.smarthealth.cards/#via-qr-print-or-scan)
|
27
|
+
|
28
|
+
The test kit does **NOT** test this requirement:
|
29
|
+
- Download and validate a health card [via Deep Link](https://spec.smarthealth.cards/#via-deep-link)
|
27
30
|
|
28
31
|
See the test descriptions within the test kit for detail on the specific validations performed as part of testing these requirements.
|
29
32
|
|
@@ -7,33 +7,19 @@ module SmartHealthCardsTestKit
|
|
7
7
|
description %(
|
8
8
|
SMART Health Card payload SHALL be a valid FHIR Bundle resource
|
9
9
|
)
|
10
|
-
input :
|
11
|
-
output :fhir_bundles
|
10
|
+
input :fhir_bundles
|
12
11
|
|
13
12
|
run do
|
13
|
+
skip_if fhir_bundles.blank?, 'No FHIR bundles received'
|
14
14
|
|
15
|
-
|
16
|
-
bundle_array =
|
15
|
+
assert_valid_json(fhir_bundles)
|
16
|
+
bundle_array = JSON.parse(fhir_bundles)
|
17
17
|
|
18
|
-
|
19
|
-
jws = SmartHealthCardsTestKit::Utils::JWS.from_jws(credential)
|
20
|
-
payload = payload_from_jws(jws)
|
21
|
-
|
22
|
-
vc = payload['vc']
|
23
|
-
assert vc.is_a?(Hash), "Expected 'vc' claim to be a JSON object, but found #{vc.class}"
|
24
|
-
|
25
|
-
subject = vc['credentialSubject']
|
26
|
-
assert subject.is_a?(Hash), "Expected 'vc.credentialSubject' to be a JSON object, but found #{subject.class}"
|
27
|
-
|
28
|
-
raw_bundle = subject['fhirBundle']
|
29
|
-
assert raw_bundle.is_a?(Hash), "Expected 'vc.fhirBundle' to be a JSON object, but found #{raw_bundle.class}"
|
30
|
-
|
31
|
-
bundle = FHIR::Bundle.new(raw_bundle)
|
32
|
-
assert_valid_resource(resource: bundle)
|
33
|
-
bundle_array.append(bundle)
|
18
|
+
skip_if bundle_array.blank?, 'No FHIR bundles received'
|
34
19
|
|
20
|
+
bundle_array.each do |bundle|
|
21
|
+
assert_valid_resource(resource: FHIR::Bundle.new(bundle))
|
35
22
|
end
|
36
|
-
output fhir_bundles: bundle_array
|
37
23
|
end
|
38
24
|
end
|
39
25
|
end
|
@@ -33,11 +33,11 @@ module SmartHealthCardsTestKit
|
|
33
33
|
(e.g., `{"patient": {"reference": "resource:0"}}`)
|
34
34
|
)
|
35
35
|
input :credential_strings
|
36
|
-
output :
|
36
|
+
output :fhir_bundles
|
37
37
|
|
38
38
|
run do
|
39
39
|
skip_if credential_strings.blank?, 'No Verifiable Credentials received'
|
40
|
-
|
40
|
+
fhir_bundles = []
|
41
41
|
|
42
42
|
credential_strings.split(',').each do |credential|
|
43
43
|
jws = SmartHealthCardsTestKit::Utils::JWS.from_jws(credential)
|
@@ -79,6 +79,9 @@ module SmartHealthCardsTestKit
|
|
79
79
|
"The following Bundle entry urls do not use short resource-scheme URIs: #{bad_urls.join(', ')}"
|
80
80
|
end
|
81
81
|
|
82
|
+
# Have to make another copy of bundle to avoid being modified by the following codes
|
83
|
+
fhir_bundles.append(FHIR::Bundle.new(raw_bundle))
|
84
|
+
|
82
85
|
bundle = FHIR::Bundle.new(raw_bundle)
|
83
86
|
resources = bundle.entry.map(&:resource)
|
84
87
|
bundle.entry.each { |entry| entry.resource = nil }
|
@@ -117,7 +120,8 @@ module SmartHealthCardsTestKit
|
|
117
120
|
end
|
118
121
|
end
|
119
122
|
end
|
120
|
-
|
123
|
+
|
124
|
+
output fhir_bundles: fhir_bundles.to_json
|
121
125
|
end
|
122
126
|
end
|
123
127
|
end
|
@@ -19,25 +19,26 @@ module SmartHealthCardsTestKit
|
|
19
19
|
id :smart_health_cards
|
20
20
|
title 'SMART Health Cards'
|
21
21
|
description %(
|
22
|
-
The
|
22
|
+
The SMART Health Cards tests systems for their conformance to the
|
23
23
|
[SMART Health Cards Framework v1.4.0](https://spec.smarthealth.cards/)
|
24
24
|
)
|
25
25
|
|
26
26
|
links [
|
27
27
|
{
|
28
|
-
|
29
|
-
|
30
|
-
url: 'https://github.com/inferno-framework/smart-health-cards-test-kit/'
|
28
|
+
label: 'Report Issue',
|
29
|
+
url: 'https://github.com/inferno-framework/smart-health-cards-test-kit/issues'
|
31
30
|
},
|
32
31
|
{
|
33
|
-
|
34
|
-
|
35
|
-
url: 'https://github.com/inferno-framework/smart-health-cards-test-kit/issues/'
|
32
|
+
label: 'Open Source',
|
33
|
+
url: 'https://github.com/inferno-framework/smart-health-cards-test-kit'
|
36
34
|
},
|
37
35
|
{
|
38
|
-
type: 'download',
|
39
36
|
label: 'Download',
|
40
|
-
url: 'https://github.com/inferno-framework/smart-health-cards-test-kit/releases
|
37
|
+
url: 'https://github.com/inferno-framework/smart-health-cards-test-kit/releases'
|
38
|
+
},
|
39
|
+
{
|
40
|
+
label: 'SMART Health Cards Framework',
|
41
|
+
url: 'https://spec.smarthealth.cards/'
|
41
42
|
}
|
42
43
|
]
|
43
44
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_health_cards_test_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yunwei Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inferno_core
|