Class: Gitlab::SecretDetection::GRPC::ScannerService
- Inherits:
-
Gitlab::SecretDetection::GRPC::Scanner::Service
- Object
- Gitlab::SecretDetection::GRPC::Scanner::Service
- Gitlab::SecretDetection::GRPC::ScannerService
- Includes:
- IntegratedErrorTracking, SDLogger
- Defined in:
- lib/gitlab/secret_detection/grpc/scanner_service.rb
Constant Summary collapse
- MAX_ALLOWED_TIMEOUT_SECONDS =
Maximum timeout value that can be given as the input. This guards against the misuse of timeouts.
600- ERROR_MESSAGES =
{ invalid_payload_fields: "Payload should not contain empty `id` and `data` fields", exclusion_empty_value: "Exclusion value cannot be empty", exclusion_invalid_type: "Invalid exclusion type", invalid_timeout_range: "Timeout value should be > 0 and <= #{MAX_ALLOWED_TIMEOUT_SECONDS} seconds" }.freeze
Instance Method Summary collapse
-
#scan(request, call) ⇒ Object
Implementation for /Scan RPC method.
-
#scan_stream(requests, call) ⇒ Object
Implementation for /ScanStream RPC method.
Methods included from IntegratedErrorTracking
#can_setup_sentry?, #ruleset_version, #setup, #track_exception
Instance Method Details
#scan(request, call) ⇒ Object
Implementation for /Scan RPC method
49 50 51 |
# File 'lib/gitlab/secret_detection/grpc/scanner_service.rb', line 49 def scan(request, call) scan_request_action(request, call) end |
#scan_stream(requests, call) ⇒ Object
Implementation for /ScanStream RPC method
54 55 56 57 |
# File 'lib/gitlab/secret_detection/grpc/scanner_service.rb', line 54 def scan_stream(requests, call) request_action = ->(r) { scan_request_action(r, call) } StreamEnumerator.new(requests, request_action).each_item end |