udap_security_test_kit 0.11.6 → 0.12.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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/udap_security_test_kit/client_suite.rb +3 -0
  3. data/lib/udap_security_test_kit/registration_failure_invalid_contents_test.rb +1 -1
  4. data/lib/udap_security_test_kit/requirements/generated/udap-security-test-kit_requirements_coverage.csv +317 -0
  5. data/lib/udap_security_test_kit/requirements/generated/udap_security_client_requirements_coverage.csv +38 -38
  6. data/lib/udap_security_test_kit/requirements/generated/udap_security_requirements_coverage.csv +70 -70
  7. data/lib/udap_security_test_kit/version.rb +2 -2
  8. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/b2b_authorization_extension_object_test.rb +77 -0
  9. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/client_authorization_code_usage_test.rb +47 -0
  10. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/client_security_csrf_protection_test.rb +50 -0
  11. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/cryptographic_algorithms_test.rb +44 -0
  12. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/data_holder_auth_request_scope_test.rb +42 -0
  13. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/idp_authentication_compliance_test.rb +44 -0
  14. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/idp_supports_required_scopes_test.rb +42 -0
  15. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/jti_reuse_prevention_test.rb +44 -0
  16. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/metadata_interpretation_test.rb +47 -0
  17. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/oauth2_protocol_compliance_test.rb +50 -0
  18. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/preferred_identity_provider_test.rb +45 -0
  19. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/private_key_authentication_test.rb +47 -0
  20. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/resource_holder_authentication_test.rb +45 -0
  21. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/software_statement_registration_test.rb +49 -0
  22. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/token_request_authentication_test.rb +51 -0
  23. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/trust_community_query_parameters_test.rb +43 -0
  24. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/validation_confidentiality_test.rb +49 -0
  25. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client_attestation_group.rb +48 -0
  26. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authentication_requests_group/authentication_request_construction_test.rb +56 -0
  27. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authentication_requests_group/authentication_request_validation_test.rb +60 -0
  28. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authentication_requests_group.rb +13 -0
  29. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/access_token_lifetime_test.rb +42 -0
  30. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/access_token_request_validation_test.rb +51 -0
  31. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/authorization_code_usage_test.rb +45 -0
  32. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/resource_holder_authorization_flow_test.rb +37 -0
  33. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group.rb +17 -0
  34. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/client_authentication_group/client_certificate_storage_test.rb +36 -0
  35. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/client_authentication_group/no_client_credentials_native_apps_test.rb +38 -0
  36. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/client_authentication_group.rb +13 -0
  37. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group/certification_handling_test.rb +45 -0
  38. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group/client_id_modification_test.rb +42 -0
  39. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group/dynamic_client_registration_validation_test.rb +48 -0
  40. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group.rb +15 -0
  41. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/deny_token_request_test.rb +42 -0
  42. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/general_error_response_test.rb +39 -0
  43. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/invalid_id_token_test.rb +43 -0
  44. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/invalid_idp_test.rb +39 -0
  45. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/invalid_redirection_uri_test.rb +43 -0
  46. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/prompt_none_test.rb +39 -0
  47. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/state_mismatch_test.rb +43 -0
  48. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/unauthenticated_user_test.rb +42 -0
  49. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/valid_state_error_response_test.rb +43 -0
  50. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group.rb +27 -0
  51. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group/access_token_validation_test.rb +47 -0
  52. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group/id_token_validation_test.rb +45 -0
  53. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group/token_response_validation_test.rb +47 -0
  54. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group.rb +15 -0
  55. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_authentication_request_test.rb +45 -0
  56. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_dynamic_registration_test.rb +45 -0
  57. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_metadata_validation_test.rb +44 -0
  58. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_token_exchange_test.rb +46 -0
  59. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group.rb +17 -0
  60. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_certificate_chain_validation_test.rb +36 -0
  61. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_grant_parameter_validation_test.rb +36 -0
  62. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_jti_reuse_test.rb +35 -0
  63. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_signature_validation_test.rb +36 -0
  64. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_token_request_validation_test.rb +43 -0
  65. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group.rb +19 -0
  66. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_authorization_extensions_required_test.rb +43 -0
  67. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_community_parameter_support_test.rb +44 -0
  68. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_metadata_endpoint_error_handling_test.rb +43 -0
  69. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_metadata_representation_test.rb +42 -0
  70. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_profiles_supported_test.rb +43 -0
  71. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group.rb +19 -0
  72. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/csrf_protection_test.rb +49 -0
  73. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/obtain_authorization_scopes_test.rb +44 -0
  74. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/state_parameter_test.rb +48 -0
  75. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/unauthenticated_client_security_test.rb +47 -0
  76. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group.rb +17 -0
  77. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server_attestation_group.rb +33 -0
  78. data/lib/udap_security_test_kit.rb +2 -0
  79. metadata +81 -4
@@ -0,0 +1,43 @@
1
+ module UDAPSecurityTestKit
2
+ class InvalidIDTokenErrorAttestationTest < Inferno::Test
3
+ title 'Handles invalid ID token error correctly'
4
+ id :udap_security_invalid_id_token_error
5
+ description %(
6
+ Data Holder either returns an `invalid_idp` error code or attempts alternate authentication when the IdP
7
+ does not return an ID Token or validation fails.
8
+ )
9
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@291'
10
+
11
+ input :invalid_id_token_error_handling_correct,
12
+ title: 'Error Handling: Handles invalid ID token error correctly',
13
+ description: %(
14
+ I attest that the Data Holder either returns an `invalid_idp` error code or attempts alternate
15
+ authentication when the IdP does not return an ID Token or validation fails.
16
+ ),
17
+ type: 'radio',
18
+ default: 'false',
19
+ options: {
20
+ list_options: [
21
+ {
22
+ label: 'Yes',
23
+ value: 'true'
24
+ },
25
+ {
26
+ label: 'No',
27
+ value: 'false'
28
+ }
29
+ ]
30
+ }
31
+ input :invalid_id_token_error_handling_note,
32
+ title: 'Notes, if applicable:',
33
+ type: 'textarea',
34
+ optional: true
35
+
36
+ run do
37
+ assert invalid_id_token_error_handling_correct == 'true',
38
+ 'Data Holder does not return an `invalid_idp` error code or attempt alternate authentication
39
+ when the IdP does not return an ID Token or validation fails.'
40
+ pass invalid_id_token_error_handling_note if invalid_id_token_error_handling_note.present?
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,39 @@
1
+ module UDAPSecurityTestKit
2
+ class InvalidIdpErrorAttestationTest < Inferno::Test
3
+ title 'Handles invalid_idp error correctly'
4
+ id :udap_security_invalid_idp_error
5
+ description %(
6
+ Data Holder returns an error response with the `invalid_idp` extension error code
7
+ when the IdP is rejected, as per
8
+ [Section 4.1.2.1 of RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1).
9
+ )
10
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@241'
11
+
12
+ input :invalid_idp_error_handling_correct,
13
+ title: 'Error Handling: Handles invalid_idp error correctly',
14
+ description: %(
15
+ I attest that the Data Holder returns an error response with the `invalid_idp`
16
+ extension error code when the IdP is rejected, as per
17
+ [Section 4.1.2.1 of RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1).
18
+ ),
19
+ type: 'radio',
20
+ default: 'false',
21
+ options: {
22
+ list_options: [
23
+ { label: 'Yes', value: 'true' },
24
+ { label: 'No', value: 'false' }
25
+ ]
26
+ }
27
+ input :invalid_idp_error_handling_note,
28
+ title: 'Notes, if applicable:',
29
+ type: 'textarea',
30
+ optional: true
31
+
32
+ run do
33
+ assert invalid_idp_error_handling_correct == 'true',
34
+ 'Data Holder does not return an error response with the `invalid_idp` extension error code when the
35
+ IdP is rejected.'
36
+ pass invalid_idp_error_handling_note if invalid_idp_error_handling_note.present?
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,43 @@
1
+ module UDAPSecurityTestKit
2
+ class InvalidRedirectionURIAttestationTest < Inferno::Test
3
+ title 'Handles invalid redirection URI correctly'
4
+ id :udap_security_invalid_redirection_uri
5
+ description %(
6
+ The Authorization Server does NOT redirect the user-agent to an invalid redirection URI when the request
7
+ fails due to a missing or invalid redirection URI.
8
+ )
9
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@242'
10
+
11
+ input :invalid_redirection_uri_handling_correct,
12
+ title: 'Error Handling: Handles Invalid redirection URI correctly',
13
+ description: %(
14
+ I attest that the Authorization Server does NOT redirect the user-agent to an invalid redirection
15
+ URI when the request fails due to a missing or invalid redirection URI.
16
+ ),
17
+ type: 'radio',
18
+ default: 'false',
19
+ options: {
20
+ list_options: [
21
+ {
22
+ label: 'Yes',
23
+ value: 'true'
24
+ },
25
+ {
26
+ label: 'No',
27
+ value: 'false'
28
+ }
29
+ ]
30
+ }
31
+ input :invalid_redirection_uri_handling_note,
32
+ title: 'Notes, if applicable:',
33
+ type: 'textarea',
34
+ optional: true
35
+
36
+ run do
37
+ assert invalid_redirection_uri_handling_correct == 'true',
38
+ 'Authorization Server redirects the user-agent to an invalid redirection URI when the
39
+ request fails due to a missing or invalid URI.'
40
+ pass invalid_redirection_uri_handling_note if invalid_redirection_uri_handling_note.present?
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,39 @@
1
+ module UDAPSecurityTestKit
2
+ class PromptNoneErrorAttestationTest < Inferno::Test
3
+ title 'Returns error for prompt=none when user not authenticated'
4
+ id :udap_security_prompt_none_error
5
+ description %(
6
+ Authorization Server returns an error if the authentication request contains prompt=none
7
+ and the End-User is not already authenticated or could not be silently authenticated.
8
+ )
9
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@267',
10
+ 'hl7.fhir.us.udap-security_1.0.0@268'
11
+
12
+ input :prompt_none_error_handling_correct,
13
+ title: 'Error Handling: Returns error for prompt=none when user not authenticated',
14
+ description: %(
15
+ I attest that the Authorization Server returns an error if the authentication
16
+ request contains prompt=none and the End-User is not already authenticated or
17
+ could not be silently authenticated.
18
+ ),
19
+ type: 'radio',
20
+ default: 'false',
21
+ options: {
22
+ list_options: [
23
+ { label: 'Yes', value: 'true' },
24
+ { label: 'No', value: 'false' }
25
+ ]
26
+ }
27
+ input :prompt_none_error_handling_note,
28
+ title: 'Notes, if applicable:',
29
+ type: 'textarea',
30
+ optional: true
31
+
32
+ run do
33
+ assert prompt_none_error_handling_correct == 'true',
34
+ 'Authorization Server does not return an error for prompt=none when the End-User
35
+ is not authenticated or could not be silently authenticated.'
36
+ pass prompt_none_error_handling_note if prompt_none_error_handling_note.present?
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,43 @@
1
+ module UDAPSecurityTestKit
2
+ class StateMismatchErrorAttestationTest < Inferno::Test
3
+ title 'Handles state mismatch error correctly'
4
+ id :udap_security_state_mismatch_error
5
+ description %(
6
+ If the `state` parameter does NOT match, the Resource Holder MUST terminate the workflow and redirect with a
7
+ `server_error`.
8
+ )
9
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@271'
10
+
11
+ input :state_mismatch_error_handling_correct,
12
+ title: 'Error Handling: State mismatch error is handled correctly',
13
+ description: %(
14
+ I attest that the Resource Holder terminates the workflow and redirects with a `server_error` when the
15
+ `state` parameter does NOT match.
16
+ ),
17
+ type: 'radio',
18
+ default: 'false',
19
+ options: {
20
+ list_options: [
21
+ {
22
+ label: 'Yes',
23
+ value: 'true'
24
+ },
25
+ {
26
+ label: 'No',
27
+ value: 'false'
28
+ }
29
+ ]
30
+ }
31
+ input :state_mismatch_error_handling_note,
32
+ title: 'Notes, if applicable:',
33
+ type: 'textarea',
34
+ optional: true
35
+
36
+ run do
37
+ assert state_mismatch_error_handling_correct == 'true',
38
+ 'Resource Holder does not terminate the workflow or redirect with a `server_error` when the
39
+ `state` parameter does NOT match.'
40
+ pass state_mismatch_error_handling_note if state_mismatch_error_handling_note.present?
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,42 @@
1
+ module UDAPSecurityTestKit
2
+ class UnauthenticatedUserErrorAttestationTest < Inferno::Test
3
+ title 'Handles unauthenticated user error correctly'
4
+ id :udap_security_unauthenticated_user_error
5
+ description %(
6
+ Data Holder returns an `access_denied` error response when it cannot resolve the authenticated user.
7
+ )
8
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@296'
9
+
10
+ input :unauthenticated_user_error_handling_correct,
11
+ title: 'Error Handling: Handles unauthenticated user error correctly',
12
+ description: %(
13
+ I attest that the Data Holder returns an `access_denied` error response when it cannot resolve
14
+ the authenticated user.
15
+ ),
16
+ type: 'radio',
17
+ default: 'false',
18
+ options: {
19
+ list_options: [
20
+ {
21
+ label: 'Yes',
22
+ value: 'true'
23
+ },
24
+ {
25
+ label: 'No',
26
+ value: 'false'
27
+ }
28
+ ]
29
+ }
30
+ input :unauthenticated_user_error_handling_note,
31
+ title: 'Notes, if applicable:',
32
+ type: 'textarea',
33
+ optional: true
34
+
35
+ run do
36
+ assert unauthenticated_user_error_handling_correct == 'true',
37
+ 'Data Holder does not return an `access_denied` error response when it cannot resolve the
38
+ authenticated user.'
39
+ pass unauthenticated_user_error_handling_note if unauthenticated_user_error_handling_note.present?
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,43 @@
1
+ module UDAPSecurityTestKit
2
+ class ValidStateErrorResponseAttestationTest < Inferno::Test
3
+ title 'Handles valid state error correctly'
4
+ id :udap_security_valid_state_error_response
5
+ description %(
6
+ Resource Holder redirects with an `access_denied` error code when the `state` value is valid
7
+ on an error response.
8
+ )
9
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@273'
10
+
11
+ input :valid_state_error_response_handling_correct,
12
+ title: 'Error Handling: Handles valid state error correctly',
13
+ description: %(
14
+ I attest that the Resource Holder redirects with an `access_denied` error code when the
15
+ `state` value is valid on an error response.
16
+ ),
17
+ type: 'radio',
18
+ default: 'false',
19
+ options: {
20
+ list_options: [
21
+ {
22
+ label: 'Yes',
23
+ value: 'true'
24
+ },
25
+ {
26
+ label: 'No',
27
+ value: 'false'
28
+ }
29
+ ]
30
+ }
31
+ input :valid_state_error_response_handling_note,
32
+ title: 'Notes, if applicable:',
33
+ type: 'textarea',
34
+ optional: true
35
+
36
+ run do
37
+ assert valid_state_error_response_handling_correct == 'true',
38
+ 'Resource Holder does not redirect with an `access_denied` error code when the `state`
39
+ value is valid on an error response.'
40
+ pass valid_state_error_response_handling_note if valid_state_error_response_handling_note.present?
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,27 @@
1
+ require_relative 'error_handling_group/deny_token_request_test'
2
+ require_relative 'error_handling_group/general_error_response_test'
3
+ require_relative 'error_handling_group/invalid_id_token_test'
4
+ require_relative 'error_handling_group/invalid_idp_test'
5
+ require_relative 'error_handling_group/invalid_redirection_uri_test'
6
+ require_relative 'error_handling_group/prompt_none_test'
7
+ require_relative 'error_handling_group/state_mismatch_test'
8
+ require_relative 'error_handling_group/unauthenticated_user_test'
9
+ require_relative 'error_handling_group/valid_state_error_response_test'
10
+
11
+ module UDAPSecurityTestKit
12
+ class ErrorHandlingAttestationGroup < Inferno::TestGroup
13
+ id :udap_server_v100_error_handling_group
14
+ title 'Error Handling'
15
+
16
+ run_as_group
17
+ test from: :udap_security_invalid_idp_error
18
+ test from: :udap_security_invalid_id_token_error
19
+ test from: :udap_security_deny_token_request
20
+ test from: :udap_security_prompt_none_error
21
+ test from: :udap_security_invalid_redirection_uri
22
+ test from: :udap_security_state_mismatch_error
23
+ test from: :udap_security_unauthenticated_user_error
24
+ test from: :udap_security_valid_state_error_response
25
+ :udap_security_general_error_response
26
+ end
27
+ end
@@ -0,0 +1,47 @@
1
+ module UDAPSecurityTestKit
2
+ class AccessTokenValidationAttestationTest < Inferno::Test
3
+ title 'Validates access token correctly'
4
+ id :udap_security_access_token_validation
5
+ description %(
6
+ Data Holder validates the Access Token as per the Access Token validation rules,
7
+ including:
8
+ - Verifying the token's integrity.
9
+ - Checking claims such as `exp` and other relevant attributes.
10
+ )
11
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@283',
12
+ 'hl7.fhir.us.udap-security_1.0.0@290'
13
+
14
+ input :access_token_validation_correct,
15
+ title: 'ID Token and Access Token Validation: Validates access token correctly',
16
+ description: %(
17
+ I attest that the Data Holder validates the Access Token as per the Access Token validation rules,
18
+ including:
19
+ - Verifying the token's integrity.
20
+ - Checking claims such as `exp` and other relevant attributes.
21
+ ),
22
+ type: 'radio',
23
+ default: 'false',
24
+ options: {
25
+ list_options: [
26
+ {
27
+ label: 'Yes',
28
+ value: 'true'
29
+ },
30
+ {
31
+ label: 'No',
32
+ value: 'false'
33
+ }
34
+ ]
35
+ }
36
+ input :access_token_validation_note,
37
+ title: 'Notes, if applicable:',
38
+ type: 'textarea',
39
+ optional: true
40
+
41
+ run do
42
+ assert access_token_validation_correct == 'true',
43
+ 'Access Token validation is not implemented correctly as per the Access Token validation rules.'
44
+ pass access_token_validation_note if access_token_validation_note.present?
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,45 @@
1
+ module UDAPSecurityTestKit
2
+ class IDTokenValidationAttestationTest < Inferno::Test
3
+ title 'Validates ID Token correctly'
4
+ id :udap_security_id_token_validation
5
+ description %(
6
+ Data Holder validates the ID Token as per OIDC Core specifications, including:
7
+ - Verifying the token's signature.
8
+ - Checking claims such as `iss`, `aud`, and `exp`.
9
+ )
10
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@282',
11
+ 'hl7.fhir.us.udap-security_1.0.0@289'
12
+
13
+ input :id_token_validation_correct,
14
+ title: 'ID Token and Access Token Validation: ID Token is validated correctly',
15
+ description: %(
16
+ I attest that the Data Holder validates the ID Token as per OIDC Core specifications, including:
17
+ - Verifying the token's signature.
18
+ - Checking claims such as `iss`, `aud`, and `exp`.
19
+ ),
20
+ type: 'radio',
21
+ default: 'false',
22
+ options: {
23
+ list_options: [
24
+ {
25
+ label: 'Yes',
26
+ value: 'true'
27
+ },
28
+ {
29
+ label: 'No',
30
+ value: 'false'
31
+ }
32
+ ]
33
+ }
34
+ input :id_token_validation_note,
35
+ title: 'Notes, if applicable:',
36
+ type: 'textarea',
37
+ optional: true
38
+
39
+ run do
40
+ assert id_token_validation_correct == 'true',
41
+ 'ID Token validation is not implemented correctly as per OIDC Core specifications.'
42
+ pass id_token_validation_note if id_token_validation_note.present?
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,47 @@
1
+ module UDAPSecurityTestKit
2
+ class TokenResponseValidationAttestationTest < Inferno::Test
3
+ title 'Validates token response correctly'
4
+ id :udap_security_token_response_validation
5
+ description %(
6
+ Client validates the Token Response as per RFC 6749 and OIDC Core specifications, including:
7
+ - Ensuring the presence of `access_token` and `token_type` parameters.
8
+ - Validating the response structure and data integrity.
9
+ )
10
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@283',
11
+ 'hl7.fhir.us.udap-security_1.0.0@284',
12
+ 'hl7.fhir.us.udap-security_1.0.0@285'
13
+
14
+ input :token_response_validation_correct,
15
+ title: 'ID Token and Access Token Validation: Validates token response correctly',
16
+ description: %(
17
+ I attest that the Client validates the Token Response as per RFC 6749 and OIDC Core specifications,
18
+ including:
19
+ - Ensuring the presence of `access_token` and `token_type` parameters.
20
+ - Validating the response structure and data integrity.
21
+ ),
22
+ type: 'radio',
23
+ default: 'false',
24
+ options: {
25
+ list_options: [
26
+ {
27
+ label: 'Yes',
28
+ value: 'true'
29
+ },
30
+ {
31
+ label: 'No',
32
+ value: 'false'
33
+ }
34
+ ]
35
+ }
36
+ input :token_response_validation_note,
37
+ title: 'Notes, if applicable:',
38
+ type: 'textarea',
39
+ optional: true
40
+
41
+ run do
42
+ assert token_response_validation_correct == 'true',
43
+ 'Token Response validation is not implemented correctly as per RFC 6749 and OIDC Core specifications.'
44
+ pass token_response_validation_note if token_response_validation_note.present?
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,15 @@
1
+ require_relative 'id_token_access_token_validation_group/id_token_validation_test'
2
+ require_relative 'id_token_access_token_validation_group/access_token_validation_test'
3
+ require_relative 'id_token_access_token_validation_group/token_response_validation_test'
4
+
5
+ module UDAPSecurityTestKit
6
+ class IDTokenAccessTokenValidationAttestationGroup < Inferno::TestGroup
7
+ id :udap_server_v100_id_token_access_token_validation_group
8
+ title 'ID Token and Access Token Validation'
9
+
10
+ run_as_group
11
+ test from: :udap_security_id_token_validation
12
+ test from: :udap_security_access_token_validation
13
+ test from: :udap_security_token_response_validation
14
+ end
15
+ end
@@ -0,0 +1,45 @@
1
+ module UDAPSecurityTestKit
2
+ class IdPAuthenticationRequestAttestationTest < Inferno::Test
3
+ title 'Performs Authentication request to the IdP’s authorization endpoint'
4
+ id :udap_security_idp_authentication_request
5
+ description %(
6
+ Data Holder makes an authentication request to the IdP’s authorization endpoint when the IdP is trusted.
7
+ )
8
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@245'
9
+
10
+ input :idp_authentication_request_correct,
11
+ title: %(
12
+ Interaction with Identity Providers (IdPs): Performs Authentication request to the IdP’s authorization
13
+ endpoint
14
+ ),
15
+ description: %(
16
+ I attest that the Data Holder makes an authentication request to the IdP’s authorization endpoint when the
17
+ IdP is trusted.
18
+ ),
19
+ type: 'radio',
20
+ default: 'false',
21
+ options: {
22
+ list_options: [
23
+ {
24
+ label: 'Yes',
25
+ value: 'true'
26
+ },
27
+ {
28
+ label: 'No',
29
+ value: 'false'
30
+ }
31
+ ]
32
+ }
33
+ input :idp_authentication_request_note,
34
+ title: 'Notes, if applicable:',
35
+ type: 'textarea',
36
+ optional: true
37
+
38
+ run do
39
+ assert idp_authentication_request_correct == 'true',
40
+ 'Data Holder does not make an authentication request to the IdP’s authorization endpoint when the IdP
41
+ is trusted.'
42
+ pass idp_authentication_request_note if idp_authentication_request_note.present?
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,45 @@
1
+ module UDAPSecurityTestKit
2
+ class IdPDynamicRegistrationAttestationTest < Inferno::Test
3
+ title 'Performs IdP dynamic registration if supported'
4
+ id :udap_security_idp_dynamic_registration
5
+ description %(
6
+ Data Holder registers as a client with the IdP if:
7
+ - The IdP is trusted.
8
+ - The IdP supports UDAP Dynamic Registration.
9
+ )
10
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@239'
11
+
12
+ input :idp_dynamic_registration_correct,
13
+ title: 'Interaction with Identity Providers (IdPs): Performs IdP dynamic registration if supported',
14
+ description: %(
15
+ I attest that the Data Holder registers as a client with the IdP if:
16
+ - The IdP is trusted.
17
+ - The IdP supports UDAP Dynamic Registration.
18
+ ),
19
+ type: 'radio',
20
+ default: 'false',
21
+ options: {
22
+ list_options: [
23
+ {
24
+ label: 'Yes',
25
+ value: 'true'
26
+ },
27
+ {
28
+ label: 'No',
29
+ value: 'false'
30
+ }
31
+ ]
32
+ }
33
+ input :idp_dynamic_registration_note,
34
+ title: 'Notes, if applicable:',
35
+ type: 'textarea',
36
+ optional: true
37
+
38
+ run do
39
+ assert idp_dynamic_registration_correct == 'true',
40
+ 'Data Holder does not register as a client with the IdP when it is trusted and supports
41
+ UDAP Dynamic Registration.'
42
+ pass idp_dynamic_registration_note if idp_dynamic_registration_note.present?
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,44 @@
1
+ module UDAPSecurityTestKit
2
+ class IdPMetadataValidationAttestationTest < Inferno::Test
3
+ title 'Validates IdP metadata to determine trust'
4
+ id :udap_security_idp_metadata_validation
5
+ description %(
6
+ Data Holder validates the IdP’s UDAP metadata to determine trustworthiness, including:
7
+ - Verifying the authenticity of the metadata.
8
+ - Ensuring the metadata meets UDAP specifications.
9
+ )
10
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@238'
11
+
12
+ input :idp_metadata_validation_correct,
13
+ title: 'Interaction with Identity Providers (IdPs): Validates IdP metadata to determine trust',
14
+ description: %(
15
+ I attest that the Data Holder validates the IdP’s UDAP metadata to determine trustworthiness, including:
16
+ - Verifying the authenticity of the metadata.
17
+ - Ensuring the metadata meets UDAP specifications.
18
+ ),
19
+ type: 'radio',
20
+ default: 'false',
21
+ options: {
22
+ list_options: [
23
+ {
24
+ label: 'Yes',
25
+ value: 'true'
26
+ },
27
+ {
28
+ label: 'No',
29
+ value: 'false'
30
+ }
31
+ ]
32
+ }
33
+ input :idp_metadata_validation_note,
34
+ title: 'Notes, if applicable:',
35
+ type: 'textarea',
36
+ optional: true
37
+
38
+ run do
39
+ assert idp_metadata_validation_correct == 'true',
40
+ 'Data Holder does not validate the IdP’s UDAP metadata to determine trustworthiness.'
41
+ pass idp_metadata_validation_note if idp_metadata_validation_note.present?
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,46 @@
1
+ module UDAPSecurityTestKit
2
+ class IdPTokenExchangeAttestationTest < Inferno::Test
3
+ title 'Exchanges code for tokens after successful authentication response'
4
+ id :udap_security_idp_token_exchange
5
+ description %(
6
+ Data Holder exchanges the authorization code for tokens after receiving a successful
7
+ authentication response from the IdP.
8
+ )
9
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@279'
10
+
11
+ input :idp_token_exchange_correct,
12
+ title: %(
13
+ 'Interaction with Identity Providers (IdPs): Exchanges code for tokens after successful
14
+ authentication response'
15
+ ),
16
+ description: %(
17
+ I attest that the Data Holder exchanges the authorization code for tokens after receiving a
18
+ successful authentication response from the IdP.
19
+ ),
20
+ type: 'radio',
21
+ default: 'false',
22
+ options: {
23
+ list_options: [
24
+ {
25
+ label: 'Yes',
26
+ value: 'true'
27
+ },
28
+ {
29
+ label: 'No',
30
+ value: 'false'
31
+ }
32
+ ]
33
+ }
34
+ input :idp_token_exchange_note,
35
+ title: 'Notes, if applicable:',
36
+ type: 'textarea',
37
+ optional: true
38
+
39
+ run do
40
+ assert idp_token_exchange_correct == 'true',
41
+ 'Data Holder does not exchange the authorization code for tokens after receiving a successful
42
+ authentication response from the IdP.'
43
+ pass idp_token_exchange_note if idp_token_exchange_note.present?
44
+ end
45
+ end
46
+ end