mirror of
https://github.com/rancher/steve.git
synced 2025-09-26 23:34:01 +00:00
Update vendor
This commit is contained in:
13
vendor/k8s.io/client-go/transport/token_source.go
generated
vendored
13
vendor/k8s.io/client-go/transport/token_source.go
generated
vendored
@@ -59,11 +59,24 @@ func NewCachedFileTokenSource(path string) oauth2.TokenSource {
|
||||
}
|
||||
}
|
||||
|
||||
// NewCachedTokenSource returns a oauth2.TokenSource reads a token from a
|
||||
// designed TokenSource. The ts would provide the source of token.
|
||||
func NewCachedTokenSource(ts oauth2.TokenSource) oauth2.TokenSource {
|
||||
return &cachingTokenSource{
|
||||
now: time.Now,
|
||||
base: ts,
|
||||
}
|
||||
}
|
||||
|
||||
type tokenSourceTransport struct {
|
||||
base http.RoundTripper
|
||||
ort http.RoundTripper
|
||||
}
|
||||
|
||||
func (tst *tokenSourceTransport) WrappedRoundTripper() http.RoundTripper {
|
||||
return tst.base
|
||||
}
|
||||
|
||||
func (tst *tokenSourceTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
// This is to allow --token to override other bearer token providers.
|
||||
if req.Header.Get("Authorization") != "" {
|
||||
|
Reference in New Issue
Block a user