★ wanayoo — archive 1999 https://github.com/synapticloop/backblaze-b2-java-api/issues/41Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 API requires changes to authorization flow #41

Open
StraightfaceStudios opened this issue Jun 8, 2019 · 0 comments
Open

v2 API requires changes to authorization flow #41

StraightfaceStudios opened this issue Jun 8, 2019 · 0 comments

Comments

@StraightfaceStudios
Copy link

@StraightfaceStudios StraightfaceStudios commented Jun 8, 2019

In regard to ../b2/response/B2AuthorizeAccountResponse.java:

In v2 of the API there can now be application key pairs that have permission to only ever read specific buckets.

"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."

https://www.backblaze.com/b2/docs/application_keys.html#usingRestrictedKeys

As a result there needs to be a new attribute in the b2client object that includes a list of "Allowed" buckets. The response from Backblaze now looks like this:

  "allowed": {
         "bucketId": "****",
         "bucketName": "AAABCC",

And add some sort of functionality like b2AuthorizeAccountResponse.getAllowedBuckets()

Similarly .../b2/request/B2ListBucketsRequest.java will need to be extended to avoid the error scenario where listing buckets results in a permission error even though the account can list specific buckets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.