Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-azure-storage-queue for openSUSE:Factory checked in at 2023-11-13 22:18:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-azure-storage-queue (Old) and /work/SRC/openSUSE:Factory/.python-azure-storage-queue.new.17445 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-azure-storage-queue" Mon Nov 13 22:18:12 2023 rev:20 rq:1124978 version:12.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-azure-storage-queue/python-azure-storage-queue.changes 2023-10-12 11:52:21.695343212 +0200 +++ /work/SRC/openSUSE:Factory/.python-azure-storage-queue.new.17445/python-azure-storage-queue.changes 2023-11-13 22:20:50.191426877 +0100 @@ -1,0 +2,8 @@ +Fri Nov 10 11:33:51 UTC 2023 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- New upstream release + + Version 12.8.0 + + For detailed information about changes see the + CHANGELOG.md file provided with this package + +------------------------------------------------------------------- Old: ---- azure-storage-queue-12.7.3.tar.gz New: ---- azure-storage-queue-12.8.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-azure-storage-queue.spec ++++++ --- /var/tmp/diff_new_pack.ejEgSk/_old 2023-11-13 22:20:50.983456038 +0100 +++ /var/tmp/diff_new_pack.ejEgSk/_new 2023-11-13 22:20:50.983456038 +0100 @@ -21,7 +21,7 @@ %define skip_python2 1 %endif Name: python-azure-storage-queue -Version: 12.7.3 +Version: 12.8.0 Release: 0 Summary: Microsoft Azure Storage Queue Client Library for Python License: MIT ++++++ azure-storage-queue-12.7.3.tar.gz -> azure-storage-queue-12.8.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/CHANGELOG.md new/azure-storage-queue-12.8.0/CHANGELOG.md --- old/azure-storage-queue-12.7.3/CHANGELOG.md 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/CHANGELOG.md 2023-11-07 23:29:15.000000000 +0100 @@ -1,5 +1,16 @@ # Release History +## 12.8.0 (2023-11-07) + +### Features Added +- Stable release of features from 12.18.0b1 + +## 12.8.0b1 (2023-10-17) + +### Features Added +- Added `audience` as an optional keyword that can be specified on APIs that have a `credential` parameter. This +keyword only has an effect when the credential provided is of type `TokenCredential`. + ## 12.7.3 (2023-10-10) ### Bugs Fixed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/PKG-INFO new/azure-storage-queue-12.8.0/PKG-INFO --- old/azure-storage-queue-12.7.3/PKG-INFO 2023-10-10 23:34:59.192380700 +0200 +++ new/azure-storage-queue-12.8.0/PKG-INFO 2023-11-07 23:30:04.985341000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: azure-storage-queue -Version: 12.7.3 +Version: 12.8.0 Summary: Microsoft Azure Azure Queue Storage Client Library for Python Home-page: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue Author: Microsoft Corporation @@ -434,6 +434,17 @@ # Release History +## 12.8.0 (2023-11-07) + +### Features Added +- Stable release of features from 12.18.0b1 + +## 12.8.0b1 (2023-10-17) + +### Features Added +- Added `audience` as an optional keyword that can be specified on APIs that have a `credential` parameter. This +keyword only has an effect when the credential provided is of type `TokenCredential`. + ## 12.7.3 (2023-10-10) ### Bugs Fixed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure/storage/queue/_queue_client.py new/azure-storage-queue-12.8.0/azure/storage/queue/_queue_client.py --- old/azure-storage-queue-12.7.3/azure/storage/queue/_queue_client.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure/storage/queue/_queue_client.py 2023-11-07 23:29:15.000000000 +0100 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for @@ -67,6 +68,9 @@ :keyword message_decode_policy: The decoding policy to use on incoming messages. Default value is not to decode messages. Other options include :class:`TextBase64DecodePolicy`, :class:`BinaryBase64DecodePolicy` or `None`. + :keyword str audience: The audience to use when requesting tokens for Azure Active Directory + authentication. Only has an effect when credential is of type TokenCredential. The value could be + https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net. .. admonition:: Example: @@ -135,6 +139,9 @@ If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key" should be the storage account key. :paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]] # pylint: disable=line-too-long + :keyword str audience: The audience to use when requesting tokens for Azure Active Directory + authentication. Only has an effect when credential is of type TokenCredential. The value could be + https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net. :returns: A queue client. :rtype: ~azure.storage.queue.QueueClient """ @@ -183,6 +190,9 @@ If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key" should be the storage account key. :paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]] # pylint: disable=line-too-long + :keyword str audience: The audience to use when requesting tokens for Azure Active Directory + authentication. Only has an effect when credential is of type TokenCredential. The value could be + https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net. :returns: A queue client. :rtype: ~azure.storage.queue.QueueClient diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure/storage/queue/_queue_service_client.py new/azure-storage-queue-12.8.0/azure/storage/queue/_queue_service_client.py --- old/azure-storage-queue-12.7.3/azure/storage/queue/_queue_service_client.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure/storage/queue/_queue_service_client.py 2023-11-07 23:29:15.000000000 +0100 @@ -70,6 +70,9 @@ compatible with the current SDK. Setting to an older version may result in reduced feature compatibility. :keyword str secondary_hostname: The hostname of the secondary endpoint. + :keyword str audience: The audience to use when requesting tokens for Azure Active Directory + authentication. Only has an effect when credential is of type TokenCredential. The value could be + https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net. .. admonition:: Example: @@ -134,6 +137,9 @@ If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key" should be the storage account key. :paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]] # pylint: disable=line-too-long + :keyword str audience: The audience to use when requesting tokens for Azure Active Directory + authentication. Only has an effect when credential is of type TokenCredential. The value could be + https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net. :returns: A Queue service client. :rtype: ~azure.storage.queue.QueueClient diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure/storage/queue/_serialize.py new/azure-storage-queue-12.8.0/azure/storage/queue/_serialize.py --- old/azure-storage-queue-12.7.3/azure/storage/queue/_serialize.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure/storage/queue/_serialize.py 2023-11-07 23:29:15.000000000 +0100 @@ -15,7 +15,7 @@ '2020-06-12', '2020-08-04', '2020-10-02', - '2021-02-12' + '2021-02-12', ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure/storage/queue/_shared/base_client.py new/azure-storage-queue-12.8.0/azure/storage/queue/_shared/base_client.py --- old/azure-storage-queue-12.7.3/azure/storage/queue/_shared/base_client.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure/storage/queue/_shared/base_client.py 2023-11-07 23:29:15.000000000 +0100 @@ -36,7 +36,7 @@ UserAgentPolicy, ) -from .constants import CONNECTION_TIMEOUT, READ_TIMEOUT, SERVICE_HOST_BASE, STORAGE_OAUTH_SCOPE +from .constants import CONNECTION_TIMEOUT, DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, STORAGE_OAUTH_SCOPE from .models import LocationMode from .authentication import SharedKeyCredentialPolicy from .shared_access_signature import QueryStringConstants @@ -221,7 +221,11 @@ # type: (Any, **Any) -> Tuple[Configuration, Pipeline] self._credential_policy = None if hasattr(credential, "get_token"): - self._credential_policy = BearerTokenCredentialPolicy(credential, STORAGE_OAUTH_SCOPE) + if kwargs.get('audience'): + audience = str(kwargs.pop('audience')).rstrip('/') + DEFAULT_OAUTH_SCOPE + else: + audience = STORAGE_OAUTH_SCOPE + self._credential_policy = BearerTokenCredentialPolicy(credential, audience) elif isinstance(credential, SharedKeyCredentialPolicy): self._credential_policy = credential elif isinstance(credential, AzureSasCredential): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure/storage/queue/_shared/base_client_async.py new/azure-storage-queue-12.8.0/azure/storage/queue/_shared/base_client_async.py --- old/azure-storage-queue-12.7.3/azure/storage/queue/_shared/base_client_async.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure/storage/queue/_shared/base_client_async.py 2023-11-07 23:29:15.000000000 +0100 @@ -24,7 +24,7 @@ ) from azure.core.pipeline.transport import AsyncHttpTransport -from .constants import CONNECTION_TIMEOUT, READ_TIMEOUT, STORAGE_OAUTH_SCOPE +from .constants import CONNECTION_TIMEOUT, DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, STORAGE_OAUTH_SCOPE from .authentication import SharedKeyCredentialPolicy from .base_client import create_configuration from .policies import ( @@ -70,7 +70,11 @@ # type: (Any, **Any) -> Tuple[Configuration, Pipeline] self._credential_policy = None if hasattr(credential, 'get_token'): - self._credential_policy = AsyncBearerTokenCredentialPolicy(credential, STORAGE_OAUTH_SCOPE) + if kwargs.get('audience'): + audience = str(kwargs.pop('audience')).rstrip('/') + DEFAULT_OAUTH_SCOPE + else: + audience = STORAGE_OAUTH_SCOPE + self._credential_policy = AsyncBearerTokenCredentialPolicy(credential, audience) elif isinstance(credential, SharedKeyCredentialPolicy): self._credential_policy = credential elif isinstance(credential, AzureSasCredential): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure/storage/queue/_shared/policies.py new/azure-storage-queue-12.8.0/azure/storage/queue/_shared/policies.py --- old/azure-storage-queue-12.7.3/azure/storage/queue/_shared/policies.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure/storage/queue/_shared/policies.py 2023-11-07 23:29:15.000000000 +0100 @@ -40,7 +40,7 @@ from azure.core.exceptions import AzureError, ServiceRequestError, ServiceResponseError from .authentication import StorageHttpChallenge -from .constants import DEFAULT_OAUTH_SCOPE, STORAGE_OAUTH_SCOPE +from .constants import DEFAULT_OAUTH_SCOPE from .models import LocationMode try: @@ -653,9 +653,8 @@ class StorageBearerTokenCredentialPolicy(BearerTokenCredentialPolicy): """ Custom Bearer token credential policy for following Storage Bearer challenges """ - def __init__(self, credential, **kwargs): - # type: (TokenCredential, **Any) -> None - super(StorageBearerTokenCredentialPolicy, self).__init__(credential, STORAGE_OAUTH_SCOPE, **kwargs) + def __init__(self, credential: "TokenCredential", audience: str, **kwargs: Any) -> None: + super(StorageBearerTokenCredentialPolicy, self).__init__(credential, audience, **kwargs) def on_challenge(self, request, response): # type: (PipelineRequest, PipelineResponse) -> bool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure/storage/queue/_shared/policies_async.py new/azure-storage-queue-12.8.0/azure/storage/queue/_shared/policies_async.py --- old/azure-storage-queue-12.7.3/azure/storage/queue/_shared/policies_async.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure/storage/queue/_shared/policies_async.py 2023-11-07 23:29:15.000000000 +0100 @@ -14,7 +14,7 @@ from azure.core.exceptions import AzureError from .authentication import StorageHttpChallenge -from .constants import DEFAULT_OAUTH_SCOPE, STORAGE_OAUTH_SCOPE +from .constants import DEFAULT_OAUTH_SCOPE from .policies import is_retry, StorageRetryPolicy if TYPE_CHECKING: @@ -237,9 +237,8 @@ class AsyncStorageBearerTokenCredentialPolicy(AsyncBearerTokenCredentialPolicy): """ Custom Bearer token credential policy for following Storage Bearer challenges """ - def __init__(self, credential, **kwargs): - # type: (AsyncTokenCredential, **Any) -> None - super(AsyncStorageBearerTokenCredentialPolicy, self).__init__(credential, STORAGE_OAUTH_SCOPE, **kwargs) + def __init__(self, credential: "AsyncTokenCredential", audience: str, **kwargs: Any) -> None: + super(AsyncStorageBearerTokenCredentialPolicy, self).__init__(credential, audience, **kwargs) async def on_challenge(self, request, response): # type: (PipelineRequest, PipelineResponse) -> bool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure/storage/queue/_shared_access_signature.py new/azure-storage-queue-12.8.0/azure/storage/queue/_shared_access_signature.py --- old/azure-storage-queue-12.7.3/azure/storage/queue/_shared_access_signature.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure/storage/queue/_shared_access_signature.py 2023-11-07 23:29:15.000000000 +0100 @@ -130,7 +130,7 @@ account_key, # type: str resource_types, # type: Union[ResourceTypes, str] permission, # type: Union[AccountSasPermissions, str] - expiry, # type: Optional[Union[datetime, str]] + expiry, # type: Union[datetime, str] start=None, # type: Optional[Union[datetime, str]] ip=None, # type: Optional[str] **kwargs # type: "Any" @@ -150,11 +150,8 @@ user is restricted to operations allowed by the permissions. :param expiry: The time at which the shared access signature becomes invalid. - Required unless an id is given referencing a stored access policy - which contains this field. This field must be omitted if it has - been specified in an associated stored access policy. Azure will always - convert values to UTC. If a date is passed in without timezone info, it - is assumed to be UTC. + Azure will always convert values to UTC. If a date is passed in + without timezone info, it is assumed to be UTC. :type expiry: ~datetime.datetime or str :param start: The time at which the shared access signature becomes valid. If @@ -252,6 +249,11 @@ :dedent: 12 :caption: Generate a sas token. """ + if not policy_id: + if not expiry: + raise ValueError("'expiry' parameter must be provided when not using a stored access policy.") + if not permission: + raise ValueError("'permission' parameter must be provided when not using a stored access policy.") sas = QueueSharedAccessSignature(account_name, account_key) return sas.generate_queue( queue_name, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure/storage/queue/_version.py new/azure-storage-queue-12.8.0/azure/storage/queue/_version.py --- old/azure-storage-queue-12.7.3/azure/storage/queue/_version.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure/storage/queue/_version.py 2023-11-07 23:29:15.000000000 +0100 @@ -4,4 +4,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "12.7.3" +VERSION = "12.8.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure/storage/queue/aio/_queue_client_async.py new/azure-storage-queue-12.8.0/azure/storage/queue/aio/_queue_client_async.py --- old/azure-storage-queue-12.7.3/azure/storage/queue/aio/_queue_client_async.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure/storage/queue/aio/_queue_client_async.py 2023-11-07 23:29:15.000000000 +0100 @@ -65,6 +65,9 @@ :keyword message_decode_policy: The decoding policy to use on incoming messages. Default value is not to decode messages. Other options include :class:`TextBase64DecodePolicy`, :class:`BinaryBase64DecodePolicy` or `None`. + :keyword str audience: The audience to use when requesting tokens for Azure Active Directory + authentication. Only has an effect when credential is of type TokenCredential. The value could be + https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net. .. admonition:: Example: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure/storage/queue/aio/_queue_service_client_async.py new/azure-storage-queue-12.8.0/azure/storage/queue/aio/_queue_service_client_async.py --- old/azure-storage-queue-12.7.3/azure/storage/queue/aio/_queue_service_client_async.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure/storage/queue/aio/_queue_service_client_async.py 2023-11-07 23:29:15.000000000 +0100 @@ -67,6 +67,9 @@ compatible with the current SDK. Setting to an older version may result in reduced feature compatibility. :keyword str secondary_hostname: The hostname of the secondary endpoint. + :keyword str audience: The audience to use when requesting tokens for Azure Active Directory + authentication. Only has an effect when credential is of type TokenCredential. The value could be + https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net. .. admonition:: Example: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure_storage_queue.egg-info/PKG-INFO new/azure-storage-queue-12.8.0/azure_storage_queue.egg-info/PKG-INFO --- old/azure-storage-queue-12.7.3/azure_storage_queue.egg-info/PKG-INFO 2023-10-10 23:34:59.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure_storage_queue.egg-info/PKG-INFO 2023-11-07 23:30:04.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: azure-storage-queue -Version: 12.7.3 +Version: 12.8.0 Summary: Microsoft Azure Azure Queue Storage Client Library for Python Home-page: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue Author: Microsoft Corporation @@ -434,6 +434,17 @@ # Release History +## 12.8.0 (2023-11-07) + +### Features Added +- Stable release of features from 12.18.0b1 + +## 12.8.0b1 (2023-10-17) + +### Features Added +- Added `audience` as an optional keyword that can be specified on APIs that have a `credential` parameter. This +keyword only has an effect when the credential provided is of type `TokenCredential`. + ## 12.7.3 (2023-10-10) ### Bugs Fixed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/azure_storage_queue.egg-info/SOURCES.txt new/azure-storage-queue-12.8.0/azure_storage_queue.egg-info/SOURCES.txt --- old/azure-storage-queue-12.7.3/azure_storage_queue.egg-info/SOURCES.txt 2023-10-10 23:34:59.000000000 +0200 +++ new/azure-storage-queue-12.8.0/azure_storage_queue.egg-info/SOURCES.txt 2023-11-07 23:30:04.000000000 +0100 @@ -2,6 +2,7 @@ LICENSE MANIFEST.in README.md +migration_guide.md pyproject.toml setup.py azure/__init__.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/migration_guide.md new/azure-storage-queue-12.8.0/migration_guide.md --- old/azure-storage-queue-12.7.3/migration_guide.md 1970-01-01 01:00:00.000000000 +0100 +++ new/azure-storage-queue-12.8.0/migration_guide.md 2023-11-07 23:29:15.000000000 +0100 @@ -0,0 +1,564 @@ +# Storage Queue Service SDK Migration Guide from <= 2.x to 12.x + +In this section, we list the main changes you need to be aware of when converting your Storage Queue SDK library from version <= 2.X to version 12.X. +In version 12 we also support asynchronous APIs. + +## Converting Core Classes +<= 2.X synchronous classes have been replaced. Some functionality has been split into separate clients for more logical organization. + +| <= 2.X Classes (Clients) | V12 Clients | NEW Asynchronous clients | +|---:|---:|---:| +| QueueService (account-level operations) | QueueServiceClient | aio.QueueServiceClient | +| QueueService (queue-level operations) | QueueClient | aio.QueueClient | + +## Version <= 2.X to Version 12 API Mapping + +<table border="1" cellspacing="0" cellpadding="0"> + <tbody> + <tr> + <td width="353" colspan="2" valign="top"> + <p align="right"> + Version <= 2.X + </p> + </td> + <td width="270" colspan="2" valign="top"> + <p align="right"> + Version 12.X + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + API Name + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + Class(es) it belongs to + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + API Name + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + Class(es) it belongs to + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + generate_account_shared_access_signature + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + generate_account_sas + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + Itâs not a class method. + </p> + <p align="right"> + Just import from azure.storage.queue directly + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + generate_queue_shared_access_signature + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + generate_queue_sas + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + Itâs not a class method. + </p> + <p align="right"> + Just import from azure.storage.queue directly + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + get_queue_service_stats + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + get_service_stats + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueServiceClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + set_queue_service_properties + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + set_service_properties + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueServiceClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + get_queue_service_properties + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + get_service_properties + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueServiceClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + list_queues + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + list_queues + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueServiceClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + create_queue + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + create_queue + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueServiceClient or QueueClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + delete_queue + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + delete_queue + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueServiceClient or QueueClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + get_queue_metadata + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + get_queue_properties + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueServiceClient or QueueClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + set_queue_metadata + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + set_queue_metadata + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + exists + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + N/A + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + N/A + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + get_queue_acl + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + get_queue_access_policy + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + set_queue_acl + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + set_queue_access_policy + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + put_message + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + send_message + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + get_messages + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + receive_messages + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + peek_messages + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + peek_messages + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + delete_message + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + delete_message + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + clear_messages + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + clear_messages + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueClient + </p> + </td> + </tr> + <tr> + <td width="242" valign="top"> + <p align="right"> + update_message + </p> + </td> + <td width="111" valign="top"> + <p align="right"> + QueueService + </p> + </td> + <td width="163" valign="top"> + <p align="right"> + update_message + </p> + </td> + <td width="107" valign="top"> + <p align="right"> + QueueClient + </p> + </td> + </tr> + </tbody> +</table> + +## Build Client with Shared Key Credential +Instantiate client in Version 2.X +```python +from azure.storage.queue import QueueService +service = QueueService("<storage-account-name>", "<account-access-key>", endpoint_suffix="<endpoint_suffix>") +``` + +Instantiate client in Version 12. +```python +from azure.storage.queue import QueueServiceClient + +service = QueueServiceClient(account_url="https://<my-storage-account-name>.queue.core.windows.net/", credential={'account_name': "<storage-account-name>", 'account_key': "<account-access-key>"}) +``` + +## Build Client with SAS token + +In version 2.X, to generate the SAS token, you needed to instantiate `QueueService`, then use the class method to generate the sas token. +```python +from azure.storage.queue import QueueService +from azure.storage.common import ( + ResourceTypes, + AccountPermissions, +) +from datetime import datetime, timedelta + +service = QueueService("<storage-account-name>", "<account-access-key>", endpoint_suffix="<endpoint_suffix>") + +token = service.generate_account_shared_access_signature( + ResourceTypes.CONTAINER, + AccountPermissions.READ, + datetime.utcnow() + timedelta(hours=1), +) + +# Create a service and use the SAS +sas_service = QueueService( + account_name="<storage-account-name>", + sas_token=token, +) +``` + +In V12, SAS token generation is a standalone api, it's no longer a class method. +```python +from datetime import datetime, timedelta +from azure.storage.queue import QueueServiceClient, generate_account_sas, ResourceTypes, AccountSasPermissions + +sas_token = generate_account_sas( + account_name="<storage-account-name>", + account_key="<account-access-key>", + resource_types=ResourceTypes(service=True), + permission=AccountSasPermissions(read=True), + expiry=datetime.utcnow() + timedelta(hours=1) +) + +queue_service_client = QueueServiceClient(account_url="https://<my_account_name>.queue.core.windows.net", credential=sas_token) +``` + +## Build Client with OAuth Credentials +V 2.X using oauth credential to instantiate a service client. +```python +from azure.storage.common import ( + TokenCredential, +) +import adal + +context = adal.AuthenticationContext( + str.format("{}/{}", "<active_directory_auth_endpoint>", "<active_directory_tenant_id>"), + api_version=None, validate_authority=True) + +token = context.acquire_token_with_client_credentials( + "https://storage.azure.com", + "<active_directory_application_id>", + "<active_directory_application_secret>")["accessToken"] +token_credential = TokenCredential(token) + +service = QueueService("<storage_account_name>", token_credential=token_credential) +``` + +In V12, you can leverage the azure-identity package. +```python +from azure.identity import DefaultAzureCredential +token_credential = DefaultAzureCredential() + +# Instantiate a QueueServiceClient using a token credential +from azure.storage.queue import QueueServiceClient +queue_service_client = QueueServiceClient("https://<my-storage-account-name>.queue.core.windows.net", credential=token_credential) +``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/tests/test_queue.py new/azure-storage-queue-12.8.0/tests/test_queue.py --- old/azure-storage-queue-12.7.3/tests/test_queue.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/tests/test_queue.py 2023-11-07 23:29:15.000000000 +0100 @@ -1349,6 +1349,90 @@ qsc.get_service_properties() assert transport.session is not None + @QueuePreparer() + @recorded_by_proxy + def test_storage_account_audience_queue_service_client(self, **kwargs): + storage_account_name = kwargs.pop("storage_account_name") + storage_account_key = kwargs.pop("storage_account_key") + + # Arrange + qsc = QueueServiceClient(self.account_url(storage_account_name, "queue"), storage_account_key) + qsc.get_service_properties() + + # Act + token_credential = self.generate_oauth_token() + qsc = QueueServiceClient( + self.account_url(storage_account_name, "queue"), credential=token_credential, + audience=f'https://{storage_account_name}.queue.core.windows.net' + ) + + # Assert + response = qsc.get_service_properties() + assert response is not None + + @QueuePreparer() + @recorded_by_proxy + def test_bad_audience_queue_service_client(self, **kwargs): + storage_account_name = kwargs.pop("storage_account_name") + storage_account_key = kwargs.pop("storage_account_key") + + # Arrange + qsc = QueueServiceClient(self.account_url(storage_account_name, "queue"), storage_account_key) + qsc.get_service_properties() + + # Act + token_credential = self.generate_oauth_token() + qsc = QueueServiceClient( + self.account_url(storage_account_name, "queue"), credential=token_credential, + audience=f'https://badaudience.queue.core.windows.net' + ) + + # Assert + with pytest.raises(ClientAuthenticationError): + qsc.get_service_properties() + + @QueuePreparer() + @recorded_by_proxy + def test_storage_account_audience_queue_client(self, **kwargs): + storage_account_name = kwargs.pop("storage_account_name") + storage_account_key = kwargs.pop("storage_account_key") + + # Arrange + queue = QueueClient(self.account_url(storage_account_name, "queue"), 'testqueue1', storage_account_key) + queue.create_queue() + + # Act + token_credential = self.generate_oauth_token() + queue = QueueClient( + self.account_url(storage_account_name, "queue"), 'testqueue1', credential=token_credential, + audience=f'https://{storage_account_name}.queue.core.windows.net' + ) + + # Assert + response = queue.get_queue_properties() + assert response is not None + + @QueuePreparer() + @recorded_by_proxy + def test_bad_audience_queue_client(self, **kwargs): + storage_account_name = kwargs.pop("storage_account_name") + storage_account_key = kwargs.pop("storage_account_key") + + # Arrange + queue = QueueClient(self.account_url(storage_account_name, "queue"), 'testqueue2', storage_account_key) + queue.create_queue() + + # Act + token_credential = self.generate_oauth_token() + queue = QueueClient( + self.account_url(storage_account_name, "queue"), 'testqueue2', credential=token_credential, + audience=f'https://badaudience.queue.core.windows.net' + ) + + # Assert + with pytest.raises(ClientAuthenticationError): + queue.get_queue_properties() + # ------------------------------------------------------------------------------ if __name__ == '__main__': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-storage-queue-12.7.3/tests/test_queue_async.py new/azure-storage-queue-12.8.0/tests/test_queue_async.py --- old/azure-storage-queue-12.7.3/tests/test_queue_async.py 2023-10-10 23:34:03.000000000 +0200 +++ new/azure-storage-queue-12.8.0/tests/test_queue_async.py 2023-11-07 23:29:15.000000000 +0100 @@ -1379,6 +1379,92 @@ await qsc.get_service_properties() assert transport.session is not None + @QueuePreparer() + @recorded_by_proxy_async + async def test_storage_account_audience_queue_service_client(self, **kwargs): + storage_account_name = kwargs.pop("storage_account_name") + storage_account_key = kwargs.pop("storage_account_key") + + # Arrange + qsc = QueueServiceClient(self.account_url(storage_account_name, "queue"), storage_account_key) + await qsc.get_service_properties() + + # Act + token_credential = self.generate_oauth_token() + qsc = QueueServiceClient( + self.account_url(storage_account_name, "queue"), credential=token_credential, + audience=f'https://{storage_account_name}.queue.core.windows.net' + ) + + # Assert + response = await qsc.get_service_properties() + assert response is not None + + @QueuePreparer() + @recorded_by_proxy_async + async def test_bad_audience_queue_service_client(self, **kwargs): + storage_account_name = kwargs.pop("storage_account_name") + storage_account_key = kwargs.pop("storage_account_key") + + # Arrange + qsc = QueueServiceClient(self.account_url(storage_account_name, "queue"), storage_account_key) + await qsc.get_service_properties() + + # Act + token_credential = self.generate_oauth_token() + qsc = QueueServiceClient( + self.account_url(storage_account_name, "queue"), credential=token_credential, + audience=f'https://badaudience.queue.core.windows.net' + ) + + # Assert + with pytest.raises(ClientAuthenticationError): + await qsc.get_service_properties() + + @QueuePreparer() + @recorded_by_proxy_async + async def test_storage_account_audience_queue_client(self, **kwargs): + storage_account_name = kwargs.pop("storage_account_name") + storage_account_key = kwargs.pop("storage_account_key") + + # Arrange + queue_name = self.get_resource_name(TEST_QUEUE_PREFIX) + queue = QueueClient(self.account_url(storage_account_name, "queue"), queue_name, storage_account_key) + await queue.create_queue() + + # Act + token_credential = self.generate_oauth_token() + queue = QueueClient( + self.account_url(storage_account_name, "queue"), queue_name, credential=token_credential, + audience=f'https://{storage_account_name}.queue.core.windows.net' + ) + + # Assert + response = await queue.get_queue_properties() + assert response is not None + + @QueuePreparer() + @recorded_by_proxy_async + async def test_bad_audience_queue_client(self, **kwargs): + storage_account_name = kwargs.pop("storage_account_name") + storage_account_key = kwargs.pop("storage_account_key") + + # Arrange + queue_name = self.get_resource_name(TEST_QUEUE_PREFIX) + queue = QueueClient(self.account_url(storage_account_name, "queue"), queue_name, storage_account_key) + await queue.create_queue() + + # Act + token_credential = self.generate_oauth_token() + queue = QueueClient( + self.account_url(storage_account_name, "queue"), queue_name, credential=token_credential, + audience=f'https://badaudience.queue.core.windows.net' + ) + + # Assert + with pytest.raises(ClientAuthenticationError): + await queue.get_queue_properties() + # ------------------------------------------------------------------------------ if __name__ == '__main__': unittest.main()