feature (byow): classify status msg data (#2181)

Classifying the data allows it to appropriately included in
audit events
This commit is contained in:
Jim authored and GitHub committed 2022-06-14 12:09:02 -04:00
1 parent 7c139d28b2
commit 9dde83aea7
5 files changed
+22 -20

No files matched your search

+2
View File
@@ -196,6 +196,8 @@ protobuild:
@protoc-go-inject-tag -input=./internal/gen/controller/api/services/user_service.pb.go
@protoc-go-inject-tag -input=./sdk/pbs/controller/api/resources/workers/worker.pb.go
@protoc-go-inject-tag -input=./internal/gen/controller/api/services/worker_service.pb.go
@protoc-go-inject-tag -input=./internal/gen/controller/servers/services/server_coordination_service.pb.go
# these protos, services and openapi artifacts are purely for testing purposes
@protoc-go-inject-tag -input=./internal/gen/testing/event/event.pb.go
@@ -276,7 +276,7 @@ type Connection struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"`
ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" class:"public"` // @gotags: `class:"public"`
Status CONNECTIONSTATUS `protobuf:"varint,2,opt,name=status,proto3,enum=controller.servers.services.v1.CONNECTIONSTATUS" json:"status,omitempty"`
}
@@ -331,7 +331,7 @@ type SessionJobInfo struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty" class:"public"` // @gotags: `class:"public"`
Status SESSIONSTATUS `protobuf:"varint,2,opt,name=status,proto3,enum=controller.servers.services.v1.SESSIONSTATUS" json:"status,omitempty"`
Connections []*Connection `protobuf:"bytes,3,rep,name=connections,proto3" json:"connections,omitempty"`
}
@@ -521,7 +521,7 @@ type UpstreamServer struct {
// type specifies between controller or worker.
Type UpstreamServer_TYPE `protobuf:"varint,10,opt,name=type,proto3,enum=controller.servers.services.v1.UpstreamServer_TYPE" json:"type,omitempty"`
// Address of the daemon
Address string `protobuf:"bytes,20,opt,name=address,proto3" json:"address,omitempty"`
Address string `protobuf:"bytes,20,opt,name=address,proto3" json:"address,omitempty" class:"public"` // @gotags: `class:"public"`
}
func (x *UpstreamServer) Reset() {
@@ -712,7 +712,7 @@ type StatusResponse struct {
CalculatedUpstreams []*UpstreamServer `protobuf:"bytes,30,rep,name=calculated_upstreams,json=calculatedUpstreams,proto3" json:"calculated_upstreams,omitempty"`
// The ID of the worker which made the request. The worker can send this value in subsequent requests so the
// controller does not need to do a database lookup for the id using the name field.
WorkerId string `protobuf:"bytes,40,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"`
WorkerId string `protobuf:"bytes,40,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty" class:"public"` // @gotags: `class:"public"`
}
func (x *StatusResponse) Reset() {
@@ -21,7 +21,7 @@ enum CONNECTIONSTATUS {
}
message Connection {
string connection_id = 1;
string connection_id = 1; // @gotags: `class:"public"`
CONNECTIONSTATUS status = 2;
}
@@ -34,7 +34,7 @@ enum SESSIONSTATUS {
}
message SessionJobInfo {
string session_id = 1;
string session_id = 1; // @gotags: `class:"public"`
SESSIONSTATUS status = 2;
repeated Connection connections = 3;
}
@@ -69,7 +69,7 @@ message UpstreamServer {
TYPE type = 10;
// Address of the daemon
string address = 20;
string address = 20; // @gotags: `class:"public"`
}
message StatusRequest {
@@ -120,5 +120,5 @@ message StatusResponse {
// The ID of the worker which made the request. The worker can send this value in subsequent requests so the
// controller does not need to do a database lookup for the id using the name field.
string worker_id = 40;
string worker_id = 40; // @gotags: `class:"public"`
}
@@ -6,24 +6,24 @@ option go_package = "github.com/hashicorp/boundary/internal/servers;servers";
// TagPair matches a key to a value.
message TagPair {
string key = 1;
string value = 2;
string key = 1; // @gotags: `class:"public"`
string value = 2; // @gotags: `class:"public"`
}
// ServerWorkerStatus is the new message used in place of Server to relay status request info.
message ServerWorkerStatus {
// Id of the worker.
string public_id = 10;
string public_id = 10; // @gotags: `class:"public"`
// Name of the resource (optional)
string name = 20;
string name = 20; // @gotags: `class:"public"`
// Address for the worker. This must be set.
string address = 30;
string address = 30; // @gotags: `class:"public"`
// Tags for workers
repeated TagPair tags = 40;
// The key id for this worker, if applicable (optional)
string key_id = 50;
string key_id = 50; // @gotags: `class:"public"`
}
+6 -6
View File
@@ -26,8 +26,8 @@ type TagPair struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty" class:"public"` // @gotags: `class:"public"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty" class:"public"` // @gotags: `class:"public"`
}
func (x *TagPair) Reset() {
@@ -83,15 +83,15 @@ type ServerWorkerStatus struct {
unknownFields protoimpl.UnknownFields
// Id of the worker.
PublicId string `protobuf:"bytes,10,opt,name=public_id,json=publicId,proto3" json:"public_id,omitempty"`
PublicId string `protobuf:"bytes,10,opt,name=public_id,json=publicId,proto3" json:"public_id,omitempty" class:"public"` // @gotags: `class:"public"`
// Name of the resource (optional)
Name string `protobuf:"bytes,20,opt,name=name,proto3" json:"name,omitempty"`
Name string `protobuf:"bytes,20,opt,name=name,proto3" json:"name,omitempty" class:"public"` // @gotags: `class:"public"`
// Address for the worker. This must be set.
Address string `protobuf:"bytes,30,opt,name=address,proto3" json:"address,omitempty"`
Address string `protobuf:"bytes,30,opt,name=address,proto3" json:"address,omitempty" class:"public"` // @gotags: `class:"public"`
// Tags for workers
Tags []*TagPair `protobuf:"bytes,40,rep,name=tags,proto3" json:"tags,omitempty"`
// The key id for this worker, if applicable (optional)
KeyId string `protobuf:"bytes,50,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
KeyId string `protobuf:"bytes,50,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty" class:"public"` // @gotags: `class:"public"`
}
func (x *ServerWorkerStatus) Reset() {