Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into add_redacted_text

* 'master' of https://github.com/Azure/azure-sdk-for-python:
  [text analytics] add bing_id property to LinkedEntity class (Azure#13446)
  fix typing for paging methods (Azure#13410)
  [text analytics] add domain_filter param (Azure#13451)
  fix issue Azure#11658 for is_valid_resource_id (Azure#11709)
  added create_table_if_not_exists method to table service client (Azure#13385)
  [ServiceBus] Test and failure improvements (Azure#13345)
  Proper encoding and decoding of source URLs - Fixes special characters in source URL issue (Azure#13275)
  Switch retry (Azure#13264)
  [ServiceBus] ServiceBusClient close spawned children (Azure#13077)
  fixing version issue by not overwriting the version with the semantic… (Azure#13411)
  • Loading branch information
iscai-msft committed Sep 1, 2020
2 parents f77b69f + 9b1b9ec commit 318b112
Show file tree
Hide file tree
Showing 62 changed files with 2,736 additions and 332 deletions.
8 changes: 4 additions & 4 deletions sdk/core/azure-mgmt-core/azure/mgmt/core/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@

_LOGGER = logging.getLogger(__name__)
_ARMID_RE = re.compile(
"(?i)/subscriptions/(?P<subscription>[^/]*)(/resourceGroups/(?P<resource_group>[^/]*))?"
"(/providers/(?P<namespace>[^/]*)/(?P<type>[^/]*)/(?P<name>[^/]*)(?P<children>.*))?"
"(?i)/subscriptions/(?P<subscription>[^/]+)(/resourceGroups/(?P<resource_group>[^/]+))?"
"(/providers/(?P<namespace>[^/]+)/(?P<type>[^/]*)/(?P<name>[^/]+)(?P<children>.*))?"
)

_CHILDREN_RE = re.compile(
"(?i)(/providers/(?P<child_namespace>[^/]*))?/"
"(?P<child_type>[^/]*)/(?P<child_name>[^/]*)"
"(?i)(/providers/(?P<child_namespace>[^/]+))?/"
"(?P<child_type>[^/]*)/(?P<child_name>[^/]+)"
)

_ARMNAME_RE = re.compile("^[^<>%&:\\?/]{1,260}$")
Expand Down
4 changes: 3 additions & 1 deletion sdk/core/azure-mgmt-core/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ def test_resource_parse(self):
invalid_ids = [
'/subscriptions/fakesub/resourceGroups/myRg/type1/name1',
'/subscriptions/fakesub/resourceGroups/myRg/providers/Microsoft.Provider/foo',
'/subscriptions/fakesub/resourceGroups/myRg/providers/namespace/type/name/type1'
'/subscriptions/fakesub/resourceGroups/myRg/providers/namespace/type/name/type1',
'/subscriptions/fakesub/resourceGroups/',
'/subscriptions//resourceGroups/'
]
for invalid_id in invalid_ids:
self.assertFalse(is_valid_resource_id(invalid_id))
Expand Down
2 changes: 2 additions & 0 deletions sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 4.2.1 (Unreleased)
### Fixed
- Correct typing for paging methods


## 4.2.0 (2020-08-11)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

if TYPE_CHECKING:
# pylint:disable=unused-import
from typing import Any, Dict, List, Optional, Iterable
from typing import Any, Dict, Iterable, List, Optional
from azure.core.paging import ItemPaged


class CertificateClient(KeyVaultClientBase):
Expand Down Expand Up @@ -530,7 +531,7 @@ def restore_certificate_backup(self, backup, **kwargs):

@distributed_trace
def list_deleted_certificates(self, **kwargs):
# type: (**Any) -> Iterable[DeletedCertificate]
# type: (**Any) -> ItemPaged[DeletedCertificate]
"""Lists the currently-recoverable deleted certificates. Possible only if vault is soft-delete enabled.
Requires certificates/get/list permission. Retrieves the certificates in the current vault which
Expand Down Expand Up @@ -566,7 +567,7 @@ def list_deleted_certificates(self, **kwargs):

@distributed_trace
def list_properties_of_certificates(self, **kwargs):
# type: (**Any) -> Iterable[CertificateProperties]
# type: (**Any) -> ItemPaged[CertificateProperties]
"""List identifiers and properties of all certificates in the vault.
Requires certificates/list permission.
Expand Down Expand Up @@ -598,7 +599,7 @@ def list_properties_of_certificates(self, **kwargs):

@distributed_trace
def list_properties_of_certificate_versions(self, certificate_name, **kwargs):
# type: (str, **Any) -> Iterable[CertificateProperties]
# type: (str, **Any) -> ItemPaged[CertificateProperties]
"""List the identifiers and properties of a certificate's versions.
Requires certificates/list permission.
Expand Down Expand Up @@ -989,7 +990,7 @@ def delete_issuer(self, issuer_name, **kwargs):

@distributed_trace
def list_properties_of_issuers(self, **kwargs):
# type: (**Any) -> Iterable[IssuerProperties]
# type: (**Any) -> ItemPaged[IssuerProperties]
"""Lists properties of the certificate issuers for the key vault.
Requires the certificates/manageissuers/getissuers permission.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
# ------------------------------------
# pylint:disable=too-many-lines,too-many-public-methods
import base64
from typing import Any, AsyncIterable, Optional, Iterable, List, Dict, Union
from typing import Any, Optional, Iterable, List, Dict, Union
from functools import partial

from azure.core.polling import async_poller
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.async_paging import AsyncItemPaged

from .. import (
KeyVaultCertificate,
Expand Down Expand Up @@ -504,7 +505,7 @@ async def restore_certificate_backup(self, backup: bytes, **kwargs: "Any") -> Ke
return KeyVaultCertificate._from_certificate_bundle(certificate_bundle=bundle)

@distributed_trace
def list_deleted_certificates(self, **kwargs: "Any") -> AsyncIterable[DeletedCertificate]:
def list_deleted_certificates(self, **kwargs: "Any") -> AsyncItemPaged[DeletedCertificate]:
"""Lists the currently-recoverable deleted certificates. Possible only if vault is soft-delete enabled.
Requires certificates/get/list permission. Retrieves the certificates in the current vault which
Expand Down Expand Up @@ -536,7 +537,7 @@ def list_deleted_certificates(self, **kwargs: "Any") -> AsyncIterable[DeletedCer
)

@distributed_trace
def list_properties_of_certificates(self, **kwargs: "Any") -> AsyncIterable[CertificateProperties]:
def list_properties_of_certificates(self, **kwargs: "Any") -> AsyncItemPaged[CertificateProperties]:
"""List identifiers and properties of all certificates in the vault.
Requires certificates/list permission.
Expand Down Expand Up @@ -568,7 +569,7 @@ def list_properties_of_certificates(self, **kwargs: "Any") -> AsyncIterable[Cert
@distributed_trace
def list_properties_of_certificate_versions(
self, certificate_name: str, **kwargs: "Any"
) -> AsyncIterable[CertificateProperties]:
) -> AsyncItemPaged[CertificateProperties]:
"""List the identifiers and properties of a certificate's versions.
Requires certificates/list permission.
Expand Down Expand Up @@ -965,7 +966,7 @@ async def delete_issuer(self, issuer_name: str, **kwargs: "Any") -> CertificateI
return CertificateIssuer._from_issuer_bundle(issuer_bundle=issuer_bundle)

@distributed_trace
def list_properties_of_issuers(self, **kwargs: "Any") -> AsyncIterable[IssuerProperties]:
def list_properties_of_issuers(self, **kwargs: "Any") -> AsyncItemPaged[IssuerProperties]:
"""Lists properties of the certificate issuers for the key vault.
Requires the certificates/manageissuers/getissuers permission.
Expand Down
2 changes: 2 additions & 0 deletions sdk/keyvault/azure-keyvault-keys/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 4.2.1 (Unreleased)
### Fixed
- Correct typing for async paging methods


## 4.2.0 (2020-08-11)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
if TYPE_CHECKING:
# pylint:disable=ungrouped-imports
from datetime import datetime
from typing import Any, AsyncIterable, Optional, List, Union
from azure.core.async_paging import AsyncItemPaged
from typing import Any, Optional, List, Union
from .. import KeyType


Expand Down Expand Up @@ -256,7 +257,7 @@ async def get_deleted_key(self, name: str, **kwargs: "Any") -> DeletedKey:
return DeletedKey._from_deleted_key_bundle(bundle)

@distributed_trace
def list_deleted_keys(self, **kwargs: "Any") -> "AsyncIterable[DeletedKey]":
def list_deleted_keys(self, **kwargs: "Any") -> "AsyncItemPaged[DeletedKey]":
"""List all deleted keys, including the public part of each. Possible only in a vault with soft-delete enabled.
Requires keys/list permission.
Expand All @@ -281,7 +282,7 @@ def list_deleted_keys(self, **kwargs: "Any") -> "AsyncIterable[DeletedKey]":
)

@distributed_trace
def list_properties_of_keys(self, **kwargs: "Any") -> "AsyncIterable[KeyProperties]":
def list_properties_of_keys(self, **kwargs: "Any") -> "AsyncItemPaged[KeyProperties]":
"""List identifiers and properties of all keys in the vault. Requires keys/list permission.
:returns: An iterator of keys without their cryptographic material or version information
Expand All @@ -304,7 +305,7 @@ def list_properties_of_keys(self, **kwargs: "Any") -> "AsyncIterable[KeyProperti
)

@distributed_trace
def list_properties_of_key_versions(self, name: str, **kwargs: "Any") -> "AsyncIterable[KeyProperties]":
def list_properties_of_key_versions(self, name: str, **kwargs: "Any") -> "AsyncItemPaged[KeyProperties]":
"""List the identifiers and properties of a key's versions. Requires keys/list permission.
:param str name: The name of the key
Expand Down
3 changes: 2 additions & 1 deletion sdk/keyvault/azure-keyvault-secrets/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Release History

## 4.2.1 (Unreleased)

### Fixed
- Correct typing for async paging methods

## 4.2.0 (2020-08-11)
### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from typing import Any, AsyncIterable, Optional, Dict
from typing import Any, Optional, Dict
from functools import partial

from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.async_paging import AsyncItemPaged

from .._models import KeyVaultSecret, DeletedSecret, SecretProperties
from .._shared import AsyncKeyVaultClientBase
Expand Down Expand Up @@ -165,7 +166,7 @@ async def update_secret_properties(
return SecretProperties._from_secret_bundle(bundle) # pylint: disable=protected-access

@distributed_trace
def list_properties_of_secrets(self, **kwargs: "Any") -> AsyncIterable[SecretProperties]:
def list_properties_of_secrets(self, **kwargs: "Any") -> AsyncItemPaged[SecretProperties]:
"""List identifiers and attributes of all secrets in the vault. Requires secrets/list permission.
List items don't include secret values. Use :func:`get_secret` to get a secret's value.
Expand All @@ -189,7 +190,7 @@ def list_properties_of_secrets(self, **kwargs: "Any") -> AsyncIterable[SecretPro
)

@distributed_trace
def list_properties_of_secret_versions(self, name: str, **kwargs: "Any") -> AsyncIterable[SecretProperties]:
def list_properties_of_secret_versions(self, name: str, **kwargs: "Any") -> AsyncItemPaged[SecretProperties]:
"""List properties of all versions of a secret, excluding their values. Requires secrets/list permission.
List items don't include secret values. Use :func:`get_secret` to get a secret's value.
Expand Down Expand Up @@ -321,7 +322,7 @@ async def get_deleted_secret(self, name: str, **kwargs: "Any") -> DeletedSecret:
return DeletedSecret._from_deleted_secret_bundle(bundle)

@distributed_trace
def list_deleted_secrets(self, **kwargs: "Any") -> AsyncIterable[DeletedSecret]:
def list_deleted_secrets(self, **kwargs: "Any") -> AsyncItemPaged[DeletedSecret]:
"""Lists all deleted secrets. Possible only in vaults with soft-delete enabled.
Requires secrets/list permission.
Expand Down
4 changes: 4 additions & 0 deletions sdk/servicebus/azure-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 7.0.0b6 (Unreleased)

**Breaking Changes**

* `ServiceBusClient.close()` now closes spawned senders and receivers.
* Attempting to initialize a sender or receiver with a different connection string entity and specified entity (e.g. `queue_name`) will result in an AuthenticationError

## 7.0.0b5 (2020-08-10)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ._common._configuration import Configuration
from .exceptions import (
ServiceBusError,
ServiceBusAuthorizationError,
ServiceBusAuthenticationError,
_create_servicebus_exception
)
from ._common.utils import create_properties
Expand Down Expand Up @@ -104,7 +104,7 @@ def _convert_connection_string_to_kwargs(conn_str, shared_key_credential_type, *

entity_in_kwargs = queue_name or topic_name
if entity_in_conn_str and entity_in_kwargs and (entity_in_conn_str != entity_in_kwargs):
raise ServiceBusAuthorizationError(
raise ServiceBusAuthenticationError(
"Entity names do not match, the entity name in connection string is {};"
" the entity name in parameter is {}.".format(entity_in_conn_str, entity_in_kwargs)
)
Expand Down
Loading

0 comments on commit 318b112

Please sign in to comment.