Coder Social home page Coder Social logo

backblaze-b2-java-api's People

Contributors

dkocher avatar synapticloop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

backblaze-b2-java-api's Issues

v2 API requires changes to authorization flow

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.

Warnings on file upload

When uploading a file, the following warnings are logged

[WARN] 14-Oct-2018 20:22:51.223 | synapticloop.b2.response.B2AuthorizeAccountResponse - Found an unexpected key of 'allowed' in JSON that is not mapped to a field, with value '{"bucketName":null,"capabilities":["listKeys","writeKeys","deleteKeys","listBuckets","writeBuckets","deleteBuckets","listFiles","readFiles","shareFiles","writeFiles","deleteFiles"],"namePrefix":null,"bucketId":null}'.
[WARN] 14-Oct-2018 20:22:51.223 | synapticloop.b2.response.B2AuthorizeAccountResponse - Found an unexpected key of 'recommendedPartSize' in JSON that is not mapped to a field, with value '100000000'.
[WARN] 14-Oct-2018 20:22:51.224 | synapticloop.b2.response.B2AuthorizeAccountResponse - Found an unexpected key of 'absoluteMinimumPartSize' in JSON that is not mapped to a field, with value '5000000'.

Is it possible to have a setting/property not to warn on missed keys.

Java 9 Support

When using Java 9 I get the following exception:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/adapters/HexBinaryAdapter
	at synapticloop.b2.util.ChecksumHelper.calculateSha1(ChecksumHelper.java:75)
	at synapticloop.b2.util.ChecksumHelper.calculateSha1(ChecksumHelper.java:44)
	at synapticloop.b2.B2ApiClient.uploadFile(B2ApiClient.java:451)
	at synapticloop.b2.B2ApiClient.uploadFile(B2ApiClient.java:434)

I'm currently getting past this by adding --add-modules java.xml.bind as a VM option.

Awesome library btw!

Java 7 or 8?

Hi.
First of all, thanks for creating this project.

I tried to use the latest released jars in my Java 7 project but got a ClassNotFoundException:
Caused by: java.lang.ClassNotFoundException: java.util.Base64

java.util.Base64 was added in Java 8.

In the gradle file you specify sourceCompatibility = 1.7

I expect that you want to use the Base64 class from commons-codec lib?

My question is does this project requires Java 7 or 8?

Thanks.

Uploading to folder

How does one upload a file to a particular folder within a bucket. Using a destination file name like /myfolder/test.txt doesn't seem to work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.