MCPcopy
hub / github.com/kubernetes/client-go / newGCPAuthProvider

Function newGCPAuthProvider

plugin/pkg/client/auth/gcp/gcp.go:116–126  ·  view source on GitHub ↗
(_ string, gcpConfig map[string]string, persister restclient.AuthProviderConfigPersister)

Source from the content-addressed store, hash-verified

114}
115
116func newGCPAuthProvider(_ string, gcpConfig map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) {
117 ts, err := tokenSource(isCmdTokenSource(gcpConfig), gcpConfig)
118 if err != nil {
119 return nil, err
120 }
121 cts, err := newCachedTokenSource(gcpConfig["access-token"], gcpConfig["expiry"], persister, ts, gcpConfig)
122 if err != nil {
123 return nil, err
124 }
125 return &gcpAuthProvider{cts, persister}, nil
126}
127
128func isCmdTokenSource(gcpConfig map[string]string) bool {
129 _, ok := gcpConfig["cmd-path"]

Callers 1

TestCmdTokenSourceFunction · 0.85

Calls 3

isCmdTokenSourceFunction · 0.85
newCachedTokenSourceFunction · 0.85
tokenSourceFunction · 0.70

Tested by 1

TestCmdTokenSourceFunction · 0.68