Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
## 1.0.0b2 (Unreleased)

### Features Added

* Added missing methods for Mapping API
* Made load method properties unordered.

### Breaking Changes
* Changes how load works. Moves if from AzureAppConfigurationProvider.load to loadProvider.
* Removed custom Key Vault Error
* Removed unneeded __repr__ and copy methods.

### Bugs Fixed

### Other Changes

* Updated method docs
* Fixed load doc that used `selector` instead of `selects`.
* Fixed CLI link in Readme.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# license information.
# -------------------------------------------------------------------------

from ._azureappconfigurationprovider import AzureAppConfigurationProvider
from ._azureappconfigurationprovider import load_provider
from ._azureappconfigurationkeyvaultoptions import AzureAppConfigurationKeyVaultOptions
from ._settingselector import SettingSelector

from ._version import VERSION

__version__ = VERSION
__all__ = ["AzureAppConfigurationProvider", "AzureAppConfigurationKeyVaultOptions", "SettingSelector"]
__all__ = ["load_provider", "AzureAppConfigurationKeyVaultOptions", "SettingSelector"]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,53 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------

from typing import overload, List, Optional, Callable
from azure.keyvault.secrets import SecretClient

class AzureAppConfigurationKeyVaultOptions:
"""
Options for connecting to Key Vault.

:param credential: A credential for authenticating with the key vault. This is optional if secret_clients is
provided.
:type credential: ~azure.core.credentials.TokenCredential
:param secret_clients: A list of SecretClient from azure-keyvault-secrets. This is optional if credential is
provided.
:type secret_clients: list[~azure.keyvault.secrets.SecretClient]
:param secret_resolver: A function that takes a URI and returns a value.
:type secret_resolver: callable
"""
@overload
def __init__(self, credential, *, secret_clients: Optional[List[SecretClient]] = None):
"""
Options for connecting to Key Vault.

:param credential: A credential for authenticating with the key vault. This is optional if secret_clients is
provided.
:type credential: ~azure.core.credentials.TokenCredential
:param secret_clients: A list of SecretClient from azure-keyvault-secrets. This is optional if credential is
provided.
:type secret_clients: list[~azure.keyvault.secrets.SecretClient]
"""
...

@overload
def __init__(self, secret_clients: List[SecretClient], * , secret_resolver: Optional[Callable[[str], str]] = None):
"""
Options for connecting to Key Vault.

:param secret_clients: A list of SecretClient from azure-keyvault-secrets. This is optional if credential is
provided.
:type secret_clients: list[~azure.keyvault.secrets.SecretClient]
:param secret_resolver: A function that takes a URI and returns a value.
:type secret_resolver: Callable[[str], str]
"""
...

def __init__(self, credential=None, secret_clients=None, secret_resolver=None):
# type: (TokenCredential, List[SecretClient], Callable) -> None
self.credential = credential
self.secret_clients = secret_clients
self.secret_resolver = secret_resolver
def __init__(self, **kwargs):
"""
Options for connecting to Key Vault.

if self.secret_clients is None:
self.secret_clients = {}
:param credential: A credential for authenticating with the key vault. This is optional if secret_clients is
provided.
:type credential: ~azure.core.credentials.TokenCredential
:param secret_clients: A list of SecretClient from azure-keyvault-secrets. This is optional if credential is
provided.
:type secret_clients: list[~azure.keyvault.secrets.SecretClient]
:param secret_resolver: A function that takes a URI and returns a value.
:type secret_resolver: Callable[[str], str]
"""
self.credential = kwargs.get("credential", None)
self.secret_clients = kwargs.get("secret_clients", {})
self.secret_resolver = kwargs.get("secret_resolver", None)
if self.credential is not None and self.secret_resolver is not None:
raise ValueError("credential and secret_resolver can't both be configured.")
Loading