Sha256: 32da4f89f7695b7550413a6a9df1e406e8289005b77b3e1ae157e902058c0d2c

Contents?: true

Size: 1.36 KB

Versions: 30

Compression:

Stored size: 1.36 KB

Contents

# A publicly disclosed credential, i.e. a {#username}.
class Metasploit::Credential::Public < ActiveRecord::Base
  include Metasploit::Model::Search

  #
  # Associations
  #

  # @!attribute cores
  #   The {Metasploit::Credential::Core core credentials} that combine this public credential with its derived
  #   {Metasploit::Credential::Private private credential} and/or {Metasploit::Credential::Realm realm}.
  #
  #   @return [ActiveRecord::Relation<Metasploit::Credential::Core>]
  has_many :cores,
           class_name: 'Metasploit::Credential::Core',
           dependent: :destroy,
           inverse_of: :public

  #
  # Attributes
  #

  # @!attribute created_at
  #   When this credential was created.
  #
  #   @return [DateTime]

  # @!attribute updated_at
  #   The last time this credential was updated.
  #
  #   @return [DateTime]

  # @!attribute username
  #   The username for this credential
  #
  #   @return [String]

  #
  # Mass-Assignment Security
  #

  attr_accessible :username

  #
  # Search Attributes
  #

  search_attribute :username,
                   type: :string


  #
  # Validations
  #

  validates :username,
            presence: true,
            uniqueness: true

  #
  # Instance Methods
  #

  # A string suitable for displaying to the user
  #
  # @return [String]
  def to_s
    username.to_s
  end

  Metasploit::Concern.run(self)
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
metasploit-credential-0.12.0 app/models/metasploit/credential/public.rb
metasploit-credential-0.10.2 app/models/metasploit/credential/public.rb
metasploit-credential-0.10.1 app/models/metasploit/credential/public.rb
metasploit-credential-0.10.1-java app/models/metasploit/credential/public.rb
metasploit-credential-0.10.1.pre.dep.pre.railties app/models/metasploit/credential/public.rb
metasploit-credential-0.10.0.pre.dep.pre.railties app/models/metasploit/credential/public.rb
metasploit-credential-0.9.1 app/models/metasploit/credential/public.rb
metasploit-credential-0.9.0 app/models/metasploit/credential/public.rb
metasploit-credential-0.9.0-java app/models/metasploit/credential/public.rb
metasploit-credential-0.8.9 app/models/metasploit/credential/public.rb
metasploit-credential-0.8.8 app/models/metasploit/credential/public.rb
metasploit-credential-0.8.7-java app/models/metasploit/credential/public.rb
metasploit-credential-0.8.7 app/models/metasploit/credential/public.rb
metasploit-credential-0.8.6 app/models/metasploit/credential/public.rb
metasploit-credential-0.8.6.pre.realm.pre.uniqueness app/models/metasploit/credential/public.rb
metasploit-credential-0.8.4-java app/models/metasploit/credential/public.rb
metasploit-credential-0.8.4 app/models/metasploit/credential/public.rb
metasploit-credential-0.8.3-java app/models/metasploit/credential/public.rb
metasploit-credential-0.8.3 app/models/metasploit/credential/public.rb
metasploit-credential-0.8.2 app/models/metasploit/credential/public.rb