Class: Acme::Client::Resources::Challenges::HTTP01

Inherits:
Base
  • Object
show all
Defined in:
lib/acme/client/resources/challenges/http01.rb

Constant Summary collapse

CONTENT_TYPE =
'text/plain'.freeze

Instance Attribute Summary

Attributes inherited from Base

#client, #error, #status, #token, #uri

Instance Method Summary collapse

Methods inherited from Base

#initialize, #verify_status

Constructor Details

This class inherits a constructor from Acme::Client::Resources::Challenges::Base

Instance Method Details

#content_typeObject



4
5
6
# File 'lib/acme/client/resources/challenges/http01.rb', line 4

def content_type
  CONTENT_TYPE
end

#file_contentObject



8
9
10
# File 'lib/acme/client/resources/challenges/http01.rb', line 8

def file_content
  authorization_key
end

#filenameObject



12
13
14
# File 'lib/acme/client/resources/challenges/http01.rb', line 12

def filename
  ".well-known/acme-challenge/#{token}"
end

#request_verificationObject



16
17
18
19
# File 'lib/acme/client/resources/challenges/http01.rb', line 16

def request_verification
  response = client.connection.post(@uri, { resource: 'challenge', type: 'http-01', keyAuthorization: authorization_key })
  response.success?
end