Class: Homebrew::Vulns::Match::Evidence Private

Inherits:
Struct
  • Object
show all
Defined in:
vulns/match.rb

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

ecosystem/name are the OSV package fields queried, so a hit's affected[] entry can be matched back to this evidence. subject_version is the version to evaluate that entry's ranges against: the formula version for the primary source, the pinned resource version for a resource, nil for distro (whose versions are not comparable to ours). advisory carries the CPANSA record for :cpansa evidence so its constraint strings survive to #range_status. source_record is the Vulnerability this evidence was matched against (attached at hit-construction time), so after #dedup_by_cve merges hits each evidence still points at the record whose affected[] it should be checked against.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#advisoryObject

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of attribute advisory

Returns:

  • (Object)

    the current value of advisory



63
64
65
# File 'vulns/match.rb', line 63

def advisory
  @advisory
end

#ecosystemObject

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of attribute ecosystem

Returns:

  • (Object)

    the current value of ecosystem



63
64
65
# File 'vulns/match.rb', line 63

def ecosystem
  @ecosystem
end

#keyObject

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



63
64
65
# File 'vulns/match.rb', line 63

def key
  @key
end

#nameObject

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



63
64
65
# File 'vulns/match.rb', line 63

def name
  @name
end

#resourceObject

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of attribute resource

Returns:

  • (Object)

    the current value of resource



63
64
65
# File 'vulns/match.rb', line 63

def resource
  @resource
end

#source_recordObject

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of attribute source_record

Returns:

  • (Object)

    the current value of source_record



63
64
65
# File 'vulns/match.rb', line 63

def source_record
  @source_record
end

#strategyObject

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of attribute strategy

Returns:

  • (Object)

    the current value of strategy



63
64
65
# File 'vulns/match.rb', line 63

def strategy
  @strategy
end

#subject_versionObject

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of attribute subject_version

Returns:

  • (Object)

    the current value of subject_version



63
64
65
# File 'vulns/match.rb', line 63

def subject_version
  @subject_version
end

Instance Method Details

#with_source(record) ⇒ T.untyped

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

  • (T.untyped)


66
67
68
# File 'vulns/match.rb', line 66

def with_source(record)
  source_record ? self : self.class.new(**to_h, source_record: record).freeze
end