diff options
Diffstat (limited to 'vendor/acme-client/lib/acme/client/resources/authorization.rb')
-rw-r--r-- | vendor/acme-client/lib/acme/client/resources/authorization.rb | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/vendor/acme-client/lib/acme/client/resources/authorization.rb b/vendor/acme-client/lib/acme/client/resources/authorization.rb deleted file mode 100644 index 9ca2e76..0000000 --- a/vendor/acme-client/lib/acme/client/resources/authorization.rb +++ /dev/null @@ -1,44 +0,0 @@ -class Acme::Client::Resources::Authorization - HTTP01 = Acme::Client::Resources::Challenges::HTTP01 - DNS01 = Acme::Client::Resources::Challenges::DNS01 - TLSSNI01 = Acme::Client::Resources::Challenges::TLSSNI01 - - attr_reader :client, :uri, :domain, :status, :expires, :http01, :dns01, :tls_sni01 - - def initialize(client, uri, response) - @client = client - @uri = uri - assign_attributes(response.body) - end - - def verify_status - response = @client.connection.get(@uri) - - assign_attributes(response.body) - status - end - - private - - def assign_attributes(body) - @expires = Time.iso8601(body['expires']) if body.key? 'expires' - @domain = body['identifier']['value'] - @status = body['status'] - assign_challenges(body['challenges']) - end - - def assign_challenges(challenges) - challenges.each do |attributes| - challenge = case attributes.fetch('type') - when 'http-01' - @http01 ||= HTTP01.new(self) - when 'dns-01' - @dns01 ||= DNS01.new(self) - when 'tls-sni-01' - @tls_sni01 ||= TLSSNI01.new(self) - end - - challenge.assign_attributes(attributes) if challenge - end - end -end |