| 515 | } |
| 516 | |
| 517 | func 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 |
| 527 | func (f *Fs) setRoot(root string) { |