robinrodricks / FluentStorage

A polycloud .NET cloud storage abstraction layer. Provides Blob storage (AWS S3, GCP, FTP, SFTP, Azure Blob/File/Event Hub/Data Lake) and Messaging (AWS SQS, Azure Queue/ServiceBus). Supports .NET 5+ and .NET Standard 2.0+. Pure C#.
MIT License
263 stars 33 forks source link

Connection strings containing special URL encoding characters are mangled #42

Open ckpearson opened 10 months ago

ckpearson commented 10 months ago

When trying to create an azure blob storage instance from a connection string, if the key contains a '+' this fails with the cryptic "not a valid base64 value".

After digging around and creating an instance of StorageConnectionString myself and looking at the code, I can see the value of each part gets url decoded.

The documentation does not mention this at all, so either the code should leave the value as-is, or the documentation should be very clear that the secret value needs to be url-encoded.

Might be helpful having an exception in there too to catch this scenario and warn the user that they need to encode the value.

ckpearson commented 10 months ago

10 also covers this and was IMO closed prematurely.

robinrodricks commented 10 months ago

Can you help locate the code which does this and suggest how the fix should be implemented?