MCPcopy
hub / github.com/rclone/rclone / getServiceAccountClient

Function getServiceAccountClient

backend/googlecloudstorage/googlecloudstorage.go:517–524  ·  view source on GitHub ↗
(ctx context.Context, credentialsData []byte)

Source from the content-addressed store, hash-verified

515}
516
517func getServiceAccountClient(ctx context.Context, credentialsData []byte) (*http.Client, error) {
518 conf, err := google.JWTConfigFromJSON(credentialsData, storageConfig.Scopes...)
519 if err != nil {
520 return nil, fmt.Errorf("error processing credentials: %w", err)
521 }
522 ctxWithSpecialClient := oauthutil.Context(ctx, fshttp.NewClient(ctx))
523 return oauth2.NewClient(ctxWithSpecialClient, conf.TokenSource(ctxWithSpecialClient)), nil
524}
525
526// setRoot changes the root of the Fs
527func (f *Fs) setRoot(root string) {

Callers 1

NewFsFunction · 0.70

Calls 3

ContextFunction · 0.92
NewClientFunction · 0.92
ErrorfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…