google

package
v0.0.0-...-3112392 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	GCPAuthProvider = "gcp"
)

Variables

View Source
var (
	GCEProvider = "GoogleComputeEngine"
	// GKEClusterURL is the URL to send requests to the token exchange service.
	GKEClusterURL = env.Register("GKE_CLUSTER_URL", "", "The url of GKE cluster").Get()
)

Functions

This section is empty.

Types

type Duration

type Duration struct {
	// Signed seconds of the span of time. Must be from -315,576,000,000
	// to +315,576,000,000 inclusive. Note: these bounds are computed from:
	// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
	Seconds int64 `json:"seconds"`
}

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin supports token exchange with Google OAuth 2.0 authorization server.

func CreateTokenManagerPlugin

func CreateTokenManagerPlugin(credFetcher security.CredFetcher, trustDomain, gcpProjectNumber, gkeClusterURL string, enableCache bool) (*Plugin, error)

CreateTokenManagerPlugin creates a plugin that fetches token from a Google OAuth 2.0 authorization server.

func (*Plugin) ClearCache

func (p *Plugin) ClearCache()

ClearCache is only used for testing purposes.

func (*Plugin) DumpPluginStatus

func (p *Plugin) DumpPluginStatus() ([]byte, error)

DumpTokenStatus dumps all token status in JSON

func (*Plugin) ExchangeToken

func (p *Plugin) ExchangeToken(parameters security.StsRequestParameters) ([]byte, error)

GenerateToken takes STS request parameters and fetches token, returns StsResponseParameters in JSON.

func (*Plugin) GetGcpProjectNumber

func (p *Plugin) GetGcpProjectNumber() string

GetGcpProjectNumber returns the GCP project number

func (*Plugin) GetMetadata

func (p *Plugin) GetMetadata(forCA bool, xdsAuthProvider, token string) (map[string]string, error)

GetMetadata returns the metadata headers related to the token

func (*Plugin) SetEndpoints

func (p *Plugin) SetEndpoints(fTokenEndpoint, aTokenEndpoint string)

SetEndpoints changes the endpoints for testing purposes only.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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