Class: SemgrepWebApp::RepositoryVisibility
- Inherits:
-
Object
- Object
- SemgrepWebApp::RepositoryVisibility
- Defined in:
- lib/semgrep_web_app/models/repository_visibility.rb
Overview
Filter by repository visibility. Only applies for secrets findings.
Constant Summary collapse
- REPOSITORY_VISIBILITY =
[ # TODO: Write general description for PUBLIC PUBLIC = 'public'.freeze, # TODO: Write general description for PRIVATE PRIVATE = 'private'.freeze, # TODO: Write general description for UNKNOWN UNKNOWN = 'unknown'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = PUBLIC) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/semgrep_web_app/models/repository_visibility.rb', line 26 def self.from_value(value, default_value = PUBLIC) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'public' then PUBLIC when 'private' then PRIVATE when 'unknown' then UNKNOWN else default_value end end |
.validate(value) ⇒ Object
20 21 22 23 24 |
# File 'lib/semgrep_web_app/models/repository_visibility.rb', line 20 def self.validate(value) return false if value.nil? REPOSITORY_VISIBILITY.include?(value) end |