davinci_crd_test_kit 0.14.1 → 0.15.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.
- checksums.yaml +4 -4
- data/config/presets/{inferno_crd_server_suite.json.erb → client_against_inferno_crd_server_suite.json.erb} +0 -33
- data/config/presets/{ri_crd_request_generator.json.erb → client_against_ri_crd_request_generator.json.erb} +1 -14
- data/config/presets/client_v221_against_inferno_crd_server_suite.json.erb +96 -0
- data/config/presets/client_v221_against_ri_br_provider.json.erb +31 -0
- data/config/presets/{ri_crd_request_generator.json_v221.json.erb → client_v221_against_ri_crd_request_generator.json.erb} +1 -1
- data/config/presets/{inferno_crd_client_suite.json.erb → server_against_inferno_crd_client_suite.json.erb} +0 -43
- data/config/presets/{ri_crd_server.json.erb → server_against_ri_crd_server.json.erb} +1 -44
- data/config/presets/{inferno_crd_client_suite_v221.json.erb → server_v221_against_inferno_crd_client_suite.json.erb} +1 -62
- data/config/presets/{inferno_crd_client_suite_prefetch_subset_v221.json.erb → server_v221_against_inferno_crd_client_suite_prefetch_subset.json.erb} +1 -47
- data/config/presets/server_v221_against_inferno_g31_suite.json.erb +49 -0
- data/lib/davinci_crd_test_kit/client/client_base_urls.rb +5 -0
- data/lib/davinci_crd_test_kit/client/client_input_helper.rb +102 -0
- data/lib/davinci_crd_test_kit/client/client_wait_messages.rb +68 -0
- data/lib/davinci_crd_test_kit/client/cross_hook_helper.rb +26 -0
- data/lib/davinci_crd_test_kit/client/endpoints/custom_service_response.rb +32 -17
- data/lib/davinci_crd_test_kit/client/endpoints/hook_request_data_access.rb +228 -0
- data/lib/davinci_crd_test_kit/client/endpoints/hook_request_endpoint.rb +172 -56
- data/lib/davinci_crd_test_kit/client/endpoints/mock_service_response.rb +29 -29
- data/lib/davinci_crd_test_kit/client/endpoints/scenario_service_response.rb +54 -0
- data/lib/davinci_crd_test_kit/client/endpoints/v201_hook_request_data_gathering.rb +219 -0
- data/lib/davinci_crd_test_kit/client/endpoints/v221_hook_request_data_gathering.rb +172 -0
- data/lib/davinci_crd_test_kit/client/jwt_claim_types.rb +28 -0
- data/lib/davinci_crd_test_kit/client/multi_request_message_helper.rb +1 -1
- data/lib/davinci_crd_test_kit/client/prefetched_coverage_payer_helper.rb +81 -0
- data/lib/davinci_crd_test_kit/client/prefetched_coverage_value.rb +14 -0
- data/lib/davinci_crd_test_kit/client/tagged_request_load_helper.rb +14 -25
- data/lib/davinci_crd_test_kit/client/v2.0.1/auth/retrieve_jwks_test.rb +36 -24
- data/lib/davinci_crd_test_kit/client/v2.0.1/auth/token_header_test.rb +14 -4
- data/lib/davinci_crd_test_kit/client/v2.0.1/auth/token_payload_test.rb +42 -22
- data/lib/davinci_crd_test_kit/client/v2.0.1/cds-services-v201.json +21 -21
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_appointment_book_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_encounter_discharge_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_encounter_start_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_fhir_api_group.rb +2 -2
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_hooks_group.rb +7 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_order_dispatch_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_order_select_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/client_order_sign_group.rb +12 -10
- data/lib/davinci_crd_test_kit/client/v2.0.1/crd_client_suite.rb +2 -2
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/appointment_book_receive_request_test.rb +10 -31
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/encounter_discharge_receive_request_test.rb +10 -31
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/encounter_start_receive_request_test.rb +8 -29
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/order_dispatch_receive_request_test.rb +10 -31
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/order_select_receive_request_test.rb +8 -29
- data/lib/davinci_crd_test_kit/client/v2.0.1/invocation/order_sign_receive_request_test.rb +10 -31
- data/lib/davinci_crd_test_kit/client/v2.0.1/must_support/client_card_must_support_coverage_information.rb +3 -36
- data/lib/davinci_crd_test_kit/client/v2.0.1/must_support/client_card_must_support_external_reference.rb +3 -36
- data/lib/davinci_crd_test_kit/client/v2.0.1/must_support/client_card_must_support_instructions.rb +3 -36
- data/lib/davinci_crd_test_kit/client/v2.0.1/registration/client_registration_verification_test.rb +3 -7
- data/lib/davinci_crd_test_kit/client/v2.0.1/registration/client_service_registration_attestation_test.rb +11 -3
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_request/hook_request_fetched_data_test.rb +4 -13
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_request/hook_request_optional_fields_test.rb +1 -1
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_request/hook_request_prefetch_equals_queried_test.rb +3 -13
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_response/client_display_cards_attest.rb +7 -17
- data/lib/davinci_crd_test_kit/client/v2.0.1/verify_response/inferno_response_validation.rb +4 -14
- data/lib/davinci_crd_test_kit/client/v2.2.1/api/client_coverage_info_update_test.rb +10 -10
- data/lib/davinci_crd_test_kit/client/v2.2.1/api/client_crd_update_verification_group.rb +1 -1
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/attestation_instructions.rb +10 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_coverage_based_invocation_attestation_test.rb +44 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_data_element_expectations_attestation_test.rb +44 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_hook_invocation_logging_attestation_test.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_must_support_use_attestation_test.rb +41 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_prefetch_key_omission_attestation_test.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_resource_identifiers_attestation_test.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_response_case_distinction_attestation_test.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_security_and_privacy_attestation_test.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_workflow_integration_attestation_test.rb +44 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/auth/decode_auth_token_test.rb +4 -2
- data/lib/davinci_crd_test_kit/client/v2.2.1/auth/retrieve_jwks_test.rb +47 -26
- data/lib/davinci_crd_test_kit/client/v2.2.1/auth/token_header_test.rb +32 -6
- data/lib/davinci_crd_test_kit/client/v2.2.1/auth/token_payload_test.rb +60 -33
- data/lib/davinci_crd_test_kit/client/v2.2.1/cds-services-prefetch-subset-v221.json +48 -48
- data/lib/davinci_crd_test_kit/client/v2.2.1/cds-services-v221.json +51 -51
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_appointment_book_group.rb +24 -15
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_attestations_group.rb +43 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_cross_hook_group.rb +28 -9
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_cross_hook_interaction_group.rb +106 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_encounter_discharge_group.rb +20 -11
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_encounter_start_group.rb +20 -11
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_fhir_api_group.rb +39 -15
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_hooks_group.rb +16 -19
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_long_running_hook_group.rb +5 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_multiple_payers_hook_group.rb +40 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_order_dispatch_group.rb +23 -14
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_order_select_group.rb +19 -10
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_order_sign_group.rb +23 -14
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_registration_group.rb +7 -7
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_scenarios_group.rb +32 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_self_pay_hook_group.rb +34 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_unknown_content_hook_group.rb +34 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/client_user_access_level_group.rb +82 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/crd_client_suite.rb +26 -6
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_card_must_support_coverage_information_test.rb +5 -5
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_fhirpath_collection_as_comma_delimited_string_test.rb +7 -14
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_hook_instances_unique_test.rb +3 -11
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_jwt_ids_unique_test.rb +89 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_location_address_propagation_test.rb +65 -31
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_order_types_signed_test.rb +101 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_prefetch_complete_and_subset_test.rb +13 -35
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/appointment_book_receive_request_test.rb +17 -116
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb +182 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/cross_hooks_receive_request_test.rb +126 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/encounter_discharge_receive_request_test.rb +17 -117
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/encounter_start_receive_request_test.rb +17 -117
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_dispatch_receive_request_test.rb +17 -125
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_select_receive_request_test.rb +17 -125
- data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_sign_receive_request_test.rb +17 -125
- data/lib/davinci_crd_test_kit/client/v2.2.1/long_running/client_long_running_receive_request_test.rb +52 -32
- data/lib/davinci_crd_test_kit/client/v2.2.1/long_running/client_skip_long_running_attestation_test.rb +12 -12
- data/lib/davinci_crd_test_kit/client/v2.2.1/multiple_payers/client_multiple_payers_request_verification_test.rb +215 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/multiple_payers/client_multiple_payers_workflow_test.rb +71 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/appointment_must_support_test.rb +84 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/appointment_reference_resolution_test.rb +82 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/client_cross_hook_must_support_group.rb +181 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/communication_request_must_support_test.rb +69 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/communication_request_reference_resolution_test.rb +79 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/coverage_must_support_test.rb +73 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/coverage_reference_resolution_test.rb +67 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/device_must_support_test.rb +59 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/device_request_must_support_test.rb +72 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/device_request_reference_resolution_test.rb +76 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/encounter_must_support_test.rb +83 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/encounter_reference_resolution_test.rb +76 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/location_must_support_test.rb +63 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/location_reference_resolution_test.rb +60 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/medication_must_support_test.rb +54 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/medication_request_must_support_test.rb +95 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/medication_request_reference_resolution_test.rb +79 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/nutrition_order_must_support_test.rb +136 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/nutrition_order_reference_resolution_test.rb +67 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/organization_must_support_test.rb +66 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/organization_reference_resolution_test.rb +60 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/patient_must_support_test.rb +69 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/practitioner_must_support_test.rb +65 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/practitioner_role_must_support_test.rb +60 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/practitioner_role_reference_resolution_test.rb +66 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/service_request_must_support_test.rb +93 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/service_request_reference_resolution_test.rb +81 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/vision_prescription_must_support_test.rb +79 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/generated/vision_prescription_reference_resolution_test.rb +65 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/request_must_support_reference_resolution.rb +379 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/request_must_support_scope.rb +66 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/must_support/request_must_support_with_attestation_option.rb +331 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/registration/client_registration_verification_test.rb +16 -30
- data/lib/davinci_crd_test_kit/client/v2.2.1/registration/client_service_registration_attestation_test.rb +84 -39
- data/lib/davinci_crd_test_kit/client/v2.2.1/self_pay/client_self_pay_workflow_test.rb +62 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/unknown_content/client_unknown_content_attestation_test.rb +99 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/unknown_content/client_unknown_content_receive_request_test.rb +67 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/user_access_level/access_level_api_access_test.rb +124 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/user_access_level/access_level_prefetch_scope_test.rb +85 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/user_access_level/access_level_receive_request_test.rb +92 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/user_access_level/access_level_same_scenario_test.rb +340 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/user_access_level/access_level_target_reference.rb +16 -0
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_conformance_test.rb +64 -7
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_coverage_verification_test.rb +31 -73
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_data_fetch_verification_test.rb +13 -3
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_granted_scopes_test.rb +8 -8
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_prefetch_complete_test.rb +12 -14
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_prefetch_profiles_test.rb +3 -3
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_requested_version_test.rb +17 -5
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_secured_transport_test.rb +2 -2
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/client_display_cards_attest.rb +59 -27
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/hook_response_support_coverage_information_test.rb +4 -4
- data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/inferno_response_validation.rb +13 -11
- data/lib/davinci_crd_test_kit/cross_suite/base_urls.rb +12 -0
- data/lib/davinci_crd_test_kit/cross_suite/cards_identification.rb +18 -2
- data/lib/davinci_crd_test_kit/cross_suite/fhirpath_on_cds_request.rb +10 -9
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/appointment_with_order/metadata.yml +67 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/appointment_without_order/metadata.yml +150 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/communication_request/metadata.yml +71 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/coverage/metadata.yml +71 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/device/metadata.yml +22 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/device_request/metadata.yml +85 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/encounter/metadata.yml +82 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/hrex_organization/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/location/metadata.yml +27 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/medication/metadata.yml +17 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/medication_request/metadata.yml +166 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/nutrition_order/metadata.yml +166 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/organization/metadata.yml +42 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/patient/metadata.yml +29 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/practitioner/metadata.yml +37 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/practitioner_role/metadata.yml +36 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/service_request/metadata.yml +202 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_allergyintolerance/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_condition_encounter_diagnosis/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_condition_problems_health_concerns/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_diagnosticreport_lab/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_diagnosticreport_note/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_documentreference/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_location/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_organization/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_patient/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_practitioner/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/us_core_procedure/metadata.yml +6 -0
- data/lib/davinci_crd_test_kit/cross_suite/generated/v2.2.1/vision_prescription/metadata.yml +66 -0
- data/lib/davinci_crd_test_kit/cross_suite/hook_request_field_validation.rb +3 -2
- data/lib/davinci_crd_test_kit/cross_suite/hook_request_resource_extraction.rb +121 -0
- data/lib/davinci_crd_test_kit/cross_suite/logical_models_override_helper.rb +47 -22
- data/lib/davinci_crd_test_kit/cross_suite/must_support_references.rb +49 -0
- data/lib/davinci_crd_test_kit/cross_suite/must_support_slice_matching.rb +50 -0
- data/lib/davinci_crd_test_kit/cross_suite/prefetch_completeness_checker.rb +75 -39
- data/lib/davinci_crd_test_kit/cross_suite/prefetch_profile_validation.rb +2 -0
- data/lib/davinci_crd_test_kit/cross_suite/profile_metadata.rb +75 -0
- data/lib/davinci_crd_test_kit/cross_suite/requests_logical_model_validation.rb +45 -36
- data/lib/davinci_crd_test_kit/cross_suite/resource_identity.rb +183 -0
- data/lib/davinci_crd_test_kit/cross_suite/response_logical_model_validation.rb +48 -41
- data/lib/davinci_crd_test_kit/cross_suite/short_circuit_interaction.rb +28 -0
- data/lib/davinci_crd_test_kit/cross_suite/tags.rb +18 -1
- data/lib/davinci_crd_test_kit/generator/crd_must_support_metadata_extractor.rb +147 -0
- data/lib/davinci_crd_test_kit/generator/must_support_metadata_generator.rb +207 -0
- data/lib/davinci_crd_test_kit/generator/must_support_test_generator.rb +249 -0
- data/lib/davinci_crd_test_kit/generator/templates/must_support_group.rb.erb +118 -0
- data/lib/davinci_crd_test_kit/generator/templates/must_support_test.rb.erb +22 -0
- data/lib/davinci_crd_test_kit/generator/templates/reference_resolution_test.rb.erb +22 -0
- data/lib/davinci_crd_test_kit/igs/davinci_crd_2.2.1.tgz +0 -0
- data/lib/davinci_crd_test_kit/igs/davinci_hrex_1.2.0.tgz +0 -0
- data/lib/davinci_crd_test_kit/metadata.rb +2 -2
- data/lib/davinci_crd_test_kit/requirements/cds-hooks_3.0.0-ballot_requirements.xlsx +0 -0
- data/lib/davinci_crd_test_kit/requirements/davinci_crd_test_kit_requirements.csv +9 -4
- data/lib/davinci_crd_test_kit/requirements/generated/crd_client_requirements_coverage.csv +107 -107
- data/lib/davinci_crd_test_kit/requirements/generated/crd_client_v221_requirements_coverage.csv +107 -102
- data/lib/davinci_crd_test_kit/requirements/generated/crd_server_requirements_coverage.csv +18 -18
- data/lib/davinci_crd_test_kit/requirements/generated/crd_server_v221_requirements_coverage.csv +36 -32
- data/lib/davinci_crd_test_kit/requirements/hl7.fhir.us.davinci-crd_2.2.1_requirements.xlsx +0 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_create_endpoint.rb +2 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_delete_endpoint.rb +2 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_read_endpoint.rb +2 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_request_handler.rb +6 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_search_endpoint.rb +21 -12
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr/fhir_update_endpoint.rb +2 -0
- data/lib/davinci_crd_test_kit/server/endpoints/mock_ehr_endpoints.rb +3 -0
- data/lib/davinci_crd_test_kit/server/server_abstract_invoke_hook_test.rb +2 -2
- data/lib/davinci_crd_test_kit/server/v2.0.1/crd_server_suite.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.0.1/server_hooks_group.rb +5 -5
- data/lib/davinci_crd_test_kit/server/v2.2.1/discovery/discovery_standard_prefetch_expressions_test.rb +1 -2
- data/lib/davinci_crd_test_kit/server/v2.2.1/must_support/supported_us_core_versions_test.rb +2 -2
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_appointment_book_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_demonstrate_hook_response_group.rb +3 -3
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_encounter_discharge_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_encounter_start_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_hooks_group.rb +5 -5
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_order_dispatch_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_order_select_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_order_sign_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/server_required_card_response_validation_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/specific_coverage_responses/coverage_not_found_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/specific_coverage_responses/no_active_coverage_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/specific_coverage_responses/no_member_found_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/specific_coverage_responses/technical_issues_group.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/verify_request/service_request_context_validation_test.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/verify_request/service_request_no_custom_extensions_test.rb +2 -2
- data/lib/davinci_crd_test_kit/server/v2.2.1/verify_request/service_request_optional_fields_validation_test.rb +1 -1
- data/lib/davinci_crd_test_kit/server/v2.2.1/verify_request/service_request_required_fields_validation_test.rb +1 -1
- data/lib/davinci_crd_test_kit/version.rb +2 -2
- metadata +132 -16
- data/config/presets/inferno_crd_server_suite_v221.json.erb +0 -94
- data/lib/davinci_crd_test_kit/client/endpoints/gather_response_generation_data.rb +0 -410
- data/lib/davinci_crd_test_kit/server/resource_extractor.rb +0 -68
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
require_relative 'attestation_instructions'
|
|
2
|
+
|
|
3
|
+
module DaVinciCRDTestKit
|
|
4
|
+
module V221
|
|
5
|
+
class SecurityAndPrivacyAttestationTest < Inferno::Test
|
|
6
|
+
id :crd_v221_security_and_privacy_attestation
|
|
7
|
+
ATTESTATION_TITLE = 'CRD client adheres to security and privacy requirements'.freeze
|
|
8
|
+
title ATTESTATION_TITLE
|
|
9
|
+
description %(
|
|
10
|
+
During this test, the tester will confirm that the CRD client adheres to the security and privacy
|
|
11
|
+
rules that CRD inherits from the specifications it builds on.
|
|
12
|
+
To see the specifics of the attested requirements, click the "View Specification Requirements" link for this
|
|
13
|
+
test.
|
|
14
|
+
)
|
|
15
|
+
flag_as_attestation
|
|
16
|
+
verifies_requirements 'hl7.fhir.us.davinci-crd_2.2.1@sec-1'
|
|
17
|
+
input_instructions ATTESTATION_INPUT_INSTRUCTIONS
|
|
18
|
+
|
|
19
|
+
input :security_and_privacy_attestation,
|
|
20
|
+
title: ATTESTATION_TITLE,
|
|
21
|
+
description: %(
|
|
22
|
+
I attest that the CRD client adheres to the security and privacy rules that CRD inherits from
|
|
23
|
+
the specifications it builds on.
|
|
24
|
+
),
|
|
25
|
+
type: 'radio',
|
|
26
|
+
default: 'false',
|
|
27
|
+
options: {
|
|
28
|
+
list_options: [
|
|
29
|
+
{ label: 'Yes', value: 'true' },
|
|
30
|
+
{ label: 'No', value: 'false' }
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
input :security_and_privacy_attestation_note,
|
|
34
|
+
title: 'Notes, if applicable:',
|
|
35
|
+
type: 'textarea',
|
|
36
|
+
optional: true
|
|
37
|
+
|
|
38
|
+
run do
|
|
39
|
+
assert security_and_privacy_attestation == 'true'
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require_relative 'attestation_instructions'
|
|
2
|
+
|
|
3
|
+
module DaVinciCRDTestKit
|
|
4
|
+
module V221
|
|
5
|
+
class WorkflowIntegrationAttestationTest < Inferno::Test
|
|
6
|
+
id :crd_v221_workflow_integration_attestation
|
|
7
|
+
ATTESTATION_TITLE = 'CRD client integrates hook invocations transparently into user workflows'.freeze
|
|
8
|
+
title ATTESTATION_TITLE
|
|
9
|
+
description %(
|
|
10
|
+
During this test, the tester will confirm that the CRD client integrates CRD hook invocations
|
|
11
|
+
transparently into the regular user workflow.
|
|
12
|
+
To see the specifics of the attested requirements, click the "View Specification Requirements" link for this
|
|
13
|
+
test.
|
|
14
|
+
)
|
|
15
|
+
flag_as_attestation
|
|
16
|
+
verifies_requirements 'hl7.fhir.us.davinci-crd_2.2.1@hook-7', 'hl7.fhir.us.davinci-crd_2.2.1@hook-8',
|
|
17
|
+
'hl7.fhir.us.davinci-crd_2.2.1@resp-48'
|
|
18
|
+
input_instructions ATTESTATION_INPUT_INSTRUCTIONS
|
|
19
|
+
|
|
20
|
+
input :workflow_integration_attestation,
|
|
21
|
+
title: ATTESTATION_TITLE,
|
|
22
|
+
description: %(
|
|
23
|
+
I attest that the CRD client integrates CRD hook invocations transparently into the regular
|
|
24
|
+
user workflow.
|
|
25
|
+
),
|
|
26
|
+
type: 'radio',
|
|
27
|
+
default: 'false',
|
|
28
|
+
options: {
|
|
29
|
+
list_options: [
|
|
30
|
+
{ label: 'Yes', value: 'true' },
|
|
31
|
+
{ label: 'No', value: 'false' }
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
input :workflow_integration_attestation_note,
|
|
35
|
+
title: 'Notes, if applicable:',
|
|
36
|
+
type: 'textarea',
|
|
37
|
+
optional: true
|
|
38
|
+
|
|
39
|
+
run do
|
|
40
|
+
assert workflow_integration_attestation == 'true'
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -8,7 +8,7 @@ module DaVinciCRDTestKit
|
|
|
8
8
|
include DaVinciCRDTestKit::TaggedRequestLoadHelper
|
|
9
9
|
|
|
10
10
|
id :crd_v221_decode_auth_token
|
|
11
|
-
title '
|
|
11
|
+
title 'Authorization tokens can be decoded as JWTs'
|
|
12
12
|
description %(
|
|
13
13
|
During this test, Inferno will verify that for each request the Bearer token is a properly constructed JWT.
|
|
14
14
|
As per the [CDS hooks specification](https://cds-hooks.hl7.org/2026Jan/en/#trusting-cds-clients),
|
|
@@ -21,7 +21,9 @@ module DaVinciCRDTestKit
|
|
|
21
21
|
output :auth_tokens, :auth_token_payloads_json, :auth_token_headers_json
|
|
22
22
|
|
|
23
23
|
run do
|
|
24
|
-
|
|
24
|
+
load_interaction_group_requests
|
|
25
|
+
# replace any outputs from an earlier run so that later tests skip rather than reuse stale tokens
|
|
26
|
+
output auth_tokens: '[]', auth_token_payloads_json: '[]', auth_token_headers_json: '[]'
|
|
25
27
|
skip_if requests.empty?, "No #{hook_name} requests were made in a previous test as expected."
|
|
26
28
|
auth_tokens = []
|
|
27
29
|
auth_token_payloads_json = []
|
|
@@ -1,43 +1,52 @@
|
|
|
1
1
|
require_relative '../../multi_request_message_helper'
|
|
2
|
+
require_relative '../../../cross_suite/short_circuit_interaction'
|
|
2
3
|
|
|
3
4
|
module DaVinciCRDTestKit
|
|
4
5
|
module V221
|
|
5
6
|
class RetrieveJWKSTest < Inferno::Test
|
|
6
7
|
include DaVinciCRDTestKit::MultiRequestMessageHelper
|
|
8
|
+
include DaVinciCRDTestKit::ShortCircuitInteraction
|
|
7
9
|
|
|
8
10
|
id :crd_v221_retrieve_jwks
|
|
9
|
-
title '
|
|
11
|
+
title 'CRD client JWKS can be retrieved'
|
|
10
12
|
description %(
|
|
11
|
-
During this test, Inferno will verify that for each request the JWKS can be retrieved
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
During this test, Inferno will verify that for each request the CRD client's JWKS can be retrieved
|
|
14
|
+
from the URL in the `jku` field of the JWT header, when present. If the JWT header has no `jku`
|
|
15
|
+
field, Inferno uses the JWKS provided in the "Registration" group instead, either retrieving it
|
|
16
|
+
from the provided URL or reading the raw JWKS JSON. The keys in the JWKS are then saved as an output
|
|
17
|
+
for use in subsequent tests.
|
|
15
18
|
)
|
|
16
19
|
|
|
17
20
|
verifies_requirements 'cds-hooks_3.0.0-ballot@183', 'cds-hooks_3.0.0-ballot@185', 'cds-hooks_3.0.0-ballot@197',
|
|
18
21
|
'cds-hooks_3.0.0-ballot@199'
|
|
19
22
|
|
|
20
|
-
input
|
|
23
|
+
# Optional so that a group whose requests were declined can pass rather than skip on an input
|
|
24
|
+
# the short circuited test before it never produced. The run block still skips when empty.
|
|
25
|
+
# The default only pre-fills the UI, so a missing value still arrives as nil.
|
|
26
|
+
input :auth_token_headers_json, optional: true, default: '[]'
|
|
21
27
|
input :cds_jwk_set,
|
|
22
28
|
title: 'CRD JSON Web Key Set (JWKS)',
|
|
23
29
|
type: 'textarea',
|
|
24
30
|
description: %(
|
|
25
|
-
The client's registered JWK Set
|
|
26
|
-
only when a request was received with a JWT without the `jku`
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
it would be populated in the `jku` header). Run or re-run the "Registration"
|
|
30
|
-
group to set or change this value.
|
|
31
|
+
The CRD client's registered JWK Set, provided during the "Registration" group, containing
|
|
32
|
+
its public key. Used only when a request was received with a JWT without the `jku`
|
|
33
|
+
header. May be either a publicly accessible URL containing the JWKS, or the raw JWKS
|
|
34
|
+
JSON. Run or re-run the "Registration" group to set or change this value.
|
|
31
35
|
),
|
|
32
36
|
locked: true,
|
|
33
37
|
optional: true
|
|
34
38
|
output :crd_jwks_keys_json
|
|
35
39
|
|
|
36
40
|
run do
|
|
37
|
-
|
|
41
|
+
check_for_short_circuit
|
|
42
|
+
|
|
43
|
+
# replace any output from an earlier run so that later tests skip rather than reuse stale keys
|
|
44
|
+
output crd_jwks_keys_json: '[]'
|
|
45
|
+
auth_token_headers = JSON.parse(auth_token_headers_json.presence || '[]') # NOTE: pre-verified json
|
|
38
46
|
skip_if auth_token_headers.compact.empty?, 'No Authorization tokens produced from the previous test.'
|
|
39
47
|
skip_if cds_jwk_set.blank? && cds_jwk_set_input_needed?(auth_token_headers),
|
|
40
|
-
|
|
48
|
+
'A request JWT has no `jku` header, so the CRD client\'s JWKS must be provided in the ' \
|
|
49
|
+
'**CRD JSON Web Key Set (JWKS)** input. Re-run the "Registration" group to provide it.'
|
|
41
50
|
|
|
42
51
|
crd_jwks_keys_json = []
|
|
43
52
|
auth_token_headers.each_with_index do |token_header, index|
|
|
@@ -49,18 +58,9 @@ module DaVinciCRDTestKit
|
|
|
49
58
|
jku = JSON.parse(token_header)['jku'] # NOTE: pre-verified json
|
|
50
59
|
jwks =
|
|
51
60
|
if jku.present?
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if response[:status] == 200
|
|
55
|
-
parse_json_request_entity(response[:body], 'Fetched jku url response', index)
|
|
56
|
-
else
|
|
57
|
-
add_request_message('error',
|
|
58
|
-
"Unexpected response status: expected 200, but received #{response[:status]}",
|
|
59
|
-
index)
|
|
60
|
-
nil
|
|
61
|
-
end
|
|
61
|
+
fetch_jwks(jku, 'Fetched jku url response', index)
|
|
62
62
|
else
|
|
63
|
-
|
|
63
|
+
parse_or_fetch_jwks(cds_jwk_set, index)
|
|
64
64
|
end
|
|
65
65
|
if jwks.blank?
|
|
66
66
|
crd_jwks_keys_json << nil
|
|
@@ -97,7 +97,7 @@ module DaVinciCRDTestKit
|
|
|
97
97
|
|
|
98
98
|
kid_uniqueness = keys.map { |key| key['kid'] }.uniq.length == keys.length
|
|
99
99
|
if kid_uniqueness.blank?
|
|
100
|
-
add_request_message('error', "`kid` must be unique within the client's JWK Set.", index)
|
|
100
|
+
add_request_message('error', "`kid` must be unique within the CRD client's JWK Set.", index)
|
|
101
101
|
crd_jwks_keys_json << nil
|
|
102
102
|
next
|
|
103
103
|
end
|
|
@@ -115,6 +115,27 @@ module DaVinciCRDTestKit
|
|
|
115
115
|
token_header.present? && JSON.parse(token_header)['jku'].blank?
|
|
116
116
|
end
|
|
117
117
|
end
|
|
118
|
+
|
|
119
|
+
def fetch_jwks(uri, entity, index)
|
|
120
|
+
get(uri)
|
|
121
|
+
|
|
122
|
+
if response[:status] == 200
|
|
123
|
+
parse_json_request_entity(response[:body], entity, index)
|
|
124
|
+
else
|
|
125
|
+
add_request_message('error',
|
|
126
|
+
"Unexpected response status: expected 200, but received #{response[:status]}",
|
|
127
|
+
index)
|
|
128
|
+
nil
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def parse_or_fetch_jwks(jwk_set_input, index)
|
|
133
|
+
if jwk_set_input.match?(%r{\Ahttps?://})
|
|
134
|
+
fetch_jwks(jwk_set_input, 'Fetched JWK Set input url response', index)
|
|
135
|
+
else
|
|
136
|
+
parse_json_request_entity(jwk_set_input, 'JWK Set input', index)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
118
139
|
end
|
|
119
140
|
end
|
|
120
141
|
end
|
|
@@ -1,29 +1,43 @@
|
|
|
1
1
|
require_relative '../../multi_request_message_helper'
|
|
2
|
+
require_relative '../../../cross_suite/short_circuit_interaction'
|
|
2
3
|
|
|
3
4
|
module DaVinciCRDTestKit
|
|
4
5
|
module V221
|
|
5
6
|
class TokenHeaderTest < Inferno::Test
|
|
6
7
|
include DaVinciCRDTestKit::MultiRequestMessageHelper
|
|
8
|
+
include DaVinciCRDTestKit::ShortCircuitInteraction
|
|
7
9
|
|
|
8
10
|
id :crd_v221_token_header
|
|
9
11
|
title 'Authorization token headers contain required information'
|
|
10
12
|
description %(
|
|
11
13
|
During this test, Inferno will verify that for each request the JWT header is conformant to the
|
|
12
|
-
requirements in the [CDS
|
|
14
|
+
requirements in the [CDS Hooks specification](https://cds-hooks.hl7.org/2026Jan/en/#trusting-cds-clients),
|
|
13
15
|
including the following:
|
|
14
16
|
- The `alg`, `kid`, and `typ` fields are required.
|
|
17
|
+
- The `alg` and `kid` fields must be strings.
|
|
18
|
+
- The `alg` field must not be `none`.
|
|
15
19
|
- The `typ` field must be "JWT".
|
|
16
|
-
- The
|
|
20
|
+
- The JWKS retrieved for the request in the previous test must contain a key whose `kid` matches
|
|
21
|
+
the header's `kid`. That key is used to verify the token's signature in the next test.
|
|
17
22
|
)
|
|
18
23
|
|
|
19
|
-
verifies_requirements 'cds-hooks_3.0.0-ballot@
|
|
24
|
+
verifies_requirements 'cds-hooks_3.0.0-ballot@181', 'cds-hooks_3.0.0-ballot@182', 'cds-hooks_3.0.0-ballot@184',
|
|
25
|
+
'cds-hooks_3.0.0-ballot@202'
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
# Optional so that a group whose requests were declined can pass rather than skip on inputs
|
|
28
|
+
# the short circuited tests before it never produced. The run block still skips when empty.
|
|
29
|
+
# The defaults only pre-fill the UI, so a missing value still arrives as nil.
|
|
30
|
+
input :auth_token_headers_json, optional: true, default: '[]'
|
|
31
|
+
input :crd_jwks_keys_json, optional: true, default: '[]'
|
|
22
32
|
output :auth_tokens_jwk_json
|
|
23
33
|
|
|
24
34
|
run do
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
check_for_short_circuit
|
|
36
|
+
|
|
37
|
+
# replace any output from an earlier run so that later tests skip rather than reuse stale keys
|
|
38
|
+
output auth_tokens_jwk_json: '[]'
|
|
39
|
+
auth_token_headers = JSON.parse(auth_token_headers_json.presence || '[]')
|
|
40
|
+
crd_jwks_keys = JSON.parse(crd_jwks_keys_json.presence || '[]')
|
|
27
41
|
skip_if auth_token_headers.compact.empty?, 'No Authorization tokens produced from the previous tests.'
|
|
28
42
|
skip_if crd_jwks_keys.compact.empty?, 'No JWKS keys produced from the previous test.'
|
|
29
43
|
|
|
@@ -43,6 +57,12 @@ module DaVinciCRDTestKit
|
|
|
43
57
|
next
|
|
44
58
|
end
|
|
45
59
|
|
|
60
|
+
unless algorithm.is_a?(String)
|
|
61
|
+
add_request_message('error', "Token header `alg` field must be a string, got #{algorithm.to_json}", index)
|
|
62
|
+
auth_tokens_jwk_json << nil
|
|
63
|
+
next
|
|
64
|
+
end
|
|
65
|
+
|
|
46
66
|
if algorithm == 'none'
|
|
47
67
|
add_request_message('error', 'Token header `alg` field cannot be set to none', index)
|
|
48
68
|
auth_tokens_jwk_json << nil
|
|
@@ -64,6 +84,12 @@ module DaVinciCRDTestKit
|
|
|
64
84
|
end
|
|
65
85
|
|
|
66
86
|
kid = header['kid']
|
|
87
|
+
unless kid.is_a?(String)
|
|
88
|
+
add_request_message('error', "Token header `kid` field must be a string, got #{kid.to_json}", index)
|
|
89
|
+
auth_tokens_jwk_json << nil
|
|
90
|
+
next
|
|
91
|
+
end
|
|
92
|
+
|
|
67
93
|
if crd_jwks_keys[index].nil?
|
|
68
94
|
add_request_message('error', 'No JWKS keys available for this request', index)
|
|
69
95
|
auth_tokens_jwk_json << nil
|
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
require_relative '../../multi_request_message_helper'
|
|
2
2
|
require_relative '../../tagged_request_load_helper'
|
|
3
|
+
require_relative '../../jwt_claim_types'
|
|
3
4
|
|
|
4
5
|
module DaVinciCRDTestKit
|
|
5
6
|
module V221
|
|
6
7
|
class TokenPayloadTest < Inferno::Test
|
|
7
8
|
include DaVinciCRDTestKit::MultiRequestMessageHelper
|
|
8
9
|
include DaVinciCRDTestKit::TaggedRequestLoadHelper
|
|
10
|
+
include DaVinciCRDTestKit::JwtClaimTypes
|
|
9
11
|
include ClientURLs
|
|
10
12
|
|
|
11
13
|
id :crd_v221_token_payload
|
|
12
14
|
title 'Authorization token payloads have required claims and valid signatures'
|
|
13
15
|
description %(
|
|
14
|
-
During this test, Inferno will verify that for each request the JWT
|
|
15
|
-
requirements in the [CDS
|
|
16
|
+
During this test, Inferno will verify that for each request the JWT is signed and its payload is
|
|
17
|
+
conformant to the requirements in the [CDS Hooks specification](https://cds-hooks.hl7.org/2026Jan/en/#trusting-cds-clients),
|
|
16
18
|
including the following:
|
|
19
|
+
- The JWT signature must be valid when verified using the key from the CRD client's JWKS
|
|
20
|
+
identified by the `kid` header in the previous test.
|
|
21
|
+
- The signing algorithm, taken from the key's `alg` or, if absent, the JWT header's `alg`, must not
|
|
22
|
+
be `none` or a symmetric (HMAC) algorithm such as `HS256`.
|
|
17
23
|
- The `iss`, `aud`, `exp`, `iat`, and `jti` claims are required.
|
|
18
|
-
- `iss` must
|
|
24
|
+
- `iss` must equal the value of the **CRD JWT Issuer** input.
|
|
19
25
|
- `aud` must match the URL of the CDS Service endpoint being invoked.
|
|
20
|
-
- `exp` must represent a time in the future.
|
|
21
|
-
- `jti` must be a non-blank string
|
|
26
|
+
- `exp` must represent a time in the future (allowing 60 seconds of clock skew).
|
|
27
|
+
- `jti` must be a non-blank string.
|
|
28
|
+
- `iss` and `jti` must be strings, `aud` a string or an array of strings, and `exp` and `iat` numbers.
|
|
22
29
|
)
|
|
23
30
|
|
|
24
|
-
verifies_requirements 'cds-hooks_3.0.0-ballot@180', 'cds-hooks_3.0.0-ballot@
|
|
31
|
+
verifies_requirements 'cds-hooks_3.0.0-ballot@180', 'cds-hooks_3.0.0-ballot@187',
|
|
25
32
|
'cds-hooks_3.0.0-ballot@189', 'cds-hooks_3.0.0-ballot@190', 'cds-hooks_3.0.0-ballot@191',
|
|
26
33
|
'cds-hooks_3.0.0-ballot@192', 'cds-hooks_3.0.0-ballot@196', 'cds-hooks_3.0.0-ballot@203'
|
|
27
34
|
|
|
@@ -38,14 +45,19 @@ module DaVinciCRDTestKit
|
|
|
38
45
|
inferno_base_url + hook_suffix
|
|
39
46
|
end
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
# Optional so that a group whose requests were declined can pass rather than skip on inputs
|
|
49
|
+
# the short circuited tests before it never produced. The run block still skips when empty.
|
|
50
|
+
# The defaults only pre-fill the UI, so a missing value still arrives as nil.
|
|
51
|
+
input :auth_tokens, optional: true, default: '[]'
|
|
52
|
+
input :auth_tokens_jwk_json, optional: true, default: '[]'
|
|
53
|
+
input :cds_jwt_iss
|
|
44
54
|
|
|
45
55
|
run do
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
check_for_short_circuit
|
|
57
|
+
|
|
58
|
+
auth_tokens_list = JSON.parse(auth_tokens.presence || '[]')
|
|
59
|
+
auth_tokens_jwk = JSON.parse(auth_tokens_jwk_json.presence || '[]')
|
|
60
|
+
requests = load_interaction_group_requests
|
|
49
61
|
skip_if auth_tokens_list.compact.empty?, 'No Authorization tokens produced from the previous tests.'
|
|
50
62
|
skip_if auth_tokens_jwk.compact.empty?, 'No Authorization token JWK produced from the previous test.'
|
|
51
63
|
|
|
@@ -56,34 +68,49 @@ module DaVinciCRDTestKit
|
|
|
56
68
|
|
|
57
69
|
begin
|
|
58
70
|
jwk = JSON.parse(auth_token_jwk).deep_symbolize_keys # NOTE: pre-verified json
|
|
59
|
-
|
|
60
|
-
payload, =
|
|
61
|
-
JWT.decode(
|
|
62
|
-
auth_tokens_list[index],
|
|
63
|
-
JWT::JWK.import(jwk).public_key,
|
|
64
|
-
true,
|
|
65
|
-
algorithms: [jwk[:alg]],
|
|
66
|
-
exp_leeway: 60,
|
|
67
|
-
iss: cds_jwt_iss,
|
|
68
|
-
aud: public_hook_url(request),
|
|
69
|
-
verify_not_before: false,
|
|
70
|
-
verify_iat: false,
|
|
71
|
-
verify_jti: true,
|
|
72
|
-
verify_iss: true,
|
|
73
|
-
verify_aud: true
|
|
74
|
-
)
|
|
71
|
+
unverified_payload, jwt_header = JWT.decode(auth_tokens_list[index], nil, false)
|
|
75
72
|
rescue StandardError => e
|
|
76
73
|
add_request_message('error', "Token validation error: #{e.message}", index)
|
|
77
74
|
next
|
|
78
75
|
end
|
|
79
76
|
|
|
80
|
-
|
|
81
|
-
missing_claims_string = missing_claims.map { |claim| "`#{claim}`" }.join(', ')
|
|
77
|
+
alg = jwk[:alg] || jwt_header['alg']
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
# Continue checking the rest of the token even when one check fails, so the tester sees every
|
|
80
|
+
# issue at once rather than fixing them one error at a time.
|
|
81
|
+
# CDS Hooks prohibits the `none` algorithm and symmetric (HMAC) algorithms for the authentication JWT.
|
|
82
|
+
if alg.to_s.match?(/\A(none|hs\d+)\z/i)
|
|
83
|
+
add_request_message('error',
|
|
84
|
+
"Token signature algorithm #{alg.inspect} is not permitted; CDS Hooks prohibits " \
|
|
85
|
+
'the `none` algorithm and symmetric (HMAC) algorithms.', index)
|
|
86
86
|
end
|
|
87
|
+
|
|
88
|
+
begin
|
|
89
|
+
JWT.decode(
|
|
90
|
+
auth_tokens_list[index],
|
|
91
|
+
JWT::JWK.import(jwk).public_key,
|
|
92
|
+
true,
|
|
93
|
+
algorithms: [alg],
|
|
94
|
+
exp_leeway: 60,
|
|
95
|
+
iss: cds_jwt_iss,
|
|
96
|
+
aud: public_hook_url(request),
|
|
97
|
+
verify_not_before: false,
|
|
98
|
+
verify_iat: false,
|
|
99
|
+
verify_jti: true,
|
|
100
|
+
verify_iss: true,
|
|
101
|
+
verify_aud: true
|
|
102
|
+
)
|
|
103
|
+
rescue StandardError => e
|
|
104
|
+
add_request_message('error', "Token validation error: #{e.message}", index)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
jwt_claim_type_errors(unverified_payload).each { |message| add_request_message('error', message, index) }
|
|
108
|
+
|
|
109
|
+
missing_claims = required_claims - unverified_payload.keys
|
|
110
|
+
next if missing_claims.empty?
|
|
111
|
+
|
|
112
|
+
missing_claims_string = missing_claims.map { |claim| "`#{claim}`" }.join(', ')
|
|
113
|
+
add_request_message('error', "JWT payload missing required claims: #{missing_claims_string}", index)
|
|
87
114
|
end
|
|
88
115
|
assert_no_error_messages("#{requests_with_errors_prefix}Token payload is missing required claims or " \
|
|
89
116
|
'does not have a valid signature. See Messages for details.')
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
{
|
|
5
5
|
"hook": "appointment-book",
|
|
6
6
|
"title": "Appointment Booking CDS Service",
|
|
7
|
-
"description": "A simulated CDS Service requesting a subset of the standard prefetches that is invoked when user
|
|
7
|
+
"description": "A simulated CDS Service requesting a subset of the standard prefetches that is invoked when user books a future appointment for a patient",
|
|
8
8
|
"id": "appointment-book-subset",
|
|
9
9
|
"prefetch" : {
|
|
10
10
|
"pat": "Patient/{{context.patientId}}",
|
|
@@ -66,18 +66,19 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
"hook": "
|
|
70
|
-
"title": "
|
|
71
|
-
"description": "A simulated CDS Service requesting a subset of the standard prefetches that
|
|
72
|
-
"id": "
|
|
73
|
-
"prefetch"
|
|
69
|
+
"hook": "order-select",
|
|
70
|
+
"title": "Order Select CDS Service",
|
|
71
|
+
"description": "A simulated CDS Service requesting a subset of the standard prefetches that fires when a clinician selects one or more orders to place for a patient",
|
|
72
|
+
"id": "order-select-subset",
|
|
73
|
+
"prefetch": {
|
|
74
74
|
"pat": "Patient/{{context.patientId}}",
|
|
75
75
|
"enc": "Encounter/{{context.encounterId}}",
|
|
76
|
-
"cov": "Coverage?patient={{context.patientId}}&status=active",
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
76
|
+
"cov": "Coverage?patient={{context.patientId}}&status=active",
|
|
77
|
+
"devs": "Device?_id={{context.draftOrders.entry.resource.ofType(DeviceRequest).code.resolve().id}}",
|
|
78
|
+
"meds": "Medication?_id={{context.draftOrders.entry.resource.ofType(MedicationRequest).medication.resolve().id}}",
|
|
79
|
+
"roles": "PractitionerRole?_id={{context.draftOrders.entry.resource.sender.resolve().ofType(PractitionerRole).id|context.draftOrders.entry.resource.recipient.resolve().ofType(PractitionerRole).id|context.draftOrders.entry.resource.performer.resolve().ofType(PractitionerRole).id}}",
|
|
80
|
+
"pracs": "Practitioner?_id={{%roles.entry.resource.practitioner.resolve().id|context.draftOrders.entry.resource.sender.resolve().ofType(Practitioner).id|context.draftOrders.entry.resource.recipient.resolve().ofType(Practitioner).id|context.draftOrders.entry.resource.performer.resolve().ofType(Practitioner).id}}",
|
|
81
|
+
"locs": "Location?_id={{%roles.entry.resource.location.resolve().id|%enc.location.location.resolve().id|context.draftOrders.entry.resource.locationReference.resolve().id}}"
|
|
81
82
|
},
|
|
82
83
|
"extension" : {
|
|
83
84
|
"davinci-crd.version" : [
|
|
@@ -96,25 +97,19 @@
|
|
|
96
97
|
}
|
|
97
98
|
},
|
|
98
99
|
{
|
|
99
|
-
"hook": "order-
|
|
100
|
-
"title": "Order
|
|
101
|
-
"description": "A simulated CDS Service requesting a subset of the standard prefetches that fires when a
|
|
102
|
-
"id": "order-
|
|
100
|
+
"hook": "order-sign",
|
|
101
|
+
"title": "Order Sign CDS Service",
|
|
102
|
+
"description": "A simulated CDS Service requesting a subset of the standard prefetches that fires when a clinician is ready to sign one or more orders for a patient",
|
|
103
|
+
"id": "order-sign-subset",
|
|
103
104
|
"prefetch": {
|
|
104
105
|
"pat": "Patient/{{context.patientId}}",
|
|
105
106
|
"enc": "Encounter/{{context.encounterId}}",
|
|
106
|
-
"cov": "Coverage?patient={{context.patientId}}&status=active",
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"visRxs": "VisionPrescription?_id={{context.dispatchedOrders.resolve().ofType(VisionPrescription).id}}",
|
|
113
|
-
"devs": "Device?_id={{%devReqs.entry.resource.code.resolve().id}}",
|
|
114
|
-
"meds": "Medication?_id={{%medReqs.entry.resource.medication.resolve().id}}",
|
|
115
|
-
"roles": "PractitionerRole?_id={{%comReqs.entry.resource.sender.resolve().ofType(PractitionerRole).id|%comReqs.entry.resource.recipient.resolve().ofType(PractitionerRole).id|%devReqs.entry.resource.performer.resolve().ofType(PractitionerRole).id|%medReqs.entry.resource.performer.resolve().ofType(PractitionerRole).id|%servReqs.entry.resource.performer.resolve().ofType(PractitionerRole).id}}",
|
|
116
|
-
"pracs": "Practitioner?_id={{%roles.entry.resource.practitioner.resolve().id|%comReqs.entry.resource.sender.resolve().ofType(Practitioner).id|%comReqs.entry.resource.recipient.resolve().ofType(Practitioner).id|%devReqs.entry.resource.performer.resolve().ofType(Practitioner).id|%medReqs.entry.resource.performer.resolve().ofType(Practitioner).id|%servReqs.entry.resource.performer.resolve().ofType(Practitioner).id}}",
|
|
117
|
-
"locs": "Location?_id={{%roles.entry.resource.location.resolve().id|%enc.location.location.resolve().id|%servReqs.entry.resource.locationReference.resolve().id}}"
|
|
107
|
+
"cov": "Coverage?patient={{context.patientId}}&status=active",
|
|
108
|
+
"devs": "Device?_id={{context.draftOrders.entry.resource.ofType(DeviceRequest).code.resolve().id}}",
|
|
109
|
+
"meds": "Medication?_id={{context.draftOrders.entry.resource.ofType(MedicationRequest).medication.resolve().id}}",
|
|
110
|
+
"roles": "PractitionerRole?_id={{context.draftOrders.entry.resource.sender.resolve().ofType(PractitionerRole).id|context.draftOrders.entry.resource.recipient.resolve().ofType(PractitionerRole).id|context.draftOrders.entry.resource.performer.resolve().ofType(PractitionerRole).id}}",
|
|
111
|
+
"pracs": "Practitioner?_id={{%roles.entry.resource.practitioner.resolve().id|context.draftOrders.entry.resource.sender.resolve().ofType(Practitioner).id|context.draftOrders.entry.resource.recipient.resolve().ofType(Practitioner).id|context.draftOrders.entry.resource.performer.resolve().ofType(Practitioner).id}}",
|
|
112
|
+
"locs": "Location?_id={{%roles.entry.resource.location.resolve().id|%enc.location.location.resolve().id|context.draftOrders.entry.resource.locationReference.resolve().id}}"
|
|
118
113
|
},
|
|
119
114
|
"extension" : {
|
|
120
115
|
"davinci-crd.version" : [
|
|
@@ -133,19 +128,25 @@
|
|
|
133
128
|
}
|
|
134
129
|
},
|
|
135
130
|
{
|
|
136
|
-
"hook": "order-
|
|
137
|
-
"title": "Order
|
|
138
|
-
"description": "A simulated CDS Service requesting a subset of the standard prefetches that fires when a
|
|
139
|
-
"id": "order-
|
|
131
|
+
"hook": "order-dispatch",
|
|
132
|
+
"title": "Order Dispatch CDS Service Example",
|
|
133
|
+
"description": "A simulated CDS Service requesting a subset of the standard prefetches that fires when a practitioner is selecting a candidate performer for a pre-existing order that was not tied to a specific performer",
|
|
134
|
+
"id": "order-dispatch-subset",
|
|
140
135
|
"prefetch": {
|
|
141
136
|
"pat": "Patient/{{context.patientId}}",
|
|
142
137
|
"enc": "Encounter/{{context.encounterId}}",
|
|
143
|
-
"cov": "Coverage?patient={{context.patientId}}&status=active",
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
138
|
+
"cov": "Coverage?patient={{context.patientId}}&status=active",
|
|
139
|
+
"comReqs": "CommunicationRequest?_id={{context.dispatchedOrders.resolve().ofType(CommunicationRequest).id}}",
|
|
140
|
+
"devReqs": "DeviceRequest?_id={{context.dispatchedOrders.resolve().ofType(DeviceRequest).id}}",
|
|
141
|
+
"medReqs": "MedicationRequest?_id={{context.dispatchedOrders.resolve().ofType(MedicationRequest).id}}",
|
|
142
|
+
"nutOrds": "NutritionOrder?_id={{context.dispatchedOrders.resolve().ofType(NutritionOrder).id}}",
|
|
143
|
+
"servReqs": "ServiceRequest?_id={{context.dispatchedOrders.resolve().ofType(ServiceRequest).id}}",
|
|
144
|
+
"visRxs": "VisionPrescription?_id={{context.dispatchedOrders.resolve().ofType(VisionPrescription).id}}",
|
|
145
|
+
"devs": "Device?_id={{%devReqs.entry.resource.code.resolve().id}}",
|
|
146
|
+
"meds": "Medication?_id={{%medReqs.entry.resource.medication.resolve().id}}",
|
|
147
|
+
"roles": "PractitionerRole?_id={{%comReqs.entry.resource.sender.resolve().ofType(PractitionerRole).id|%comReqs.entry.resource.recipient.resolve().ofType(PractitionerRole).id|%devReqs.entry.resource.performer.resolve().ofType(PractitionerRole).id|%medReqs.entry.resource.performer.resolve().ofType(PractitionerRole).id|%servReqs.entry.resource.performer.resolve().ofType(PractitionerRole).id}}",
|
|
148
|
+
"pracs": "Practitioner?_id={{%roles.entry.resource.practitioner.resolve().id|%comReqs.entry.resource.sender.resolve().ofType(Practitioner).id|%comReqs.entry.resource.recipient.resolve().ofType(Practitioner).id|%devReqs.entry.resource.performer.resolve().ofType(Practitioner).id|%medReqs.entry.resource.performer.resolve().ofType(Practitioner).id|%servReqs.entry.resource.performer.resolve().ofType(Practitioner).id}}",
|
|
149
|
+
"locs": "Location?_id={{%roles.entry.resource.location.resolve().id|%enc.location.location.resolve().id|%servReqs.entry.resource.locationReference.resolve().id}}"
|
|
149
150
|
},
|
|
150
151
|
"extension" : {
|
|
151
152
|
"davinci-crd.version" : [
|
|
@@ -164,19 +165,18 @@
|
|
|
164
165
|
}
|
|
165
166
|
},
|
|
166
167
|
{
|
|
167
|
-
"hook": "
|
|
168
|
-
"title": "
|
|
169
|
-
"description": "A simulated CDS Service requesting a subset of the standard prefetches that
|
|
170
|
-
"id": "
|
|
171
|
-
"prefetch": {
|
|
168
|
+
"hook": "encounter-discharge",
|
|
169
|
+
"title": "Encounter Disharge CDS Service Example",
|
|
170
|
+
"description": "A simulated CDS Service requesting a subset of the standard prefetches that is invoked when the user is performing the discharge process for an encounter - typically an inpatient encounter.",
|
|
171
|
+
"id": "encounter-discharge-subset",
|
|
172
|
+
"prefetch" : {
|
|
172
173
|
"pat": "Patient/{{context.patientId}}",
|
|
173
174
|
"enc": "Encounter/{{context.encounterId}}",
|
|
174
|
-
"cov": "Coverage?patient={{context.patientId}}&status=active",
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"locs": "Location?_id={{%roles.entry.resource.location.resolve().id|%enc.location.location.resolve().id|context.draftOrders.entry.resource.locationReference.resolve().id}}"
|
|
175
|
+
"cov": "Coverage?patient={{context.patientId}}&status=active",
|
|
176
|
+
"roles" : "PractitionerRole?_id={{%enc.participant.individual.resolve().ofType(PractitionerRole).id}}",
|
|
177
|
+
"pracs" : "Practitioner?_id={{%roles.entry.resource.practitioner.resolve().id|%enc.participant.individual.resolve().ofType(Practitioner).id}}",
|
|
178
|
+
"orgs" : "Organization?_id={{%roles.entry.resource.organization.resolve().id}}",
|
|
179
|
+
"locs" : "Location?_id={{%roles.entry.resource.location.resolve().id}}"
|
|
180
180
|
},
|
|
181
181
|
"extension" : {
|
|
182
182
|
"davinci-crd.version" : [
|