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

Azure SAS Token Must be Prefixed with ? #1034

Closed
Silvenga opened this issue Jul 6, 2021 · 3 comments · Fixed by #1056
Closed

Azure SAS Token Must be Prefixed with ? #1034

Silvenga opened this issue Jul 6, 2021 · 3 comments · Fixed by #1056

Comments

@Silvenga
Copy link

Silvenga commented Jul 6, 2021

Database name

PostgreSQL

Issue description

Describe your problem

Azure SAS tokens must be prefixed with ?, or the token get's merged with the path resulting in a 404 error. With ? prefixed, the token is correctly merged with the query string.

(the go library handling Azure normally REDACTS the signature from logs, but only when prefixed with ?)

Please provide steps to reproduce

> az storage container generate-sas \
> --account-name <blah> \
> --name <blah> \
> --auth-mode key \
> --permissions acdlrw \
> --https-only \
> --expiry $EXPIRY
se=2031-07-06T09%3A54%3A00Z&sp=racwdl&spr=https&sv=2018-11-09&sr=c&sig=<blah>

Giving this string directly to wal-g e.g.

export AZURE_STORAGE_SAS_TOKEN=se=2031-07-06T09%3A54%3A00Z&sp=racwdl&spr=https&sv=2018-11-09&sr=c&sig=<blah>

Results in 404 errors (with the string concatenated with the requires URL path).


IMO, this shouldn't be required (or it should be documented?). It feels rather odd to require it.

This could be a bug in the go library, not 100% sure. The go library is definitely impacted by this bug Azure/azure-storage-azcopy#122 (comment) - so updating that dependency might be a good idea anyway.

The issue #1008 appears unrelated.

@serprex
Copy link
Contributor

serprex commented Aug 9, 2021

This was an oversight in #642 by yours truly. It'd make sense to prepend ? when it's missing from the string

@x4m
Copy link
Collaborator

x4m commented Aug 9, 2021

Hi! Improvements to Azure storage would be very welcome!

@Silvenga
Copy link
Author

Thanks @serprex!

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 a pull request may close this issue.

3 participants