forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python …
…into get_certs_2016 * 'master' of https://github.com/Azure/azure-sdk-for-python: (115 commits) don't want to exclude mgmt. auto-increments are fine here (Azure#13549) add test for opinion in diff sentence (Azure#13524) Change prerelease versioning (Azure#13500) [text analytics] add --pre suffix to pip install (Azure#13523) update changelog (Azure#13369) update release date for Sep (Azure#13370) update release date for Sep (Azure#13371) Sync eng/common directory with azure-sdk-tools repository for Tools PR 946 (Azure#13533) 404 python erroring sanitize_setup. should not be (Azure#13532) Live pipeline issues (Azure#13526) [ServiceBus] Clean up README prior to P6 with doc-owner recommendations. (Azure#13511) Make doc-owner recommended revisions to eventhub readme and samples. (Azure#13518) Fix storage file datalake readme and samples issues (Azure#12512) [EventGrid] Receive Functions (Azure#13428) Tableitem metadata (Azure#13445) modify bing id docstring to mention Bing Entity Search more (Azure#13509) [text analytics] link opinion mining in the readme (Azure#13493) If match headers (Azure#13315) fix authorization header on asyncio requests containing url-encoded chars (Azure#13346) Sync eng/common directory with azure-sdk-tools repository for Tools PR 930 (Azure#13384) ...
- Loading branch information
Showing
1,799 changed files
with
90,274 additions
and
44,709 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
import os | ||
from azure.identity import DefaultAzureCredential, KnownAuthorities | ||
from azure.identity import AzureAuthorityHosts, DefaultAzureCredential | ||
|
||
|
||
class KeyVaultBase: | ||
credential_type = DefaultAzureCredential | ||
host_alias_map = { | ||
'AzureChinaCloud': KnownAuthorities.AZURE_CHINA, | ||
'AzureGermanCloud': KnownAuthorities.AZURE_GERMANY, | ||
'AzureUSGovernment': KnownAuthorities.AZURE_GOVERNMENT, | ||
'AzureCloud': KnownAuthorities.AZURE_PUBLIC_CLOUD, | ||
"AzureChinaCloud": (AzureAuthorityHosts.AZURE_CHINA, "2016-10-01"), | ||
"AzureGermanCloud": (AzureAuthorityHosts.AZURE_GERMANY, "2016-10-01"), | ||
"AzureUSGovernment": (AzureAuthorityHosts.AZURE_GOVERNMENT, "2016-10-01"), | ||
"AzureCloud": (AzureAuthorityHosts.AZURE_PUBLIC_CLOUD, "7.1"), | ||
} | ||
|
||
# Instantiate a default credential based on the credential_type | ||
def get_default_credential(self, authority_host_alias=None): | ||
alias = authority_host_alias or os.environ.get("AZURE_CLOUD") | ||
authority_host = self.host_alias_map.get(alias, KnownAuthorities.AZURE_PUBLIC_CLOUD) | ||
return self.credential_type(authority=authority_host) | ||
def get_client_args(self, authority_host_alias=None): | ||
alias = authority_host_alias or os.environ.get("AZURE_CLOUD", "AzureCloud") | ||
authority_host, api_version = self.host_alias_map[alias] | ||
credential = self.credential_type(authority=authority_host) | ||
return {"api_version": api_version, "credential": credential, "vault_url": os.environ["AZURE_PROJECT_URL"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
from key_vault_base import KeyVaultBase | ||
from azure.identity.aio import DefaultAzureCredential | ||
|
||
|
||
class KeyVaultBaseAsync(KeyVaultBase): | ||
credential_type = DefaultAzureCredential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.