Class: Bullion::Models::Order

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/bullion/models/order.rb

Overview

ACMEv2 Order model

Instance Method Summary collapse

Instance Method Details

#domainsObject

Used to extract domains from order (mostly for comparison with CSR)



44
# File 'lib/bullion/models/order.rb', line 44

def domains = identifiers.map { it["value"] }

#init_valuesObject



25
26
27
28
29
# File 'lib/bullion/models/order.rb', line 25

def init_values
  self.expires ||= Time.now + (60 * 60)
  self.not_before ||= Time.now
  self.not_after ||= Time.now + (60 * 60 * 24 * 90) # 90 days
end

#prep_authorizations!Object



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/bullion/models/order.rb', line 31

def prep_authorizations!
  identifiers.each do |identifier|
    authorization = Authorization.new
    authorization.order = self
    authorization.identifier = identifier

    authorization.save

    authorization.prep_challenges!
  end
end