Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 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
Comment thread
mrm9084 marked this conversation as resolved.
from ._azureappconfigurationprovider import loadProvider
Comment thread
mrm9084 marked this conversation as resolved.
Outdated
from ._azureappconfigurationkeyvaultoptions import AzureAppConfigurationKeyVaultOptions
from ._settingselector import SettingSelector

from ._version import VERSION

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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


class AzureAppConfigurationKeyVaultOptions:

"""
Options for connecting to Key Vault.

Expand All @@ -16,11 +17,10 @@ class AzureAppConfigurationKeyVaultOptions:
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
:type secret_resolver: Callable[[str], str]
"""

def __init__(self, credential=None, secret_clients=None, secret_resolver=None):
# type: (TokenCredential, List[SecretClient], Callable) -> None
def __init__(self, *, credential=None, secret_clients=None, secret_resolver=None):
# type: (TokenCredential, List[SecretClient], Callable[[str], str]) -> None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use inline type hints and overloads (though I can't see where the Vault endpoint comes from?):

@overload
def __init__(self, credential: TokenCredential,*, secret_resolver: Optional[Callable[[str], str]] = None) -> None
    ...

@overload
def __init__(self, secret_client: List[SecretClient], *, secret_resolver: Optional[Callcable[[str], str]] = None) -> None
    ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I know what you are talking about, the "vault endpoint" comes from App Configuration inside of the key vault reference.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the options here are, Credential with List of Clients, or List of Clients with Secret Resolver.

The idea is that we default either to the TokenCredential provided or the Secret Resolver.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also ran into an issue with TokenCredential it works fine locally, but for some reason it breaks in the build pipeline, I got ImportError: cannot import name 'TokenCredential'. I was using from azure.core.credential import TokenCredential. https://dev.azure.com/azure-sdk/public/_build/results?buildId=2105499&view=ms.vss-test-web.build-test-results-tab&runId=38663166&resultId=100000&paneView=debug

self.credential = credential
self.secret_clients = secret_clients
self.secret_resolver = secret_resolver
Expand Down
Loading