Azure / azure-storage-cpplite

Lite version of C++ Client Library for Microsoft Azure Storage
MIT License
25 stars 43 forks source link

Auth support for emulators #70

Closed joe-maley closed 4 years ago

joe-maley commented 4 years ago

This allows constructing a shared_key_credential that can authenticate with an emulator (e.g. Azurite)

joe-maley commented 4 years ago

Resolves #66

Jinming-Hu commented 4 years ago

Hi @joe-maley , the canonicalized resource is formed with account name + uri path. In the case of Azurite, uri includes storage account, this is why storage account appears twice in canonicalized resource.

Cpplite failed to authenticate on Azurite because it put uri path together with domain name, so the path cannot be extracted when constructing string_to_sign. This is a bug. Your PR is fine because it actually works, but it didn't fix this bug, it circumvents this bug. I cannot merge your PR because we don't want to cover up any bugs, we should actually fix them.

This issue should've been fixed in the latest 0.3.0 release, please give it a try. Thanks for your contribution.

joe-maley commented 4 years ago

@JinmingHu-MSFT Totally fine, thanks for the explanation. We're using this patch locally as a work-around for Azurite but will update to 0.3.0 when it is released. Thanks!