github.com/google/cloudprober@v0.11.3/common/oauth/proto/config.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // versions: 3 // protoc-gen-go v1.26.0 4 // protoc v3.17.3 5 // source: github.com/google/cloudprober/common/oauth/proto/config.proto 6 7 package proto 8 9 import ( 10 protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 reflect "reflect" 13 sync "sync" 14 ) 15 16 const ( 17 // Verify that this generated code is sufficiently up-to-date. 18 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 // Verify that runtime/protoimpl is sufficiently up-to-date. 20 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 ) 22 23 type Config struct { 24 state protoimpl.MessageState 25 sizeCache protoimpl.SizeCache 26 unknownFields protoimpl.UnknownFields 27 28 // Types that are assignable to Type: 29 // *Config_BearerToken 30 // *Config_GoogleCredentials 31 Type isConfig_Type `protobuf_oneof:"type"` 32 } 33 34 func (x *Config) Reset() { 35 *x = Config{} 36 if protoimpl.UnsafeEnabled { 37 mi := &file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes[0] 38 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 39 ms.StoreMessageInfo(mi) 40 } 41 } 42 43 func (x *Config) String() string { 44 return protoimpl.X.MessageStringOf(x) 45 } 46 47 func (*Config) ProtoMessage() {} 48 49 func (x *Config) ProtoReflect() protoreflect.Message { 50 mi := &file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes[0] 51 if protoimpl.UnsafeEnabled && x != nil { 52 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 53 if ms.LoadMessageInfo() == nil { 54 ms.StoreMessageInfo(mi) 55 } 56 return ms 57 } 58 return mi.MessageOf(x) 59 } 60 61 // Deprecated: Use Config.ProtoReflect.Descriptor instead. 62 func (*Config) Descriptor() ([]byte, []int) { 63 return file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDescGZIP(), []int{0} 64 } 65 66 func (m *Config) GetType() isConfig_Type { 67 if m != nil { 68 return m.Type 69 } 70 return nil 71 } 72 73 func (x *Config) GetBearerToken() *BearerToken { 74 if x, ok := x.GetType().(*Config_BearerToken); ok { 75 return x.BearerToken 76 } 77 return nil 78 } 79 80 func (x *Config) GetGoogleCredentials() *GoogleCredentials { 81 if x, ok := x.GetType().(*Config_GoogleCredentials); ok { 82 return x.GoogleCredentials 83 } 84 return nil 85 } 86 87 type isConfig_Type interface { 88 isConfig_Type() 89 } 90 91 type Config_BearerToken struct { 92 BearerToken *BearerToken `protobuf:"bytes,1,opt,name=bearer_token,json=bearerToken,oneof"` 93 } 94 95 type Config_GoogleCredentials struct { 96 GoogleCredentials *GoogleCredentials `protobuf:"bytes,2,opt,name=google_credentials,json=googleCredentials,oneof"` 97 } 98 99 func (*Config_BearerToken) isConfig_Type() {} 100 101 func (*Config_GoogleCredentials) isConfig_Type() {} 102 103 // Bearer token is added to the HTTP request through an HTTP header: 104 // "Authorization: Bearer <access_token>" 105 type BearerToken struct { 106 state protoimpl.MessageState 107 sizeCache protoimpl.SizeCache 108 unknownFields protoimpl.UnknownFields 109 110 // Types that are assignable to Source: 111 // *BearerToken_File 112 // *BearerToken_Cmd 113 // *BearerToken_GceServiceAccount 114 Source isBearerToken_Source `protobuf_oneof:"source"` 115 // How often to refresh token. As OAuth token usually expire, we need to 116 // refresh them on a regular interval. If set to 0, caching is disabled. 117 RefreshIntervalSec *float32 `protobuf:"fixed32,90,opt,name=refresh_interval_sec,json=refreshIntervalSec,def=60" json:"refresh_interval_sec,omitempty"` 118 } 119 120 // Default values for BearerToken fields. 121 const ( 122 Default_BearerToken_RefreshIntervalSec = float32(60) 123 ) 124 125 func (x *BearerToken) Reset() { 126 *x = BearerToken{} 127 if protoimpl.UnsafeEnabled { 128 mi := &file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes[1] 129 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 130 ms.StoreMessageInfo(mi) 131 } 132 } 133 134 func (x *BearerToken) String() string { 135 return protoimpl.X.MessageStringOf(x) 136 } 137 138 func (*BearerToken) ProtoMessage() {} 139 140 func (x *BearerToken) ProtoReflect() protoreflect.Message { 141 mi := &file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes[1] 142 if protoimpl.UnsafeEnabled && x != nil { 143 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 144 if ms.LoadMessageInfo() == nil { 145 ms.StoreMessageInfo(mi) 146 } 147 return ms 148 } 149 return mi.MessageOf(x) 150 } 151 152 // Deprecated: Use BearerToken.ProtoReflect.Descriptor instead. 153 func (*BearerToken) Descriptor() ([]byte, []int) { 154 return file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDescGZIP(), []int{1} 155 } 156 157 func (m *BearerToken) GetSource() isBearerToken_Source { 158 if m != nil { 159 return m.Source 160 } 161 return nil 162 } 163 164 func (x *BearerToken) GetFile() string { 165 if x, ok := x.GetSource().(*BearerToken_File); ok { 166 return x.File 167 } 168 return "" 169 } 170 171 func (x *BearerToken) GetCmd() string { 172 if x, ok := x.GetSource().(*BearerToken_Cmd); ok { 173 return x.Cmd 174 } 175 return "" 176 } 177 178 func (x *BearerToken) GetGceServiceAccount() string { 179 if x, ok := x.GetSource().(*BearerToken_GceServiceAccount); ok { 180 return x.GceServiceAccount 181 } 182 return "" 183 } 184 185 func (x *BearerToken) GetRefreshIntervalSec() float32 { 186 if x != nil && x.RefreshIntervalSec != nil { 187 return *x.RefreshIntervalSec 188 } 189 return Default_BearerToken_RefreshIntervalSec 190 } 191 192 type isBearerToken_Source interface { 193 isBearerToken_Source() 194 } 195 196 type BearerToken_File struct { 197 // Path to token file. 198 File string `protobuf:"bytes,1,opt,name=file,oneof"` 199 } 200 201 type BearerToken_Cmd struct { 202 // Run a comand to obtain the token, e.g. 203 // cat /var/lib/myapp/token, or 204 // /var/lib/run/get_token.sh 205 Cmd string `protobuf:"bytes,2,opt,name=cmd,oneof"` 206 } 207 208 type BearerToken_GceServiceAccount struct { 209 // GCE metadata token 210 GceServiceAccount string `protobuf:"bytes,3,opt,name=gce_service_account,json=gceServiceAccount,oneof"` 211 } 212 213 func (*BearerToken_File) isBearerToken_Source() {} 214 215 func (*BearerToken_Cmd) isBearerToken_Source() {} 216 217 func (*BearerToken_GceServiceAccount) isBearerToken_Source() {} 218 219 // Google credentials in JSON format. We simply use oauth2/google package to 220 // use these credentials. 221 type GoogleCredentials struct { 222 state protoimpl.MessageState 223 sizeCache protoimpl.SizeCache 224 unknownFields protoimpl.UnknownFields 225 226 JsonFile *string `protobuf:"bytes,1,opt,name=json_file,json=jsonFile" json:"json_file,omitempty"` 227 Scope []string `protobuf:"bytes,2,rep,name=scope" json:"scope,omitempty"` 228 // Use encoded JWT directly as access token, instead of implementing the whole 229 // OAuth2.0 flow. 230 JwtAsAccessToken *bool `protobuf:"varint,4,opt,name=jwt_as_access_token,json=jwtAsAccessToken" json:"jwt_as_access_token,omitempty"` 231 // Audience works only if jwt_as_access_token is true. 232 Audience *string `protobuf:"bytes,3,opt,name=audience" json:"audience,omitempty"` 233 } 234 235 func (x *GoogleCredentials) Reset() { 236 *x = GoogleCredentials{} 237 if protoimpl.UnsafeEnabled { 238 mi := &file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes[2] 239 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 240 ms.StoreMessageInfo(mi) 241 } 242 } 243 244 func (x *GoogleCredentials) String() string { 245 return protoimpl.X.MessageStringOf(x) 246 } 247 248 func (*GoogleCredentials) ProtoMessage() {} 249 250 func (x *GoogleCredentials) ProtoReflect() protoreflect.Message { 251 mi := &file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes[2] 252 if protoimpl.UnsafeEnabled && x != nil { 253 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 254 if ms.LoadMessageInfo() == nil { 255 ms.StoreMessageInfo(mi) 256 } 257 return ms 258 } 259 return mi.MessageOf(x) 260 } 261 262 // Deprecated: Use GoogleCredentials.ProtoReflect.Descriptor instead. 263 func (*GoogleCredentials) Descriptor() ([]byte, []int) { 264 return file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDescGZIP(), []int{2} 265 } 266 267 func (x *GoogleCredentials) GetJsonFile() string { 268 if x != nil && x.JsonFile != nil { 269 return *x.JsonFile 270 } 271 return "" 272 } 273 274 func (x *GoogleCredentials) GetScope() []string { 275 if x != nil { 276 return x.Scope 277 } 278 return nil 279 } 280 281 func (x *GoogleCredentials) GetJwtAsAccessToken() bool { 282 if x != nil && x.JwtAsAccessToken != nil { 283 return *x.JwtAsAccessToken 284 } 285 return false 286 } 287 288 func (x *GoogleCredentials) GetAudience() string { 289 if x != nil && x.Audience != nil { 290 return *x.Audience 291 } 292 return "" 293 } 294 295 var File_github_com_google_cloudprober_common_oauth_proto_config_proto protoreflect.FileDescriptor 296 297 var file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDesc = []byte{ 298 0x0a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 299 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x72, 0x2f, 300 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x70, 0x72, 0x6f, 301 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 302 0x11, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x72, 0x2e, 0x6f, 0x61, 0x75, 303 0x74, 0x68, 0x22, 0xac, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x43, 0x0a, 304 0x0c, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 305 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x62, 0x65, 306 0x72, 0x2e, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 307 0x6b, 0x65, 0x6e, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 308 0x65, 0x6e, 0x12, 0x55, 0x0a, 0x12, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x63, 0x72, 0x65, 309 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 310 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x72, 0x2e, 0x6f, 0x61, 0x75, 311 0x74, 0x68, 0x2e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 312 0x69, 0x61, 0x6c, 0x73, 0x48, 0x00, 0x52, 0x11, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x43, 0x72, 313 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 314 0x65, 0x22, 0xa9, 0x01, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 315 0x6e, 0x12, 0x14, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 316 0x00, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 317 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x67, 318 0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 319 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x11, 0x67, 0x63, 0x65, 0x53, 320 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 321 0x14, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 322 0x6c, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x5a, 0x20, 0x01, 0x28, 0x02, 0x3a, 0x02, 0x36, 0x30, 0x52, 323 0x12, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 324 0x53, 0x65, 0x63, 0x42, 0x08, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x91, 0x01, 325 0x0a, 0x11, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 326 0x61, 0x6c, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x6c, 0x65, 327 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x65, 328 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 329 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x13, 0x6a, 0x77, 0x74, 0x5f, 0x61, 0x73, 330 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 331 0x01, 0x28, 0x08, 0x52, 0x10, 0x6a, 0x77, 0x74, 0x41, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 332 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 333 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 334 0x65, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 335 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x62, 336 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x2f, 337 0x70, 0x72, 0x6f, 0x74, 0x6f, 338 } 339 340 var ( 341 file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDescOnce sync.Once 342 file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDescData = file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDesc 343 ) 344 345 func file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDescGZIP() []byte { 346 file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDescOnce.Do(func() { 347 file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDescData) 348 }) 349 return file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDescData 350 } 351 352 var file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) 353 var file_github_com_google_cloudprober_common_oauth_proto_config_proto_goTypes = []interface{}{ 354 (*Config)(nil), // 0: cloudprober.oauth.Config 355 (*BearerToken)(nil), // 1: cloudprober.oauth.BearerToken 356 (*GoogleCredentials)(nil), // 2: cloudprober.oauth.GoogleCredentials 357 } 358 var file_github_com_google_cloudprober_common_oauth_proto_config_proto_depIdxs = []int32{ 359 1, // 0: cloudprober.oauth.Config.bearer_token:type_name -> cloudprober.oauth.BearerToken 360 2, // 1: cloudprober.oauth.Config.google_credentials:type_name -> cloudprober.oauth.GoogleCredentials 361 2, // [2:2] is the sub-list for method output_type 362 2, // [2:2] is the sub-list for method input_type 363 2, // [2:2] is the sub-list for extension type_name 364 2, // [2:2] is the sub-list for extension extendee 365 0, // [0:2] is the sub-list for field type_name 366 } 367 368 func init() { file_github_com_google_cloudprober_common_oauth_proto_config_proto_init() } 369 func file_github_com_google_cloudprober_common_oauth_proto_config_proto_init() { 370 if File_github_com_google_cloudprober_common_oauth_proto_config_proto != nil { 371 return 372 } 373 if !protoimpl.UnsafeEnabled { 374 file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 375 switch v := v.(*Config); i { 376 case 0: 377 return &v.state 378 case 1: 379 return &v.sizeCache 380 case 2: 381 return &v.unknownFields 382 default: 383 return nil 384 } 385 } 386 file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 387 switch v := v.(*BearerToken); i { 388 case 0: 389 return &v.state 390 case 1: 391 return &v.sizeCache 392 case 2: 393 return &v.unknownFields 394 default: 395 return nil 396 } 397 } 398 file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { 399 switch v := v.(*GoogleCredentials); i { 400 case 0: 401 return &v.state 402 case 1: 403 return &v.sizeCache 404 case 2: 405 return &v.unknownFields 406 default: 407 return nil 408 } 409 } 410 } 411 file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes[0].OneofWrappers = []interface{}{ 412 (*Config_BearerToken)(nil), 413 (*Config_GoogleCredentials)(nil), 414 } 415 file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes[1].OneofWrappers = []interface{}{ 416 (*BearerToken_File)(nil), 417 (*BearerToken_Cmd)(nil), 418 (*BearerToken_GceServiceAccount)(nil), 419 } 420 type x struct{} 421 out := protoimpl.TypeBuilder{ 422 File: protoimpl.DescBuilder{ 423 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 424 RawDescriptor: file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDesc, 425 NumEnums: 0, 426 NumMessages: 3, 427 NumExtensions: 0, 428 NumServices: 0, 429 }, 430 GoTypes: file_github_com_google_cloudprober_common_oauth_proto_config_proto_goTypes, 431 DependencyIndexes: file_github_com_google_cloudprober_common_oauth_proto_config_proto_depIdxs, 432 MessageInfos: file_github_com_google_cloudprober_common_oauth_proto_config_proto_msgTypes, 433 }.Build() 434 File_github_com_google_cloudprober_common_oauth_proto_config_proto = out.File 435 file_github_com_google_cloudprober_common_oauth_proto_config_proto_rawDesc = nil 436 file_github_com_google_cloudprober_common_oauth_proto_config_proto_goTypes = nil 437 file_github_com_google_cloudprober_common_oauth_proto_config_proto_depIdxs = nil 438 }