scaffolding for 'zrok agent release share' (#463)

This commit is contained in:
Michael Quigley 2024-09-10 12:53:45 -04:00
parent 3f2e5546e6
commit e58524572f
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
6 changed files with 322 additions and 82 deletions

View File

@ -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.27.4
// source: agent/agentGrpc/agent.proto
package agentGrpc
@ -249,6 +249,91 @@ func (x *PublicShareRequest) GetAccessGrants() []string {
return nil
}
type ReleaseShareRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
}
func (x *ReleaseShareRequest) Reset() {
*x = ReleaseShareRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ReleaseShareRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ReleaseShareRequest) ProtoMessage() {}
func (x *ReleaseShareRequest) ProtoReflect() protoreflect.Message {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ReleaseShareRequest.ProtoReflect.Descriptor instead.
func (*ReleaseShareRequest) Descriptor() ([]byte, []int) {
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{3}
}
func (x *ReleaseShareRequest) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
type ReleaseShareReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ReleaseShareReply) Reset() {
*x = ReleaseShareReply{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ReleaseShareReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ReleaseShareReply) ProtoMessage() {}
func (x *ReleaseShareReply) ProtoReflect() protoreflect.Message {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ReleaseShareReply.ProtoReflect.Descriptor instead.
func (*ReleaseShareReply) Descriptor() ([]byte, []int) {
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{4}
}
type ShareDetail struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -267,7 +352,7 @@ type ShareDetail struct {
func (x *ShareDetail) Reset() {
*x = ShareDetail{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[3]
mi := &file_agent_agentGrpc_agent_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -280,7 +365,7 @@ func (x *ShareDetail) String() string {
func (*ShareDetail) ProtoMessage() {}
func (x *ShareDetail) ProtoReflect() protoreflect.Message {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[3]
mi := &file_agent_agentGrpc_agent_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -293,7 +378,7 @@ func (x *ShareDetail) ProtoReflect() protoreflect.Message {
// Deprecated: Use ShareDetail.ProtoReflect.Descriptor instead.
func (*ShareDetail) Descriptor() ([]byte, []int) {
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{3}
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{5}
}
func (x *ShareDetail) GetToken() string {
@ -361,7 +446,7 @@ type StatusRequest struct {
func (x *StatusRequest) Reset() {
*x = StatusRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[4]
mi := &file_agent_agentGrpc_agent_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -374,7 +459,7 @@ func (x *StatusRequest) String() string {
func (*StatusRequest) ProtoMessage() {}
func (x *StatusRequest) ProtoReflect() protoreflect.Message {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[4]
mi := &file_agent_agentGrpc_agent_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -387,7 +472,7 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.
func (*StatusRequest) Descriptor() ([]byte, []int) {
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{4}
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{6}
}
type StatusReply struct {
@ -402,7 +487,7 @@ type StatusReply struct {
func (x *StatusReply) Reset() {
*x = StatusReply{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[5]
mi := &file_agent_agentGrpc_agent_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -415,7 +500,7 @@ func (x *StatusReply) String() string {
func (*StatusReply) ProtoMessage() {}
func (x *StatusReply) ProtoReflect() protoreflect.Message {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[5]
mi := &file_agent_agentGrpc_agent_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -428,7 +513,7 @@ func (x *StatusReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use StatusReply.ProtoReflect.Descriptor instead.
func (*StatusReply) Descriptor() ([]byte, []int) {
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{5}
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{7}
}
func (x *StatusReply) GetAccesses() []*AccessDetail {
@ -454,7 +539,7 @@ type VersionRequest struct {
func (x *VersionRequest) Reset() {
*x = VersionRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[6]
mi := &file_agent_agentGrpc_agent_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -467,7 +552,7 @@ func (x *VersionRequest) String() string {
func (*VersionRequest) ProtoMessage() {}
func (x *VersionRequest) ProtoReflect() protoreflect.Message {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[6]
mi := &file_agent_agentGrpc_agent_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -480,7 +565,7 @@ func (x *VersionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use VersionRequest.ProtoReflect.Descriptor instead.
func (*VersionRequest) Descriptor() ([]byte, []int) {
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{6}
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{8}
}
type VersionReply struct {
@ -494,7 +579,7 @@ type VersionReply struct {
func (x *VersionReply) Reset() {
*x = VersionReply{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[7]
mi := &file_agent_agentGrpc_agent_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -507,7 +592,7 @@ func (x *VersionReply) String() string {
func (*VersionReply) ProtoMessage() {}
func (x *VersionReply) ProtoReflect() protoreflect.Message {
mi := &file_agent_agentGrpc_agent_proto_msgTypes[7]
mi := &file_agent_agentGrpc_agent_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -520,7 +605,7 @@ func (x *VersionReply) ProtoReflect() protoreflect.Message {
// Deprecated: Use VersionReply.ProtoReflect.Descriptor instead.
func (*VersionReply) Descriptor() ([]byte, []int) {
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{7}
return file_agent_agentGrpc_agent_proto_rawDescGZIP(), []int{9}
}
func (x *VersionReply) GetV() string {
@ -569,46 +654,54 @@ var file_agent_agentGrpc_agent_proto_rawDesc = []byte{
0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x12, 0x22,
0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x0a,
0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x6e,
0x74, 0x73, 0x22, 0x85, 0x02, 0x0a, 0x0b, 0x53, 0x68, 0x61, 0x72, 0x65, 0x44, 0x65, 0x74, 0x61,
0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72,
0x65, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x61,
0x72, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e,
0x64, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x61, 0x63,
0x6b, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x65,
0x72, 0x76, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x73, 0x65,
0x72, 0x76, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64,
0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10,
0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74,
0x12, 0x28, 0x0a, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x64, 0x70, 0x6f,
0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x65,
0x6e, 0x64, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6c,
0x6f, 0x73, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x63, 0x6c, 0x6f, 0x73,
0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74,
0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5e, 0x0a, 0x0b, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x29, 0x0a, 0x08, 0x61, 0x63,
0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41,
0x63, 0x63, 0x65, 0x73, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x08, 0x61, 0x63, 0x63,
0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x44, 0x65, 0x74,
0x61, 0x69, 0x6c, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x56,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x1c, 0x0a,
0x0c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0c, 0x0a,
0x01, 0x76, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x76, 0x32, 0x97, 0x01, 0x0a, 0x05,
0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x0b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x53,
0x68, 0x61, 0x72, 0x65, 0x12, 0x13, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x53, 0x68, 0x61,
0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x50, 0x75, 0x62, 0x6c,
0x69, 0x63, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x28,
0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x2b, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x7a, 0x69, 0x74, 0x69, 0x2f, 0x7a, 0x72, 0x6f,
0x6b, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x47, 0x72, 0x70,
0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x73, 0x22, 0x2b, 0x0a, 0x13, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x68, 0x61,
0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b,
0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22,
0x13, 0x0a, 0x11, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52,
0x65, 0x70, 0x6c, 0x79, 0x22, 0x85, 0x02, 0x0a, 0x0b, 0x53, 0x68, 0x61, 0x72, 0x65, 0x44, 0x65,
0x74, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x68,
0x61, 0x72, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73,
0x68, 0x61, 0x72, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x61, 0x63, 0x6b,
0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62,
0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65,
0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65,
0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x64, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09,
0x52, 0x10, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69,
0x6e, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x64,
0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x62, 0x61, 0x63,
0x6b, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06,
0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x63, 0x6c,
0x6f, 0x73, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x0f, 0x0a, 0x0d,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5e, 0x0a,
0x0b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x29, 0x0a, 0x08,
0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d,
0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x08, 0x61,
0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x44,
0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x22, 0x10, 0x0a,
0x0e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22,
0x1c, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12,
0x0c, 0x0a, 0x01, 0x76, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x76, 0x32, 0xd3, 0x01,
0x0a, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x0b, 0x50, 0x75, 0x62, 0x6c, 0x69,
0x63, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x13, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x53,
0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x50, 0x75,
0x62, 0x6c, 0x69, 0x63, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00,
0x12, 0x3a, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65,
0x12, 0x14, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x28, 0x0a, 0x06,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x2b, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x12, 0x0f, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c,
0x79, 0x22, 0x00, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x7a, 0x69, 0x74, 0x69, 0x2f, 0x7a, 0x72, 0x6f, 0x6b, 0x2f,
0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x47, 0x72, 0x70, 0x63, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -623,28 +716,32 @@ func file_agent_agentGrpc_agent_proto_rawDescGZIP() []byte {
return file_agent_agentGrpc_agent_proto_rawDescData
}
var file_agent_agentGrpc_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_agent_agentGrpc_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_agent_agentGrpc_agent_proto_goTypes = []any{
(*AccessDetail)(nil), // 0: AccessDetail
(*PublicShareReply)(nil), // 1: PublicShareReply
(*PublicShareRequest)(nil), // 2: PublicShareRequest
(*ShareDetail)(nil), // 3: ShareDetail
(*StatusRequest)(nil), // 4: StatusRequest
(*StatusReply)(nil), // 5: StatusReply
(*VersionRequest)(nil), // 6: VersionRequest
(*VersionReply)(nil), // 7: VersionReply
(*AccessDetail)(nil), // 0: AccessDetail
(*PublicShareReply)(nil), // 1: PublicShareReply
(*PublicShareRequest)(nil), // 2: PublicShareRequest
(*ReleaseShareRequest)(nil), // 3: ReleaseShareRequest
(*ReleaseShareReply)(nil), // 4: ReleaseShareReply
(*ShareDetail)(nil), // 5: ShareDetail
(*StatusRequest)(nil), // 6: StatusRequest
(*StatusReply)(nil), // 7: StatusReply
(*VersionRequest)(nil), // 8: VersionRequest
(*VersionReply)(nil), // 9: VersionReply
}
var file_agent_agentGrpc_agent_proto_depIdxs = []int32{
0, // 0: StatusReply.accesses:type_name -> AccessDetail
3, // 1: StatusReply.shares:type_name -> ShareDetail
5, // 1: StatusReply.shares:type_name -> ShareDetail
2, // 2: Agent.PublicShare:input_type -> PublicShareRequest
4, // 3: Agent.Status:input_type -> StatusRequest
6, // 4: Agent.Version:input_type -> VersionRequest
1, // 5: Agent.PublicShare:output_type -> PublicShareReply
5, // 6: Agent.Status:output_type -> StatusReply
7, // 7: Agent.Version:output_type -> VersionReply
5, // [5:8] is the sub-list for method output_type
2, // [2:5] is the sub-list for method input_type
3, // 3: Agent.ReleaseShare:input_type -> ReleaseShareRequest
6, // 4: Agent.Status:input_type -> StatusRequest
8, // 5: Agent.Version:input_type -> VersionRequest
1, // 6: Agent.PublicShare:output_type -> PublicShareReply
4, // 7: Agent.ReleaseShare:output_type -> ReleaseShareReply
7, // 8: Agent.Status:output_type -> StatusReply
9, // 9: Agent.Version:output_type -> VersionReply
6, // [6:10] is the sub-list for method output_type
2, // [2:6] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
@ -693,7 +790,7 @@ func file_agent_agentGrpc_agent_proto_init() {
}
}
file_agent_agentGrpc_agent_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*ShareDetail); i {
switch v := v.(*ReleaseShareRequest); i {
case 0:
return &v.state
case 1:
@ -705,7 +802,7 @@ func file_agent_agentGrpc_agent_proto_init() {
}
}
file_agent_agentGrpc_agent_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*StatusRequest); i {
switch v := v.(*ReleaseShareReply); i {
case 0:
return &v.state
case 1:
@ -717,7 +814,7 @@ func file_agent_agentGrpc_agent_proto_init() {
}
}
file_agent_agentGrpc_agent_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*StatusReply); i {
switch v := v.(*ShareDetail); i {
case 0:
return &v.state
case 1:
@ -729,7 +826,7 @@ func file_agent_agentGrpc_agent_proto_init() {
}
}
file_agent_agentGrpc_agent_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*VersionRequest); i {
switch v := v.(*StatusRequest); i {
case 0:
return &v.state
case 1:
@ -741,6 +838,30 @@ func file_agent_agentGrpc_agent_proto_init() {
}
}
file_agent_agentGrpc_agent_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*StatusReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_agent_agentGrpc_agent_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*VersionRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_agent_agentGrpc_agent_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*VersionReply); i {
case 0:
return &v.state
@ -759,7 +880,7 @@ func file_agent_agentGrpc_agent_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_agent_agentGrpc_agent_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumMessages: 10,
NumExtensions: 0,
NumServices: 1,
},

View File

@ -4,6 +4,7 @@ option go_package = "github.com/openziti/zrok/agent/agentGrpc";
service Agent {
rpc PublicShare(PublicShareRequest) returns (PublicShareReply) {}
rpc ReleaseShare(ReleaseShareRequest) returns (ReleaseShareReply) {}
rpc Status(StatusRequest) returns (StatusReply) {}
rpc Version(VersionRequest) returns (VersionReply) {}
}
@ -31,6 +32,13 @@ message PublicShareRequest {
repeated string accessGrants = 10;
}
message ReleaseShareRequest {
string token = 1;
}
message ReleaseShareReply {
}
message ShareDetail {
string token = 1;
string shareMode = 2;

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.27.3
// - protoc v5.27.4
// source: agent/agentGrpc/agent.proto
package agentGrpc
@ -19,9 +19,10 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
Agent_PublicShare_FullMethodName = "/Agent/PublicShare"
Agent_Status_FullMethodName = "/Agent/Status"
Agent_Version_FullMethodName = "/Agent/Version"
Agent_PublicShare_FullMethodName = "/Agent/PublicShare"
Agent_ReleaseShare_FullMethodName = "/Agent/ReleaseShare"
Agent_Status_FullMethodName = "/Agent/Status"
Agent_Version_FullMethodName = "/Agent/Version"
)
// AgentClient is the client API for Agent service.
@ -29,6 +30,7 @@ const (
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type AgentClient interface {
PublicShare(ctx context.Context, in *PublicShareRequest, opts ...grpc.CallOption) (*PublicShareReply, error)
ReleaseShare(ctx context.Context, in *ReleaseShareRequest, opts ...grpc.CallOption) (*ReleaseShareReply, error)
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error)
Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionReply, error)
}
@ -51,6 +53,16 @@ func (c *agentClient) PublicShare(ctx context.Context, in *PublicShareRequest, o
return out, nil
}
func (c *agentClient) ReleaseShare(ctx context.Context, in *ReleaseShareRequest, opts ...grpc.CallOption) (*ReleaseShareReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ReleaseShareReply)
err := c.cc.Invoke(ctx, Agent_ReleaseShare_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
@ -76,6 +88,7 @@ func (c *agentClient) Version(ctx context.Context, in *VersionRequest, opts ...g
// for forward compatibility.
type AgentServer interface {
PublicShare(context.Context, *PublicShareRequest) (*PublicShareReply, error)
ReleaseShare(context.Context, *ReleaseShareRequest) (*ReleaseShareReply, error)
Status(context.Context, *StatusRequest) (*StatusReply, error)
Version(context.Context, *VersionRequest) (*VersionReply, error)
mustEmbedUnimplementedAgentServer()
@ -91,6 +104,9 @@ type UnimplementedAgentServer struct{}
func (UnimplementedAgentServer) PublicShare(context.Context, *PublicShareRequest) (*PublicShareReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method PublicShare not implemented")
}
func (UnimplementedAgentServer) ReleaseShare(context.Context, *ReleaseShareRequest) (*ReleaseShareReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReleaseShare not implemented")
}
func (UnimplementedAgentServer) Status(context.Context, *StatusRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
}
@ -136,6 +152,24 @@ func _Agent_PublicShare_Handler(srv interface{}, ctx context.Context, dec func(i
return interceptor(ctx, in, info, handler)
}
func _Agent_ReleaseShare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReleaseShareRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentServer).ReleaseShare(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agent_ReleaseShare_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentServer).ReleaseShare(ctx, req.(*ReleaseShareRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agent_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatusRequest)
if err := dec(in); err != nil {
@ -183,6 +217,10 @@ var Agent_ServiceDesc = grpc.ServiceDesc{
MethodName: "PublicShare",
Handler: _Agent_PublicShare_Handler,
},
{
MethodName: "ReleaseShare",
Handler: _Agent_ReleaseShare_Handler,
},
{
MethodName: "Status",
Handler: _Agent_Status_Handler,

12
agent/releaseShare.go Executable file
View File

@ -0,0 +1,12 @@
package agent
import (
"context"
"github.com/openziti/zrok/agent/agentGrpc"
"github.com/sirupsen/logrus"
)
func (i *agentGrpcImpl) ReleaseShare(_ context.Context, req *agentGrpc.ReleaseShareRequest) (*agentGrpc.ReleaseShareReply, error) {
logrus.Infof("releasing '%v'", req.Token)
return nil, nil
}

55
cmd/zrok/agentReleaseShare.go Executable file
View File

@ -0,0 +1,55 @@
package main
import (
"context"
"fmt"
"github.com/openziti/zrok/agent/agentClient"
"github.com/openziti/zrok/agent/agentGrpc"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/tui"
"github.com/spf13/cobra"
)
func init() {
agentReleaseCmd.AddCommand(newAgentReleaseShareCommand().cmd)
}
type agentReleaseShareCommand struct {
cmd *cobra.Command
}
func newAgentReleaseShareCommand() *agentReleaseShareCommand {
cmd := &cobra.Command{
Use: "share <token>",
Short: "Release a share from the zrok Agent",
Args: cobra.ExactArgs(1),
}
command := &agentReleaseShareCommand{cmd: cmd}
cmd.Run = command.run
return command
}
func (cmd *agentReleaseShareCommand) run(_ *cobra.Command, args []string) {
root, err := environment.LoadRoot()
if err != nil {
if !panicInstead {
tui.Error("unable to load environment", err)
}
panic(err)
}
client, conn, err := agentClient.NewClient(root)
if err != nil {
tui.Error("error connecting to agent", err)
}
defer conn.Close()
_, err = client.ReleaseShare(context.Background(), &agentGrpc.ReleaseShareRequest{
Token: args[0],
})
if err != nil {
tui.Error("error releasing share", err)
}
fmt.Println("success.")
}

View File

@ -26,6 +26,7 @@ func init() {
adminCmd.AddCommand(adminUpdateCmd)
rootCmd.AddCommand(agentCmd)
agentCmd.AddCommand(agentShareCmd)
agentCmd.AddCommand(agentReleaseCmd)
testCmd.AddCommand(loopCmd)
rootCmd.AddCommand(adminCmd)
rootCmd.AddCommand(configCmd)
@ -90,6 +91,11 @@ var agentShareCmd = &cobra.Command{
Short: "zrok Agent sharing commands",
}
var agentReleaseCmd = &cobra.Command{
Use: "release",
Short: "zrok Agent release commands",
}
var configCmd = &cobra.Command{
Use: "config",
Short: "Configure your zrok environment",