Documentation ¶
Index ¶
- Constants
- Variables
- type Duration
- type Plugin
- func (p *Plugin) ClearCache()
- func (p *Plugin) DumpPluginStatus() ([]byte, error)
- func (p *Plugin) ExchangeToken(parameters security.StsRequestParameters) ([]byte, error)
- func (p *Plugin) GetGcpProjectNumber() string
- func (p *Plugin) GetMetadata(forCA bool, xdsAuthProvider, token string) (map[string]string, error)
- func (p *Plugin) SetEndpoints(fTokenEndpoint, aTokenEndpoint string)
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.RegisterStringVar("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 ¶
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 ¶
GetGcpProjectNumber returns the GCP project number
func (*Plugin) GetMetadata ¶
GetMetadata returns the metadata headers related to the token
func (*Plugin) SetEndpoints ¶
SetEndpoints changes the endpoints for testing purposes only.
Click to show internal directories.
Click to hide internal directories.