"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
box: add --box-impersonate to impersonate a user ID - fixes #7267
Nick Craig-Wood6afd7088d349
diff --git a/backend/box/box.go b/backend/box/box.goindex d2853480a..d925ab7db 100644--- a/backend/box/box.go+++ b/backend/box/box.go@@ -149,6 +149,23 @@ func init() {Default: "",Help: "Only show items owned by the login (email address) passed in.",Advanced: true,+ }, {+ Name: "impersonate",+ Default: "",+ Help: `Impersonate this user ID when using a service account.++Settng this flag allows rclone, when using a JWT service account, to+act on behalf of another user by setting the as-user header.++The user ID is the Box identifier for a user. User IDs can found for+any user via the GET /users endpoint, which is only available to+admins, or by calling the GET /users/me endpoint with an authenticated+user session.++See: https://developer.box.com/guides/authentication/jwt/as-user/+`,+ Advanced: true,+ Sensitive: true,}, {Name: config.ConfigEncoding,Help: config.ConfigEncodingHelp,@@ -262,6 +279,7 @@ type Options struct {AccessToken string `config:"access_token"`ListChunk int `config:"list_chunk"`OwnedBy string `config:"owned_by"`+ Impersonate string `config:"impersonate"`}// ItemMeta defines metadata we cache for each Item ID@@ -451,6 +469,11 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, ef.srv.SetHeader("Authorization", "Bearer "+f.opt.AccessToken)}+ // If using impersonate set an as-user header+ if f.opt.Impersonate != "" {+ f.srv.SetHeader("as-user", f.opt.Impersonate)+ }+jsonFile, ok := m.Get("box_config_file")boxSubType, boxSubTypeOk := m.Get("box_sub_type")