box / boxcli

A command line interface for interacting with the Box API.
https://developer.box.com
Apache License 2.0
222 stars 59 forks source link

Can I restrict usage of Box CLI to only allow uploading to a single folder? #479

Closed j-signorelli closed 1 year ago

j-signorelli commented 1 year ago

Description of the Issue

I am interested in using Box CLI but only restricting access to allow uploads to a single folder on my Box drive in terminal on Linux. Is this possible? It seems that I can only allow entire write access or not.

lukaszsocha2 commented 1 year ago

Hi @j-signorelli, to restrict permission to just one folder you can use tokens:exchange command with --folder-id flag, e.g: box tokens:exchange item_upload --folder-id=0. I will return a downscoped token to a specified folder. Please see documentation of this command: https://github.com/box/boxcli/blob/main/docs/tokens.md#box-tokensexchange-scope Hope this helps, @lukaszsocha2