pyrit.auth.AzureStorageAuth#

class AzureStorageAuth[source]#

Bases: object

A utility class for Azure Storage authentication, providing methods to generate SAS tokens using user delegation keys.

__init__()#

Methods

__init__()

get_sas_token(container_url)

Generates a SAS token for the specified blob using a user delegation key.

get_user_delegation_key(blob_service_client)

Retrieves a user delegation key valid for one day.

async static get_sas_token(container_url: str) str[source]#

Generates a SAS token for the specified blob using a user delegation key.

Parameters:

container_url (str) – The URL of the Azure Blob Storage container.

Returns:

The generated SAS token.

Return type:

str

async static get_user_delegation_key(blob_service_client: BlobServiceClient) UserDelegationKey[source]#

Retrieves a user delegation key valid for one day.

Parameters:
  • blob_service_client (BlobServiceClient) – An instance of BlobServiceClient to interact

  • Storage. (with Azure Blob)

Returns:

A user delegation key valid for one day.

Return type:

UserDelegationKey