cloud-storage-rs icon indicating copy to clipboard operation
cloud-storage-rs copied to clipboard

Allow usage w/ an emulator

Open crepererum opened this issue 2 years ago • 2 comments

It would be nice if cloud-storage would allow users to connect to an emulator like https://github.com/oittaa/gcp-storage-emulator or https://github.com/fsouza/fake-gcs-server for local testing. For this the following behavior changes are required:

  1. Disable auth. Other libs call this AnonymousCredentials, but I think it's just that they don't specify any auth headers at all (ref).
  2. Allow to specify a custom endpoint instead of a hardcoded BASE_URL.

crepererum avatar Dec 17 '21 11:12 crepererum

Sure this is something that we can do. Do you have a specific API in mind that works well for you? Maybe something like

cloud_storage::Client::new()
    .disable_auth()
    .base_url("whatever")
    // rest of your behaviour

Would that work/be convenient?

ThouCheese avatar Dec 17 '21 14:12 ThouCheese

The proposed API looks perfect. 👍

crepererum avatar Dec 22 '21 06:12 crepererum