Add GRPC timeout capability and rspec integration
This MR does multiple things within gRPC:
- Adds per-scan and per-payload timeout capability in the Service Definition file (and reflected in generated files).
- Introduces allowable timeout value(
MAX_ALLOWED_TIMEOUT_SECONDS
) to guard against misusal of triggering long-running requests. Currently, the value is set to600
seconds. - This MR reduces the existing timeout values for the overall scan and each payload to
3min
(prev10min
) and30sec
(prev8.3m
?) respectively, as the previous values aren't reasonable for network-based requests (We can discuss the newly defined numbers if they're not convincing) - Adds request validation for RPC endpoints:
- Scan and Blob timeout value range check
- Non-empty value check on payload's
id
anddata
field - Non-empty value check on allowlist's entry value
- Adds rspec tests for
#scan
and#scan_stream
endpoints covering use cases for RPC requests and their equivalent responses.
Relevant Issue Numbers
Edited by Vishwa Bhat