common.pb.go raw

   1  // Copyright 2021 Google LLC
   2  //
   3  // Licensed under the Apache License, Version 2.0 (the "License");
   4  // you may not use this file except in compliance with the License.
   5  // You may obtain a copy of the License at
   6  //
   7  //    https://www.apache.org/licenses/LICENSE-2.0
   8  //
   9  // Unless required by applicable law or agreed to in writing, software
  10  // distributed under the License is distributed on an "AS IS" BASIS,
  11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12  // See the License for the specific language governing permissions and
  13  // limitations under the License.
  14  
  15  // Code generated by protoc-gen-go. DO NOT EDIT.
  16  // versions:
  17  // 	protoc-gen-go v1.34.2
  18  // 	protoc        v3.21.12
  19  // source: internal/proto/common/common.proto
  20  
  21  package common_go_proto
  22  
  23  import (
  24  	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  25  	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  26  	reflect "reflect"
  27  	sync "sync"
  28  )
  29  
  30  const (
  31  	// Verify that this generated code is sufficiently up-to-date.
  32  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  33  	// Verify that runtime/protoimpl is sufficiently up-to-date.
  34  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  35  )
  36  
  37  // The ciphersuites supported by S2A. The name determines the confidentiality,
  38  // and authentication ciphers as well as the hash algorithm used for PRF in
  39  // TLS 1.2 or HKDF in TLS 1.3. Thus, the components of the name are:
  40  //   - AEAD -- for encryption and authentication, e.g., AES_128_GCM.
  41  //   - Hash algorithm -- used in PRF or HKDF, e.g., SHA256.
  42  type Ciphersuite int32
  43  
  44  const (
  45  	Ciphersuite_AES_128_GCM_SHA256       Ciphersuite = 0
  46  	Ciphersuite_AES_256_GCM_SHA384       Ciphersuite = 1
  47  	Ciphersuite_CHACHA20_POLY1305_SHA256 Ciphersuite = 2
  48  )
  49  
  50  // Enum value maps for Ciphersuite.
  51  var (
  52  	Ciphersuite_name = map[int32]string{
  53  		0: "AES_128_GCM_SHA256",
  54  		1: "AES_256_GCM_SHA384",
  55  		2: "CHACHA20_POLY1305_SHA256",
  56  	}
  57  	Ciphersuite_value = map[string]int32{
  58  		"AES_128_GCM_SHA256":       0,
  59  		"AES_256_GCM_SHA384":       1,
  60  		"CHACHA20_POLY1305_SHA256": 2,
  61  	}
  62  )
  63  
  64  func (x Ciphersuite) Enum() *Ciphersuite {
  65  	p := new(Ciphersuite)
  66  	*p = x
  67  	return p
  68  }
  69  
  70  func (x Ciphersuite) String() string {
  71  	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
  72  }
  73  
  74  func (Ciphersuite) Descriptor() protoreflect.EnumDescriptor {
  75  	return file_internal_proto_common_common_proto_enumTypes[0].Descriptor()
  76  }
  77  
  78  func (Ciphersuite) Type() protoreflect.EnumType {
  79  	return &file_internal_proto_common_common_proto_enumTypes[0]
  80  }
  81  
  82  func (x Ciphersuite) Number() protoreflect.EnumNumber {
  83  	return protoreflect.EnumNumber(x)
  84  }
  85  
  86  // Deprecated: Use Ciphersuite.Descriptor instead.
  87  func (Ciphersuite) EnumDescriptor() ([]byte, []int) {
  88  	return file_internal_proto_common_common_proto_rawDescGZIP(), []int{0}
  89  }
  90  
  91  // The TLS versions supported by S2A's handshaker module.
  92  type TLSVersion int32
  93  
  94  const (
  95  	TLSVersion_TLS1_2 TLSVersion = 0
  96  	TLSVersion_TLS1_3 TLSVersion = 1
  97  )
  98  
  99  // Enum value maps for TLSVersion.
 100  var (
 101  	TLSVersion_name = map[int32]string{
 102  		0: "TLS1_2",
 103  		1: "TLS1_3",
 104  	}
 105  	TLSVersion_value = map[string]int32{
 106  		"TLS1_2": 0,
 107  		"TLS1_3": 1,
 108  	}
 109  )
 110  
 111  func (x TLSVersion) Enum() *TLSVersion {
 112  	p := new(TLSVersion)
 113  	*p = x
 114  	return p
 115  }
 116  
 117  func (x TLSVersion) String() string {
 118  	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
 119  }
 120  
 121  func (TLSVersion) Descriptor() protoreflect.EnumDescriptor {
 122  	return file_internal_proto_common_common_proto_enumTypes[1].Descriptor()
 123  }
 124  
 125  func (TLSVersion) Type() protoreflect.EnumType {
 126  	return &file_internal_proto_common_common_proto_enumTypes[1]
 127  }
 128  
 129  func (x TLSVersion) Number() protoreflect.EnumNumber {
 130  	return protoreflect.EnumNumber(x)
 131  }
 132  
 133  // Deprecated: Use TLSVersion.Descriptor instead.
 134  func (TLSVersion) EnumDescriptor() ([]byte, []int) {
 135  	return file_internal_proto_common_common_proto_rawDescGZIP(), []int{1}
 136  }
 137  
 138  type Identity struct {
 139  	state         protoimpl.MessageState
 140  	sizeCache     protoimpl.SizeCache
 141  	unknownFields protoimpl.UnknownFields
 142  
 143  	// Types that are assignable to IdentityOneof:
 144  	//
 145  	//	*Identity_SpiffeId
 146  	//	*Identity_Hostname
 147  	//	*Identity_Uid
 148  	//	*Identity_Username
 149  	//	*Identity_GcpId
 150  	IdentityOneof isIdentity_IdentityOneof `protobuf_oneof:"identity_oneof"`
 151  	// Additional identity-specific attributes.
 152  	Attributes map[string]string `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
 153  }
 154  
 155  func (x *Identity) Reset() {
 156  	*x = Identity{}
 157  	if protoimpl.UnsafeEnabled {
 158  		mi := &file_internal_proto_common_common_proto_msgTypes[0]
 159  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 160  		ms.StoreMessageInfo(mi)
 161  	}
 162  }
 163  
 164  func (x *Identity) String() string {
 165  	return protoimpl.X.MessageStringOf(x)
 166  }
 167  
 168  func (*Identity) ProtoMessage() {}
 169  
 170  func (x *Identity) ProtoReflect() protoreflect.Message {
 171  	mi := &file_internal_proto_common_common_proto_msgTypes[0]
 172  	if protoimpl.UnsafeEnabled && x != nil {
 173  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 174  		if ms.LoadMessageInfo() == nil {
 175  			ms.StoreMessageInfo(mi)
 176  		}
 177  		return ms
 178  	}
 179  	return mi.MessageOf(x)
 180  }
 181  
 182  // Deprecated: Use Identity.ProtoReflect.Descriptor instead.
 183  func (*Identity) Descriptor() ([]byte, []int) {
 184  	return file_internal_proto_common_common_proto_rawDescGZIP(), []int{0}
 185  }
 186  
 187  func (m *Identity) GetIdentityOneof() isIdentity_IdentityOneof {
 188  	if m != nil {
 189  		return m.IdentityOneof
 190  	}
 191  	return nil
 192  }
 193  
 194  func (x *Identity) GetSpiffeId() string {
 195  	if x, ok := x.GetIdentityOneof().(*Identity_SpiffeId); ok {
 196  		return x.SpiffeId
 197  	}
 198  	return ""
 199  }
 200  
 201  func (x *Identity) GetHostname() string {
 202  	if x, ok := x.GetIdentityOneof().(*Identity_Hostname); ok {
 203  		return x.Hostname
 204  	}
 205  	return ""
 206  }
 207  
 208  func (x *Identity) GetUid() string {
 209  	if x, ok := x.GetIdentityOneof().(*Identity_Uid); ok {
 210  		return x.Uid
 211  	}
 212  	return ""
 213  }
 214  
 215  func (x *Identity) GetUsername() string {
 216  	if x, ok := x.GetIdentityOneof().(*Identity_Username); ok {
 217  		return x.Username
 218  	}
 219  	return ""
 220  }
 221  
 222  func (x *Identity) GetGcpId() string {
 223  	if x, ok := x.GetIdentityOneof().(*Identity_GcpId); ok {
 224  		return x.GcpId
 225  	}
 226  	return ""
 227  }
 228  
 229  func (x *Identity) GetAttributes() map[string]string {
 230  	if x != nil {
 231  		return x.Attributes
 232  	}
 233  	return nil
 234  }
 235  
 236  type isIdentity_IdentityOneof interface {
 237  	isIdentity_IdentityOneof()
 238  }
 239  
 240  type Identity_SpiffeId struct {
 241  	// The SPIFFE ID of a connection endpoint.
 242  	SpiffeId string `protobuf:"bytes,1,opt,name=spiffe_id,json=spiffeId,proto3,oneof"`
 243  }
 244  
 245  type Identity_Hostname struct {
 246  	// The hostname of a connection endpoint.
 247  	Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3,oneof"`
 248  }
 249  
 250  type Identity_Uid struct {
 251  	// The UID of a connection endpoint.
 252  	Uid string `protobuf:"bytes,4,opt,name=uid,proto3,oneof"`
 253  }
 254  
 255  type Identity_Username struct {
 256  	// The username of a connection endpoint.
 257  	Username string `protobuf:"bytes,5,opt,name=username,proto3,oneof"`
 258  }
 259  
 260  type Identity_GcpId struct {
 261  	// The GCP ID of a connection endpoint.
 262  	GcpId string `protobuf:"bytes,6,opt,name=gcp_id,json=gcpId,proto3,oneof"`
 263  }
 264  
 265  func (*Identity_SpiffeId) isIdentity_IdentityOneof() {}
 266  
 267  func (*Identity_Hostname) isIdentity_IdentityOneof() {}
 268  
 269  func (*Identity_Uid) isIdentity_IdentityOneof() {}
 270  
 271  func (*Identity_Username) isIdentity_IdentityOneof() {}
 272  
 273  func (*Identity_GcpId) isIdentity_IdentityOneof() {}
 274  
 275  var File_internal_proto_common_common_proto protoreflect.FileDescriptor
 276  
 277  var file_internal_proto_common_common_proto_rawDesc = []byte{
 278  	0x0a, 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
 279  	0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
 280  	0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
 281  	0xa8, 0x02, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x09,
 282  	0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48,
 283  	0x00, 0x52, 0x08, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x68,
 284  	0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,
 285  	0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x03, 0x75, 0x69, 0x64,
 286  	0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a,
 287  	0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48,
 288  	0x00, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x06, 0x67,
 289  	0x63, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x67,
 290  	0x63, 0x70, 0x49, 0x64, 0x12, 0x43, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
 291  	0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
 292  	0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x74,
 293  	0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61,
 294  	0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74,
 295  	0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
 296  	0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
 297  	0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76,
 298  	0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x69, 0x64, 0x65, 0x6e,
 299  	0x74, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x2a, 0x5b, 0x0a, 0x0b, 0x43, 0x69,
 300  	0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45, 0x53,
 301  	0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10,
 302  	0x00, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, 0x4d,
 303  	0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x48, 0x41,
 304  	0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53,
 305  	0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x02, 0x2a, 0x24, 0x0a, 0x0a, 0x54, 0x4c, 0x53, 0x56, 0x65,
 306  	0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x4c, 0x53, 0x31, 0x5f, 0x32, 0x10,
 307  	0x00, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x4c, 0x53, 0x31, 0x5f, 0x33, 0x10, 0x01, 0x42, 0x36, 0x5a,
 308  	0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67,
 309  	0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
 310  	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x67, 0x6f, 0x5f,
 311  	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 312  }
 313  
 314  var (
 315  	file_internal_proto_common_common_proto_rawDescOnce sync.Once
 316  	file_internal_proto_common_common_proto_rawDescData = file_internal_proto_common_common_proto_rawDesc
 317  )
 318  
 319  func file_internal_proto_common_common_proto_rawDescGZIP() []byte {
 320  	file_internal_proto_common_common_proto_rawDescOnce.Do(func() {
 321  		file_internal_proto_common_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_proto_common_common_proto_rawDescData)
 322  	})
 323  	return file_internal_proto_common_common_proto_rawDescData
 324  }
 325  
 326  var file_internal_proto_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
 327  var file_internal_proto_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
 328  var file_internal_proto_common_common_proto_goTypes = []any{
 329  	(Ciphersuite)(0), // 0: s2a.proto.Ciphersuite
 330  	(TLSVersion)(0),  // 1: s2a.proto.TLSVersion
 331  	(*Identity)(nil), // 2: s2a.proto.Identity
 332  	nil,              // 3: s2a.proto.Identity.AttributesEntry
 333  }
 334  var file_internal_proto_common_common_proto_depIdxs = []int32{
 335  	3, // 0: s2a.proto.Identity.attributes:type_name -> s2a.proto.Identity.AttributesEntry
 336  	1, // [1:1] is the sub-list for method output_type
 337  	1, // [1:1] is the sub-list for method input_type
 338  	1, // [1:1] is the sub-list for extension type_name
 339  	1, // [1:1] is the sub-list for extension extendee
 340  	0, // [0:1] is the sub-list for field type_name
 341  }
 342  
 343  func init() { file_internal_proto_common_common_proto_init() }
 344  func file_internal_proto_common_common_proto_init() {
 345  	if File_internal_proto_common_common_proto != nil {
 346  		return
 347  	}
 348  	if !protoimpl.UnsafeEnabled {
 349  		file_internal_proto_common_common_proto_msgTypes[0].Exporter = func(v any, i int) any {
 350  			switch v := v.(*Identity); i {
 351  			case 0:
 352  				return &v.state
 353  			case 1:
 354  				return &v.sizeCache
 355  			case 2:
 356  				return &v.unknownFields
 357  			default:
 358  				return nil
 359  			}
 360  		}
 361  	}
 362  	file_internal_proto_common_common_proto_msgTypes[0].OneofWrappers = []any{
 363  		(*Identity_SpiffeId)(nil),
 364  		(*Identity_Hostname)(nil),
 365  		(*Identity_Uid)(nil),
 366  		(*Identity_Username)(nil),
 367  		(*Identity_GcpId)(nil),
 368  	}
 369  	type x struct{}
 370  	out := protoimpl.TypeBuilder{
 371  		File: protoimpl.DescBuilder{
 372  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 373  			RawDescriptor: file_internal_proto_common_common_proto_rawDesc,
 374  			NumEnums:      2,
 375  			NumMessages:   2,
 376  			NumExtensions: 0,
 377  			NumServices:   0,
 378  		},
 379  		GoTypes:           file_internal_proto_common_common_proto_goTypes,
 380  		DependencyIndexes: file_internal_proto_common_common_proto_depIdxs,
 381  		EnumInfos:         file_internal_proto_common_common_proto_enumTypes,
 382  		MessageInfos:      file_internal_proto_common_common_proto_msgTypes,
 383  	}.Build()
 384  	File_internal_proto_common_common_proto = out.File
 385  	file_internal_proto_common_common_proto_rawDesc = nil
 386  	file_internal_proto_common_common_proto_goTypes = nil
 387  	file_internal_proto_common_common_proto_depIdxs = nil
 388  }
 389