One gRPC service per domain in state.v1 (tasks, executions, accounts, identities, packages, captures, bindings, access, orgs, alerts and so on), each with its own server type in staterpc. RPC and message names and numbers are unchanged.
73 lines
2.7 KiB
Protocol Buffer
73 lines
2.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package state.v1;
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
service CaptureService {
|
|
// Capture refusals: events the network rules refused at the receiver,
|
|
// counted per source. Administrative.
|
|
rpc RecordCaptureRefusal(RecordCaptureRefusalRequest) returns (RecordCaptureRefusalResponse);
|
|
rpc ListCaptureRefusals(ListCaptureRefusalsRequest) returns (ListCaptureRefusalsResponse);
|
|
rpc InsertCapture(InsertCaptureRequest) returns (InsertCaptureResponse);
|
|
// StreamCaptures returns one capture per message: a batch of large capture
|
|
// bodies can exceed gRPC's 4MiB unary message cap
|
|
// (docs/prds/state-store-contract.md).
|
|
rpc StreamCaptures(StreamCapturesRequest) returns (stream StreamCapturesResponse);
|
|
rpc StreamUndispatchedCaptures(StreamUndispatchedCapturesRequest) returns (stream StreamUndispatchedCapturesResponse);
|
|
}
|
|
|
|
// CapturedEvent mirrors storecontract.CapturedEvent.
|
|
message CapturedEvent {
|
|
string id = 1;
|
|
google.protobuf.Timestamp received_at = 2;
|
|
string source = 3;
|
|
string remote_addr = 4;
|
|
string content_type = 5;
|
|
string headers = 6;
|
|
string body = 7;
|
|
bool authenticated = 8;
|
|
// event_type is the ID of the event type the capture was identified as on
|
|
// arrival; empty is unidentified.
|
|
string event_type = 9;
|
|
// unsigned marks an event taken on an approved unsigned source.
|
|
bool unsigned = 10;
|
|
// delivery names the sender's delivery; a retry of one delivery shares it.
|
|
// Intake sets it from the source's delivery header; empty takes the
|
|
// capture ID.
|
|
string delivery = 11;
|
|
}
|
|
message RecordCaptureRefusalRequest {
|
|
string source = 1;
|
|
string addr = 2;
|
|
google.protobuf.Timestamp refused_at = 3;
|
|
}
|
|
message RecordCaptureRefusalResponse {}
|
|
message ListCaptureRefusalsRequest { google.protobuf.Timestamp since = 1; }
|
|
message CaptureRefusals {
|
|
string source = 1;
|
|
int64 refused = 2;
|
|
int64 accepted = 3;
|
|
repeated string addrs = 4;
|
|
}
|
|
message ListCaptureRefusalsResponse { repeated CaptureRefusals sources = 1; }
|
|
message InsertCaptureRequest {
|
|
CapturedEvent capture = 1;
|
|
int64 retention_seconds = 2;
|
|
int64 max_events = 3;
|
|
}
|
|
message InsertCaptureResponse { string id = 1; }
|
|
message StreamCapturesRequest { int64 limit = 1; }
|
|
// Streamed one capture per message; see StreamCaptures above.
|
|
message StreamCapturesResponse { CapturedEvent capture = 1; }
|
|
message StreamUndispatchedCapturesRequest {
|
|
reserved 1;
|
|
reserved "sources";
|
|
// Bindings are the ids of the armed bindings, on enabled workflows, the
|
|
// captures are listed for.
|
|
repeated string bindings = 3;
|
|
int64 limit = 2;
|
|
}
|
|
// Streamed one capture per message; see StreamUndispatchedCaptures above.
|
|
message StreamUndispatchedCapturesResponse { CapturedEvent capture = 1; }
|