Class: Bullion::Models::Nonce

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

Overview

ACMEv2 Nonce model

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.clean_up!Object

Delete old nonces



16
17
18
19
# File 'lib/bullion/models/nonce.rb', line 16

def self.clean_up!
  # nonces older than this can safely be deleted
  where("created_at < ?", Time.now - 86_400).delete_all
end

Instance Method Details

#init_valuesObject



11
12
13
# File 'lib/bullion/models/nonce.rb', line 11

def init_values
  self.token ||= SecureRandom.alphanumeric
end