Class: SemgrepWebApp::ValidationState
- Inherits:
-
Object
- Object
- SemgrepWebApp::ValidationState
- Defined in:
- lib/semgrep_web_app/models/validation_state.rb
Overview
Filter by whether a secret could be validated. Only applies for secrets findings.
Constant Summary collapse
- VALIDATION_STATE =
[ # TODO: Write general description for CONFIRMED_VALID CONFIRMED_VALID = 'confirmed_valid'.freeze, # TODO: Write general description for CONFIRMED_INVALID CONFIRMED_INVALID = 'confirmed_invalid'.freeze, # TODO: Write general description for VALIDATION_ERROR VALIDATION_ERROR = 'validation_error'.freeze, # TODO: Write general description for NO_VALIDATOR NO_VALIDATOR = 'no_validator'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = CONFIRMED_VALID) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/semgrep_web_app/models/validation_state.rb', line 30 def self.from_value(value, default_value = CONFIRMED_VALID) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'confirmed_valid' then CONFIRMED_VALID when 'confirmed_invalid' then CONFIRMED_INVALID when 'validation_error' then VALIDATION_ERROR when 'no_validator' then NO_VALIDATOR else default_value end end |
.validate(value) ⇒ Object
24 25 26 27 28 |
# File 'lib/semgrep_web_app/models/validation_state.rb', line 24 def self.validate(value) return false if value.nil? VALIDATION_STATE.include?(value) end |