I am using rclone api rcd with box enterprise but i am unable to find how can i pass the header
as:user as in rclone CLI we have the header flag to pass on to box but in rclone API i am unable to find that. I have tried to pass on the headers in _config but it is not working.
Run the command 'rclone version' and share the full output of the command.
rclone v1.63.1
os/version: Microsoft Windows 10 Pro 22H2 (64 bit)
os/kernel: 10.0.19045.3324 (x86_64)
os/type: windows
os/arch: amd64
go/version: go1.20.6
go/linking: static
go/tags: cmount
Which cloud storage system are you using? (eg Google Drive)
Box
The command you were trying to run (eg rclone copy /tmp remote:tmp)
Sorry for inconsistent remote names but I change them knowingly as my real remote name contains company name ids.
Also I am using a service account and not client_id and client_secret. Does that make any difference.
I pushed a little fix to the latest beta which turns that into
Error "not_found" (404): On-Behalf-Of User not found ({"invalid_user_id":{"id":"00000000000"}})
Which is a little easier to understand! I don't think I've seen one of those errors before so I guess I never noticed we were outputting the message as numbers instead of a string!
You were correct I made a mistake there. Sorry about that.
That will be helpful indeed.
Now, there are some issues with current RClone Box backend which I observe with api server. Google backend works fine BTW.
It is somehow cashing the input and results. I only passed "00000000000" may be once or twice because I was having JSON format issues but server cached it and was returning the same result even when I was passing a correct Box user id. I had to restart the server to get the correct results.
In my case caching is not a friend because I need to perform multiple migrations at the same time.
A solution is to add AS-USER key in box config and not using cache.
As a newbie I am unaware of the project philosophy so my solution may not be for all .
We are currently making changes internally in box.go to work in our case.
It will be a long journey as I am starting to work with Go from this project. I am from Python/Django background.
That will depend on exactly what you are doing. If you are creating a new backend with the extra config then yes backends are cached for 5 minutes by default.
This won't be a problem if we make the impersonate flag as this will become part of the cache key and a different backend will be created.
As per my understanding, you want to add multiple box_user_ids to impersonate as-user in a single config section.
Box APIs only support a single as-user id in headers so it is not supported.
I suggest that you use List Enterprise User to get all users and create config for all of them using same credentials file and respective user_id.