Class: SemgrepWebApp::Exposures2
- Inherits:
-
Object
- Object
- SemgrepWebApp::Exposures2
- Defined in:
- lib/semgrep_web_app/models/exposures2.rb
Overview
List of exposures or reachability types to filter by. If not specified,
returns findings across all exposures. This filter is applicable when
issue_type=sca is specified. Valid values: reachable, always_reachable,
conditionally_reachable, unreachable, unknown
Constant Summary collapse
- EXPOSURES2 =
[ # TODO: Write general description for REACHABLE REACHABLE = 'reachable'.freeze, # TODO: Write general description for ALWAYS_REACHABLE ALWAYS_REACHABLE = 'always_reachable'.freeze, # TODO: Write general description for CONDITIONALLY_REACHABLE CONDITIONALLY_REACHABLE = 'conditionally_reachable'.freeze, # TODO: Write general description for UNREACHABLE UNREACHABLE = 'unreachable'.freeze, # TODO: Write general description for UNKNOWN UNKNOWN = 'unknown'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = REACHABLE) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/semgrep_web_app/models/exposures2.rb', line 35 def self.from_value(value, default_value = REACHABLE) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'reachable' then REACHABLE when 'always_reachable' then ALWAYS_REACHABLE when 'conditionally_reachable' then CONDITIONALLY_REACHABLE when 'unreachable' then UNREACHABLE when 'unknown' then UNKNOWN else default_value end end |
.validate(value) ⇒ Object
29 30 31 32 33 |
# File 'lib/semgrep_web_app/models/exposures2.rb', line 29 def self.validate(value) return false if value.nil? EXPOSURES2.include?(value) end |