Closed
Description
db1fac5 created the issue
Regression from <7.0
When opening connection, b2_list_buckets will fail if the app key in-use is limited to one bucket. 6.9 would list one bucket, 7.0 errors and breaks authorization flow.
Reproduction:
- Create B2 app key limited to one bucket
- Attempt connection POST /b2api/v2/b2_list_buckets HTTP/1.1
Error: 401 Listing Directory / Failed
https://www.backblaze.com/b2/docs/application_keys.html#usingRestrictedKeys
Most of the API calls that deal with buckets or files use a bucketId to identify a bucket. But, when using an application key that restricts access to just one bucket, you can't use b2_list_buckets to list all the buckets.
When there is a bucket restriction, the bucketId and the bucketName for that bucket are in the response from b2_authorize_account in the allowed section. You can then use that bucketId in all of your later calls.