ExAzureCore.Http.Plugins.SasToken (ex_azure_core v0.3.0)

Copy Markdown

Req plugin that adds Shared Access Signature (SAS) token authentication.

Appends the SAS token to the request URL as query parameters. SAS tokens provide delegated access to Azure Storage resources.

Supports both raw string tokens and AzureSasCredential structs.

Options

  • :sas_token - The SAS token (string or %AzureSasCredential{})

Example

# Using a string
req = Req.new()
|> ExAzureCore.Http.Plugins.SasToken.attach(
  sas_token: "sv=2021-06-08&ss=b&srt=sco&sp=rwdlacupitfx&se=..."
)

# Using an AzureSasCredential
{:ok, credential} = AzureSasCredential.new("sv=2021-06-08&ss=b...")
req = Req.new()
|> ExAzureCore.Http.Plugins.SasToken.attach(sas_token: credential)

Summary

Functions

Attaches the SAS token plugin to a Req request.

Functions

attach(request, opts \\ [])

@spec attach(
  Req.Request.t(),
  keyword()
) :: Req.Request.t()

Attaches the SAS token plugin to a Req request.