b2blaze icon indicating copy to clipboard operation
b2blaze copied to clipboard

Improve behaviour with restricted application keys

Open Katharine opened this issue 6 years ago • 0 comments

It is now possible to create application keys with restrictions. These keys only have one access to one bucket, and to a subset of possible API calls.

Most importantly, these restricted keys cannot freely call b2_list_buckets, which renders them unusable with b2blaze. This PR makes a minimal change to make these keys work: when using such a restricted key, only try listing the one permitted bucket.

This is an incomplete solution: a key could theoretically not have the ability to call b2_list_buckets even for its single permitted bucket, and b2blaze has little reason to require that they can. However, it solves the most common case where the keys are created via the web UI, which always grants access to b2_list_buckets.

I've tested this using the subset of the integration tests that don't involve creating/destroying buckets, but by the nature of the problem and the current testing setup, I can't really include these tests in the repo usefully.

Katharine avatar Jan 15 '19 06:01 Katharine