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

Use b2_authorize_account allowed bucketId as default #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Klowner
Copy link
Contributor

@Klowner Klowner commented Nov 24, 2019

Looks like #63 hasn't been touched in a few months, seems like a nice feature to have!

@cbess
Copy link
Collaborator

cbess commented Nov 24, 2019

If you provide/update test coverage for this feature, I'd be on board with the changes.

@Klowner
Copy link
Contributor Author

Klowner commented Nov 24, 2019

Would you prefer the individual tests be added to each of the API test groups or would a new test suite that just verifies that defaultBucketId is properly merged into all outgoing request bodies as bucketId (when bucketId / bucketName are omitted from options)?

@odensc
Copy link
Collaborator

odensc commented Dec 10, 2019

The latter is fine.

@adrw
Copy link

adrw commented Mar 28, 2020

@Klowner Any chance this can be merged soon? Looks like a great optimization!

@Klowner
Copy link
Contributor Author

Klowner commented Apr 8, 2020

@adrw feel like writing some tests? :)

@ADumaine
Copy link

ADumaine commented Feb 1, 2022

This has been sitting here over 2 years. When will this be merged?

Having the associated bucketId also helps determine whether a master key or an application key has been used since a master key does not have an association with an individual bucket but an application key can.

For now I'll have to look for another package.

@ADumaine
Copy link

I ended up patching lib/utils.js to get this functionality. I also added bucketName since it is required by downloadFileByName

+  if (authResponse.allowed) {
+        context.defaultBucketId = authResponse.allowed.bucketId || '';
+        context.defaultBucketName = authResponse.allowed.bucketName || '';
+    }

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

Successfully merging this pull request may close these issues.

5 participants