proto

package
v0.13.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_github_com_cloudprober_cloudprober_internal_oauth_proto_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type BearerToken

type BearerToken struct {

	// Types that are assignable to Source:
	//
	//	*BearerToken_File
	//	*BearerToken_Cmd
	//	*BearerToken_GceServiceAccount
	//	*BearerToken_K8SLocalToken
	Source isBearerToken_Source `protobuf_oneof:"source"`
	// If above sources return JSON tokens with an expiry, we use that info to
	// determine when to refresh tokens and refresh_interval_sec is completely
	// ignored. If above sources return a string, we refresh from the source
	// every 30s by default. To disable this behavior set refresh_interval_sec to
	// zero.
	RefreshIntervalSec *float32 `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

Bearer token is added to the HTTP request through an HTTP header: "Authorization: Bearer <access_token>"

func (*BearerToken) Descriptor deprecated

func (*BearerToken) Descriptor() ([]byte, []int)

Deprecated: Use BearerToken.ProtoReflect.Descriptor instead.

func (*BearerToken) GetCmd

func (x *BearerToken) GetCmd() string

func (*BearerToken) GetFile

func (x *BearerToken) GetFile() string

func (*BearerToken) GetGceServiceAccount

func (x *BearerToken) GetGceServiceAccount() string

func (*BearerToken) GetK8SLocalToken

func (x *BearerToken) GetK8SLocalToken() bool

func (*BearerToken) GetRefreshIntervalSec

func (x *BearerToken) GetRefreshIntervalSec() float32

func (*BearerToken) GetSource

func (m *BearerToken) GetSource() isBearerToken_Source

func (*BearerToken) ProtoMessage

func (*BearerToken) ProtoMessage()

func (*BearerToken) ProtoReflect

func (x *BearerToken) ProtoReflect() protoreflect.Message

func (*BearerToken) Reset

func (x *BearerToken) Reset()

func (*BearerToken) String

func (x *BearerToken) String() string

type BearerToken_Cmd

type BearerToken_Cmd struct {
	// Run a comand to obtain the token, e.g.
	// cat /var/lib/myapp/token, or
	// /var/lib/run/get_token.sh
	Cmd string `protobuf:"bytes,2,opt,name=cmd,proto3,oneof"`
}

type BearerToken_File

type BearerToken_File struct {
	// Path to token file.
	File string `protobuf:"bytes,1,opt,name=file,proto3,oneof"`
}

type BearerToken_GceServiceAccount

type BearerToken_GceServiceAccount struct {
	// GCE metadata token
	GceServiceAccount string `protobuf:"bytes,3,opt,name=gce_service_account,json=gceServiceAccount,proto3,oneof"`
}

type BearerToken_K8SLocalToken

type BearerToken_K8SLocalToken struct {
	// K8s service account token file:
	// /var/run/secrets/kubernetes.io/serviceaccount/token
	K8SLocalToken bool `protobuf:"varint,4,opt,name=k8s_local_token,json=k8sLocalToken,proto3,oneof"`
}

type Config

type Config struct {

	// Types that are assignable to Type:
	//
	//	*Config_HttpRequest
	//	*Config_BearerToken
	//	*Config_GoogleCredentials
	Type isConfig_Type `protobuf_oneof:"type"`
	// How long before the expiry do we refresh. Default is 60 (1m). This applies
	// only to http_request and bearer_token types, and only if token presents
	// expiry in some way.
	// TODO(manugarg): Consider setting default based on probe interval.
	RefreshExpiryBufferSec *int32 `` /* 139-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetBearerToken

func (x *Config) GetBearerToken() *BearerToken

func (*Config) GetGoogleCredentials

func (x *Config) GetGoogleCredentials() *GoogleCredentials

func (*Config) GetHttpRequest

func (x *Config) GetHttpRequest() *HTTPRequest

func (*Config) GetRefreshExpiryBufferSec

func (x *Config) GetRefreshExpiryBufferSec() int32

func (*Config) GetType

func (m *Config) GetType() isConfig_Type

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type Config_BearerToken

type Config_BearerToken struct {
	BearerToken *BearerToken `protobuf:"bytes,1,opt,name=bearer_token,json=bearerToken,proto3,oneof"`
}

type Config_GoogleCredentials

type Config_GoogleCredentials struct {
	GoogleCredentials *GoogleCredentials `protobuf:"bytes,2,opt,name=google_credentials,json=googleCredentials,proto3,oneof"`
}

type Config_HttpRequest

type Config_HttpRequest struct {
	HttpRequest *HTTPRequest `protobuf:"bytes,3,opt,name=http_request,json=httpRequest,proto3,oneof"`
}

type GoogleCredentials

type GoogleCredentials struct {
	JsonFile string   `protobuf:"bytes,1,opt,name=json_file,json=jsonFile,proto3" json:"json_file,omitempty"`
	Scope    []string `protobuf:"bytes,2,rep,name=scope,proto3" json:"scope,omitempty"`
	// Use encoded JWT directly as access token, instead of implementing the whole
	// OAuth2.0 flow.
	JwtAsAccessToken bool `protobuf:"varint,4,opt,name=jwt_as_access_token,json=jwtAsAccessToken,proto3" json:"jwt_as_access_token,omitempty"`
	// Audience works only if jwt_as_access_token is true.
	Audience string `protobuf:"bytes,3,opt,name=audience,proto3" json:"audience,omitempty"`
	// contains filtered or unexported fields
}

Google credentials in JSON format. We simply use oauth2/google package to use these credentials.

func (*GoogleCredentials) Descriptor deprecated

func (*GoogleCredentials) Descriptor() ([]byte, []int)

Deprecated: Use GoogleCredentials.ProtoReflect.Descriptor instead.

func (*GoogleCredentials) GetAudience

func (x *GoogleCredentials) GetAudience() string

func (*GoogleCredentials) GetJsonFile

func (x *GoogleCredentials) GetJsonFile() string

func (*GoogleCredentials) GetJwtAsAccessToken

func (x *GoogleCredentials) GetJwtAsAccessToken() bool

func (*GoogleCredentials) GetScope

func (x *GoogleCredentials) GetScope() []string

func (*GoogleCredentials) ProtoMessage

func (*GoogleCredentials) ProtoMessage()

func (*GoogleCredentials) ProtoReflect

func (x *GoogleCredentials) ProtoReflect() protoreflect.Message

func (*GoogleCredentials) Reset

func (x *GoogleCredentials) Reset()

func (*GoogleCredentials) String

func (x *GoogleCredentials) String() string

type HTTPRequest

type HTTPRequest struct {
	TokenUrl string `protobuf:"bytes,1,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"`
	Method   string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
	// Data to be sent as request body. If there are multiple "data" fields, we combine
	// their values with a '&' in between. Note: 1) If data appears to be a valid json,
	// we automatically set the content-type header to "application/json", 2) If data
	// appears to be a query string we set content-type to
	// "application/x-www-form-urlencoded". Content type header can still be overridden
	// using the header field below.
	Data []string `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
	// HTTP request headers
	Header map[string]string `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*HTTPRequest) Descriptor deprecated

func (*HTTPRequest) Descriptor() ([]byte, []int)

Deprecated: Use HTTPRequest.ProtoReflect.Descriptor instead.

func (*HTTPRequest) GetData

func (x *HTTPRequest) GetData() []string

func (*HTTPRequest) GetHeader

func (x *HTTPRequest) GetHeader() map[string]string

func (*HTTPRequest) GetMethod

func (x *HTTPRequest) GetMethod() string

func (*HTTPRequest) GetTokenUrl

func (x *HTTPRequest) GetTokenUrl() string

func (*HTTPRequest) ProtoMessage

func (*HTTPRequest) ProtoMessage()

func (*HTTPRequest) ProtoReflect

func (x *HTTPRequest) ProtoReflect() protoreflect.Message

func (*HTTPRequest) Reset

func (x *HTTPRequest) Reset()

func (*HTTPRequest) String

func (x *HTTPRequest) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL