Commit 4b416af3 authored by Derek Schaller's avatar Derek Schaller
Browse files

Merge branch 'main' into renovate/hookform-resolvers-2.x

parents 03c759c8 8afb56e0
Showing with 2453 additions and 843 deletions
+2453 -843
......@@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.0
go-version: 1.17.0
- name: Set up Node
uses: actions/setup-node@v2
with:
......@@ -36,6 +36,6 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.0
go-version: 1.17.0
- name: lint
run: make api-lint
......@@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.0
go-version: 1.17.0
- name: go mod cache
uses: actions/cache@v2
with:
......@@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.0
go-version: 1.17.0
- name: go mod cache
uses: actions/cache@v2
with:
......@@ -74,7 +74,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.0
go-version: 1.17.0
- name: go mod cache
uses: actions/cache@v2
with:
......
......@@ -81,7 +81,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.0
go-version: 1.17.0
- uses: actions/setup-node@v2
with:
node-version: '14.x'
......
......@@ -18,7 +18,7 @@ jobs:
path: ${{ env.PACKAGEPATH }}
- uses: actions/setup-go@v2
with:
go-version: 1.16.0
go-version: 1.17.0
- uses: actions/setup-node@v2
with:
node-version: '14.x'
......
......@@ -7,7 +7,7 @@ COPY Makefile .
RUN make frontend
# Backend build.
FROM golang:1.16-buster as gobuild
FROM golang:1.17-buster as gobuild
WORKDIR /go/src/github.com/lyft/clutch
COPY ./backend ./backend
COPY Makefile .
......
......@@ -35,6 +35,20 @@ service DDBAPI {
}
}
// https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TableDescription.html
enum Status {
// Unspecified status indicates the table status could not be found.
UNSPECIFIED = 0;
UNKNOWN = 1;
CREATING = 2;
UPDATING = 3;
DELETING = 4;
ACTIVE = 5;
INACCESSIBLE_ENCRYPTION_CREDENTIALS = 6;
ARCHIVING = 7;
ARCHIVED = 8;
}
message Table {
option (clutch.api.v1.id).patterns = {
type_url : "clutch.aws.dynamodb.v1.Table",
......@@ -45,6 +59,7 @@ message Table {
string region = 2;
repeated GlobalSecondaryIndex global_secondary_indexes = 3;
ProvisionedThroughput provisioned_throughput = 4;
Status status = 5;
}
message GlobalSecondaryIndex {
......@@ -76,6 +91,8 @@ message UpdateTableCapacityRequest {
}
message UpdateTableCapacityResponse {
string table_name = 1;
Status table_status = 2;
}
message UpdateGSICapacityRequest {
......@@ -87,4 +104,7 @@ message UpdateGSICapacityRequest {
}
message UpdateGSICapacityResponse {
string table_name = 1;
string index_name = 2;
Status table_status = 3;
}
......@@ -9,9 +9,26 @@ import "validate/validate.proto";
message Config {
repeated string regions = 1 [ (validate.rules).repeated = {min_items : 1} ];
ClientConfig client_config = 2;
DynamodbConfig dynamodb_config = 3;
}
message ClientConfig {
// If not set explicity, retries default to 0
int32 retries = 1 [ (validate.rules).int32.gte = 0 ];
}
message DynamodbConfig {
ScalingLimits scaling_limits = 1;
}
message ScalingLimits {
// defaults to AWS quotas if not set
// AWS max read: 40000
// AWS max write: 40000
int64 max_read_capacity_units = 1 [ (validate.rules).int64 = {ignore_empty : true, gte : 1} ];
int64 max_write_capacity_units = 2 [ (validate.rules).int64 = {ignore_empty : true, gte : 1} ];
// defaults to a scale factor of 2.0x
float max_scale_factor = 3;
// enables whether the service can override safety limits. Defaults to false
bool enable_override = 4;
}
\ No newline at end of file
......@@ -6,10 +6,24 @@ option go_package = "github.com/lyft/clutch/backend/api/config/service/github/v1
import "validate/validate.proto";
message AppConfig {
int64 app_id = 1 [ (validate.rules).int64.gte = 1 ];
int64 installation_id = 2 [ (validate.rules).int64.gte = 1 ];
oneof pem {
option (validate.required) = true;
// a private encryption key from a pem file
string key_pem = 3 [ (validate.rules).string = {min_bytes : 1} ];
// a base64 encoded private encryption key from a pem file
string base64_pem = 4 [ (validate.rules).string = {min_bytes : 1} ];
}
}
message Config {
oneof auth {
option (validate.required) = true;
string access_token = 1 [ (validate.rules).string = {min_bytes : 1} ];
AppConfig app_config = 2;
}
}
......@@ -17,6 +17,7 @@ message Project {
// Allows an organization to populate any information they see fit that does not fit our schema
map<string, google.protobuf.Value> data = 5;
ProjectDependencies dependencies = 6;
OnCall oncall = 7;
}
// Dependencies could be either upstream or downstream of this project.
......@@ -29,3 +30,16 @@ message ProjectDependencies {
message Dependency {
repeated string ids = 1;
}
// Oncall information that could come from several sources for a project
// From active alerts from source like pagerduty, to who is currently on call.
message OnCall {
PagerDuty pagerduty = 1;
}
// PagerDuty specific information for a project
message PagerDuty {
// A project may have more than one PagerDuty service id
// https://developer.pagerduty.com/api-reference/docs/CONCEPTS.md#services
repeated string service_ids = 1;
}
......@@ -227,6 +227,14 @@ service K8sAPI {
};
option (clutch.api.v1.action).type = READ;
}
rpc ListEvents(ListEventsRequest) returns (ListEventsResponse) {
option (google.api.http) = {
post : "/v1/k8s/listEvents"
body : "*"
};
option (clutch.api.v1.action).type = READ;
}
}
message DescribePodRequest {
......@@ -1055,6 +1063,54 @@ message DescribeNamespaceResponse {
Namespace namespace = 1 [ (clutch.api.v1.log) = false ];
}
// ObjectKind represent a persistent entity in the system
// For now we only support the kind Pod, we can expand on this
// list as we add support for different kinds.
enum ObjectKind {
UNSPECIFIED = 0;
UNKNOWN = 1;
POD = 2;
}
// this represents a Kubernetes event: https://pkg.go.dev/k8s.io/api/core/v1#Event
// for a given object
message Event {
string name = 1;
string reason = 2;
string description = 3;
// these values represent info of the object
// this event is about
string cluster = 4;
string namespace = 5;
// name of the object i.e pod name, deployment name, etc
string involved_object_name = 6;
// kind of the object e.g pod, deployment, service, etc
ObjectKind kind = 7;
}
message ListEventsRequest {
option (clutch.api.v1.id).patterns = {
type_url : "clutch.k8s.v1.Namespace",
// requests for all events associated with a given object
pattern : "{cluster}/{namespace}/{object_name}"
};
string clientset = 1 [ (validate.rules).string = {min_bytes : 1} ];
string cluster = 2 [ (validate.rules).string = {min_bytes : 1} ];
string namespace = 3 [ (validate.rules).string = {min_bytes : 1} ];
// name of the object i.e pod name, deployment name, etc
string object_name = 4 [ (validate.rules).string = {min_bytes : 1} ];
// kind of the object e.g pod, deployment, service, etc
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds
ObjectKind kind = 5 [ (validate.rules).enum = {defined_only : true} ];
}
message ListEventsResponse {
option (clutch.api.v1.reference).fields = "events";
repeated Event events = 1 [ (clutch.api.v1.log) = false ];
}
// This message type is used to add support for nullable strings and is an
// alternative to the well-known `StringValue` type. We need it, because the
// grpc-gateway used by Clutch deserializes a null `StringValue` as an empty
......
syntax = "proto3";
package clutch.timeseries.v1;
option go_package = "github.com/lyft/clutch/backend/api/timeseries/v1;timeseriesv1";
import "google/protobuf/any.proto";
import "validate/validate.proto";
message TimeRange {
int64 start_millis = 1 [ (validate.rules).int64.gt = 0 ];
int64 end_millis = 2 [ (validate.rules).int64.gt = 0 ];
}
// A timeseries Point message is useful for organizing events
// to be displayed in a timeline view. Users can transform data
// into a timeseries format and be able to organize them.
message Point {
oneof timestamp {
option (validate.required) = true;
TimeRange range = 1;
int64 millis = 2;
}
google.protobuf.Any pb = 3;
string description = 4;
}
This diff is collapsed.
......@@ -69,6 +69,8 @@ func (m *Table) Validate() error {
}
}
// no validation rules for Status
return nil
}
......@@ -527,6 +529,10 @@ func (m *UpdateTableCapacityResponse) Validate() error {
return nil
}
// no validation rules for TableName
// no validation rules for TableStatus
return nil
}
......@@ -687,6 +693,12 @@ func (m *UpdateGSICapacityResponse) Validate() error {
return nil
}
// no validation rules for TableName
// no validation rules for IndexName
// no validation rules for TableStatus
return nil
}
......
......@@ -26,8 +26,9 @@ type Config struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Regions []string `protobuf:"bytes,1,rep,name=regions,proto3" json:"regions,omitempty"`
ClientConfig *ClientConfig `protobuf:"bytes,2,opt,name=client_config,json=clientConfig,proto3" json:"client_config,omitempty"`
Regions []string `protobuf:"bytes,1,rep,name=regions,proto3" json:"regions,omitempty"`
ClientConfig *ClientConfig `protobuf:"bytes,2,opt,name=client_config,json=clientConfig,proto3" json:"client_config,omitempty"`
DynamodbConfig *DynamodbConfig `protobuf:"bytes,3,opt,name=dynamodb_config,json=dynamodbConfig,proto3" json:"dynamodb_config,omitempty"`
}
func (x *Config) Reset() {
......@@ -76,6 +77,13 @@ func (x *Config) GetClientConfig() *ClientConfig {
return nil
}
func (x *Config) GetDynamodbConfig() *DynamodbConfig {
if x != nil {
return x.DynamodbConfig
}
return nil
}
type ClientConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
......@@ -124,6 +132,129 @@ func (x *ClientConfig) GetRetries() int32 {
return 0
}
type DynamodbConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ScalingLimits *ScalingLimits `protobuf:"bytes,1,opt,name=scaling_limits,json=scalingLimits,proto3" json:"scaling_limits,omitempty"`
}
func (x *DynamodbConfig) Reset() {
*x = DynamodbConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_config_service_aws_v1_aws_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DynamodbConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DynamodbConfig) ProtoMessage() {}
func (x *DynamodbConfig) ProtoReflect() protoreflect.Message {
mi := &file_config_service_aws_v1_aws_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DynamodbConfig.ProtoReflect.Descriptor instead.
func (*DynamodbConfig) Descriptor() ([]byte, []int) {
return file_config_service_aws_v1_aws_proto_rawDescGZIP(), []int{2}
}
func (x *DynamodbConfig) GetScalingLimits() *ScalingLimits {
if x != nil {
return x.ScalingLimits
}
return nil
}
type ScalingLimits struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// defaults to AWS quotas if not set
// AWS max read: 40000
// AWS max write: 40000
MaxReadCapacityUnits int64 `protobuf:"varint,1,opt,name=max_read_capacity_units,json=maxReadCapacityUnits,proto3" json:"max_read_capacity_units,omitempty"`
MaxWriteCapacityUnits int64 `protobuf:"varint,2,opt,name=max_write_capacity_units,json=maxWriteCapacityUnits,proto3" json:"max_write_capacity_units,omitempty"`
// defaults to a scale factor of 2.0x
MaxScaleFactor float32 `protobuf:"fixed32,3,opt,name=max_scale_factor,json=maxScaleFactor,proto3" json:"max_scale_factor,omitempty"`
// enables whether the service can override safety limits. Defaults to false
EnableOverride bool `protobuf:"varint,4,opt,name=enable_override,json=enableOverride,proto3" json:"enable_override,omitempty"`
}
func (x *ScalingLimits) Reset() {
*x = ScalingLimits{}
if protoimpl.UnsafeEnabled {
mi := &file_config_service_aws_v1_aws_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ScalingLimits) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ScalingLimits) ProtoMessage() {}
func (x *ScalingLimits) ProtoReflect() protoreflect.Message {
mi := &file_config_service_aws_v1_aws_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ScalingLimits.ProtoReflect.Descriptor instead.
func (*ScalingLimits) Descriptor() ([]byte, []int) {
return file_config_service_aws_v1_aws_proto_rawDescGZIP(), []int{3}
}
func (x *ScalingLimits) GetMaxReadCapacityUnits() int64 {
if x != nil {
return x.MaxReadCapacityUnits
}
return 0
}
func (x *ScalingLimits) GetMaxWriteCapacityUnits() int64 {
if x != nil {
return x.MaxWriteCapacityUnits
}
return 0
}
func (x *ScalingLimits) GetMaxScaleFactor() float32 {
if x != nil {
return x.MaxScaleFactor
}
return 0
}
func (x *ScalingLimits) GetEnableOverride() bool {
if x != nil {
return x.EnableOverride
}
return false
}
var File_config_service_aws_v1_aws_proto protoreflect.FileDescriptor
var file_config_service_aws_v1_aws_proto_rawDesc = []byte{
......@@ -132,23 +263,49 @@ var file_config_service_aws_v1_aws_proto_rawDesc = []byte{
0x6f, 0x12, 0x1c, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x76, 0x31, 0x1a,
0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7d, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x07, 0x72,
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4f, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e,
0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x69,
0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x31, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, 0x0a, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69,
0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28,
0x00, 0x52, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x79, 0x66, 0x74, 0x2f, 0x63, 0x6c,
0x75, 0x74, 0x63, 0x68, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f,
0x61, 0x77, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x77, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd4, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x07,
0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4f, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a,
0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c,
0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x55, 0x0a, 0x0f, 0x64, 0x79, 0x6e, 0x61,
0x6d, 0x6f, 0x64, 0x62, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x76, 0x31,
0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x6f, 0x64, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52,
0x0e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x6f, 0x64, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22,
0x31, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
0x21, 0x0a, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x00, 0x52, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69,
0x65, 0x73, 0x22, 0x64, 0x0a, 0x0e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x6f, 0x64, 0x62, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x12, 0x52, 0x0a, 0x0e, 0x73, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x5f,
0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63,
0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x77, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x61, 0x6c,
0x69, 0x6e, 0x67, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x0d, 0x73, 0x63, 0x61, 0x6c, 0x69,
0x6e, 0x67, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0xe8, 0x01, 0x0a, 0x0d, 0x53, 0x63, 0x61,
0x6c, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x17, 0x6d, 0x61,
0x78, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x5f,
0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x09, 0xfa, 0x42, 0x06,
0x22, 0x04, 0x28, 0x01, 0x40, 0x01, 0x52, 0x14, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x61, 0x64, 0x43,
0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x18,
0x6d, 0x61, 0x78, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69,
0x74, 0x79, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x09,
0xfa, 0x42, 0x06, 0x22, 0x04, 0x28, 0x01, 0x40, 0x01, 0x52, 0x15, 0x6d, 0x61, 0x78, 0x57, 0x72,
0x69, 0x74, 0x65, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x55, 0x6e, 0x69, 0x74, 0x73,
0x12, 0x28, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x5f, 0x66, 0x61,
0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x53,
0x63, 0x61, 0x6c, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e,
0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72,
0x69, 0x64, 0x65, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x6c, 0x79, 0x66, 0x74, 0x2f, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2f, 0x62, 0x61,
0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x77, 0x73, 0x2f, 0x76, 0x31, 0x3b,
0x61, 0x77, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
......@@ -163,18 +320,22 @@ func file_config_service_aws_v1_aws_proto_rawDescGZIP() []byte {
return file_config_service_aws_v1_aws_proto_rawDescData
}
var file_config_service_aws_v1_aws_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_config_service_aws_v1_aws_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_config_service_aws_v1_aws_proto_goTypes = []interface{}{
(*Config)(nil), // 0: clutch.config.service.aws.v1.Config
(*ClientConfig)(nil), // 1: clutch.config.service.aws.v1.ClientConfig
(*Config)(nil), // 0: clutch.config.service.aws.v1.Config
(*ClientConfig)(nil), // 1: clutch.config.service.aws.v1.ClientConfig
(*DynamodbConfig)(nil), // 2: clutch.config.service.aws.v1.DynamodbConfig
(*ScalingLimits)(nil), // 3: clutch.config.service.aws.v1.ScalingLimits
}
var file_config_service_aws_v1_aws_proto_depIdxs = []int32{
1, // 0: clutch.config.service.aws.v1.Config.client_config:type_name -> clutch.config.service.aws.v1.ClientConfig
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
2, // 1: clutch.config.service.aws.v1.Config.dynamodb_config:type_name -> clutch.config.service.aws.v1.DynamodbConfig
3, // 2: clutch.config.service.aws.v1.DynamodbConfig.scaling_limits:type_name -> clutch.config.service.aws.v1.ScalingLimits
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_config_service_aws_v1_aws_proto_init() }
......@@ -207,6 +368,30 @@ func file_config_service_aws_v1_aws_proto_init() {
return nil
}
}
file_config_service_aws_v1_aws_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DynamodbConfig); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_config_service_aws_v1_aws_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ScalingLimits); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
......@@ -214,7 +399,7 @@ func file_config_service_aws_v1_aws_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_config_service_aws_v1_aws_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
......
......@@ -57,6 +57,16 @@ func (m *Config) Validate() error {
}
}
if v, ok := interface{}(m.GetDynamodbConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ConfigValidationError{
field: "DynamodbConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
......@@ -185,3 +195,169 @@ var _ interface {
Cause() error
ErrorName() string
} = ClientConfigValidationError{}
// Validate checks the field values on DynamodbConfig with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *DynamodbConfig) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetScalingLimits()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DynamodbConfigValidationError{
field: "ScalingLimits",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// DynamodbConfigValidationError is the validation error returned by
// DynamodbConfig.Validate if the designated constraints aren't met.
type DynamodbConfigValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DynamodbConfigValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DynamodbConfigValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DynamodbConfigValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DynamodbConfigValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DynamodbConfigValidationError) ErrorName() string { return "DynamodbConfigValidationError" }
// Error satisfies the builtin error interface
func (e DynamodbConfigValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sDynamodbConfig.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DynamodbConfigValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DynamodbConfigValidationError{}
// Validate checks the field values on ScalingLimits with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *ScalingLimits) Validate() error {
if m == nil {
return nil
}
if m.GetMaxReadCapacityUnits() != 0 {
if m.GetMaxReadCapacityUnits() < 1 {
return ScalingLimitsValidationError{
field: "MaxReadCapacityUnits",
reason: "value must be greater than or equal to 1",
}
}
}
if m.GetMaxWriteCapacityUnits() != 0 {
if m.GetMaxWriteCapacityUnits() < 1 {
return ScalingLimitsValidationError{
field: "MaxWriteCapacityUnits",
reason: "value must be greater than or equal to 1",
}
}
}
// no validation rules for MaxScaleFactor
// no validation rules for EnableOverride
return nil
}
// ScalingLimitsValidationError is the validation error returned by
// ScalingLimits.Validate if the designated constraints aren't met.
type ScalingLimitsValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ScalingLimitsValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ScalingLimitsValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ScalingLimitsValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ScalingLimitsValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ScalingLimitsValidationError) ErrorName() string { return "ScalingLimitsValidationError" }
// Error satisfies the builtin error interface
func (e ScalingLimitsValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sScalingLimits.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ScalingLimitsValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ScalingLimitsValidationError{}
......@@ -21,6 +21,104 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type AppConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AppId int64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"`
InstallationId int64 `protobuf:"varint,2,opt,name=installation_id,json=installationId,proto3" json:"installation_id,omitempty"`
// Types that are assignable to Pem:
// *AppConfig_KeyPem
// *AppConfig_Base64Pem
Pem isAppConfig_Pem `protobuf_oneof:"pem"`
}
func (x *AppConfig) Reset() {
*x = AppConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_config_service_github_v1_github_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AppConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AppConfig) ProtoMessage() {}
func (x *AppConfig) ProtoReflect() protoreflect.Message {
mi := &file_config_service_github_v1_github_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AppConfig.ProtoReflect.Descriptor instead.
func (*AppConfig) Descriptor() ([]byte, []int) {
return file_config_service_github_v1_github_proto_rawDescGZIP(), []int{0}
}
func (x *AppConfig) GetAppId() int64 {
if x != nil {
return x.AppId
}
return 0
}
func (x *AppConfig) GetInstallationId() int64 {
if x != nil {
return x.InstallationId
}
return 0
}
func (m *AppConfig) GetPem() isAppConfig_Pem {
if m != nil {
return m.Pem
}
return nil
}
func (x *AppConfig) GetKeyPem() string {
if x, ok := x.GetPem().(*AppConfig_KeyPem); ok {
return x.KeyPem
}
return ""
}
func (x *AppConfig) GetBase64Pem() string {
if x, ok := x.GetPem().(*AppConfig_Base64Pem); ok {
return x.Base64Pem
}
return ""
}
type isAppConfig_Pem interface {
isAppConfig_Pem()
}
type AppConfig_KeyPem struct {
// a private encryption key from a pem file
KeyPem string `protobuf:"bytes,3,opt,name=key_pem,json=keyPem,proto3,oneof"`
}
type AppConfig_Base64Pem struct {
// a base64 encoded private encryption key from a pem file
Base64Pem string `protobuf:"bytes,4,opt,name=base64_pem,json=base64Pem,proto3,oneof"`
}
func (*AppConfig_KeyPem) isAppConfig_Pem() {}
func (*AppConfig_Base64Pem) isAppConfig_Pem() {}
type Config struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
......@@ -28,13 +126,14 @@ type Config struct {
// Types that are assignable to Auth:
// *Config_AccessToken
// *Config_AppConfig
Auth isConfig_Auth `protobuf_oneof:"auth"`
}
func (x *Config) Reset() {
*x = Config{}
if protoimpl.UnsafeEnabled {
mi := &file_config_service_github_v1_github_proto_msgTypes[0]
mi := &file_config_service_github_v1_github_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -47,7 +146,7 @@ func (x *Config) String() string {
func (*Config) ProtoMessage() {}
func (x *Config) ProtoReflect() protoreflect.Message {
mi := &file_config_service_github_v1_github_proto_msgTypes[0]
mi := &file_config_service_github_v1_github_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -60,7 +159,7 @@ func (x *Config) ProtoReflect() protoreflect.Message {
// Deprecated: Use Config.ProtoReflect.Descriptor instead.
func (*Config) Descriptor() ([]byte, []int) {
return file_config_service_github_v1_github_proto_rawDescGZIP(), []int{0}
return file_config_service_github_v1_github_proto_rawDescGZIP(), []int{1}
}
func (m *Config) GetAuth() isConfig_Auth {
......@@ -77,6 +176,13 @@ func (x *Config) GetAccessToken() string {
return ""
}
func (x *Config) GetAppConfig() *AppConfig {
if x, ok := x.GetAuth().(*Config_AppConfig); ok {
return x.AppConfig
}
return nil
}
type isConfig_Auth interface {
isConfig_Auth()
}
......@@ -85,8 +191,14 @@ type Config_AccessToken struct {
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3,oneof"`
}
type Config_AppConfig struct {
AppConfig *AppConfig `protobuf:"bytes,2,opt,name=app_config,json=appConfig,proto3,oneof"`
}
func (*Config_AccessToken) isConfig_Auth() {}
func (*Config_AppConfig) isConfig_Auth() {}
var File_config_service_github_v1_github_proto protoreflect.FileDescriptor
var file_config_service_github_v1_github_proto_rawDesc = []byte{
......@@ -96,16 +208,32 @@ var file_config_service_github_v1_github_proto_rawDesc = []byte{
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x43, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2c, 0x0a, 0x0c, 0x61,
0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x63,
0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0b, 0x0a, 0x04, 0x61, 0x75, 0x74,
0x68, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x42, 0x46, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x79, 0x66, 0x74, 0x2f, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68,
0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x76, 0x31, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x22, 0xb7, 0x01, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
0x1e, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12,
0x30, 0x0a, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28,
0x01, 0x52, 0x0e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49,
0x64, 0x12, 0x22, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x48, 0x00, 0x52, 0x06, 0x6b,
0x65, 0x79, 0x50, 0x65, 0x6d, 0x12, 0x28, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x36, 0x34, 0x5f,
0x70, 0x65, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02,
0x20, 0x01, 0x48, 0x00, 0x52, 0x09, 0x62, 0x61, 0x73, 0x65, 0x36, 0x34, 0x50, 0x65, 0x6d, 0x42,
0x0a, 0x0a, 0x03, 0x70, 0x65, 0x6d, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x90, 0x01, 0x0a, 0x06,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2c, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73,
0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42,
0x04, 0x72, 0x02, 0x20, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54,
0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x4b, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63,
0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x09, 0x61, 0x70, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x42, 0x0b, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x42, 0x46,
0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x79, 0x66,
0x74, 0x2f, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64,
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
......@@ -120,16 +248,18 @@ func file_config_service_github_v1_github_proto_rawDescGZIP() []byte {
return file_config_service_github_v1_github_proto_rawDescData
}
var file_config_service_github_v1_github_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_config_service_github_v1_github_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_config_service_github_v1_github_proto_goTypes = []interface{}{
(*Config)(nil), // 0: clutch.config.service.github.v1.Config
(*AppConfig)(nil), // 0: clutch.config.service.github.v1.AppConfig
(*Config)(nil), // 1: clutch.config.service.github.v1.Config
}
var file_config_service_github_v1_github_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
0, // 0: clutch.config.service.github.v1.Config.app_config:type_name -> clutch.config.service.github.v1.AppConfig
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_config_service_github_v1_github_proto_init() }
......@@ -139,6 +269,18 @@ func file_config_service_github_v1_github_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_config_service_github_v1_github_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AppConfig); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_config_service_github_v1_github_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Config); i {
case 0:
return &v.state
......@@ -152,7 +294,12 @@ func file_config_service_github_v1_github_proto_init() {
}
}
file_config_service_github_v1_github_proto_msgTypes[0].OneofWrappers = []interface{}{
(*AppConfig_KeyPem)(nil),
(*AppConfig_Base64Pem)(nil),
}
file_config_service_github_v1_github_proto_msgTypes[1].OneofWrappers = []interface{}{
(*Config_AccessToken)(nil),
(*Config_AppConfig)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
......@@ -160,7 +307,7 @@ func file_config_service_github_v1_github_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_config_service_github_v1_github_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
......
......@@ -33,6 +33,112 @@ var (
_ = anypb.Any{}
)
// Validate checks the field values on AppConfig with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *AppConfig) Validate() error {
if m == nil {
return nil
}
if m.GetAppId() < 1 {
return AppConfigValidationError{
field: "AppId",
reason: "value must be greater than or equal to 1",
}
}
if m.GetInstallationId() < 1 {
return AppConfigValidationError{
field: "InstallationId",
reason: "value must be greater than or equal to 1",
}
}
switch m.Pem.(type) {
case *AppConfig_KeyPem:
if len(m.GetKeyPem()) < 1 {
return AppConfigValidationError{
field: "KeyPem",
reason: "value length must be at least 1 bytes",
}
}
case *AppConfig_Base64Pem:
if len(m.GetBase64Pem()) < 1 {
return AppConfigValidationError{
field: "Base64Pem",
reason: "value length must be at least 1 bytes",
}
}
default:
return AppConfigValidationError{
field: "Pem",
reason: "value is required",
}
}
return nil
}
// AppConfigValidationError is the validation error returned by
// AppConfig.Validate if the designated constraints aren't met.
type AppConfigValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AppConfigValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AppConfigValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AppConfigValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AppConfigValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AppConfigValidationError) ErrorName() string { return "AppConfigValidationError" }
// Error satisfies the builtin error interface
func (e AppConfigValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAppConfig.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AppConfigValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AppConfigValidationError{}
// Validate checks the field values on Config with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Config) Validate() error {
......@@ -51,6 +157,18 @@ func (m *Config) Validate() error {
}
}
case *Config_AppConfig:
if v, ok := interface{}(m.GetAppConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ConfigValidationError{
field: "AppConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
return ConfigValidationError{
field: "Auth",
......
......@@ -36,6 +36,7 @@ type Project struct {
// Allows an organization to populate any information they see fit that does not fit our schema
Data map[string]*structpb.Value `protobuf:"bytes,5,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Dependencies *ProjectDependencies `protobuf:"bytes,6,opt,name=dependencies,proto3" json:"dependencies,omitempty"`
Oncall *OnCall `protobuf:"bytes,7,opt,name=oncall,proto3" json:"oncall,omitempty"`
}
func (x *Project) Reset() {
......@@ -112,6 +113,13 @@ func (x *Project) GetDependencies() *ProjectDependencies {
return nil
}
func (x *Project) GetOncall() *OnCall {
if x != nil {
return x.Oncall
}
return nil
}
// Dependencies could be either upstream or downstream of this project.
type ProjectDependencies struct {
state protoimpl.MessageState
......@@ -216,6 +224,105 @@ func (x *Dependency) GetIds() []string {
return nil
}
// Oncall information that could come from several sources for a project
// From active alerts from source like pagerduty, to who is currently on call.
type OnCall struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Pagerduty *PagerDuty `protobuf:"bytes,1,opt,name=pagerduty,proto3" json:"pagerduty,omitempty"`
}
func (x *OnCall) Reset() {
*x = OnCall{}
if protoimpl.UnsafeEnabled {
mi := &file_core_project_v1_project_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OnCall) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OnCall) ProtoMessage() {}
func (x *OnCall) ProtoReflect() protoreflect.Message {
mi := &file_core_project_v1_project_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OnCall.ProtoReflect.Descriptor instead.
func (*OnCall) Descriptor() ([]byte, []int) {
return file_core_project_v1_project_proto_rawDescGZIP(), []int{3}
}
func (x *OnCall) GetPagerduty() *PagerDuty {
if x != nil {
return x.Pagerduty
}
return nil
}
// PagerDuty specific information for a project
type PagerDuty struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// A project may have more than one PagerDuty service id
// https://developer.pagerduty.com/api-reference/docs/CONCEPTS.md#services
ServiceIds []string `protobuf:"bytes,1,rep,name=service_ids,json=serviceIds,proto3" json:"service_ids,omitempty"`
}
func (x *PagerDuty) Reset() {
*x = PagerDuty{}
if protoimpl.UnsafeEnabled {
mi := &file_core_project_v1_project_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PagerDuty) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PagerDuty) ProtoMessage() {}
func (x *PagerDuty) ProtoReflect() protoreflect.Message {
mi := &file_core_project_v1_project_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PagerDuty.ProtoReflect.Descriptor instead.
func (*PagerDuty) Descriptor() ([]byte, []int) {
return file_core_project_v1_project_proto_rawDescGZIP(), []int{4}
}
func (x *PagerDuty) GetServiceIds() []string {
if x != nil {
return x.ServiceIds
}
return nil
}
var File_core_project_v1_project_proto protoreflect.FileDescriptor
var file_core_project_v1_project_proto_rawDesc = []byte{
......@@ -224,7 +331,7 @@ var file_core_project_v1_project_proto_rawDesc = []byte{
0x16, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x6a, 0x65, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8, 0x02, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x03, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x69, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x77, 0x6e,
......@@ -239,44 +346,56 @@ var file_core_project_v1_project_proto_rawDesc = []byte{
0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f,
0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72,
0x6f, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65,
0x73, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x1a,
0x4f, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
0x22, 0x95, 0x03, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x70, 0x65,
0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x09, 0x75, 0x70, 0x73, 0x74,
0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x6c,
0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x70, 0x65,
0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61,
0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61,
0x6d, 0x73, 0x12, 0x5e, 0x0a, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68,
0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x76, 0x31,
0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e,
0x63, 0x69, 0x65, 0x73, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61,
0x6d, 0x73, 0x1a, 0x60, 0x0a, 0x0e, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x45,
0x73, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12,
0x36, 0x0a, 0x06, 0x6f, 0x6e, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x1e, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x52,
0x06, 0x6f, 0x6e, 0x63, 0x61, 0x6c, 0x6c, 0x1a, 0x4f, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63,
0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44,
0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x3a, 0x02, 0x38, 0x01, 0x1a, 0x62, 0x0a, 0x10, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65,
0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x75, 0x74,
0x63, 0x68, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e,
0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x1e, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x65,
0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x42, 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x79, 0x66, 0x74, 0x2f, 0x63, 0x6c, 0x75, 0x74,
0x63, 0x68, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63,
0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x70,
0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x95, 0x03, 0x0a, 0x13, 0x50, 0x72, 0x6f,
0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73,
0x12, 0x58, 0x0a, 0x09, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x72,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f,
0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73,
0x2e, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
0x09, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x5e, 0x0a, 0x0b, 0x64, 0x6f,
0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x3c, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x44, 0x6f, 0x77,
0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x64,
0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0x60, 0x0a, 0x0e, 0x55, 0x70,
0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x38,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e,
0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x6a,
0x65, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63,
0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x62, 0x0a, 0x10,
0x44, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x38, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e,
0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
0x22, 0x1e, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73,
0x22, 0x49, 0x0a, 0x06, 0x4f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x3f, 0x0a, 0x09, 0x70, 0x61,
0x67, 0x65, 0x72, 0x64, 0x75, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e,
0x63, 0x6c, 0x75, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x6a,
0x65, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x72, 0x44, 0x75, 0x74, 0x79,
0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x72, 0x64, 0x75, 0x74, 0x79, 0x22, 0x2c, 0x0a, 0x09, 0x50,
0x61, 0x67, 0x65, 0x72, 0x44, 0x75, 0x74, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x73, 0x42, 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x79, 0x66, 0x74, 0x2f, 0x63, 0x6c, 0x75,
0x74, 0x63, 0x68, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b,
0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
......@@ -291,29 +410,33 @@ func file_core_project_v1_project_proto_rawDescGZIP() []byte {
return file_core_project_v1_project_proto_rawDescData
}
var file_core_project_v1_project_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_core_project_v1_project_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_core_project_v1_project_proto_goTypes = []interface{}{
(*Project)(nil), // 0: clutch.core.project.v1.Project
(*ProjectDependencies)(nil), // 1: clutch.core.project.v1.ProjectDependencies
(*Dependency)(nil), // 2: clutch.core.project.v1.Dependency
nil, // 3: clutch.core.project.v1.Project.DataEntry
nil, // 4: clutch.core.project.v1.ProjectDependencies.UpstreamsEntry
nil, // 5: clutch.core.project.v1.ProjectDependencies.DownstreamsEntry
(*structpb.Value)(nil), // 6: google.protobuf.Value
(*OnCall)(nil), // 3: clutch.core.project.v1.OnCall
(*PagerDuty)(nil), // 4: clutch.core.project.v1.PagerDuty
nil, // 5: clutch.core.project.v1.Project.DataEntry
nil, // 6: clutch.core.project.v1.ProjectDependencies.UpstreamsEntry
nil, // 7: clutch.core.project.v1.ProjectDependencies.DownstreamsEntry
(*structpb.Value)(nil), // 8: google.protobuf.Value
}
var file_core_project_v1_project_proto_depIdxs = []int32{
3, // 0: clutch.core.project.v1.Project.data:type_name -> clutch.core.project.v1.Project.DataEntry
5, // 0: clutch.core.project.v1.Project.data:type_name -> clutch.core.project.v1.Project.DataEntry
1, // 1: clutch.core.project.v1.Project.dependencies:type_name -> clutch.core.project.v1.ProjectDependencies
4, // 2: clutch.core.project.v1.ProjectDependencies.upstreams:type_name -> clutch.core.project.v1.ProjectDependencies.UpstreamsEntry
5, // 3: clutch.core.project.v1.ProjectDependencies.downstreams:type_name -> clutch.core.project.v1.ProjectDependencies.DownstreamsEntry
6, // 4: clutch.core.project.v1.Project.DataEntry.value:type_name -> google.protobuf.Value
2, // 5: clutch.core.project.v1.ProjectDependencies.UpstreamsEntry.value:type_name -> clutch.core.project.v1.Dependency
2, // 6: clutch.core.project.v1.ProjectDependencies.DownstreamsEntry.value:type_name -> clutch.core.project.v1.Dependency
7, // [7:7] is the sub-list for method output_type
7, // [7:7] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
3, // 2: clutch.core.project.v1.Project.oncall:type_name -> clutch.core.project.v1.OnCall
6, // 3: clutch.core.project.v1.ProjectDependencies.upstreams:type_name -> clutch.core.project.v1.ProjectDependencies.UpstreamsEntry
7, // 4: clutch.core.project.v1.ProjectDependencies.downstreams:type_name -> clutch.core.project.v1.ProjectDependencies.DownstreamsEntry
4, // 5: clutch.core.project.v1.OnCall.pagerduty:type_name -> clutch.core.project.v1.PagerDuty
8, // 6: clutch.core.project.v1.Project.DataEntry.value:type_name -> google.protobuf.Value
2, // 7: clutch.core.project.v1.ProjectDependencies.UpstreamsEntry.value:type_name -> clutch.core.project.v1.Dependency
2, // 8: clutch.core.project.v1.ProjectDependencies.DownstreamsEntry.value:type_name -> clutch.core.project.v1.Dependency
9, // [9:9] is the sub-list for method output_type
9, // [9:9] is the sub-list for method input_type
9, // [9:9] is the sub-list for extension type_name
9, // [9:9] is the sub-list for extension extendee
0, // [0:9] is the sub-list for field type_name
}
func init() { file_core_project_v1_project_proto_init() }
......@@ -358,6 +481,30 @@ func file_core_project_v1_project_proto_init() {
return nil
}
}
file_core_project_v1_project_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OnCall); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_core_project_v1_project_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PagerDuty); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
......@@ -365,7 +512,7 @@ func file_core_project_v1_project_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_core_project_v1_project_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumMessages: 8,
NumExtensions: 0,
NumServices: 0,
},
......
......@@ -71,6 +71,16 @@ func (m *Project) Validate() error {
}
}
if v, ok := interface{}(m.GetOncall()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ProjectValidationError{
field: "Oncall",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
......@@ -292,3 +302,141 @@ var _ interface {
Cause() error
ErrorName() string
} = DependencyValidationError{}
// Validate checks the field values on OnCall with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *OnCall) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetPagerduty()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OnCallValidationError{
field: "Pagerduty",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// OnCallValidationError is the validation error returned by OnCall.Validate if
// the designated constraints aren't met.
type OnCallValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e OnCallValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e OnCallValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e OnCallValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e OnCallValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e OnCallValidationError) ErrorName() string { return "OnCallValidationError" }
// Error satisfies the builtin error interface
func (e OnCallValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sOnCall.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = OnCallValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = OnCallValidationError{}
// Validate checks the field values on PagerDuty with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *PagerDuty) Validate() error {
if m == nil {
return nil
}
return nil
}
// PagerDutyValidationError is the validation error returned by
// PagerDuty.Validate if the designated constraints aren't met.
type PagerDutyValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PagerDutyValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PagerDutyValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PagerDutyValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PagerDutyValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PagerDutyValidationError) ErrorName() string { return "PagerDutyValidationError" }
// Error satisfies the builtin error interface
func (e PagerDutyValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPagerDuty.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PagerDutyValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PagerDutyValidationError{}
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment