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

Accessing CSV in private Blob Storage using Access Token (SAS token URL in Azure, Signed URL in GCP, Presigned URL in AWS) #174

Open
egoienola opened this issue Mar 23, 2021 · 1 comment

Comments

@egoienola
Copy link

egoienola commented Mar 23, 2021

I store my CSV in blob storage that is secured (e.g. not publicly accessible).

Taking Microsoft Azure's Blob Storage as an example, the URL would be something like:
https://mystorageacct.blob.core.windows.net/container-storage/radar.csv

However, this isn't publicly available, so can't supply that as input.

All these cloud providers have the ability to create URLs that embed an access code of sorts, giving access to the CSV file to anyone who meets the criteria (whitelisted set of IPs, date/time range etc). The URL generated might look like so:
https://mystorageacct.blob.core.windows.net/container-storage/radar.csv&sp=r&st=2021-03-23T18:27:51Z&se=2021-03-24T02:27:51Z&spr=https&sv=2020-02-10&sr=b&sig=a-secure-token-goes-here

As it stands, this line in the code will fail to parse such URL:

if (domainName && queryParams.sheetId.endsWith('csv')) {

... as it expects the URL to finish in '.csv'.

As a hack, I have been appending an extra parameter to my secure URL (e.g. https://mystorageacct.blob.core.windows.net/container-storage/radar.csv&sp=r&st=2021-03-23T18:27:51Z&se=2021-03-24T02:27:51Z&spr=https&sv=2020-02-10&sr=b&sig=a-secure-token-goes-here&hack=csv) which works a treat, but I wondered if the code could be enhanced so that the is it a CSV or GoogleSheets decision is carried out differently.

Thanks

@prasadaws10
Copy link

prasadaws10 commented Sep 21, 2022

I store my CSV in blob storage that is secured (e.g. not publicly accessible).

Taking Microsoft Azure's Blob Storage as an example, the URL would be something like: https://mystorageacct.blob.core.windows.net/container-storage/radar.csv

However, this isn't publicly available, so can't supply that as input.

All these cloud providers have the ability to create URLs that embed an access code of sorts, giving access to the CSV file to anyone who meets the criteria (whitelisted set of IPs, date/time range etc). The URL generated might look like so: https://mystorageacct.blob.core.windows.net/container-storage/radar.csv&sp=r&st=2021-03-23T18:27:51Z&se=2021-03-24T02:27:51Z&spr=https&sv=2020-02-10&sr=b&sig=a-secure-token-goes-here

As it stands, this line in the code will fail to parse such URL:

if (domainName && queryParams.sheetId.endsWith('csv')) {

... as it expects the URL to finish in '.csv'.
As a hack, I have been appending an extra parameter to my secure URL (e.g. https://mystorageacct.blob.core.windows.net/container-storage/radar.csv&sp=r&st=2021-03-23T18:27:51Z&se=2021-03-24T02:27:51Z&spr=https&sv=2020-02-10&sr=b&sig=a-secure-token-goes-here&hack=csv) which works a treat, but I wondered if the code could be enhanced so that the is it a CSV or GoogleSheets decision is carried out differently.

Thanks

@egoienola

Hi I am using a BYOR image and trying to use a private URL from Azure blob storage. But while browsing the issues I found yours. Are you able to load from the blob storage ? For the hack that you mentioned, should the URL be ending in secure-token.CSV or "=csv" ?

Please let me know.

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

No branches or pull requests

2 participants