Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FI-3531 Add optional community parameter input #20

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/udap_security_test_kit/well_known_endpoint_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'uri'
module UDAPSecurityTestKit
class WellKnownEndpointTest < Inferno::Test
include Inferno::DSL::Assertions
Expand All @@ -18,11 +19,23 @@ class WellKnownEndpointTest < Inferno::Test
title: 'FHIR Server Base URL',
description: 'Base FHIR URL of FHIR Server. Discovery request will be sent to {baseURL}/.well-known/udap'

input :udap_community_parameter,
title: 'UDAP Community Parameter',
description: "If included, the designated community value will be appended as a query to the well-known
endpoint to indicate the client's trust of certificates from this trust community.",
optional: true

output :udap_well_known_metadata_json
makes_request :config

run do
get("#{udap_fhir_base_url.strip.chomp('/')}/.well-known/udap", name: :udap_well_known_metadata_json)
uri = URI.parse("#{udap_fhir_base_url.strip.chomp('/')}/.well-known/udap")
unless udap_community_parameter.blank?
queries = URI.decode_www_form(uri.query || '') << ['community', udap_community_parameter]
uri.query = URI.encode_www_form(queries)
end

get(uri.to_s, name: :udap_well_known_metadata_json)
assert_response_status(200)
assert_valid_json(response[:body])
output udap_well_known_metadata_json: response[:body]
Expand Down
Loading