Sha256: 1306229553d0cc0b0c552f0b160b15c9cb63628d9fe2f73b48a5af78ecf15d99

Contents?: true

Size: 386 Bytes

Versions: 2

Compression:

Stored size: 386 Bytes

Contents

class Mdm::ApiKey < ActiveRecord::Base
  
  #
  # Validators
  #

  validate :supports_api
  validates :token, :presence => true, :length => { :minimum => 8 }

  protected

  def supports_api
    license = License.get

    if license and not license.supports_api?
      errors[:license] = " - this product does not support API access"
    end
  end

  Metasploit::Concern.run(self)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
metasploit_data_models-1.0.0.pre.rails.pre.4.0b app/models/mdm/api_key.rb
metasploit_data_models-1.0.0.pre.rails.pre.4.0a app/models/mdm/api_key.rb