Method: Compliance::API.version

Defined in:
lib/bundles/inspec-compliance/api.rb

.version(url, insecure) ⇒ Object

return the server api version NB this method does not use Compliance::Configuration to allow for using it before we know the version (e.g. oidc or not)



46
47
48
49
50
51
52
53
54
# File 'lib/bundles/inspec-compliance/api.rb', line 46

def self.version(url, insecure)
  response = Compliance::HTTP.get(url+'/version', nil, insecure)
  data = response.body
  if !data.nil?
    JSON.parse(data)
  else
    {}
  end
end