Sha256: df067990131f712ad9b8aff94c3385a5d672e06c90b9320175e6febb37545fdc
Contents?: true
Size: 1.35 KB
Versions: 8
Compression:
Stored size: 1.35 KB
Contents
class Puppet::HTTP::Service::Ca < Puppet::HTTP::Service HEADERS = { 'Accept' => 'text/plain' }.freeze def get_certificate(name, ssl_context: nil) response = @client.get( with_base_url("/certificate/#{name}"), headers: HEADERS, ssl_context: ssl_context ) return response.body.to_s if response.success? raise Puppet::HTTP::ResponseError.new(response) end def get_certificate_revocation_list(if_modified_since: nil, ssl_context: nil) request_headers = if if_modified_since h = HEADERS.dup h['If-Modified-Since'] = if_modified_since.httpdate h else HEADERS end response = @client.get( with_base_url("/certificate_revocation_list/ca"), headers: request_headers, ssl_context: ssl_context ) return response.body.to_s if response.success? raise Puppet::HTTP::ResponseError.new(response) end def put_certificate_request(name, csr, ssl_context: nil) response = @client.put( with_base_url("/certificate_request/#{name}"), headers: HEADERS, content_type: 'text/plain', body: csr.to_pem, ssl_context: ssl_context ) return response.body.to_s if response.success? raise Puppet::HTTP::ResponseError.new(response) end end
Version data entries
8 entries across 8 versions & 1 rubygems