lib/mdqt/cli/get.rb in mdqt-0.3.1 vs lib/mdqt/cli/get.rb in mdqt-0.4.0
- old
+ new
@@ -24,17 +24,26 @@
client = MDQT::Client.new(
options.service,
verbose: options.verbose,
explain: options.explain ? true : false,
+ tls_risky: options.tls_risky ? true : false,
cache_type: options.cache ? :file : :none,
)
args.empty? ? [client.get_metadata("")] : args.collect {|entity_id| client.get_metadata(entity_id)}
end
def verify_results(results)
+
+ if options.validate
+ results.each do |result|
+ next unless result.ok?
+ halt! "The data for #{result.identifier} is not valid when checked against schema:\n#{result.validation_error}" unless result.valid?
+ btw "Data for #{result.identifier.empty? ? 'aggregate' : result.identifier } has been validated against schema" ## FIXME - needs constistent #label maybe?
+ end
+ end
return results unless options.verify_with
cert_paths = extract_certificate_paths(options.verify_with)