diff --git a/Makefile b/Makefile index 958317b..5f706cf 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ deploy: build push .PHONY: deploy generate-grpc: - protoc proto/v1alpha/proxy.proto --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. + mkdir -p proto/gen + protoc proto/v1alpha/proxy.proto \ + --go_out=proto/gen --go_opt paths=source_relative \ + --go-grpc_out=proto/gen --go-grpc_opt paths=source_relative .PHONY: generate-grpc diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index dfbeed6..8a63ee6 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -1,6 +1,8 @@ package main import ( + "cloud-proxy/internal/cloud/gcp" + "cloud-proxy/internal/cloud/gcp/gcpauth" "context" "fmt" "net/http" @@ -8,10 +10,6 @@ import ( "runtime" "time" - "cloud-proxy/internal/cloud/gcp" - "cloud-proxy/internal/cloud/gcp/gcpauth" - proto "cloud-proxy/proto/v1alpha" - "google.golang.org/grpc" "google.golang.org/grpc/backoff" "google.golang.org/grpc/credentials" @@ -92,8 +90,8 @@ func main() { "authorization", fmt.Sprintf("Token %s", cfg.CastAI.ApiKey), )) - client := proxy.New(gcp.New(gcpauth.NewCredentialsSource(), http.DefaultClient), logger, cfg.ClusterID, GetVersion()) - err = client.Run(ctx, proto.NewCloudProxyAPIClient(conn)) + client := proxy.New(conn, gcp.New(gcpauth.NewCredentialsSource(), http.DefaultClient), logger, cfg.ClusterID, GetVersion()) + err = client.Run(ctx) if err != nil { logger.Panicf("Failed to run client: %v", err) panic(err) diff --git a/e2e/setup.go b/e2e/setup.go index 87f1264..1ac94de 100644 --- a/e2e/setup.go +++ b/e2e/setup.go @@ -9,7 +9,7 @@ import ( "net/http" "cloud-proxy/internal/e2etest" - proto "cloud-proxy/proto/v1alpha" + cloudproxyv1alpha "cloud-proxy/proto/gen/proto/v1alpha" compute "cloud.google.com/go/compute/apiv1" container "cloud.google.com/go/container/apiv1" "golang.org/x/sync/errgroup" @@ -24,7 +24,7 @@ type Server interface { } type TestSetup struct { - proto.UnimplementedCloudProxyAPIServer + cloudproxyv1alpha.UnimplementedCloudProxyAPIServer result bool @@ -32,14 +32,14 @@ type TestSetup struct { dispatcher *e2etest.Dispatcher roundTripper *e2etest.HttpOverGrpcRoundTripper - requestChan chan *proto.StreamCloudProxyResponse - responseChan chan *proto.StreamCloudProxyRequest + requestChan chan *cloudproxyv1alpha.StreamCloudProxyResponse + responseChan chan *cloudproxyv1alpha.StreamCloudProxyRequest logger *log.Logger } func NewTestSetup(logger *log.Logger) *TestSetup { - requestChan, respChan := make(chan *proto.StreamCloudProxyResponse), make(chan *proto.StreamCloudProxyRequest) + requestChan, respChan := make(chan *cloudproxyv1alpha.StreamCloudProxyResponse), make(chan *cloudproxyv1alpha.StreamCloudProxyRequest) dispatcher := e2etest.NewDispatcher(requestChan, respChan, logger) roundTrip := e2etest.NewHttpOverGrpcRoundTripper(dispatcher, logger) @@ -62,7 +62,7 @@ func (srv *TestSetup) StartServer() error { } srv.grpcServer = grpc.NewServer() - proto.RegisterCloudProxyAPIServer(srv.grpcServer, srv) + cloudproxyv1alpha.RegisterCloudProxyAPIServer(srv.grpcServer, srv) go func() { if err := srv.grpcServer.Serve(list); err != nil { @@ -81,7 +81,7 @@ func (srv *TestSetup) GracefulStopServer() { srv.grpcServer.Stop() } -func (srv *TestSetup) StreamCloudProxy(stream proto.CloudProxyAPI_StreamCloudProxyServer) error { +func (srv *TestSetup) StreamCloudProxy(stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyServer) error { srv.logger.Println("Received a proxy connection from client") //md, ok := metadata.FromIncomingContext(stream.Context()) diff --git a/internal/castai/dummy/mock_cast.go b/internal/castai/dummy/mock_cast.go index c79ebfe..ff595fe 100644 --- a/internal/castai/dummy/mock_cast.go +++ b/internal/castai/dummy/mock_cast.go @@ -1,7 +1,7 @@ package dummy import ( - proto "cloud-proxy/proto/v1alpha" + cloudproxyv1alpha "cloud-proxy/proto/gen/proto/v1alpha" "fmt" "io" "log" @@ -25,7 +25,7 @@ type MockCast struct { func (mc *MockCast) Run() error { logger := log.New(os.Stderr, "[CAST-MOCK] ", log.LstdFlags) - requestChan, respChan := make(chan *proto.StreamCloudProxyResponse), make(chan *proto.StreamCloudProxyRequest) + requestChan, respChan := make(chan *cloudproxyv1alpha.StreamCloudProxyResponse), make(chan *cloudproxyv1alpha.StreamCloudProxyRequest) // Start the mock server listener, err := net.Listen("tcp", ":50051") @@ -34,7 +34,7 @@ func (mc *MockCast) Run() error { } grpcServer := grpc.NewServer() - proto.RegisterCloudProxyAPIServer(grpcServer, NewMockCastServer(requestChan, respChan, logger)) + cloudproxyv1alpha.RegisterCloudProxyAPIServer(grpcServer, NewMockCastServer(requestChan, respChan, logger)) dispatcher := e2etest.NewDispatcher(requestChan, respChan, logger) @@ -68,15 +68,15 @@ func (mc *MockCast) Run() error { } type MockCastServer struct { - proto.UnimplementedCloudProxyAPIServer + cloudproxyv1alpha.UnimplementedCloudProxyAPIServer - requestChan <-chan *proto.StreamCloudProxyResponse - responseChan chan<- *proto.StreamCloudProxyRequest + requestChan <-chan *cloudproxyv1alpha.StreamCloudProxyResponse + responseChan chan<- *cloudproxyv1alpha.StreamCloudProxyRequest logger *log.Logger } -func NewMockCastServer(requestChan <-chan *proto.StreamCloudProxyResponse, responseChan chan<- *proto.StreamCloudProxyRequest, logger *log.Logger) *MockCastServer { +func NewMockCastServer(requestChan <-chan *cloudproxyv1alpha.StreamCloudProxyResponse, responseChan chan<- *cloudproxyv1alpha.StreamCloudProxyRequest, logger *log.Logger) *MockCastServer { return &MockCastServer{ requestChan: requestChan, responseChan: responseChan, @@ -84,7 +84,7 @@ func NewMockCastServer(requestChan <-chan *proto.StreamCloudProxyResponse, respo } } -func (msrv *MockCastServer) Proxy(stream proto.CloudProxyAPI_StreamCloudProxyServer) error { +func (msrv *MockCastServer) Proxy(stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyServer) error { msrv.logger.Println("Received a proxy connection from client") var eg errgroup.Group diff --git a/internal/e2etest/dispatcher.go b/internal/e2etest/dispatcher.go index 088c42c..df90caa 100644 --- a/internal/e2etest/dispatcher.go +++ b/internal/e2etest/dispatcher.go @@ -4,22 +4,22 @@ import ( "log" "sync" - proto "cloud-proxy/proto/v1alpha" + cloudproxyv1alpha "cloud-proxy/proto/gen/proto/v1alpha" ) type Dispatcher struct { - pendingRequests map[string]chan *proto.StreamCloudProxyRequest + pendingRequests map[string]chan *cloudproxyv1alpha.StreamCloudProxyRequest locker sync.Mutex - proxyRequestChan chan<- *proto.StreamCloudProxyResponse - proxyResponseChan <-chan *proto.StreamCloudProxyRequest + proxyRequestChan chan<- *cloudproxyv1alpha.StreamCloudProxyResponse + proxyResponseChan <-chan *cloudproxyv1alpha.StreamCloudProxyRequest logger *log.Logger } -func NewDispatcher(requestChan chan<- *proto.StreamCloudProxyResponse, responseChan <-chan *proto.StreamCloudProxyRequest, logger *log.Logger) *Dispatcher { +func NewDispatcher(requestChan chan<- *cloudproxyv1alpha.StreamCloudProxyResponse, responseChan <-chan *cloudproxyv1alpha.StreamCloudProxyRequest, logger *log.Logger) *Dispatcher { return &Dispatcher{ - pendingRequests: make(map[string]chan *proto.StreamCloudProxyRequest), + pendingRequests: make(map[string]chan *cloudproxyv1alpha.StreamCloudProxyRequest), locker: sync.Mutex{}, proxyRequestChan: requestChan, proxyResponseChan: responseChan, @@ -40,21 +40,21 @@ func (d *Dispatcher) Run() { }() } -func (d *Dispatcher) SendRequest(req *proto.StreamCloudProxyResponse) (<-chan *proto.StreamCloudProxyRequest, error) { +func (d *Dispatcher) SendRequest(req *cloudproxyv1alpha.StreamCloudProxyResponse) (<-chan *cloudproxyv1alpha.StreamCloudProxyRequest, error) { waiter := d.addRequestToWaitingList(req.MessageId) d.proxyRequestChan <- req return waiter, nil } -func (d *Dispatcher) addRequestToWaitingList(requestID string) <-chan *proto.StreamCloudProxyRequest { - waiter := make(chan *proto.StreamCloudProxyRequest, 1) +func (d *Dispatcher) addRequestToWaitingList(requestID string) <-chan *cloudproxyv1alpha.StreamCloudProxyRequest { + waiter := make(chan *cloudproxyv1alpha.StreamCloudProxyRequest, 1) d.locker.Lock() d.pendingRequests[requestID] = waiter d.locker.Unlock() return waiter } -func (d *Dispatcher) findWaiterForResponse(requestID string) chan *proto.StreamCloudProxyRequest { +func (d *Dispatcher) findWaiterForResponse(requestID string) chan *cloudproxyv1alpha.StreamCloudProxyRequest { d.locker.Lock() val, ok := d.pendingRequests[requestID] if !ok { diff --git a/internal/e2etest/roundtripper.go b/internal/e2etest/roundtripper.go index 03fef86..7914d77 100644 --- a/internal/e2etest/roundtripper.go +++ b/internal/e2etest/roundtripper.go @@ -2,7 +2,7 @@ package e2etest import ( "bytes" - proto "cloud-proxy/proto/v1alpha" + cloudproxyv1alpha "cloud-proxy/proto/gen/proto/v1alpha" "fmt" "io" "log" @@ -24,14 +24,14 @@ func NewHttpOverGrpcRoundTripper(dispatcher *Dispatcher, logger *log.Logger) *Ht func (p *HttpOverGrpcRoundTripper) RoundTrip(request *http.Request) (*http.Response, error) { requestID := uuid.New().String() - headers := make(map[string]*proto.HeaderValue) + headers := make(map[string]*cloudproxyv1alpha.HeaderValue) for h, v := range request.Header { - headers[h] = &proto.HeaderValue{Value: v} + headers[h] = &cloudproxyv1alpha.HeaderValue{Value: v} } - protoReq := &proto.StreamCloudProxyResponse{ + protoReq := &cloudproxyv1alpha.StreamCloudProxyResponse{ MessageId: requestID, - HttpRequest: &proto.HTTPRequest{ + HttpRequest: &cloudproxyv1alpha.HTTPRequest{ Method: request.Method, Path: request.URL.String(), Headers: headers, diff --git a/internal/proxy/client.go b/internal/proxy/client.go index 068587f..ac5b98d 100644 --- a/internal/proxy/client.go +++ b/internal/proxy/client.go @@ -1,20 +1,20 @@ -//go:generate mockgen -destination ./mock/cloud.go -package=mock_cloud cloud-proxy/internal/proxy CloudClient -//go:generate mockgen -destination ./mock/stream.go -package=mock_cloud cloud-proxy/internal/proxy StreamCloudProxyClient +//go:generate mockgen -package=mock_proxy -source $GOFILE -destination mock/$GOFILE . +//go:generate mockgen -package=mock_proxy -destination mock/stream.go cloud-proxy/proto/gen/proto/v1alpha CloudProxyAPI_StreamCloudProxyClient + package proxy import ( "bytes" + cloudproxyv1alpha "cloud-proxy/proto/gen/proto/v1alpha" "context" "fmt" + "github.com/samber/lo" + "github.com/sirupsen/logrus" + "google.golang.org/grpc" "io" "net/http" "sync/atomic" "time" - - cloudproxyv1alpha "cloud-proxy/proto/v1alpha" - proto "cloud-proxy/proto/v1alpha" - "github.com/samber/lo" - "github.com/sirupsen/logrus" ) const ( @@ -23,12 +23,12 @@ const ( KeepAliveTimeoutDefault = time.Minute ) -type StreamCloudProxyClient = cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient type CloudClient interface { DoHTTPRequest(request *http.Request) (*http.Response, error) } type Client struct { + grpcConn *grpc.ClientConn cloudClient CloudClient log *logrus.Logger clusterID string @@ -42,9 +42,10 @@ type Client struct { version string } -func New(executor CloudClient, logger *logrus.Logger, clusterID, version string) *Client { +func New(grpcConn *grpc.ClientConn, cloudClient CloudClient, logger *logrus.Logger, clusterID, version string) *Client { c := &Client{ - cloudClient: executor, + grpcConn: grpcConn, + cloudClient: cloudClient, log: logger, clusterID: clusterID, version: version, @@ -55,29 +56,46 @@ func New(executor CloudClient, logger *logrus.Logger, clusterID, version string) return c } -func (c *Client) Run(ctx context.Context, grpcClient cloudproxyv1alpha.CloudProxyAPIClient) error { +func (c *Client) Run(ctx context.Context) error { for { if ctx.Err() != nil { return nil } c.log.Info("Starting proxy client") - err := c.run(ctx, grpcClient) + stream, closeStream, err := c.getStream() if err != nil { - c.log.Printf("c.run exited: %v", err) + c.log.Errorf("c.getStream: %v", err) + time.Sleep(time.Second) + continue + } + err = c.run(ctx, stream, closeStream) + if err != nil { + c.log.Errorf("c.run exited: %v", err) } } } -func (c *Client) initializeStream(ctx context.Context, proxyCastAIClient cloudproxyv1alpha.CloudProxyAPIClient) (StreamCloudProxyClient, error) { +func (c *Client) getStream() (cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient, func(), error) { c.log.Info("Connecting to castai") - - stream, err := proxyCastAIClient.StreamCloudProxy(ctx) + apiClient := cloudproxyv1alpha.NewCloudProxyAPIClient(c.grpcConn) + stream, err := apiClient.StreamCloudProxy(context.Background()) if err != nil { - return nil, fmt.Errorf("proxyCastAIClient.StreamCloudProxy: %w", err) + return nil, nil, fmt.Errorf("proxyCastAIClient.StreamCloudProxy: %w", err) } + c.log.Info("Connected to castai, sending initial metadata") + return stream, func() { + err := stream.CloseSend() + if err != nil { + c.log.Errorf("error closing stream %v", err) + } + }, nil +} + +func (c *Client) sendInitialRequest(stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient) error { + c.log.Info("Seding initial request to castai") - err = stream.Send(&cloudproxyv1alpha.StreamCloudProxyRequest{ + err := stream.Send(&cloudproxyv1alpha.StreamCloudProxyRequest{ Request: &cloudproxyv1alpha.StreamCloudProxyRequest_InitialRequest{ InitialRequest: &cloudproxyv1alpha.InitialCloudProxyRequest{ ClientMetadata: &cloudproxyv1alpha.ClientMetadata{ @@ -88,33 +106,31 @@ func (c *Client) initializeStream(ctx context.Context, proxyCastAIClient cloudpr }, }) if err != nil { - return nil, fmt.Errorf("stream.Send: initial request %w", err) + return fmt.Errorf("stream.Send: initial request %w", err) } c.lastSeen.Store(time.Now().UnixNano()) c.log.Info("Stream to castai started successfully") - return stream, nil + return nil } -func (c *Client) run(ctx context.Context, grpcClient cloudproxyv1alpha.CloudProxyAPIClient) error { - stream, err := c.initializeStream(ctx, grpcClient) +func (c *Client) run(ctx context.Context, stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient, closeStream func()) error { + defer closeStream() + + err := c.sendInitialRequest(stream) if err != nil { return fmt.Errorf("c.Connect: %w", err) } - defer func() { - err := stream.CloseSend() - if err != nil { - c.log.Errorf("error closing stream: %v", err) - } - }() - ctxWithCancel, cancel := context.WithCancel(ctx) defer cancel() go c.sendKeepAlive(ctxWithCancel, stream) for { + if ctx.Err() != nil { + return ctx.Err() + } if !c.isAlive() { return fmt.Errorf("last seen too old, closing stream") } @@ -129,7 +145,11 @@ func (c *Client) run(ctx context.Context, grpcClient cloudproxyv1alpha.CloudProx } } -func (c *Client) handleMessage(in *cloudproxyv1alpha.StreamCloudProxyResponse, stream StreamCloudProxyClient) { +func (c *Client) handleMessage(in *cloudproxyv1alpha.StreamCloudProxyResponse, stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient) { + if in == nil { + c.log.Error("nil message") + return + } c.processConfigurationRequest(in) // skip processing http request if keep alive message @@ -206,7 +226,7 @@ func (c *Client) isAlive() bool { return true } -func (c *Client) sendKeepAlive(ctx context.Context, stream StreamCloudProxyClient) { +func (c *Client) sendKeepAlive(ctx context.Context, stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient) { ticker := time.NewTimer(time.Duration(c.keepAlive.Load())) defer ticker.Stop() @@ -244,7 +264,7 @@ func (c *Client) sendKeepAlive(ctx context.Context, stream StreamCloudProxyClien var errBadRequest = fmt.Errorf("bad request") -func (c *Client) toHTTPRequest(req *proto.HTTPRequest) (*http.Request, error) { +func (c *Client) toHTTPRequest(req *cloudproxyv1alpha.HTTPRequest) (*http.Request, error) { if req == nil { return nil, fmt.Errorf("nil http request %w", errBadRequest) } @@ -263,17 +283,17 @@ func (c *Client) toHTTPRequest(req *proto.HTTPRequest) (*http.Request, error) { return reqHTTP, nil } -func (c *Client) toResponse(resp *http.Response) *proto.HTTPResponse { +func (c *Client) toResponse(resp *http.Response) *cloudproxyv1alpha.HTTPResponse { if resp == nil { - return &proto.HTTPResponse{ + return &cloudproxyv1alpha.HTTPResponse{ Error: lo.ToPtr("nil response"), } } - var headers map[string]*proto.HeaderValue + var headers map[string]*cloudproxyv1alpha.HeaderValue if resp.Header != nil { - headers = make(map[string]*proto.HeaderValue) + headers = make(map[string]*cloudproxyv1alpha.HeaderValue) for h, v := range resp.Header { - headers[h] = &proto.HeaderValue{Value: v} + headers[h] = &cloudproxyv1alpha.HeaderValue{Value: v} } } var bodyResp []byte @@ -287,7 +307,7 @@ func (c *Client) toResponse(resp *http.Response) *proto.HTTPResponse { } } - return &proto.HTTPResponse{ + return &cloudproxyv1alpha.HTTPResponse{ Body: bodyResp, Error: errMessage, Status: int32(resp.StatusCode), diff --git a/internal/proxy/client_test.go b/internal/proxy/client_test.go index c40d01d..3d573d3 100644 --- a/internal/proxy/client_test.go +++ b/internal/proxy/client_test.go @@ -2,14 +2,20 @@ package proxy import ( "bytes" - proto "cloud-proxy/proto/v1alpha" + mock_proxy "cloud-proxy/internal/proxy/mock" + cloudproxyv1alpha "cloud-proxy/proto/gen/proto/v1alpha" "context" + "fmt" + "github.com/golang/mock/gomock" "github.com/samber/lo" + "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "io" "net/http" "net/url" + "reflect" "testing" + "time" ) type mockReadCloserErr struct{} @@ -33,11 +39,11 @@ func TestClient_toResponse(t *testing.T) { name string fields fields args args - want *proto.HTTPResponse + want *cloudproxyv1alpha.HTTPResponse }{ { name: "nil response", - want: &proto.HTTPResponse{ + want: &cloudproxyv1alpha.HTTPResponse{ Error: lo.ToPtr("nil response"), }, }, @@ -48,7 +54,7 @@ func TestClient_toResponse(t *testing.T) { Body: &mockReadCloserErr{}, }, }, - want: &proto.HTTPResponse{ + want: &cloudproxyv1alpha.HTTPResponse{ Error: lo.ToPtr("io.ReadAll: body for error: unexpected EOF"), }, }, @@ -62,10 +68,10 @@ func TestClient_toResponse(t *testing.T) { Body: io.NopCloser(bytes.NewReader([]byte("body"))), }, }, - want: &proto.HTTPResponse{ + want: &cloudproxyv1alpha.HTTPResponse{ Body: []byte("body"), Status: 200, - Headers: map[string]*proto.HeaderValue{"header": {Value: []string{"value"}}}, + Headers: map[string]*cloudproxyv1alpha.HeaderValue{"header": {Value: []string{"value"}}}, }, }, } @@ -73,7 +79,7 @@ func TestClient_toResponse(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - c := New(nil, nil, "clusterID", "version") + c := New(nil, nil, nil, "clusterID", "version") got := c.toResponse(tt.args.resp) //diff := cmp.Diff(got, tt.want, protocmp.Transform()) //require.Empty(t, diff) @@ -84,8 +90,9 @@ func TestClient_toResponse(t *testing.T) { func TestClient_toHTTPRequest(t *testing.T) { t.Parallel() + type args struct { - req *proto.HTTPRequest + req *cloudproxyv1alpha.HTTPRequest } tests := []struct { name string @@ -100,7 +107,7 @@ func TestClient_toHTTPRequest(t *testing.T) { { name: "error creating http request", args: args{ - req: &proto.HTTPRequest{ + req: &cloudproxyv1alpha.HTTPRequest{ Path: "\n\t\f", }, }, @@ -109,9 +116,9 @@ func TestClient_toHTTPRequest(t *testing.T) { { name: "success", args: args{ - req: &proto.HTTPRequest{ + req: &cloudproxyv1alpha.HTTPRequest{ Method: "GET", - Headers: map[string]*proto.HeaderValue{ + Headers: map[string]*cloudproxyv1alpha.HeaderValue{ "header": {Value: []string{"value"}}, }, Body: []byte("body"), @@ -135,7 +142,7 @@ func TestClient_toHTTPRequest(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - c := New(nil, nil, "clusterID", "version") + c := New(nil, nil, nil, "clusterID", "version") got, err := c.toHTTPRequest(tt.args.req) require.Equal(t, tt.wantErr, err != nil, err) if err != nil { @@ -147,3 +154,328 @@ func TestClient_toHTTPRequest(t *testing.T) { }) } } + +func TestClient_handleMessage(t *testing.T) { + t.Parallel() + + type fields struct { + tuneMockCloudClient func(m *mock_proxy.MockCloudClient) + } + type args struct { + in *cloudproxyv1alpha.StreamCloudProxyResponse + tuneMockStream func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) + } + tests := []struct { + name string + fields fields + args args + wantLastSeenUpdated bool + wantKeepAlive int64 + wantKeepAliveTimeout int64 + wantErrCount int64 + }{ + { + name: "nil response", + wantLastSeenUpdated: false, + wantKeepAlive: int64(KeepAliveDefault), + wantKeepAliveTimeout: int64(KeepAliveTimeoutDefault), + }, + { + name: "keep alive", + args: args{ + in: &cloudproxyv1alpha.StreamCloudProxyResponse{ + MessageId: KeepAliveMessageID, + }, + }, + wantLastSeenUpdated: true, + wantKeepAlive: int64(KeepAliveDefault), + wantKeepAliveTimeout: int64(KeepAliveTimeoutDefault), + }, + { + name: "keep alive timeout and keepalive", + args: args{ + in: &cloudproxyv1alpha.StreamCloudProxyResponse{ + MessageId: KeepAliveMessageID, + ConfigurationRequest: &cloudproxyv1alpha.ConfigurationRequest{ + KeepAlive: 1, + KeepAliveTimeout: 2, + }, + }, + }, + wantLastSeenUpdated: true, + wantKeepAlive: 1, + wantKeepAliveTimeout: 2, + }, + { + name: "http error, send error", + args: args{ + in: &cloudproxyv1alpha.StreamCloudProxyResponse{ + MessageId: "msgID", + HttpRequest: &cloudproxyv1alpha.HTTPRequest{}, + }, + tuneMockStream: func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) { + m.EXPECT().Send(&cloudproxyv1alpha.StreamCloudProxyRequest{ + Request: &cloudproxyv1alpha.StreamCloudProxyRequest_Response{ + Response: &cloudproxyv1alpha.ClusterResponse{ + ClientMetadata: &cloudproxyv1alpha.ClientMetadata{ + ClusterId: "clusterID", + }, + MessageId: "msgID", + HttpResponse: &cloudproxyv1alpha.HTTPResponse{ + Error: lo.ToPtr("c.cloudClient.DoHTTPRequest: error"), + }, + }, + }, + }).Return(fmt.Errorf("error")) + }, + }, + fields: fields{ + tuneMockCloudClient: func(m *mock_proxy.MockCloudClient) { + m.EXPECT().DoHTTPRequest(gomock.Any()).Return(nil, fmt.Errorf("error")) + }, + }, + wantLastSeenUpdated: false, + wantKeepAlive: int64(KeepAliveDefault), + wantKeepAliveTimeout: int64(KeepAliveTimeoutDefault), + wantErrCount: 1, + }, + } + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + cloudClient := mock_proxy.NewMockCloudClient(ctrl) + if tt.fields.tuneMockCloudClient != nil { + tt.fields.tuneMockCloudClient(cloudClient) + } + c := New(nil, cloudClient, logrus.New(), "clusterID", "version") + stream := mock_proxy.NewMockCloudProxyAPI_StreamCloudProxyClient(ctrl) + if tt.args.tuneMockStream != nil { + tt.args.tuneMockStream(stream) + } + + c.handleMessage(tt.args.in, stream) + require.Equal(t, tt.wantLastSeenUpdated, c.lastSeen.Load() > 0, "lastSeen: %v", c.lastSeen.Load()) + require.Equal(t, tt.wantKeepAlive, c.keepAlive.Load(), "keepAlive: %v", c.keepAlive.Load()) + require.Equal(t, tt.wantKeepAliveTimeout, c.keepAliveTimeout.Load(), "keepAliveTimeout: %v", c.keepAliveTimeout.Load()) + require.Equal(t, tt.wantErrCount, c.errCount.Load(), "errCount: %v", c.errCount.Load()) + }) + } +} + +func TestClient_processHttpRequest(t *testing.T) { + t.Parallel() + type fields struct { + tuneMockCloudClient func(m *mock_proxy.MockCloudClient) + } + type args struct { + req *cloudproxyv1alpha.HTTPRequest + } + tests := []struct { + name string + fields fields + args args + want *cloudproxyv1alpha.HTTPResponse + wantProcessCount int64 + }{ + { + name: "nil request", + want: &cloudproxyv1alpha.HTTPResponse{ + Error: lo.ToPtr("nil http request"), + }, + }, + { + name: "error creating http request", + args: args{ + req: &cloudproxyv1alpha.HTTPRequest{ + Path: "\n\t\f", + }, + }, + want: &cloudproxyv1alpha.HTTPResponse{ + Error: lo.ToPtr("toHTTPRequest: http.NewRequest: error: parse \"\\n\\t\\f\": net/url: invalid control character in URL"), + }, + }, + { + name: "cloud client error", + args: args{ + req: &cloudproxyv1alpha.HTTPRequest{}, + }, + fields: fields{ + tuneMockCloudClient: func(m *mock_proxy.MockCloudClient) { + m.EXPECT().DoHTTPRequest(gomock.Any()).Return(nil, fmt.Errorf("error")) + }, + }, + want: &cloudproxyv1alpha.HTTPResponse{ + Error: lo.ToPtr("c.cloudClient.DoHTTPRequest: error"), + }, + }, + { + name: "success", + args: args{ + req: &cloudproxyv1alpha.HTTPRequest{}, + }, + fields: fields{ + tuneMockCloudClient: func(m *mock_proxy.MockCloudClient) { + m.EXPECT().DoHTTPRequest(gomock.Any()).Return(&http.Response{}, nil) + }, + }, + want: &cloudproxyv1alpha.HTTPResponse{}, + wantProcessCount: 1, + }, + } + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + cloudClient := mock_proxy.NewMockCloudClient(ctrl) + if tt.fields.tuneMockCloudClient != nil { + tt.fields.tuneMockCloudClient(cloudClient) + } + c := New(nil, cloudClient, logrus.New(), "clusterID", "version") + if got := c.processHttpRequest(tt.args.req); !reflect.DeepEqual(got, tt.want) { + t.Errorf("processHttpRequest() = %v, want %v", got, tt.want) + } + require.Equal(t, tt.wantProcessCount, c.processedCount.Load(), "processedCount: %v", c.processedCount.Load()) + }) + } +} + +func TestClient_sendKeepAlive(t *testing.T) { + t.Parallel() + + type args struct { + ctx func() context.Context + tuneMockStream func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) + keepAlive int64 + keepAliveTimeout int64 + } + tests := []struct { + name string + args args + isLastSeenZero bool + }{ + { + name: "end of ticker", + args: args{ + ctx: func() context.Context { + return context.Background() + }, + keepAlive: 0, + }, + }, + { + name: "context done", + args: args{ + ctx: func() context.Context { + ctx, cancel := context.WithCancel(context.Background()) + cancel() + return ctx + }, + keepAlive: int64(time.Second), + keepAliveTimeout: int64(10 * time.Minute), + }, + }, + { + name: "send returned error, should exit", + args: args{ + ctx: func() context.Context { + return context.Background() + }, + tuneMockStream: func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) { + m.EXPECT().Send(gomock.Any()).Return(fmt.Errorf("error")) + }, + keepAlive: int64(time.Second), + keepAliveTimeout: int64(10 * time.Minute), + }, + isLastSeenZero: true, + }, + } + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + c := New(nil, nil, logrus.New(), "clusterID", "version") + c.keepAlive.Store(tt.args.keepAlive) + c.keepAliveTimeout.Store(tt.args.keepAliveTimeout) + + stream := mock_proxy.NewMockCloudProxyAPI_StreamCloudProxyClient(ctrl) + if tt.args.tuneMockStream != nil { + tt.args.tuneMockStream(stream) + } + c.lastSeen.Store(time.Now().UnixNano()) + + c.sendKeepAlive(tt.args.ctx(), stream) + require.Equal(t, tt.isLastSeenZero, c.lastSeen.Load() == 0, "lastSeen: %v", c.lastSeen.Load()) + }) + } +} + +func TestClient_run(t *testing.T) { + t.Parallel() + type fields struct { + } + type args struct { + ctx func() context.Context + tuneMockStream func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) + } + tests := []struct { + name string + fields fields + args args + wantErr bool + wantLastSeenUpdated bool + }{ + { + name: "send initial error", + args: args{ + ctx: func() context.Context { + return context.Background() + }, + tuneMockStream: func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) { + m.EXPECT().Send(gomock.Any()).Return(fmt.Errorf("test error")) + }, + }, + wantErr: true, + }, + { + name: "context done", + args: args{ + ctx: func() context.Context { + ctx, cancel := context.WithCancel(context.Background()) + cancel() + return ctx + }, + tuneMockStream: func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) { + m.EXPECT().Send(gomock.Any()).Return(nil) + }, + }, + wantLastSeenUpdated: true, + wantErr: true, + }, + } + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + c := New(nil, nil, logrus.New(), "clusterID", "version") + stream := mock_proxy.NewMockCloudProxyAPI_StreamCloudProxyClient(ctrl) + if tt.args.tuneMockStream != nil { + tt.args.tuneMockStream(stream) + } + if err := c.run(tt.args.ctx(), stream, func() {}); (err != nil) != tt.wantErr { + t.Errorf("run() error = %v, wantErr %v", err, tt.wantErr) + } + require.Equal(t, tt.wantLastSeenUpdated, c.lastSeen.Load() > 0, "lastSeen: %v", c.lastSeen.Load()) + }) + } +} diff --git a/internal/proxy/mock/cloud.go b/internal/proxy/mock/client.go similarity index 72% rename from internal/proxy/mock/cloud.go rename to internal/proxy/mock/client.go index fcacb6a..9e565cc 100644 --- a/internal/proxy/mock/cloud.go +++ b/internal/proxy/mock/client.go @@ -1,8 +1,8 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: cloud-proxy/internal/proxy (interfaces: CloudClient) +// Source: client.go -// Package mock_cloud is a generated GoMock package. -package mock_cloud +// Package mock_proxy is a generated GoMock package. +package mock_proxy import ( http "net/http" @@ -35,16 +35,16 @@ func (m *MockCloudClient) EXPECT() *MockCloudClientMockRecorder { } // DoHTTPRequest mocks base method. -func (m *MockCloudClient) DoHTTPRequest(arg0 *http.Request) (*http.Response, error) { +func (m *MockCloudClient) DoHTTPRequest(request *http.Request) (*http.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DoHTTPRequest", arg0) + ret := m.ctrl.Call(m, "DoHTTPRequest", request) ret0, _ := ret[0].(*http.Response) ret1, _ := ret[1].(error) return ret0, ret1 } // DoHTTPRequest indicates an expected call of DoHTTPRequest. -func (mr *MockCloudClientMockRecorder) DoHTTPRequest(arg0 interface{}) *gomock.Call { +func (mr *MockCloudClientMockRecorder) DoHTTPRequest(request interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DoHTTPRequest", reflect.TypeOf((*MockCloudClient)(nil).DoHTTPRequest), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DoHTTPRequest", reflect.TypeOf((*MockCloudClient)(nil).DoHTTPRequest), request) } diff --git a/internal/proxy/mock/stream.go b/internal/proxy/mock/stream.go index 6a4836f..b5f91f3 100644 --- a/internal/proxy/mock/stream.go +++ b/internal/proxy/mock/stream.go @@ -1,11 +1,11 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: cloud-proxy/internal/proxy (interfaces: StreamCloudProxyClient) +// Source: cloud-proxy/proto/gen/proto/v1alpha (interfaces: CloudProxyAPI_StreamCloudProxyClient) -// Package mock_cloud is a generated GoMock package. -package mock_cloud +// Package mock_proxy is a generated GoMock package. +package mock_proxy import ( - cloudproxyv1alpha "cloud-proxy/proto/v1alpha" + cloudproxyv1alpha "cloud-proxy/proto/gen/proto/v1alpha" context "context" reflect "reflect" @@ -13,31 +13,31 @@ import ( metadata "google.golang.org/grpc/metadata" ) -// MockStreamCloudProxyClient is a mock of StreamCloudProxyClient interface. -type MockStreamCloudProxyClient struct { +// MockCloudProxyAPI_StreamCloudProxyClient is a mock of CloudProxyAPI_StreamCloudProxyClient interface. +type MockCloudProxyAPI_StreamCloudProxyClient struct { ctrl *gomock.Controller - recorder *MockStreamCloudProxyClientMockRecorder + recorder *MockCloudProxyAPI_StreamCloudProxyClientMockRecorder } -// MockStreamCloudProxyClientMockRecorder is the mock recorder for MockStreamCloudProxyClient. -type MockStreamCloudProxyClientMockRecorder struct { - mock *MockStreamCloudProxyClient +// MockCloudProxyAPI_StreamCloudProxyClientMockRecorder is the mock recorder for MockCloudProxyAPI_StreamCloudProxyClient. +type MockCloudProxyAPI_StreamCloudProxyClientMockRecorder struct { + mock *MockCloudProxyAPI_StreamCloudProxyClient } -// NewMockStreamCloudProxyClient creates a new mock instance. -func NewMockStreamCloudProxyClient(ctrl *gomock.Controller) *MockStreamCloudProxyClient { - mock := &MockStreamCloudProxyClient{ctrl: ctrl} - mock.recorder = &MockStreamCloudProxyClientMockRecorder{mock} +// NewMockCloudProxyAPI_StreamCloudProxyClient creates a new mock instance. +func NewMockCloudProxyAPI_StreamCloudProxyClient(ctrl *gomock.Controller) *MockCloudProxyAPI_StreamCloudProxyClient { + mock := &MockCloudProxyAPI_StreamCloudProxyClient{ctrl: ctrl} + mock.recorder = &MockCloudProxyAPI_StreamCloudProxyClientMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockStreamCloudProxyClient) EXPECT() *MockStreamCloudProxyClientMockRecorder { +func (m *MockCloudProxyAPI_StreamCloudProxyClient) EXPECT() *MockCloudProxyAPI_StreamCloudProxyClientMockRecorder { return m.recorder } // CloseSend mocks base method. -func (m *MockStreamCloudProxyClient) CloseSend() error { +func (m *MockCloudProxyAPI_StreamCloudProxyClient) CloseSend() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CloseSend") ret0, _ := ret[0].(error) @@ -45,13 +45,13 @@ func (m *MockStreamCloudProxyClient) CloseSend() error { } // CloseSend indicates an expected call of CloseSend. -func (mr *MockStreamCloudProxyClientMockRecorder) CloseSend() *gomock.Call { +func (mr *MockCloudProxyAPI_StreamCloudProxyClientMockRecorder) CloseSend() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockStreamCloudProxyClient)(nil).CloseSend)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockCloudProxyAPI_StreamCloudProxyClient)(nil).CloseSend)) } // Context mocks base method. -func (m *MockStreamCloudProxyClient) Context() context.Context { +func (m *MockCloudProxyAPI_StreamCloudProxyClient) Context() context.Context { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Context") ret0, _ := ret[0].(context.Context) @@ -59,13 +59,13 @@ func (m *MockStreamCloudProxyClient) Context() context.Context { } // Context indicates an expected call of Context. -func (mr *MockStreamCloudProxyClientMockRecorder) Context() *gomock.Call { +func (mr *MockCloudProxyAPI_StreamCloudProxyClientMockRecorder) Context() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockStreamCloudProxyClient)(nil).Context)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockCloudProxyAPI_StreamCloudProxyClient)(nil).Context)) } // Header mocks base method. -func (m *MockStreamCloudProxyClient) Header() (metadata.MD, error) { +func (m *MockCloudProxyAPI_StreamCloudProxyClient) Header() (metadata.MD, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Header") ret0, _ := ret[0].(metadata.MD) @@ -74,13 +74,13 @@ func (m *MockStreamCloudProxyClient) Header() (metadata.MD, error) { } // Header indicates an expected call of Header. -func (mr *MockStreamCloudProxyClientMockRecorder) Header() *gomock.Call { +func (mr *MockCloudProxyAPI_StreamCloudProxyClientMockRecorder) Header() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockStreamCloudProxyClient)(nil).Header)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockCloudProxyAPI_StreamCloudProxyClient)(nil).Header)) } // Recv mocks base method. -func (m *MockStreamCloudProxyClient) Recv() (*cloudproxyv1alpha.StreamCloudProxyResponse, error) { +func (m *MockCloudProxyAPI_StreamCloudProxyClient) Recv() (*cloudproxyv1alpha.StreamCloudProxyResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Recv") ret0, _ := ret[0].(*cloudproxyv1alpha.StreamCloudProxyResponse) @@ -89,13 +89,13 @@ func (m *MockStreamCloudProxyClient) Recv() (*cloudproxyv1alpha.StreamCloudProxy } // Recv indicates an expected call of Recv. -func (mr *MockStreamCloudProxyClientMockRecorder) Recv() *gomock.Call { +func (mr *MockCloudProxyAPI_StreamCloudProxyClientMockRecorder) Recv() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockStreamCloudProxyClient)(nil).Recv)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockCloudProxyAPI_StreamCloudProxyClient)(nil).Recv)) } // RecvMsg mocks base method. -func (m *MockStreamCloudProxyClient) RecvMsg(arg0 interface{}) error { +func (m *MockCloudProxyAPI_StreamCloudProxyClient) RecvMsg(arg0 interface{}) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RecvMsg", arg0) ret0, _ := ret[0].(error) @@ -103,13 +103,13 @@ func (m *MockStreamCloudProxyClient) RecvMsg(arg0 interface{}) error { } // RecvMsg indicates an expected call of RecvMsg. -func (mr *MockStreamCloudProxyClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call { +func (mr *MockCloudProxyAPI_StreamCloudProxyClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockStreamCloudProxyClient)(nil).RecvMsg), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockCloudProxyAPI_StreamCloudProxyClient)(nil).RecvMsg), arg0) } // Send mocks base method. -func (m *MockStreamCloudProxyClient) Send(arg0 *cloudproxyv1alpha.StreamCloudProxyRequest) error { +func (m *MockCloudProxyAPI_StreamCloudProxyClient) Send(arg0 *cloudproxyv1alpha.StreamCloudProxyRequest) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Send", arg0) ret0, _ := ret[0].(error) @@ -117,13 +117,13 @@ func (m *MockStreamCloudProxyClient) Send(arg0 *cloudproxyv1alpha.StreamCloudPro } // Send indicates an expected call of Send. -func (mr *MockStreamCloudProxyClientMockRecorder) Send(arg0 interface{}) *gomock.Call { +func (mr *MockCloudProxyAPI_StreamCloudProxyClientMockRecorder) Send(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockStreamCloudProxyClient)(nil).Send), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockCloudProxyAPI_StreamCloudProxyClient)(nil).Send), arg0) } // SendMsg mocks base method. -func (m *MockStreamCloudProxyClient) SendMsg(arg0 interface{}) error { +func (m *MockCloudProxyAPI_StreamCloudProxyClient) SendMsg(arg0 interface{}) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SendMsg", arg0) ret0, _ := ret[0].(error) @@ -131,13 +131,13 @@ func (m *MockStreamCloudProxyClient) SendMsg(arg0 interface{}) error { } // SendMsg indicates an expected call of SendMsg. -func (mr *MockStreamCloudProxyClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call { +func (mr *MockCloudProxyAPI_StreamCloudProxyClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockStreamCloudProxyClient)(nil).SendMsg), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockCloudProxyAPI_StreamCloudProxyClient)(nil).SendMsg), arg0) } // Trailer mocks base method. -func (m *MockStreamCloudProxyClient) Trailer() metadata.MD { +func (m *MockCloudProxyAPI_StreamCloudProxyClient) Trailer() metadata.MD { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Trailer") ret0, _ := ret[0].(metadata.MD) @@ -145,7 +145,7 @@ func (m *MockStreamCloudProxyClient) Trailer() metadata.MD { } // Trailer indicates an expected call of Trailer. -func (mr *MockStreamCloudProxyClientMockRecorder) Trailer() *gomock.Call { +func (mr *MockCloudProxyAPI_StreamCloudProxyClientMockRecorder) Trailer() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockStreamCloudProxyClient)(nil).Trailer)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockCloudProxyAPI_StreamCloudProxyClient)(nil).Trailer)) } diff --git a/proto/v1alpha/proxy.pb.go b/proto/gen/proto/v1alpha/proxy.pb.go similarity index 61% rename from proto/v1alpha/proxy.pb.go rename to proto/gen/proto/v1alpha/proxy.pb.go index 7316339..39cbe4a 100644 --- a/proto/v1alpha/proxy.pb.go +++ b/proto/gen/proto/v1alpha/proxy.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.28.0 // source: proto/v1alpha/proxy.proto package cloudproxyv1alpha @@ -227,7 +227,7 @@ type ClientStats struct { unknownFields protoimpl.UnknownFields ClientMetadata *ClientMetadata `protobuf:"bytes,1,opt,name=client_metadata,json=clientMetadata,proto3" json:"client_metadata,omitempty"` - Status ClientStats_Status `protobuf:"varint,2,opt,name=status,proto3,enum=castai.cloud.proxy.v1alpha.ClientStats_Status" json:"status,omitempty"` + Status ClientStats_Status `protobuf:"varint,2,opt,name=status,proto3,enum=cloud.proxy.v1alpha.ClientStats_Status" json:"status,omitempty"` // The total number of RPCs that started. NumCallsStarted int64 `protobuf:"varint,3,opt,name=num_calls_started,json=numCallsStarted,proto3" json:"num_calls_started,omitempty"` // The total number of RPCs that finished. @@ -863,6 +863,8 @@ type ClientMetadata struct { ClusterId string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` OrganizationId *string `protobuf:"bytes,2,opt,name=organization_id,json=organizationId,proto3,oneof" json:"organization_id,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + PodName string `protobuf:"bytes,4,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"` } func (x *ClientMetadata) Reset() { @@ -911,211 +913,219 @@ func (x *ClientMetadata) GetOrganizationId() string { return "" } +func (x *ClientMetadata) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ClientMetadata) GetPodName() string { + if x != nil { + return x.PodName + } + return "" +} + var File_proto_v1alpha_proxy_proto protoreflect.FileDescriptor var file_proto_v1alpha_proxy_proto_rawDesc = []byte{ 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x61, 0x73, - 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x22, 0x9e, 0x02, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x5f, 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, - 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, - 0x6c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, - 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, - 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x12, 0x49, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x0a, - 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x18, 0x49, 0x6e, 0x69, - 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd9, 0x03, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x46, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x63, 0x61, 0x73, 0x74, - 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6e, 0x75, - 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x2c, 0x0a, - 0x12, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, - 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x43, 0x61, - 0x6c, 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x5d, 0x0a, 0x2d, 0x6e, - 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, - 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x66, 0x61, - 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x26, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, - 0x73, 0x68, 0x65, 0x64, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x61, - 0x69, 0x6c, 0x65, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x48, 0x0a, 0x21, 0x6e, 0x75, - 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, - 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, - 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x76, 0x65, 0x64, 0x22, 0x2a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, - 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4f, - 0x4b, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4c, 0x4f, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x02, - 0x22, 0xed, 0x01, 0x0a, 0x0f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x12, 0x1d, - 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x4d, 0x0a, - 0x0d, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0c, - 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, 0x10, - 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x22, 0x94, 0x01, 0x0a, 0x11, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x4f, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, - 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x8f, 0x03, 0x0a, 0x18, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x12, 0x1d, - 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x4f, 0x0a, - 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x01, 0x52, 0x0b, - 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x6a, - 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, - 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, - 0x02, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x0f, - 0x0a, 0x0d, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, - 0x18, 0x0a, 0x16, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x63, 0x0a, 0x14, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, - 0x12, 0x2c, 0x0a, 0x12, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6b, 0x65, - 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x90, - 0x02, 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x17, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x88, 0x01, 0x01, 0x12, 0x4e, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x1a, 0x63, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x3d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x62, 0x6f, 0x64, - 0x79, 0x22, 0xa3, 0x02, 0x0a, 0x0c, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, - 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x35, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, + 0x22, 0x89, 0x02, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x58, 0x0a, 0x0f, + 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x49, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x48, 0x00, + 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x42, 0x0a, + 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x82, 0x01, 0x0a, + 0x18, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, + 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x0f, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x22, 0xcb, 0x03, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x12, 0x4c, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, + 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x3f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x27, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6e, 0x75, 0x6d, + 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x12, + 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, + 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, + 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x5d, 0x0a, 0x2d, 0x6e, 0x75, + 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, + 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x66, 0x61, 0x69, + 0x6c, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x26, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, + 0x68, 0x65, 0x64, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x61, 0x69, + 0x6c, 0x65, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x48, 0x0a, 0x21, 0x6e, 0x75, 0x6d, + 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x5f, + 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, 0x69, + 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x64, 0x22, 0x2a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, + 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, + 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4c, 0x4f, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x22, + 0xdf, 0x01, 0x0a, 0x0f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0d, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, + 0x0c, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, + 0x10, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x22, 0x8d, 0x01, 0x0a, 0x11, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x48, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, + 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0xfa, 0x02, 0x0a, 0x18, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, + 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0e, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, + 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, + 0x12, 0x48, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, + 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x01, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x63, 0x0a, 0x15, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x48, 0x02, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x42, + 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x42, 0x18, 0x0a, 0x16, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x63, + 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, + 0x6c, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6b, 0x65, 0x65, 0x70, + 0x41, 0x6c, 0x69, 0x76, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, + 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x10, 0x6b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x22, 0x82, 0x02, 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, + 0x17, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x1a, 0x5c, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, + 0x07, 0x0a, 0x05, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x95, 0x02, 0x0a, 0x0c, 0x48, 0x54, 0x54, + 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, + 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x01, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x48, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x1a, - 0x63, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x5c, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x3d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x08, 0x0a, - 0x06, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x23, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xb5, 0x01, 0x0a, - 0x12, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, - 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x4a, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, - 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, - 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x7a, 0x0a, 0x13, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0d, 0x68, - 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x79, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, + 0x05, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x22, 0x23, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa7, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x0f, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x43, 0x0a, 0x0c, 0x68, 0x74, + 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x73, 0x0a, 0x13, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0d, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x22, 0xaa, 0x01, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x88, 0x01, 0x01, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6f, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x12, 0x0a, + 0x10, 0x5f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x32, 0xea, 0x01, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, + 0x41, 0x50, 0x49, 0x12, 0x75, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x2c, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x62, 0x0a, 0x0b, 0x53, 0x65, + 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x27, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0c, 0x68, 0x74, - 0x74, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x22, 0x71, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x2c, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x6f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, - 0x12, 0x0a, 0x10, 0x5f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x32, 0x87, 0x02, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x41, 0x50, 0x49, 0x12, 0x83, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x33, 0x2e, 0x63, 0x61, 0x73, - 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, - 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x34, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x70, 0x0a, 0x0b, 0x53, - 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x2e, 0x2e, 0x63, 0x61, 0x73, - 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x61, 0x73, - 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3f, 0x5a, - 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x61, 0x73, 0x74, - 0x61, 0x69, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, + 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x49, + 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x61, 0x73, + 0x74, 0x61, 0x69, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -1133,47 +1143,47 @@ func file_proto_v1alpha_proxy_proto_rawDescGZIP() []byte { var file_proto_v1alpha_proxy_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_proto_v1alpha_proxy_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_proto_v1alpha_proxy_proto_goTypes = []any{ - (ClientStats_Status)(0), // 0: castai.cloud.proxy.v1alpha.ClientStats.Status - (*StreamCloudProxyRequest)(nil), // 1: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest - (*InitialCloudProxyRequest)(nil), // 2: castai.cloud.proxy.v1alpha.InitialCloudProxyRequest - (*ClientStats)(nil), // 3: castai.cloud.proxy.v1alpha.ClientStats - (*ClusterResponse)(nil), // 4: castai.cloud.proxy.v1alpha.ClusterResponse - (*CloudProxyRequest)(nil), // 5: castai.cloud.proxy.v1alpha.CloudProxyRequest - (*StreamCloudProxyResponse)(nil), // 6: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse - (*ConfigurationRequest)(nil), // 7: castai.cloud.proxy.v1alpha.ConfigurationRequest - (*HTTPRequest)(nil), // 8: castai.cloud.proxy.v1alpha.HTTPRequest - (*HTTPResponse)(nil), // 9: castai.cloud.proxy.v1alpha.HTTPResponse - (*HeaderValue)(nil), // 10: castai.cloud.proxy.v1alpha.HeaderValue - (*SendToProxyRequest)(nil), // 11: castai.cloud.proxy.v1alpha.SendToProxyRequest - (*SendToProxyResponse)(nil), // 12: castai.cloud.proxy.v1alpha.SendToProxyResponse - (*ClientMetadata)(nil), // 13: castai.cloud.proxy.v1alpha.ClientMetadata - nil, // 14: castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry - nil, // 15: castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry + (ClientStats_Status)(0), // 0: cloud.proxy.v1alpha.ClientStats.Status + (*StreamCloudProxyRequest)(nil), // 1: cloud.proxy.v1alpha.StreamCloudProxyRequest + (*InitialCloudProxyRequest)(nil), // 2: cloud.proxy.v1alpha.InitialCloudProxyRequest + (*ClientStats)(nil), // 3: cloud.proxy.v1alpha.ClientStats + (*ClusterResponse)(nil), // 4: cloud.proxy.v1alpha.ClusterResponse + (*CloudProxyRequest)(nil), // 5: cloud.proxy.v1alpha.CloudProxyRequest + (*StreamCloudProxyResponse)(nil), // 6: cloud.proxy.v1alpha.StreamCloudProxyResponse + (*ConfigurationRequest)(nil), // 7: cloud.proxy.v1alpha.ConfigurationRequest + (*HTTPRequest)(nil), // 8: cloud.proxy.v1alpha.HTTPRequest + (*HTTPResponse)(nil), // 9: cloud.proxy.v1alpha.HTTPResponse + (*HeaderValue)(nil), // 10: cloud.proxy.v1alpha.HeaderValue + (*SendToProxyRequest)(nil), // 11: cloud.proxy.v1alpha.SendToProxyRequest + (*SendToProxyResponse)(nil), // 12: cloud.proxy.v1alpha.SendToProxyResponse + (*ClientMetadata)(nil), // 13: cloud.proxy.v1alpha.ClientMetadata + nil, // 14: cloud.proxy.v1alpha.HTTPRequest.HeadersEntry + nil, // 15: cloud.proxy.v1alpha.HTTPResponse.HeadersEntry } var file_proto_v1alpha_proxy_proto_depIdxs = []int32{ - 2, // 0: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest.initial_request:type_name -> castai.cloud.proxy.v1alpha.InitialCloudProxyRequest - 3, // 1: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest.client_stats:type_name -> castai.cloud.proxy.v1alpha.ClientStats - 4, // 2: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest.response:type_name -> castai.cloud.proxy.v1alpha.ClusterResponse - 13, // 3: castai.cloud.proxy.v1alpha.InitialCloudProxyRequest.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata - 13, // 4: castai.cloud.proxy.v1alpha.ClientStats.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata - 0, // 5: castai.cloud.proxy.v1alpha.ClientStats.status:type_name -> castai.cloud.proxy.v1alpha.ClientStats.Status - 13, // 6: castai.cloud.proxy.v1alpha.ClusterResponse.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata - 9, // 7: castai.cloud.proxy.v1alpha.ClusterResponse.http_response:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse - 8, // 8: castai.cloud.proxy.v1alpha.CloudProxyRequest.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest - 13, // 9: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata - 8, // 10: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest - 7, // 11: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.configuration_request:type_name -> castai.cloud.proxy.v1alpha.ConfigurationRequest - 14, // 12: castai.cloud.proxy.v1alpha.HTTPRequest.headers:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry - 15, // 13: castai.cloud.proxy.v1alpha.HTTPResponse.headers:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry - 13, // 14: castai.cloud.proxy.v1alpha.SendToProxyRequest.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata - 8, // 15: castai.cloud.proxy.v1alpha.SendToProxyRequest.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest - 9, // 16: castai.cloud.proxy.v1alpha.SendToProxyResponse.http_response:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse - 10, // 17: castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry.value:type_name -> castai.cloud.proxy.v1alpha.HeaderValue - 10, // 18: castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry.value:type_name -> castai.cloud.proxy.v1alpha.HeaderValue - 1, // 19: castai.cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:input_type -> castai.cloud.proxy.v1alpha.StreamCloudProxyRequest - 11, // 20: castai.cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:input_type -> castai.cloud.proxy.v1alpha.SendToProxyRequest - 6, // 21: castai.cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:output_type -> castai.cloud.proxy.v1alpha.StreamCloudProxyResponse - 12, // 22: castai.cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:output_type -> castai.cloud.proxy.v1alpha.SendToProxyResponse + 2, // 0: cloud.proxy.v1alpha.StreamCloudProxyRequest.initial_request:type_name -> cloud.proxy.v1alpha.InitialCloudProxyRequest + 3, // 1: cloud.proxy.v1alpha.StreamCloudProxyRequest.client_stats:type_name -> cloud.proxy.v1alpha.ClientStats + 4, // 2: cloud.proxy.v1alpha.StreamCloudProxyRequest.response:type_name -> cloud.proxy.v1alpha.ClusterResponse + 13, // 3: cloud.proxy.v1alpha.InitialCloudProxyRequest.client_metadata:type_name -> cloud.proxy.v1alpha.ClientMetadata + 13, // 4: cloud.proxy.v1alpha.ClientStats.client_metadata:type_name -> cloud.proxy.v1alpha.ClientMetadata + 0, // 5: cloud.proxy.v1alpha.ClientStats.status:type_name -> cloud.proxy.v1alpha.ClientStats.Status + 13, // 6: cloud.proxy.v1alpha.ClusterResponse.client_metadata:type_name -> cloud.proxy.v1alpha.ClientMetadata + 9, // 7: cloud.proxy.v1alpha.ClusterResponse.http_response:type_name -> cloud.proxy.v1alpha.HTTPResponse + 8, // 8: cloud.proxy.v1alpha.CloudProxyRequest.http_request:type_name -> cloud.proxy.v1alpha.HTTPRequest + 13, // 9: cloud.proxy.v1alpha.StreamCloudProxyResponse.client_metadata:type_name -> cloud.proxy.v1alpha.ClientMetadata + 8, // 10: cloud.proxy.v1alpha.StreamCloudProxyResponse.http_request:type_name -> cloud.proxy.v1alpha.HTTPRequest + 7, // 11: cloud.proxy.v1alpha.StreamCloudProxyResponse.configuration_request:type_name -> cloud.proxy.v1alpha.ConfigurationRequest + 14, // 12: cloud.proxy.v1alpha.HTTPRequest.headers:type_name -> cloud.proxy.v1alpha.HTTPRequest.HeadersEntry + 15, // 13: cloud.proxy.v1alpha.HTTPResponse.headers:type_name -> cloud.proxy.v1alpha.HTTPResponse.HeadersEntry + 13, // 14: cloud.proxy.v1alpha.SendToProxyRequest.client_metadata:type_name -> cloud.proxy.v1alpha.ClientMetadata + 8, // 15: cloud.proxy.v1alpha.SendToProxyRequest.http_request:type_name -> cloud.proxy.v1alpha.HTTPRequest + 9, // 16: cloud.proxy.v1alpha.SendToProxyResponse.http_response:type_name -> cloud.proxy.v1alpha.HTTPResponse + 10, // 17: cloud.proxy.v1alpha.HTTPRequest.HeadersEntry.value:type_name -> cloud.proxy.v1alpha.HeaderValue + 10, // 18: cloud.proxy.v1alpha.HTTPResponse.HeadersEntry.value:type_name -> cloud.proxy.v1alpha.HeaderValue + 1, // 19: cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:input_type -> cloud.proxy.v1alpha.StreamCloudProxyRequest + 11, // 20: cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:input_type -> cloud.proxy.v1alpha.SendToProxyRequest + 6, // 21: cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:output_type -> cloud.proxy.v1alpha.StreamCloudProxyResponse + 12, // 22: cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:output_type -> cloud.proxy.v1alpha.SendToProxyResponse 21, // [21:23] is the sub-list for method output_type 19, // [19:21] is the sub-list for method input_type 19, // [19:19] is the sub-list for extension type_name diff --git a/proto/v1alpha/proxy_grpc.pb.go b/proto/gen/proto/v1alpha/proxy_grpc.pb.go similarity index 100% rename from proto/v1alpha/proxy_grpc.pb.go rename to proto/gen/proto/v1alpha/proxy_grpc.pb.go diff --git a/proto/v1alpha/proxy.proto b/proto/v1alpha/proxy.proto index e573fd3..526c874 100644 --- a/proto/v1alpha/proxy.proto +++ b/proto/v1alpha/proxy.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package castai.cloud.proxy.v1alpha; -option go_package = "github.com/castai/cloud-proxy/proto/v1alpha;cloudproxyv1alpha"; +option go_package = "github.com/castai/cloud-proxy/proto/gen/proto/v1alpha;cloudproxyv1alpha"; // CloudProxyAPI provides the API for proxying cloud requests for CAST AI External Provisioner. service CloudProxyAPI { @@ -110,4 +110,6 @@ message SendToProxyResponse { message ClientMetadata { string cluster_id = 1; optional string organization_id = 2; + string namespace = 3; + string pod_name = 4; }