Skip to content

Commit 902e4ab

Browse files
committed
[PRODCRE-792] Per-method onchain config for capabilities V2
1 parent 75577eb commit 902e4ab

3 files changed

Lines changed: 52 additions & 6 deletions

File tree

pkg/capabilities/capabilities.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,12 @@ type RemoteExecutableConfig struct {
493493
RequestHashExcludedAttributes []string
494494
RegistrationRefresh time.Duration
495495
RegistrationExpiry time.Duration
496+
497+
Schedule string
498+
DeltaStage time.Duration
499+
RequestTimeout time.Duration
500+
ServerMaxParallelRequests int
501+
RequestHasherType string
496502
}
497503

498504
// NOTE: consider splitting this config into values stored in Registry (KS-118)
@@ -541,4 +547,12 @@ type CapabilityConfiguration struct {
541547
RemoteTriggerConfig *RemoteTriggerConfig
542548
RemoteTargetConfig *RemoteTargetConfig
543549
RemoteExecutableConfig *RemoteExecutableConfig
550+
551+
// v2 / "NoDAG" capabilities
552+
CapabilityMethodConfig map[string]CapabilityMethodConfig
553+
}
554+
555+
type CapabilityMethodConfig struct {
556+
RemoteTriggerConfig *RemoteTriggerConfig
557+
RemoteExecutableConfig *RemoteExecutableConfig
544558
}

pkg/capabilities/pb/capabilities.pb.go

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/capabilities/pb/registry.proto

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,48 @@ message RemoteTriggerConfig {
1616
google.protobuf.Duration batchCollectionPeriod = 6;
1717
}
1818

19+
// deprecated - v1 only
1920
message RemoteTargetConfig {
2021
// A collection of dot seperated paths to attributes that should be excluded from the request sent to the remote target
2122
// when calculating the hash of the request. This is useful for excluding attributes that are not deterministic to ensure
2223
// that the hash of logically identical requests is consistent.
2324
repeated string requestHashExcludedAttributes = 1;
2425
}
2526

27+
enum TransmissionSchedule {
28+
AllAtOnce = 0;
29+
OneAtATime = 1;
30+
}
31+
32+
enum RequestHasherType {
33+
Simple = 0;
34+
WriteReportExcludeSignatures = 1;
35+
}
36+
2637
message RemoteExecutableConfig {
2738
// A collection of dot seperated paths to attributes that should be excluded from the request sent to the remote executable capability
2839
// when calculating the hash of the request. This is useful for excluding attributes that are not deterministic to ensure
2940
// that the hash of logically identical requests is consistent.
30-
repeated string requestHashExcludedAttributes = 1;
31-
google.protobuf.Duration registrationRefresh = 2;
32-
google.protobuf.Duration registrationExpiry = 3;
41+
repeated string requestHashExcludedAttributes = 1; // deprecated - v1 only
42+
google.protobuf.Duration registrationRefresh = 2; // unused
43+
google.protobuf.Duration registrationExpiry = 3; // unused
44+
45+
TransmissionSchedule transmission_schedule = 4;
46+
google.protobuf.Duration delta_stage = 5;
47+
google.protobuf.Duration request_timeout = 6;
48+
RequestHasherType request_hasher_type = 7;
49+
}
50+
51+
message AggregatorConfig {
52+
enum AggregatorType aggregator_type = 1;
53+
}
54+
55+
message CapabilityMethodConfig {
56+
oneof remote_config {
57+
RemoteTriggerConfig remote_trigger_config = 1;
58+
RemoteExecutableConfig remote_transmission_config = 2;
59+
}
60+
AggregatorConfig aggregator_config = 3;
3361
}
3462

3563
message CapabilityConfig {
@@ -43,5 +71,8 @@ message CapabilityConfig {
4371

4472
values.v1.Map restricted_config = 5;
4573
repeated string restricted_keys = 6;
74+
75+
// v2 ("NoDAG") capabilities
76+
map<string, CapabilityMethodConfig> method_configs = 7;
4677
}
4778

0 commit comments

Comments
 (0)