12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'gems/aws-sdk-signerdata/lib/aws-sdk-signerdata/endpoint_provider.rb', line 12
def resolve_endpoint(parameters)
if Aws::Endpoints::Matchers.set?(parameters.endpoint)
return Aws::Endpoints::Endpoint.new(url: parameters.endpoint)
end
if (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region))
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
return Aws::Endpoints::Endpoint.new(url: "https://data-signer-fips.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}")
end
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
return Aws::Endpoints::Endpoint.new(url: "https://data-signer-fips.#{parameters.region}.#{partition_result['dnsSuffix']}")
end
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
return Aws::Endpoints::Endpoint.new(url: "https://data-signer.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}")
end
return Aws::Endpoints::Endpoint.new(url: "https://data-signer.#{parameters.region}.#{partition_result['dnsSuffix']}")
end
raise ArgumentError, 'No endpoint could be resolved'
end
|