diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b1319a4..3267f65 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.22.2 + go-version: 1.22.5 check-latest: true - name: Check out code uses: actions/checkout@v3 @@ -40,7 +40,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.22.2 + go-version: 1.22.5 check-latest: true - name: Check out code uses: actions/checkout@v3 @@ -57,7 +57,7 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.22.2 + go-version: 1.22.5 check-latest: true - name: Get govulncheck run: go install golang.org/x/vuln/cmd/govulncheck@latest diff --git a/kms/client-examples_test.go b/kms/client-examples_test.go index 31930ae..11e5670 100644 --- a/kms/client-examples_test.go +++ b/kms/client-examples_test.go @@ -7,9 +7,12 @@ package kms_test import ( "context" "crypto/tls" + "errors" "fmt" "io" "log" + "log/slog" + "time" "github.com/minio/kms-go/kms" ) @@ -264,3 +267,42 @@ func ExampleClient_ListEnclaves() { fmt.Println(v.Name) } } + +// ExampleClient_Logs shows how to fetch server log records. +func ExampleClient_Logs() { + key, err := kms.ParseAPIKey("k1:d7cY_5k8HbBGkZpoy2hGmvkxg83QDBXsA_nFXDfTk2E") + if err != nil { + log.Fatalf("Failed to parse KMS API key: %v", err) + } + + client, err := kms.NewClient(&kms.Config{ + Endpoints: []string{ + "127.0.0.1:7373", + }, + APIKey: key, + TLS: &tls.Config{ + RootCAs: nil, // Use nil for system root CAs or customize + InsecureSkipVerify: false, // Don't skip TLS cert verification in prod + }, + }) + if err != nil { + log.Fatalf("Failed to create KMS client: %v", err) + } + + logs, err := client.Logs(context.TODO(), &kms.LogRequest{ + Host: "127.0.0.1:7373", // The server to fetch logs from + Level: slog.LevelWarn, // Fetch only warnings or error logs + Since: time.Now().Add(-5 * time.Minute), // Fetch logs of the last 5 min + }) + if err != nil { + log.Fatalf("Failed to fetch server logs: %v", err) + } + defer logs.Close() + + for r, ok := logs.Next(); ok; r, ok = logs.Next() { + _ = r // TODO: print logs + } + if err = logs.Close(); err != nil && !errors.Is(err, io.EOF) && !errors.Is(err, context.Canceled) { + log.Fatal(err) + } +} diff --git a/kms/client.go b/kms/client.go index e79bae3..a69f88c 100644 --- a/kms/client.go +++ b/kms/client.go @@ -20,6 +20,7 @@ import ( "sync" "time" + "aead.dev/mem" "github.com/minio/kms-go/kms/cmds" "github.com/minio/kms-go/kms/internal/api" "github.com/minio/kms-go/kms/internal/headers" @@ -722,6 +723,67 @@ func (c *Client) ReadDB(ctx context.Context) (*ReadDBResponse, error) { }, nil } +// Logs returns a stream of server log records from req.Host. +// If req.Host is empty, the first host of the client's host +// list is used. +// +// The LogRequest specifies which log records are fetched. +// For example, only records with a certain log level or +// records that contain a specific log message. +// +// It requires SysAdmin privileges. +// +// The returned error is of type *HostError. +func (c *Client) Logs(ctx context.Context, req *LogRequest) (*LogResponse, error) { + const ( + Method = http.MethodPost + Path = api.PathLog + StatusOK = http.StatusOK + ) + + var ( + err error + reqURL string + host = req.Host + ) + if host == "" { + reqURL, host, err = c.lb.URL(Path) + } else { + reqURL, err = url.JoinPath(httpsURL(host), Path) + } + if err != nil { + return nil, hostError(host, err) + } + + body, err := pb.Marshal(req) + if err != nil { + return nil, hostError(host, err) + } + r, err := http.NewRequestWithContext(ctx, Method, reqURL, bytes.NewReader(body)) + if err != nil { + return nil, hostError(host, err) + } + r.Header.Add(headers.Accept, headers.ContentTypeBinary) + r.Header.Add(headers.ContentType, headers.ContentTypeBinary) + + resp, err := c.client.Do(r) + if err != nil { + return nil, hostError(host, err) + } + if resp.StatusCode != StatusOK { + defer resp.Body.Close() + return nil, hostError(host, readError(resp)) + } + + if ct := resp.Header.Get(headers.ContentType); ct != headers.ContentTypeBinary { + return nil, hostError(host, fmt.Errorf("kms: invalid content-type '%s'", ct)) + } + return &LogResponse{ + r: resp.Body, + buf: make([]byte, 4*mem.KiB), + }, nil +} + // CreateEnclave creates a new enclave with the name req.Name. // // It returns ErrEnclaveExists if such an enclave already exists diff --git a/kms/internal/api/api.go b/kms/internal/api/api.go index c54deb3..cadaf22 100644 --- a/kms/internal/api/api.go +++ b/kms/internal/api/api.go @@ -20,6 +20,7 @@ const ( PathProfile = "/v1/debug/pprof" PathDB = "/v1/db" + PathLog = "/v1/log" PathKMS = "/v1/kms/" PathRPCReplicate = "/v1/rpc/replicate" diff --git a/kms/log.go b/kms/log.go new file mode 100644 index 0000000..392850d --- /dev/null +++ b/kms/log.go @@ -0,0 +1,142 @@ +// Copyright 2024 - MinIO, Inc. All rights reserved. +// Use of this source code is governed by the AGPLv3 +// license that can be found in the LICENSE file. + +package kms + +import ( + "encoding/binary" + "errors" + "io" + "log/slog" + "net/netip" + "time" + + pb "github.com/minio/kms-go/kms/protobuf" +) + +// StackFrame contains the resolved file and line number +// of a function call. +type StackFrame struct { + // Function is the package path-qualified function name containing the + // source line. If non-empty, this string uniquely identifies a single + // function in the program. This may be the empty string if not known. + Function string + + // File and Line are the file name and line number (1-based) of the source + // line. These may be the empty string and zero, respectively, if not known. + File string + Line int +} + +// LogRecord is a structure representing a KMS log event. +type LogRecord struct { + // The log level of the event. + Level slog.Level + + // The log message. + Message string + + // The time at which the event was produced. + Time time.Time + + // The stack trace at the time the event was recorded. + // Its first frame is the location at which this event + // was produced and subsequent frames represent function + // calls higher up the call stack. + // + // If empty, no stack trace has been captured. + Trace []StackFrame + + // If non-empty, HTTP method of the request that caused + // this event. + Method string + + // If non-empty, URL path of the request that caused + // this event. + Path string + + // If non-empty, identity of the request that caused + // this event. + Identity Identity + + // If valid, IP address of the client sending the + // request that caused this event. + IP netip.Addr +} + +// MarshalPB converts the LogRecord into its protobuf representation. +func (r *LogRecord) MarshalPB(v *pb.LogRecord) error { + v.Level = int32(r.Level) + v.Message = r.Message + v.Time = pb.Time(r.Time) + + if len(r.Trace) > 0 { + v.Trace = make([]*pb.LogRecord_StackFrame, 0, len(r.Trace)) + for _, t := range r.Trace { + v.Trace = append(v.Trace, &pb.LogRecord_StackFrame{ + Function: t.Function, + File: t.File, + Line: uint32(t.Line), + }) + } + } + if r.Method != "" || r.Path != "" || r.Identity != "" || r.IP.IsValid() { + v.Req = &pb.LogRecord_Request{ + Method: r.Method, + Path: r.Path, + Identity: r.Identity.String(), + IP: r.IP.String(), + } + } + return nil +} + +// UnmarshalPB initializes the LogRecord from its protobuf representation. +func (r *LogRecord) UnmarshalPB(v *pb.LogRecord) error { + var ip netip.Addr + if v.Req != nil { + var err error + if ip, err = netip.ParseAddr(v.Req.IP); err != nil { + return err + } + } + + r.Level = slog.Level(v.Level) + r.Message = v.Message + r.Time = v.Time.AsTime() + + r.Trace = make([]StackFrame, 0, len(v.Trace)) + for _, t := range v.GetTrace() { + r.Trace = append(r.Trace, StackFrame{ + Function: t.Function, + File: t.File, + Line: int(t.Line), + }) + } + + r.Method = v.Req.GetMethod() + r.Path = v.Req.GetPath() + r.Identity = Identity(v.Req.GetIdentity()) + r.IP = ip + return nil +} + +// readLogRecord reads a length-encoded protobuf log record +// into buf and unmarshales it into rec. It returns the first +// error encountered while reading from r. +func readLogRecord(r io.Reader, buf []byte, rec *LogRecord) error { + if _, err := io.ReadFull(r, buf[:4]); err != nil { + return err + } + + msgLen := binary.BigEndian.Uint32(buf) + if uint64(len(buf)) < uint64(msgLen) { + return errors.New("kms: log record too large") + } + + if _, err := io.ReadFull(r, buf[:msgLen]); err != nil { + return err + } + return pb.Unmarshal(buf[:msgLen], rec) +} diff --git a/kms/protobuf/log.pb.go b/kms/protobuf/log.pb.go new file mode 100644 index 0000000..0d5c194 --- /dev/null +++ b/kms/protobuf/log.pb.go @@ -0,0 +1,390 @@ +// Copyright 2024 - MinIO, Inc. All rights reserved. +// Use of this source code is governed by the AGPLv3 +// license that can be found in the LICENSE file. + +// Generate the Go protobuf code by running the protobuf compiler +// from the repository root: +// +// $ protoc -I=./kms/protobuf --go_out=. ./kms/protobuf/*.proto + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.27.1 +// source: log.proto + +package protobuf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type LogRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The log level of the event. + Level int32 `protobuf:"zigzag32,1,opt,name=Level,json=level,proto3" json:"Level,omitempty"` + // The time at which the event was produced. + Time *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=Time,json=time,proto3" json:"Time,omitempty"` + // The log message. + Message string `protobuf:"bytes,3,opt,name=Message,json=message,proto3" json:"Message,omitempty"` + // The stack trace at the time the event was recorded. + // Its first frame is the location at which this event + // was produced and subsequent frames represent function + // calls higher up the call stack. + // + // If empty, no stack trace has been captured. + Trace []*LogRecord_StackFrame `protobuf:"bytes,4,rep,name=Trace,json=trace,proto3" json:"Trace,omitempty"` + // HTTP request information + Req *LogRecord_Request `protobuf:"bytes,5,opt,name=Req,json=request,proto3" json:"Req,omitempty"` +} + +func (x *LogRecord) Reset() { + *x = LogRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_log_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogRecord) ProtoMessage() {} + +func (x *LogRecord) ProtoReflect() protoreflect.Message { + mi := &file_log_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 LogRecord.ProtoReflect.Descriptor instead. +func (*LogRecord) Descriptor() ([]byte, []int) { + return file_log_proto_rawDescGZIP(), []int{0} +} + +func (x *LogRecord) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *LogRecord) GetTime() *timestamppb.Timestamp { + if x != nil { + return x.Time + } + return nil +} + +func (x *LogRecord) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *LogRecord) GetTrace() []*LogRecord_StackFrame { + if x != nil { + return x.Trace + } + return nil +} + +func (x *LogRecord) GetReq() *LogRecord_Request { + if x != nil { + return x.Req + } + return nil +} + +type LogRecord_StackFrame struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Function is the package path-qualified function name containing the + // source line. If non-empty, this string uniquely identifies a single + // function in the program. This may be the empty string if not known. + Function string `protobuf:"bytes,1,opt,name=Function,json=function,proto3" json:"Function,omitempty"` + File string `protobuf:"bytes,2,opt,name=File,json=file,proto3" json:"File,omitempty"` + Line uint32 `protobuf:"varint,3,opt,name=Line,json=line,proto3" json:"Line,omitempty"` +} + +func (x *LogRecord_StackFrame) Reset() { + *x = LogRecord_StackFrame{} + if protoimpl.UnsafeEnabled { + mi := &file_log_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogRecord_StackFrame) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogRecord_StackFrame) ProtoMessage() {} + +func (x *LogRecord_StackFrame) ProtoReflect() protoreflect.Message { + mi := &file_log_proto_msgTypes[1] + 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 LogRecord_StackFrame.ProtoReflect.Descriptor instead. +func (*LogRecord_StackFrame) Descriptor() ([]byte, []int) { + return file_log_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *LogRecord_StackFrame) GetFunction() string { + if x != nil { + return x.Function + } + return "" +} + +func (x *LogRecord_StackFrame) GetFile() string { + if x != nil { + return x.File + } + return "" +} + +func (x *LogRecord_StackFrame) GetLine() uint32 { + if x != nil { + return x.Line + } + return 0 +} + +type LogRecord_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // HTTP method of the request that caused this event. + Method string `protobuf:"bytes,1,opt,name=Method,json=method,proto3" json:"Method,omitempty"` + // URL path of the request that caused this event. + Path string `protobuf:"bytes,2,opt,name=Path,json=path,proto3" json:"Path,omitempty"` + // Identity of the request that caused this event. + Identity string `protobuf:"bytes,3,opt,name=Identity,json=identity,proto3" json:"Identity,omitempty"` + // IP address of the client sending the request that + // caused this event. + IP string `protobuf:"bytes,4,opt,name=IP,json=ip,proto3" json:"IP,omitempty"` +} + +func (x *LogRecord_Request) Reset() { + *x = LogRecord_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_log_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogRecord_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogRecord_Request) ProtoMessage() {} + +func (x *LogRecord_Request) ProtoReflect() protoreflect.Message { + mi := &file_log_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 LogRecord_Request.ProtoReflect.Descriptor instead. +func (*LogRecord_Request) Descriptor() ([]byte, []int) { + return file_log_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *LogRecord_Request) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *LogRecord_Request) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *LogRecord_Request) GetIdentity() string { + if x != nil { + return x.Identity + } + return "" +} + +func (x *LogRecord_Request) GetIP() string { + if x != nil { + return x.IP + } + return "" +} + +var File_log_proto protoreflect.FileDescriptor + +var file_log_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6d, 0x69, 0x6e, + 0x69, 0x6f, 0x2e, 0x6b, 0x6d, 0x73, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8b, 0x03, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x11, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x2e, 0x0a, 0x04, 0x54, + 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x2e, 0x6b, 0x6d, 0x73, + 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x12, 0x32, 0x0a, 0x03, + 0x52, 0x65, 0x71, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x69, 0x6e, 0x69, + 0x6f, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x50, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x69, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x6c, 0x69, + 0x6e, 0x65, 0x1a, 0x61, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x50, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x70, 0x42, 0x0e, 0x5a, 0x0c, 0x6b, 0x6d, 0x73, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_log_proto_rawDescOnce sync.Once + file_log_proto_rawDescData = file_log_proto_rawDesc +) + +func file_log_proto_rawDescGZIP() []byte { + file_log_proto_rawDescOnce.Do(func() { + file_log_proto_rawDescData = protoimpl.X.CompressGZIP(file_log_proto_rawDescData) + }) + return file_log_proto_rawDescData +} + +var file_log_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_log_proto_goTypes = []interface{}{ + (*LogRecord)(nil), // 0: minio.kms.LogRecord + (*LogRecord_StackFrame)(nil), // 1: minio.kms.LogRecord.StackFrame + (*LogRecord_Request)(nil), // 2: minio.kms.LogRecord.Request + (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp +} +var file_log_proto_depIdxs = []int32{ + 3, // 0: minio.kms.LogRecord.Time:type_name -> google.protobuf.Timestamp + 1, // 1: minio.kms.LogRecord.Trace:type_name -> minio.kms.LogRecord.StackFrame + 2, // 2: minio.kms.LogRecord.Req:type_name -> minio.kms.LogRecord.Request + 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_log_proto_init() } +func file_log_proto_init() { + if File_log_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_log_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_log_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogRecord_StackFrame); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_log_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogRecord_Request); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_log_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_log_proto_goTypes, + DependencyIndexes: file_log_proto_depIdxs, + MessageInfos: file_log_proto_msgTypes, + }.Build() + File_log_proto = out.File + file_log_proto_rawDesc = nil + file_log_proto_goTypes = nil + file_log_proto_depIdxs = nil +} diff --git a/kms/protobuf/log.proto b/kms/protobuf/log.proto new file mode 100644 index 0000000..2b3db74 --- /dev/null +++ b/kms/protobuf/log.proto @@ -0,0 +1,64 @@ +// Copyright 2024 - MinIO, Inc. All rights reserved. +// Use of this source code is governed by the AGPLv3 +// license that can be found in the LICENSE file. + +// Generate the Go protobuf code by running the protobuf compiler +// from the repository root: +// +// $ protoc -I=./kms/protobuf --go_out=. ./kms/protobuf/*.proto + +syntax = "proto3"; + +package minio.kms; + +import "google/protobuf/timestamp.proto"; + +option go_package = "kms/protobuf"; + +message LogRecord { + message StackFrame { + // Function is the package path-qualified function name containing the + // source line. If non-empty, this string uniquely identifies a single + // function in the program. This may be the empty string if not known. + string Function = 1 [ json_name = "function" ]; + + string File = 2 [ json_name = "file" ]; + + uint32 Line = 3 [ json_name = "line" ]; + } + + message Request { + // HTTP method of the request that caused this event. + string Method = 1 [ json_name = "method" ]; + + // URL path of the request that caused this event. + string Path = 2 [ json_name = "path" ]; + + // Identity of the request that caused this event. + string Identity = 3 [ json_name = "identity" ]; + + // IP address of the client sending the request that + // caused this event. + string IP = 4 [ json_name = "ip" ]; + } + + // The log level of the event. + sint32 Level = 1 [ json_name="level" ]; + + // The time at which the event was produced. + google.protobuf.Timestamp Time = 2 [ json_name = "time" ]; + + // The log message. + string Message = 3 [ json_name = "message" ]; + + // The stack trace at the time the event was recorded. + // Its first frame is the location at which this event + // was produced and subsequent frames represent function + // calls higher up the call stack. + // + // If empty, no stack trace has been captured. + repeated StackFrame Trace = 4 [ json_name = "trace" ]; + + // HTTP request information + Request Req = 5 [ json_name = "request" ]; +} diff --git a/kms/protobuf/request.pb.go b/kms/protobuf/request.pb.go index 8595e80..60ecbb5 100644 --- a/kms/protobuf/request.pb.go +++ b/kms/protobuf/request.pb.go @@ -10,7 +10,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v5.26.1 +// protoc v5.27.1 // source: request.proto package protobuf @@ -18,6 +18,7 @@ package protobuf import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -443,6 +444,111 @@ func (x *EnclaveStatusRequest) GetName() string { return "" } +type LogRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The server only sends log records with an equal or greater + // log level. The default level is slog.LevelInfo. + Level int32 `protobuf:"zigzag32,1,opt,name=Level,json=level,proto3" json:"Level,omitempty"` + // The server only sends log records with a log message that + // contain this message. + Message string `protobuf:"bytes,2,opt,name=Message,json=message,proto3" json:"Message,omitempty"` + // Optionally, fetch log records since the given point in time. + // If empty, the server sends only new log records. The server + // ignores any timestamps newer then its current time. + Since *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=Since,json=since,proto3" json:"Since,omitempty"` + // The server only sends only log records with this request method. + Method string `protobuf:"bytes,4,opt,name=Method,json=method,proto3" json:"Method,omitempty"` + // The server sends only log records with this request path. + Path string `protobuf:"bytes,5,opt,name=Path,json=path,proto3" json:"Path,omitempty"` + Identity string `protobuf:"bytes,6,opt,name=Identity,json=identity,proto3" json:"Identity,omitempty"` + // The server sends only log records with this IP address. + IP string `protobuf:"bytes,7,opt,name=IP,json=ip,proto3" json:"IP,omitempty"` +} + +func (x *LogRequest) Reset() { + *x = LogRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_request_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogRequest) ProtoMessage() {} + +func (x *LogRequest) ProtoReflect() protoreflect.Message { + mi := &file_request_proto_msgTypes[8] + 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 LogRequest.ProtoReflect.Descriptor instead. +func (*LogRequest) Descriptor() ([]byte, []int) { + return file_request_proto_rawDescGZIP(), []int{8} +} + +func (x *LogRequest) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *LogRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *LogRequest) GetSince() *timestamppb.Timestamp { + if x != nil { + return x.Since + } + return nil +} + +func (x *LogRequest) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *LogRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *LogRequest) GetIdentity() string { + if x != nil { + return x.Identity + } + return "" +} + +func (x *LogRequest) GetIP() string { + if x != nil { + return x.IP + } + return "" +} + type CreateKeyRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -459,7 +565,7 @@ type CreateKeyRequest struct { func (x *CreateKeyRequest) Reset() { *x = CreateKeyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[8] + mi := &file_request_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -472,7 +578,7 @@ func (x *CreateKeyRequest) String() string { func (*CreateKeyRequest) ProtoMessage() {} func (x *CreateKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[8] + mi := &file_request_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -485,7 +591,7 @@ func (x *CreateKeyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateKeyRequest.ProtoReflect.Descriptor instead. func (*CreateKeyRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{8} + return file_request_proto_rawDescGZIP(), []int{9} } func (x *CreateKeyRequest) GetName() string { @@ -524,7 +630,7 @@ type ImportKeyRequest struct { func (x *ImportKeyRequest) Reset() { *x = ImportKeyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[9] + mi := &file_request_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -537,7 +643,7 @@ func (x *ImportKeyRequest) String() string { func (*ImportKeyRequest) ProtoMessage() {} func (x *ImportKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[9] + mi := &file_request_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -550,7 +656,7 @@ func (x *ImportKeyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ImportKeyRequest.ProtoReflect.Descriptor instead. func (*ImportKeyRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{9} + return file_request_proto_rawDescGZIP(), []int{10} } func (x *ImportKeyRequest) GetName() string { @@ -590,7 +696,7 @@ type DeleteKeyRequest struct { func (x *DeleteKeyRequest) Reset() { *x = DeleteKeyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[10] + mi := &file_request_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -603,7 +709,7 @@ func (x *DeleteKeyRequest) String() string { func (*DeleteKeyRequest) ProtoMessage() {} func (x *DeleteKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[10] + mi := &file_request_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -616,7 +722,7 @@ func (x *DeleteKeyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteKeyRequest.ProtoReflect.Descriptor instead. func (*DeleteKeyRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{10} + return file_request_proto_rawDescGZIP(), []int{11} } func (x *DeleteKeyRequest) GetName() string { @@ -654,7 +760,7 @@ type KeyStatusRequest struct { func (x *KeyStatusRequest) Reset() { *x = KeyStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[11] + mi := &file_request_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -667,7 +773,7 @@ func (x *KeyStatusRequest) String() string { func (*KeyStatusRequest) ProtoMessage() {} func (x *KeyStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[11] + mi := &file_request_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -680,7 +786,7 @@ func (x *KeyStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyStatusRequest.ProtoReflect.Descriptor instead. func (*KeyStatusRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{11} + return file_request_proto_rawDescGZIP(), []int{12} } func (x *KeyStatusRequest) GetName() string { @@ -720,7 +826,7 @@ type EncryptRequest struct { func (x *EncryptRequest) Reset() { *x = EncryptRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[12] + mi := &file_request_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -733,7 +839,7 @@ func (x *EncryptRequest) String() string { func (*EncryptRequest) ProtoMessage() {} func (x *EncryptRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[12] + mi := &file_request_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -746,7 +852,7 @@ func (x *EncryptRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EncryptRequest.ProtoReflect.Descriptor instead. func (*EncryptRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{12} + return file_request_proto_rawDescGZIP(), []int{13} } func (x *EncryptRequest) GetName() string { @@ -802,7 +908,7 @@ type GenerateKeyRequest struct { func (x *GenerateKeyRequest) Reset() { *x = GenerateKeyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[13] + mi := &file_request_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -815,7 +921,7 @@ func (x *GenerateKeyRequest) String() string { func (*GenerateKeyRequest) ProtoMessage() {} func (x *GenerateKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[13] + mi := &file_request_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -828,7 +934,7 @@ func (x *GenerateKeyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GenerateKeyRequest.ProtoReflect.Descriptor instead. func (*GenerateKeyRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{13} + return file_request_proto_rawDescGZIP(), []int{14} } func (x *GenerateKeyRequest) GetName() string { @@ -878,7 +984,7 @@ type DecryptRequest struct { func (x *DecryptRequest) Reset() { *x = DecryptRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[14] + mi := &file_request_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -891,7 +997,7 @@ func (x *DecryptRequest) String() string { func (*DecryptRequest) ProtoMessage() {} func (x *DecryptRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[14] + mi := &file_request_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -904,7 +1010,7 @@ func (x *DecryptRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DecryptRequest.ProtoReflect.Descriptor instead. func (*DecryptRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{14} + return file_request_proto_rawDescGZIP(), []int{15} } func (x *DecryptRequest) GetName() string { @@ -948,7 +1054,7 @@ type CreatePolicyRequest struct { func (x *CreatePolicyRequest) Reset() { *x = CreatePolicyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[15] + mi := &file_request_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -961,7 +1067,7 @@ func (x *CreatePolicyRequest) String() string { func (*CreatePolicyRequest) ProtoMessage() {} func (x *CreatePolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[15] + mi := &file_request_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -974,7 +1080,7 @@ func (x *CreatePolicyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatePolicyRequest.ProtoReflect.Descriptor instead. func (*CreatePolicyRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{15} + return file_request_proto_rawDescGZIP(), []int{16} } func (x *CreatePolicyRequest) GetName() string { @@ -1009,7 +1115,7 @@ type PolicyRequest struct { func (x *PolicyRequest) Reset() { *x = PolicyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[16] + mi := &file_request_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1022,7 +1128,7 @@ func (x *PolicyRequest) String() string { func (*PolicyRequest) ProtoMessage() {} func (x *PolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[16] + mi := &file_request_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1035,7 +1141,7 @@ func (x *PolicyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PolicyRequest.ProtoReflect.Descriptor instead. func (*PolicyRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{16} + return file_request_proto_rawDescGZIP(), []int{17} } func (x *PolicyRequest) GetName() string { @@ -1056,7 +1162,7 @@ type DeletePolicyRequest struct { func (x *DeletePolicyRequest) Reset() { *x = DeletePolicyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[17] + mi := &file_request_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1069,7 +1175,7 @@ func (x *DeletePolicyRequest) String() string { func (*DeletePolicyRequest) ProtoMessage() {} func (x *DeletePolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[17] + mi := &file_request_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1082,7 +1188,7 @@ func (x *DeletePolicyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeletePolicyRequest.ProtoReflect.Descriptor instead. func (*DeletePolicyRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{17} + return file_request_proto_rawDescGZIP(), []int{18} } func (x *DeletePolicyRequest) GetName() string { @@ -1105,7 +1211,7 @@ type AssignPolicyRequest struct { func (x *AssignPolicyRequest) Reset() { *x = AssignPolicyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[18] + mi := &file_request_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1118,7 +1224,7 @@ func (x *AssignPolicyRequest) String() string { func (*AssignPolicyRequest) ProtoMessage() {} func (x *AssignPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[18] + mi := &file_request_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1131,7 +1237,7 @@ func (x *AssignPolicyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AssignPolicyRequest.ProtoReflect.Descriptor instead. func (*AssignPolicyRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{18} + return file_request_proto_rawDescGZIP(), []int{19} } func (x *AssignPolicyRequest) GetIdentity() string { @@ -1164,7 +1270,7 @@ type CreateIdentityRequest struct { func (x *CreateIdentityRequest) Reset() { *x = CreateIdentityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[19] + mi := &file_request_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1177,7 +1283,7 @@ func (x *CreateIdentityRequest) String() string { func (*CreateIdentityRequest) ProtoMessage() {} func (x *CreateIdentityRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[19] + mi := &file_request_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1190,7 +1296,7 @@ func (x *CreateIdentityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateIdentityRequest.ProtoReflect.Descriptor instead. func (*CreateIdentityRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{19} + return file_request_proto_rawDescGZIP(), []int{20} } func (x *CreateIdentityRequest) GetIdentity() string { @@ -1225,7 +1331,7 @@ type IdentityRequest struct { func (x *IdentityRequest) Reset() { *x = IdentityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[20] + mi := &file_request_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1238,7 +1344,7 @@ func (x *IdentityRequest) String() string { func (*IdentityRequest) ProtoMessage() {} func (x *IdentityRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[20] + mi := &file_request_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1251,7 +1357,7 @@ func (x *IdentityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use IdentityRequest.ProtoReflect.Descriptor instead. func (*IdentityRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{20} + return file_request_proto_rawDescGZIP(), []int{21} } func (x *IdentityRequest) GetIdentity() string { @@ -1272,7 +1378,7 @@ type DeleteIdentityRequest struct { func (x *DeleteIdentityRequest) Reset() { *x = DeleteIdentityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[21] + mi := &file_request_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1285,7 +1391,7 @@ func (x *DeleteIdentityRequest) String() string { func (*DeleteIdentityRequest) ProtoMessage() {} func (x *DeleteIdentityRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_proto_msgTypes[21] + mi := &file_request_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1298,7 +1404,7 @@ func (x *DeleteIdentityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteIdentityRequest.ProtoReflect.Descriptor instead. func (*DeleteIdentityRequest) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{21} + return file_request_proto_rawDescGZIP(), []int{22} } func (x *DeleteIdentityRequest) GetIdentity() string { @@ -1312,126 +1418,141 @@ var File_request_proto protoreflect.FileDescriptor var file_request_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x09, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x2e, 0x6b, 0x6d, 0x73, 0x1a, 0x0a, 0x72, 0x75, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5c, - 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1f, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, - 0x65, 0x41, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x69, - 0x6e, 0x75, 0x65, 0x5f, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x2b, 0x0a, 0x15, - 0x41, 0x64, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x22, 0x2e, 0x0a, 0x18, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x22, 0x43, 0x0a, 0x12, 0x45, 0x64, 0x69, - 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, - 0x6f, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x09, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x44, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x22, 0x2a, - 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x14, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x14, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x5b, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1f, - 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0x4c, 0x0a, 0x10, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x09, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x2e, 0x6b, 0x6d, 0x73, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x72, 0x75, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x5c, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1f, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, + 0x75, 0x65, 0x41, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, + 0x69, 0x6e, 0x75, 0x65, 0x5f, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x2b, 0x0a, + 0x15, 0x41, 0x64, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x22, 0x2e, 0x0a, 0x18, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x22, 0x43, 0x0a, 0x12, 0x45, 0x64, + 0x69, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x68, 0x6f, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x09, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x44, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x22, + 0x2a, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x14, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4b, - 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x63, 0x0a, - 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x14, 0x45, 0x6e, 0x63, 0x6c, 0x61, + 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0xc6, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x11, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x73, + 0x69, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x50, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, + 0x49, 0x50, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x5b, 0x0a, 0x10, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, 0x64, + 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x4c, 0x0a, 0x10, 0x49, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x63, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, + 0x61, 0x6c, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x40, 0x0a, 0x10, + 0x4b, 0x65, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x85, + 0x01, 0x0a, 0x0e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x21, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x40, 0x0a, 0x10, 0x4b, 0x65, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x85, 0x01, 0x0a, 0x0e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, - 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, - 0x65, 0x78, 0x74, 0x12, 0x27, 0x0a, 0x0e, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, - 0x64, 0x44, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x61, 0x73, 0x73, - 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x22, 0x83, 0x01, 0x0a, - 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x27, 0x0a, 0x0e, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x44, - 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x6f, 0x63, - 0x69, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x4c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x22, 0x87, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, - 0x65, 0x78, 0x74, 0x12, 0x27, 0x0a, 0x0e, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, - 0x64, 0x44, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x61, 0x73, 0x73, - 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x22, 0xc3, 0x02, 0x0a, - 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x05, 0x41, 0x6c, 0x6c, 0x6f, - 0x77, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x2e, - 0x6b, 0x6d, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x3c, 0x0a, 0x04, 0x44, 0x65, 0x6e, - 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x2e, - 0x6b, 0x6d, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x44, 0x65, 0x6e, 0x79, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x04, 0x64, 0x65, 0x6e, 0x79, 0x1a, 0x4c, 0x0a, 0x0a, 0x41, 0x6c, 0x6c, 0x6f, 0x77, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x2e, 0x6b, - 0x6d, 0x73, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4b, 0x0a, 0x09, 0x44, 0x65, 0x6e, 0x79, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, - 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x22, 0x23, 0x0a, 0x0d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x1c, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x27, 0x0a, + 0x0e, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x22, 0x83, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0e, 0x41, + 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x87, 0x01, 0x0a, + 0x0e, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, + 0x0a, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x12, 0x27, 0x0a, + 0x0e, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x22, 0xc3, 0x02, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x49, 0x0a, 0x13, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x7c, 0x0a, - 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, - 0x12, 0x29, 0x0a, 0x10, 0x49, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2d, 0x0a, 0x0f, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x33, 0x0a, 0x15, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x05, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x61, 0x6c, + 0x6c, 0x6f, 0x77, 0x12, 0x3c, 0x0a, 0x04, 0x44, 0x65, 0x6e, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x44, 0x65, 0x6e, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x65, 0x6e, + 0x79, 0x1a, 0x4c, 0x0a, 0x0a, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x52, 0x75, 0x6c, + 0x65, 0x53, 0x65, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x4b, 0x0a, 0x09, 0x44, 0x65, 0x6e, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, + 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x23, 0x0a, 0x0d, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x29, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x49, 0x0a, 0x13, + 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x42, - 0x0e, 0x5a, 0x0c, 0x6b, 0x6d, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, + 0x16, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x7c, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, + 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x49, 0x73, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2d, 0x0a, 0x0f, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x22, 0x33, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x42, 0x0e, 0x5a, 0x0c, 0x6b, 0x6d, 0x73, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -1446,7 +1567,7 @@ func file_request_proto_rawDescGZIP() []byte { return file_request_proto_rawDescData } -var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_request_proto_goTypes = []interface{}{ (*ClusterStatusRequest)(nil), // 0: minio.kms.ClusterStatusRequest (*ListRequest)(nil), // 1: minio.kms.ListRequest @@ -1456,34 +1577,37 @@ var file_request_proto_goTypes = []interface{}{ (*CreateEnclaveRequest)(nil), // 5: minio.kms.CreateEnclaveRequest (*DeleteEnclaveRequest)(nil), // 6: minio.kms.DeleteEnclaveRequest (*EnclaveStatusRequest)(nil), // 7: minio.kms.EnclaveStatusRequest - (*CreateKeyRequest)(nil), // 8: minio.kms.CreateKeyRequest - (*ImportKeyRequest)(nil), // 9: minio.kms.ImportKeyRequest - (*DeleteKeyRequest)(nil), // 10: minio.kms.DeleteKeyRequest - (*KeyStatusRequest)(nil), // 11: minio.kms.KeyStatusRequest - (*EncryptRequest)(nil), // 12: minio.kms.EncryptRequest - (*GenerateKeyRequest)(nil), // 13: minio.kms.GenerateKeyRequest - (*DecryptRequest)(nil), // 14: minio.kms.DecryptRequest - (*CreatePolicyRequest)(nil), // 15: minio.kms.CreatePolicyRequest - (*PolicyRequest)(nil), // 16: minio.kms.PolicyRequest - (*DeletePolicyRequest)(nil), // 17: minio.kms.DeletePolicyRequest - (*AssignPolicyRequest)(nil), // 18: minio.kms.AssignPolicyRequest - (*CreateIdentityRequest)(nil), // 19: minio.kms.CreateIdentityRequest - (*IdentityRequest)(nil), // 20: minio.kms.IdentityRequest - (*DeleteIdentityRequest)(nil), // 21: minio.kms.DeleteIdentityRequest - nil, // 22: minio.kms.CreatePolicyRequest.AllowEntry - nil, // 23: minio.kms.CreatePolicyRequest.DenyEntry - (*RuleSet)(nil), // 24: minio.kms.RuleSet + (*LogRequest)(nil), // 8: minio.kms.LogRequest + (*CreateKeyRequest)(nil), // 9: minio.kms.CreateKeyRequest + (*ImportKeyRequest)(nil), // 10: minio.kms.ImportKeyRequest + (*DeleteKeyRequest)(nil), // 11: minio.kms.DeleteKeyRequest + (*KeyStatusRequest)(nil), // 12: minio.kms.KeyStatusRequest + (*EncryptRequest)(nil), // 13: minio.kms.EncryptRequest + (*GenerateKeyRequest)(nil), // 14: minio.kms.GenerateKeyRequest + (*DecryptRequest)(nil), // 15: minio.kms.DecryptRequest + (*CreatePolicyRequest)(nil), // 16: minio.kms.CreatePolicyRequest + (*PolicyRequest)(nil), // 17: minio.kms.PolicyRequest + (*DeletePolicyRequest)(nil), // 18: minio.kms.DeletePolicyRequest + (*AssignPolicyRequest)(nil), // 19: minio.kms.AssignPolicyRequest + (*CreateIdentityRequest)(nil), // 20: minio.kms.CreateIdentityRequest + (*IdentityRequest)(nil), // 21: minio.kms.IdentityRequest + (*DeleteIdentityRequest)(nil), // 22: minio.kms.DeleteIdentityRequest + nil, // 23: minio.kms.CreatePolicyRequest.AllowEntry + nil, // 24: minio.kms.CreatePolicyRequest.DenyEntry + (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp + (*RuleSet)(nil), // 26: minio.kms.RuleSet } var file_request_proto_depIdxs = []int32{ - 22, // 0: minio.kms.CreatePolicyRequest.Allow:type_name -> minio.kms.CreatePolicyRequest.AllowEntry - 23, // 1: minio.kms.CreatePolicyRequest.Deny:type_name -> minio.kms.CreatePolicyRequest.DenyEntry - 24, // 2: minio.kms.CreatePolicyRequest.AllowEntry.value:type_name -> minio.kms.RuleSet - 24, // 3: minio.kms.CreatePolicyRequest.DenyEntry.value:type_name -> minio.kms.RuleSet - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 25, // 0: minio.kms.LogRequest.Since:type_name -> google.protobuf.Timestamp + 23, // 1: minio.kms.CreatePolicyRequest.Allow:type_name -> minio.kms.CreatePolicyRequest.AllowEntry + 24, // 2: minio.kms.CreatePolicyRequest.Deny:type_name -> minio.kms.CreatePolicyRequest.DenyEntry + 26, // 3: minio.kms.CreatePolicyRequest.AllowEntry.value:type_name -> minio.kms.RuleSet + 26, // 4: minio.kms.CreatePolicyRequest.DenyEntry.value:type_name -> minio.kms.RuleSet + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_request_proto_init() } @@ -1590,7 +1714,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateKeyRequest); i { + switch v := v.(*LogRequest); i { case 0: return &v.state case 1: @@ -1602,7 +1726,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImportKeyRequest); i { + switch v := v.(*CreateKeyRequest); i { case 0: return &v.state case 1: @@ -1614,7 +1738,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteKeyRequest); i { + switch v := v.(*ImportKeyRequest); i { case 0: return &v.state case 1: @@ -1626,7 +1750,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyStatusRequest); i { + switch v := v.(*DeleteKeyRequest); i { case 0: return &v.state case 1: @@ -1638,7 +1762,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EncryptRequest); i { + switch v := v.(*KeyStatusRequest); i { case 0: return &v.state case 1: @@ -1650,7 +1774,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenerateKeyRequest); i { + switch v := v.(*EncryptRequest); i { case 0: return &v.state case 1: @@ -1662,7 +1786,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DecryptRequest); i { + switch v := v.(*GenerateKeyRequest); i { case 0: return &v.state case 1: @@ -1674,7 +1798,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreatePolicyRequest); i { + switch v := v.(*DecryptRequest); i { case 0: return &v.state case 1: @@ -1686,7 +1810,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PolicyRequest); i { + switch v := v.(*CreatePolicyRequest); i { case 0: return &v.state case 1: @@ -1698,7 +1822,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeletePolicyRequest); i { + switch v := v.(*PolicyRequest); i { case 0: return &v.state case 1: @@ -1710,7 +1834,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AssignPolicyRequest); i { + switch v := v.(*DeletePolicyRequest); i { case 0: return &v.state case 1: @@ -1722,7 +1846,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateIdentityRequest); i { + switch v := v.(*AssignPolicyRequest); i { case 0: return &v.state case 1: @@ -1734,7 +1858,7 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IdentityRequest); i { + switch v := v.(*CreateIdentityRequest); i { case 0: return &v.state case 1: @@ -1746,6 +1870,18 @@ func file_request_proto_init() { } } file_request_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_request_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteIdentityRequest); i { case 0: return &v.state @@ -1764,7 +1900,7 @@ func file_request_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_request_proto_rawDesc, NumEnums: 0, - NumMessages: 24, + NumMessages: 25, NumExtensions: 0, NumServices: 0, }, diff --git a/kms/protobuf/request.proto b/kms/protobuf/request.proto index 83e9506..2460afc 100644 --- a/kms/protobuf/request.proto +++ b/kms/protobuf/request.proto @@ -13,6 +13,7 @@ package minio.kms; option go_package = "kms/protobuf"; +import "google/protobuf/timestamp.proto"; import "rule.proto"; message ClusterStatusRequest {} @@ -74,6 +75,31 @@ message EnclaveStatusRequest { string Name = 1 [ json_name = "name" ]; } +message LogRequest { + // The server only sends log records with an equal or greater + // log level. The default level is slog.LevelInfo. + sint32 Level = 1 [ json_name = "level" ]; + + // The server only sends log records with a log message that + // contain this message. + string Message = 2 [ json_name = "message" ]; + + // Optionally, fetch log records since the given point in time. + // If empty, the server sends only new log records. The server + // ignores any timestamps newer then its current time. + google.protobuf.Timestamp Since = 3 [ json_name = "since" ]; + + // The server only sends only log records with this request method. + string Method = 4 [ json_name = "method" ]; + + // The server sends only log records with this request path. + string Path = 5 [ json_name = "path" ]; + + string Identity = 6 [ json_name = "identity" ]; + + // The server sends only log records with this IP address. + string IP = 7 [ json_name = "ip" ]; +} message CreateKeyRequest { string Name = 1 [ json_name = "name" ]; diff --git a/kms/protobuf/response.pb.go b/kms/protobuf/response.pb.go index 984a2d0..48073cb 100644 --- a/kms/protobuf/response.pb.go +++ b/kms/protobuf/response.pb.go @@ -10,7 +10,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v5.26.1 +// protoc v5.27.1 // source: response.proto package protobuf @@ -389,13 +389,32 @@ type ProfileStatusResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Started *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=Started,json=started,proto3" json:"Started,omitempty"` - CPU bool `protobuf:"varint,2,opt,name=CPU,json=cpu,proto3" json:"CPU,omitempty"` - Heap bool `protobuf:"varint,3,opt,name=Heap,json=heap,proto3" json:"Heap,omitempty"` - Goroutine bool `protobuf:"varint,4,opt,name=Goroutine,json=goroutine,proto3" json:"Goroutine,omitempty"` - Thread bool `protobuf:"varint,5,opt,name=Thread,json=thread,proto3" json:"Thread,omitempty"` - BlockRate uint32 `protobuf:"varint,6,opt,name=BlockRate,json=block_rate,proto3" json:"BlockRate,omitempty"` - MutexFraction uint32 `protobuf:"varint,7,opt,name=MutexFraction,json=mutex_frac,proto3" json:"MutexFraction,omitempty"` + // Started is the point in time when profiling was enabled. + Started *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=Started,json=started,proto3" json:"Started,omitempty"` + // CPU indicates whether the server is capturing a CPU profile. + CPU bool `protobuf:"varint,2,opt,name=CPU,json=cpu,proto3" json:"CPU,omitempty"` + // Heap indicates whether the server is capturing a heap memory profile. + Heap bool `protobuf:"varint,3,opt,name=Heap,json=heap,proto3" json:"Heap,omitempty"` + // Goroutine indicates whether the server is capturing a runtime go + // routine profile. + Goroutine bool `protobuf:"varint,4,opt,name=Goroutine,json=goroutine,proto3" json:"Goroutine,omitempty"` + // Goroutine indicates whether the server is capturing a OS thread + // profile. + Thread bool `protobuf:"varint,5,opt,name=Thread,json=thread,proto3" json:"Thread,omitempty"` + // BlockRate is the fraction of runtime blocking events, like a + // go routine getting blocked, collected by the server's block + // profile. On average, the server samples one blocking event per + // BlockRate nanoseconds spent blocked. + // + // If 0, block profiling is disabled. + BlockRate uint32 `protobuf:"varint,6,opt,name=BlockRate,json=block_rate,proto3" json:"BlockRate,omitempty"` + // MutexFraction is the fraction of mutex contention events, + // like waiting to accquire a lock, collected by the server's + // mutex profile. On average, the server collects 1/MutexFraction + // events in its mutex profile. + // + // If 0, mutex profiling is disabled. + MutexFraction uint32 `protobuf:"varint,7,opt,name=MutexFraction,json=mutex_frac,proto3" json:"MutexFraction,omitempty"` } func (x *ProfileStatusResponse) Reset() { diff --git a/kms/protobuf/rule.pb.go b/kms/protobuf/rule.pb.go index 14eeef1..ea92d62 100644 --- a/kms/protobuf/rule.pb.go +++ b/kms/protobuf/rule.pb.go @@ -10,7 +10,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v5.26.1 +// protoc v5.27.1 // source: rule.proto package protobuf diff --git a/kms/request.go b/kms/request.go index 666c029..888c621 100644 --- a/kms/request.go +++ b/kms/request.go @@ -6,6 +6,9 @@ package kms import ( "errors" + "log/slog" + "net/netip" + "time" "github.com/minio/kms-go/kms/cmds" pb "github.com/minio/kms-go/kms/protobuf" @@ -245,9 +248,73 @@ func (r *EditClusterRequest) UnmarshalPB(v *pb.EditClusterRequest) error { return nil } -// BackupDBRequest contains options for requesting a database backup from -// a KMS server. -type BackupDBRequest struct{} +// LogRequest contains options for fetching server logs. +// It allows filtering for more specific log records. +type LogRequest struct { + // Host is the KMS server from which logs are fetched. + Host string + + // The server only sends log records with an equal or greater + // log level. The default level is slog.LevelInfo. + Level slog.Level + + // The server only sends log records with a log message that + // contain this message. + Message string + + // Optionally, fetch log records since the given point in time. + // If empty, the server sends only new log records. The server + // ignores any timestamps newer then its current time. + Since time.Time + + // The server only sends only log records with this request method. + Method string + + // The server sends only log records with this request path. + Path string + + // The servers sends only log records with this identity. + Identity Identity + + // The server sends only log records with this IP address. + IP netip.Addr +} + +// MarshalPB converts the LogRequest into its protobuf representation. +func (r *LogRequest) MarshalPB(v *pb.LogRequest) error { + v.Level = int32(r.Level) + v.Message = r.Message + v.Since = pb.Time(r.Since) + v.Method = r.Method + v.Path = r.Path + v.Identity = r.Identity.String() + if r.IP.IsValid() { + v.IP = r.IP.String() + } else { + v.IP = "" + } + return nil +} + +// UnmarshalPB initializes the LogRequest from its protobuf representation. +func (r *LogRequest) UnmarshalPB(v *pb.LogRequest) error { + var ip netip.Addr + if v.IP != "" { + var err error + if ip, err = netip.ParseAddr(v.IP); err != nil { + return err + } + } + + r.Level = slog.Level(v.Level) + r.Message = v.Message + r.Since = v.Since.AsTime() + r.Method = v.Method + r.Path = v.Path + r.Identity = Identity(v.Identity) + r.IP = ip + return nil +} // CreateEnclaveRequest contains options for creating enclaves. type CreateEnclaveRequest struct { diff --git a/kms/response.go b/kms/response.go index 8fd7a9b..41fd586 100644 --- a/kms/response.go +++ b/kms/response.go @@ -470,6 +470,43 @@ func (r *ProfileResponse) Close() error { return r.Body.Close() } +// LogResponse is a continuous stream of server log records. +type LogResponse struct { + r io.ReadCloser + buf []byte + err error +} + +// Next returns the next LogRecord, if any, and a boolean +// flag indicating whether there was an actual LogRecord. +// +// Once Next returns false, there are no more LogRecords. +// Callers should use Close to check for any error encountered +// while reading from the underlying connection. +func (r *LogResponse) Next() (LogRecord, bool) { + if r.err != nil { + return LogRecord{}, false + } + + var rec LogRecord + if r.err = readLogRecord(r.r, r.buf, &rec); r.err != nil { + r.Close() + return LogRecord{}, false + } + return rec, true +} + +// Close closes the underlying stream and returns the +// first error encountered while reading. If no error +// has been encountered, it returns the first error +// encountered while closing the connection, if any. +func (r *LogResponse) Close() error { + if err := r.r.Close(); r.err == nil { + r.err = err + } + return r.err +} + // EnclaveStatusResponse contains information about an enclave. type EnclaveStatusResponse struct { // Name is the name of the enclave.