Class: SemgrepWebApp::BulkTriageRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SemgrepWebApp::BulkTriageRequest
- Defined in:
- lib/semgrep_web_app/models/bulk_triage_request.rb
Overview
BulkTriageRequest Model.
Instance Attribute Summary collapse
-
#autotriage_verdict ⇒ AutotriageVerdict
The autotriage verdict to filter by.
-
#categories ⇒ Array[String]
List of categories to filter by.
-
#component_tags ⇒ Array[String]
List of component tags to filter by.
-
#confidence ⇒ Confidence3
List of confidence levels to filter by.
-
#dependencies ⇒ Array[String]
Filter by dependency name.
-
#epss_probability ⇒ EpssProbability
Filter by EPSS probability (likelihood of exploit).
-
#exposures ⇒ Exposures
Filter by exposure (reachability type).
-
#include_historical ⇒ TrueClass | FalseClass
Whether to include historical findings.
-
#issue_ids ⇒ Array[Integer]
An array of issue IDs to act on.
-
#issue_type ⇒ IssueType
Type of findings to bulk triage.
-
#limit ⇒ Integer
Max number of issues to triage.
-
#new_note ⇒ String
The note to attach to the bulk triaged findings.
-
#new_triage_reason ⇒ NewTriageReason
The reason for triaging to a given triage state.
-
#new_triage_state ⇒ NewTriageState
The triage state you would like to bulk triage your findings to.
-
#policies ⇒ Array[String]
List of policy modes to filter by.
-
#policy_mode ⇒ PolicyMode1
List of policy modes to filter by.
-
#pro_only ⇒ TrueClass | FalseClass
Filter by whether a finding is only available with Semgrep Pro features.
-
#project_tags ⇒ Array[String]
List of project tags to filter by.
-
#ref ⇒ String
Branch reference to filter by.
-
#repos ⇒ Array[String]
List of repository names to filter by.
-
#repository_visibility ⇒ RepositoryVisibility
Filter by repository visibility.
-
#rules ⇒ Array[String]
List of rule names to filter by.
-
#ruleset ⇒ Array[String]
List of Semgrep Registry rulesets to filter by.
-
#secret_types ⇒ Array[String]
Filter by type of secret (typically provider-related).
-
#severities ⇒ Severities
List of severities to filter by.
-
#since ⇒ String
Epoch timestamp in seconds.
-
#status ⇒ Status1
The status to filter by.
-
#transitivities ⇒ Transitivities
Filter by transitivity of a dependency.
-
#triage_reasons ⇒ TriageReasons
List of triage reasons to filter by.
-
#validation_state ⇒ ValidationState
Filter by whether a secret could be validated.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(issue_type:, autotriage_verdict: SKIP, categories: SKIP, component_tags: SKIP, confidence: SKIP, dependencies: SKIP, epss_probability: SKIP, exposures: SKIP, include_historical: SKIP, issue_ids: SKIP, limit: 3000, new_note: SKIP, new_triage_reason: SKIP, new_triage_state: SKIP, policies: SKIP, policy_mode: SKIP, pro_only: SKIP, project_tags: SKIP, ref: SKIP, repos: SKIP, repository_visibility: SKIP, rules: SKIP, ruleset: SKIP, secret_types: SKIP, severities: SKIP, since: SKIP, status: SKIP, transitivities: SKIP, triage_reasons: SKIP, validation_state: SKIP, additional_properties: nil) ⇒ BulkTriageRequest
constructor
A new instance of BulkTriageRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(issue_type:, autotriage_verdict: SKIP, categories: SKIP, component_tags: SKIP, confidence: SKIP, dependencies: SKIP, epss_probability: SKIP, exposures: SKIP, include_historical: SKIP, issue_ids: SKIP, limit: 3000, new_note: SKIP, new_triage_reason: SKIP, new_triage_state: SKIP, policies: SKIP, policy_mode: SKIP, pro_only: SKIP, project_tags: SKIP, ref: SKIP, repos: SKIP, repository_visibility: SKIP, rules: SKIP, ruleset: SKIP, secret_types: SKIP, severities: SKIP, since: SKIP, status: SKIP, transitivities: SKIP, triage_reasons: SKIP, validation_state: SKIP, additional_properties: nil) ⇒ BulkTriageRequest
Returns a new instance of BulkTriageRequest.
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 221 def initialize(issue_type:, autotriage_verdict: SKIP, categories: SKIP, component_tags: SKIP, confidence: SKIP, dependencies: SKIP, epss_probability: SKIP, exposures: SKIP, include_historical: SKIP, issue_ids: SKIP, limit: 3000, new_note: SKIP, new_triage_reason: SKIP, new_triage_state: SKIP, policies: SKIP, policy_mode: SKIP, pro_only: SKIP, project_tags: SKIP, ref: SKIP, repos: SKIP, repository_visibility: SKIP, rules: SKIP, ruleset: SKIP, secret_types: SKIP, severities: SKIP, since: SKIP, status: SKIP, transitivities: SKIP, triage_reasons: SKIP, validation_state: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @autotriage_verdict = autotriage_verdict unless autotriage_verdict == SKIP @categories = categories unless categories == SKIP @component_tags = unless == SKIP @confidence = confidence unless confidence == SKIP @dependencies = dependencies unless dependencies == SKIP @epss_probability = epss_probability unless epss_probability == SKIP @exposures = exposures unless exposures == SKIP @include_historical = include_historical unless include_historical == SKIP @issue_ids = issue_ids unless issue_ids == SKIP @issue_type = issue_type @limit = limit unless limit == SKIP @new_note = new_note unless new_note == SKIP @new_triage_reason = new_triage_reason unless new_triage_reason == SKIP @new_triage_state = new_triage_state unless new_triage_state == SKIP @policies = policies unless policies == SKIP @policy_mode = policy_mode unless policy_mode == SKIP @pro_only = pro_only unless pro_only == SKIP @project_tags = unless == SKIP @ref = ref unless ref == SKIP @repos = repos unless repos == SKIP @repository_visibility = repository_visibility unless repository_visibility == SKIP @rules = rules unless rules == SKIP @ruleset = ruleset unless ruleset == SKIP @secret_types = secret_types unless secret_types == SKIP @severities = severities unless severities == SKIP @since = since unless since == SKIP @status = status unless status == SKIP @transitivities = transitivities unless transitivities == SKIP @triage_reasons = triage_reasons unless triage_reasons == SKIP @validation_state = validation_state unless validation_state == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#autotriage_verdict ⇒ AutotriageVerdict
The autotriage verdict to filter by
14 15 16 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 14 def autotriage_verdict @autotriage_verdict end |
#categories ⇒ Array[String]
List of categories to filter by
18 19 20 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 18 def categories @categories end |
#component_tags ⇒ Array[String]
List of component tags to filter by
22 23 24 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 22 def @component_tags end |
#confidence ⇒ Confidence3
List of confidence levels to filter by
26 27 28 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 26 def confidence @confidence end |
#dependencies ⇒ Array[String]
Filter by dependency name. Only applies for sca findings.
30 31 32 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 30 def dependencies @dependencies end |
#epss_probability ⇒ EpssProbability
Filter by EPSS probability (likelihood of exploit). Only applies for sca findings.
35 36 37 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 35 def epss_probability @epss_probability end |
#exposures ⇒ Exposures
Filter by exposure (reachability type). Only applies for sca findings. Reachability is the ability of an attacker to access a vulnerability in a system.
41 42 43 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 41 def exposures @exposures end |
#include_historical ⇒ TrueClass | FalseClass
Whether to include historical findings. Only applies for secrets findings. Defaults to true.
46 47 48 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 46 def include_historical @include_historical end |
#issue_ids ⇒ Array[Integer]
An array of issue IDs to act on. If this is not provided, an issue filter should be provided.
51 52 53 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 51 def issue_ids @issue_ids end |
#issue_type ⇒ IssueType
Type of findings to bulk triage.
55 56 57 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 55 def issue_type @issue_type end |
#limit ⇒ Integer
Max number of issues to triage. Must be an integer between 1 and 3000. Defaults to 3000. When selecting findings to triage, Semgrep will also triage findings with the same fingerprint on other branches. As a result, the list of triaged issue_ids returned in the response may be higher than the specified limit.
63 64 65 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 63 def limit @limit end |
#new_note ⇒ String
The note to attach to the bulk triaged findings. Maximum 3000 characters.
67 68 69 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 67 def new_note @new_note end |
#new_triage_reason ⇒ NewTriageReason
The reason for triaging to a given triage state.
71 72 73 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 71 def new_triage_reason @new_triage_reason end |
#new_triage_state ⇒ NewTriageState
The triage state you would like to bulk triage your findings to.
75 76 77 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 75 def new_triage_state @new_triage_state end |
#policies ⇒ Array[String]
List of policy modes to filter by
79 80 81 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 79 def policies @policies end |
#policy_mode ⇒ PolicyMode1
List of policy modes to filter by
83 84 85 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 83 def policy_mode @policy_mode end |
#pro_only ⇒ TrueClass | FalseClass
Filter by whether a finding is only available with Semgrep Pro features.
87 88 89 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 87 def pro_only @pro_only end |
#project_tags ⇒ Array[String]
List of project tags to filter by
91 92 93 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 91 def @project_tags end |
#ref ⇒ String
Branch reference to filter by
95 96 97 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 95 def ref @ref end |
#repos ⇒ Array[String]
List of repository names to filter by
99 100 101 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 99 def repos @repos end |
#repository_visibility ⇒ RepositoryVisibility
Filter by repository visibility. Only applies for secrets findings.
103 104 105 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 103 def repository_visibility @repository_visibility end |
#rules ⇒ Array[String]
List of rule names to filter by
107 108 109 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 107 def rules @rules end |
#ruleset ⇒ Array[String]
List of Semgrep Registry rulesets to filter by
111 112 113 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 111 def ruleset @ruleset end |
#secret_types ⇒ Array[String]
Filter by type of secret (typically provider-related). Only applies for secrets findings.
116 117 118 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 116 def secret_types @secret_types end |
#severities ⇒ Severities
List of severities to filter by
120 121 122 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 120 def severities @severities end |
#since ⇒ String
Epoch timestamp in seconds. Filters using the relevant_since field: the timestamp when this finding was detected by Semgrep (the first time, or when reintroduced).
126 127 128 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 126 def since @since end |
#status ⇒ Status1
The status to filter by
130 131 132 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 130 def status @status end |
#transitivities ⇒ Transitivities
Filter by transitivity of a dependency. Only applies for sca findings.
134 135 136 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 134 def transitivities @transitivities end |
#triage_reasons ⇒ TriageReasons
List of triage reasons to filter by
138 139 140 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 138 def triage_reasons @triage_reasons end |
#validation_state ⇒ ValidationState
Filter by whether a secret could be validated. Only applies for secrets findings.
143 144 145 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 143 def validation_state @validation_state end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 269 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. issue_type = hash.key?('issue_type') ? hash['issue_type'] : nil autotriage_verdict = hash.key?('autotriage_verdict') ? hash['autotriage_verdict'] : SKIP categories = hash.key?('categories') ? hash['categories'] : SKIP = hash.key?('component_tags') ? hash['component_tags'] : SKIP confidence = hash.key?('confidence') ? hash['confidence'] : SKIP dependencies = hash.key?('dependencies') ? hash['dependencies'] : SKIP epss_probability = hash.key?('epss_probability') ? hash['epss_probability'] : SKIP exposures = hash.key?('exposures') ? hash['exposures'] : SKIP include_historical = hash.key?('include_historical') ? hash['include_historical'] : SKIP issue_ids = hash.key?('issue_ids') ? hash['issue_ids'] : SKIP limit = hash['limit'] ||= 3000 new_note = hash.key?('new_note') ? hash['new_note'] : SKIP new_triage_reason = hash.key?('new_triage_reason') ? hash['new_triage_reason'] : SKIP new_triage_state = hash.key?('new_triage_state') ? hash['new_triage_state'] : SKIP policies = hash.key?('policies') ? hash['policies'] : SKIP policy_mode = hash.key?('policy_mode') ? hash['policy_mode'] : SKIP pro_only = hash.key?('pro_only') ? hash['pro_only'] : SKIP = hash.key?('project_tags') ? hash['project_tags'] : SKIP ref = hash.key?('ref') ? hash['ref'] : SKIP repos = hash.key?('repos') ? hash['repos'] : SKIP repository_visibility = hash.key?('repository_visibility') ? hash['repository_visibility'] : SKIP rules = hash.key?('rules') ? hash['rules'] : SKIP ruleset = hash.key?('ruleset') ? hash['ruleset'] : SKIP secret_types = hash.key?('secret_types') ? hash['secret_types'] : SKIP severities = hash.key?('severities') ? hash['severities'] : SKIP since = hash.key?('since') ? hash['since'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP transitivities = hash.key?('transitivities') ? hash['transitivities'] : SKIP triage_reasons = hash.key?('triage_reasons') ? hash['triage_reasons'] : SKIP validation_state = hash.key?('validation_state') ? hash['validation_state'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. BulkTriageRequest.new(issue_type: issue_type, autotriage_verdict: autotriage_verdict, categories: categories, component_tags: , confidence: confidence, dependencies: dependencies, epss_probability: epss_probability, exposures: exposures, include_historical: include_historical, issue_ids: issue_ids, limit: limit, new_note: new_note, new_triage_reason: new_triage_reason, new_triage_state: new_triage_state, policies: policies, policy_mode: policy_mode, pro_only: pro_only, project_tags: , ref: ref, repos: repos, repository_visibility: repository_visibility, rules: rules, ruleset: ruleset, secret_types: secret_types, severities: severities, since: since, status: status, transitivities: transitivities, triage_reasons: triage_reasons, validation_state: validation_state, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 146 def self.names @_hash = {} if @_hash.nil? @_hash['autotriage_verdict'] = 'autotriage_verdict' @_hash['categories'] = 'categories' @_hash['component_tags'] = 'component_tags' @_hash['confidence'] = 'confidence' @_hash['dependencies'] = 'dependencies' @_hash['epss_probability'] = 'epss_probability' @_hash['exposures'] = 'exposures' @_hash['include_historical'] = 'include_historical' @_hash['issue_ids'] = 'issue_ids' @_hash['issue_type'] = 'issue_type' @_hash['limit'] = 'limit' @_hash['new_note'] = 'new_note' @_hash['new_triage_reason'] = 'new_triage_reason' @_hash['new_triage_state'] = 'new_triage_state' @_hash['policies'] = 'policies' @_hash['policy_mode'] = 'policy_mode' @_hash['pro_only'] = 'pro_only' @_hash['project_tags'] = 'project_tags' @_hash['ref'] = 'ref' @_hash['repos'] = 'repos' @_hash['repository_visibility'] = 'repository_visibility' @_hash['rules'] = 'rules' @_hash['ruleset'] = 'ruleset' @_hash['secret_types'] = 'secret_types' @_hash['severities'] = 'severities' @_hash['since'] = 'since' @_hash['status'] = 'status' @_hash['transitivities'] = 'transitivities' @_hash['triage_reasons'] = 'triage_reasons' @_hash['validation_state'] = 'validation_state' @_hash end |
.nullables ⇒ Object
An array for nullable fields
217 218 219 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 217 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 182 def self.optionals %w[ autotriage_verdict categories component_tags confidence dependencies epss_probability exposures include_historical issue_ids limit new_note new_triage_reason new_triage_state policies policy_mode pro_only project_tags ref repos repository_visibility rules ruleset secret_types severities since status transitivities triage_reasons validation_state ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 373 def inspect class_name = self.class.name.split('::').last "<#{class_name} autotriage_verdict: #{@autotriage_verdict.inspect}, categories:"\ " #{@categories.inspect}, component_tags: #{@component_tags.inspect}, confidence:"\ " #{@confidence.inspect}, dependencies: #{@dependencies.inspect}, epss_probability:"\ " #{@epss_probability.inspect}, exposures: #{@exposures.inspect}, include_historical:"\ " #{@include_historical.inspect}, issue_ids: #{@issue_ids.inspect}, issue_type:"\ " #{@issue_type.inspect}, limit: #{@limit.inspect}, new_note: #{@new_note.inspect},"\ " new_triage_reason: #{@new_triage_reason.inspect}, new_triage_state:"\ " #{@new_triage_state.inspect}, policies: #{@policies.inspect}, policy_mode:"\ " #{@policy_mode.inspect}, pro_only: #{@pro_only.inspect}, project_tags:"\ " #{@project_tags.inspect}, ref: #{@ref.inspect}, repos: #{@repos.inspect},"\ " repository_visibility: #{@repository_visibility.inspect}, rules: #{@rules.inspect},"\ " ruleset: #{@ruleset.inspect}, secret_types: #{@secret_types.inspect}, severities:"\ " #{@severities.inspect}, since: #{@since.inspect}, status: #{@status.inspect},"\ " transitivities: #{@transitivities.inspect}, triage_reasons: #{@triage_reasons.inspect},"\ " validation_state: #{@validation_state.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
# File 'lib/semgrep_web_app/models/bulk_triage_request.rb', line 356 def to_s class_name = self.class.name.split('::').last "<#{class_name} autotriage_verdict: #{@autotriage_verdict}, categories: #{@categories},"\ " component_tags: #{@component_tags}, confidence: #{@confidence}, dependencies:"\ " #{@dependencies}, epss_probability: #{@epss_probability}, exposures: #{@exposures},"\ " include_historical: #{@include_historical}, issue_ids: #{@issue_ids}, issue_type:"\ " #{@issue_type}, limit: #{@limit}, new_note: #{@new_note}, new_triage_reason:"\ " #{@new_triage_reason}, new_triage_state: #{@new_triage_state}, policies: #{@policies},"\ " policy_mode: #{@policy_mode}, pro_only: #{@pro_only}, project_tags: #{@project_tags}, ref:"\ " #{@ref}, repos: #{@repos}, repository_visibility: #{@repository_visibility}, rules:"\ " #{@rules}, ruleset: #{@ruleset}, secret_types: #{@secret_types}, severities:"\ " #{@severities}, since: #{@since}, status: #{@status}, transitivities: #{@transitivities},"\ " triage_reasons: #{@triage_reasons}, validation_state: #{@validation_state},"\ " additional_properties: #{@additional_properties}>" end |