Module connection_string

Module connection_string 

Source
Expand description

Minimal Azure Storage connection string parser and URL builder for Blob Storage.

This module intentionally avoids relying on the legacy Azure Storage SDK crates. It extracts only the fields we need and composes container/blob URLs suitable for the newer azure_storage_blob crate (>= 0.7).

Supported keys (case-insensitive):

  • AccountName
  • AccountKey
  • SharedAccessSignature
  • DefaultEndpointsProtocol
  • EndpointSuffix
  • BlobEndpoint
  • UseDevelopmentStorage
  • DevelopmentStorageProxyUri

Behavior

  • If BlobEndpoint is present, it is used as the base for container/blob URLs. It may already include the account segment (e.g., Azurite: http://127.0.0.1:10000/devstoreaccount1).
  • Otherwise, if UseDevelopmentStorage=true, we synthesize a dev endpoint: {protocol}://127.0.0.1:10000/{account_name}, with protocol default http if unspecified. If DevelopmentStorageProxyUri is present, it replaces the host/port while still appending the account name path segment.
  • Otherwise, we synthesize the public cloud endpoint: {protocol}://{account_name}.blob.{endpoint_suffix} where endpoint_suffix defaults to core.windows.net and protocol defaults to https.

SAS handling

  • If SharedAccessSignature exists, it will be appended to the generated URLs as a query string. Both sv=... and ?sv=... forms are accepted; the leading ‘?’ is normalized.

Examples:

Structs§

ParsedConnectionString
A parsed Azure Storage connection string and helpers to compose URLs for containers/blobs.

Enums§

Auth
Represents the type of authentication present in the connection string.
ConnectionStringError
Errors that can occur while parsing a connection string or composing URLs.