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

Backblaze Application Keys #298

Closed
lqbombjack opened this issue May 7, 2019 · 10 comments
Closed

Backblaze Application Keys #298

lqbombjack opened this issue May 7, 2019 · 10 comments
Labels
jclouds Requires jclouds changes

Comments

@lqbombjack
Copy link

Is it possible to add support for Application Keys which was added in v2 of the Backblze api?

Rather than having to use the main account's master id?

@gaul
Copy link
Owner

gaul commented May 8, 2019

What happens when you use S3Proxy with an application key today? Reading through the docs it is not obvious if anything needs to be done to support it:

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

@ecarneiro
Copy link

I work for Backblaze and I wanted to chime in here and explain, how I understand, the authorize call works with B2.

When using the Master Key, the Key ID and the Account ID are the same. However, when using Application Keys, the Key ID of the application key is not the same as the account ID. The account ID is what is needed to make certain calls such as bucket operations.

The response of the b2_authorize_account contains the account ID.

If you look at the b2_list_buckets endpoint, it takes in an account ID. This Account ID is returned in the authorize call.

Looking at the source code, It seems that the account ID is being pulled from the credentials that the user entered versus the response from the authorize call.

Can you please confirm if this is indeed the case?

@ecarneiro
Copy link

@nilayp - Adding Nilay for Visibility.

@gaul
Copy link
Owner

gaul commented Oct 3, 2019

Again, does anything need to be done to support applications keys beyond what already exists? You can trace through the jclouds code AuthorizationApi and RequestAuthorization to see the call to b2_authorize_account and use of the Authorization header. It would help if one of you can test this and share any symptoms.

@ecarneiro
Copy link

Yes. You need to pull the account ID from the response of the authorize call rather than use the account ID from what is passed in to authenticate the user.

If you look at the bucketsAPI class - https://github.com/apache/jclouds/blob/master/providers/b2/src/main/java/org/jclouds/b2/features/BucketApi.java - you will see that the account ID is pulled from : @PayloadParams(keys = {"accountId"}, values = {"{jclouds.identity}"})

This should actually be pulled from the Authorization response. https://github.com/apache/jclouds/blob/master/providers/b2/src/main/java/org/jclouds/b2/domain/Authorization.java

@gaul
Copy link
Owner

gaul commented Oct 3, 2019

This makes sense. It seems that you will need a custom MapBinder to insert a dynamic value from Authorization. Could you open a JIRA ticket and a pull request against jclouds? The project plans a release next week so if you hurry it can include your fix.

@ecarneiro
Copy link

I am going to move this ticket to JClouds repo as I am not able to develop this. Hopefully someone from the community can contribute and fix this.

@kernworks
Copy link

+1 on this even though it's a JClouds issue
Looks like ecarneiro did open a JIRA against JClouds.
Here it is for reference:
https://issues.apache.org/jira/projects/JCLOUDS/issues/JCLOUDS-1519?filter=allopenissues

@gaul gaul added the jclouds Requires jclouds changes label Sep 7, 2021
@davidsenk
Copy link

@gaul

Hi, I submitted a fix to the jclouds repository apache/jclouds#190

I tested my fix with s3proxy, and it works beautifully with application keys now! Hopefully a future release of s3proxy will be able to include this updated fix!

@gaul
Copy link
Owner

gaul commented Apr 1, 2024

Addressed by S3Proxy 2.2.0.

@gaul gaul closed this as completed Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jclouds Requires jclouds changes
Projects
None yet
Development

No branches or pull requests

5 participants