sebagomez / azurestorageexplorer

☁💾 Manage your Azure Storage blobs, tables, queues and file shares from this simple and intuitive web application.

Home Page:https://azurestorage.azurewebsites.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request: input sanitization on account name

1stewart opened this issue · comments

Microsoft's Storage Accounts only support lowercase and numbers in names: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage

Supplying invalid values (accidentally since I missed the space!) results in attempting to use the value, instead of validating it before submitting, and the response 'Invalid account or key', though I think it'd be more user friendly if the account name box failed regex validation. There may be a reason to support other characters for custom domains, but since both requests are defaulting to the normal endpoints I think the logic could be split if there's a suffix.

Request URL: https://REDACTED.azurewebsites.net/api/Queues/GetQueues?account=fakename**%20**&key=fddfsfdsfdfd

{description: "System.UriFormatException: 'Invalid URI: The hostname could not be parsed.'",…}
description: "System.UriFormatException: 'Invalid URI: The hostname could not be parsed.'"
statusText: "Invalid URI: The hostname could not be parsed."

Request URL: https://REDACTED.azurewebsites.net/api/Queues/GetQueues?account=fakenaDDDD&key=fddfsfdsfdfd

{"description":"System.AggregateException: 'Retry failed after 6 tries. Retry settings can be adjusted in ClientOptions.Retry. (Name or service not known (fakenadddd.queue.core.windows.net:443)) (Name or service not known (fakenadddd.queue.core.windows.net:443)) (Name or service not known (fakenadddd.queue.core.windows.net:443)) (Name or service not known (fakenadddd.queue.core.windows.net:443)) (Name or service not known (fakenadddd.queue.core.windows.net:443)) (Name or service not known (fakenadddd.queue.core.windows.net:443))'","statusText":"Retry failed after 6 tries. Retry settings can be adjusted in ClientOptions.Retry. (Name or service not known (fakenadddd.queue.core.windows.net:443)) (Name or service not known (fakenadddd.queue.core.windows.net:443)) (Name or service not known (fakenadddd.queue.core.windows.net:443)) (Name or service not known (fakenadddd.queue.core.windows.net:443)) (Name or service not known (fakenadddd.queue.core.windows.net:443)) (Name or service not known (fakenadddd.queue.core.windows.net:443))"}

Thank you @1stewart for this report.
I have been working on the internal support for custom domains, so I'll take a look at your report with that in mind.