Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…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
iscai-msft committed Sep 3, 2020
2 parents 0920f67 + dfe38f5 commit 6c2df58
Show file tree
Hide file tree
Showing 1,799 changed files with 90,274 additions and 44,709 deletions.
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
# PRLabel: %Storage
/sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft @tasherif-msft @kasobol-msft

/sdk/applicationinsights/ @alexeldeib
/sdk/applicationinsights/ @alexeldeib

# PRLabel: %Batch
/sdk/batch/ @bgklein @xingwu1
/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/ @areddish
/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/ @areddish

# PRLabel: %KeyVault
/sdk/keyvault/ @schaabs @chlowell @iscai-msft
Expand All @@ -52,7 +52,7 @@

# PRLabel: %Data Factory
/sdk/datafactory/ @hvermis
/sdk/datalake/ @ro-joowan
/sdk/datalake/ @ro-joowan
/sdk/datadatamigration/ @vchske

# PRLabel: %Event Grid
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ Mypy install and run.
**Example: Invoke tox, breaking into the debugger on failure**
`tox -e whl -c ../../../eng/tox/tox.ini -- --pdb`

### More Reading

We maintain an [additional document](doc/eng_sys_checks.md) that has a ton of detail as to what is actually _happening_ in these executions.

### Dev Feed
Daily dev build version of Azure sdk packages for python are available and are uploaded to Azure devops feed daily. We have also created a tox environment to test a package against dev built version of dependent packages. Below is the link to Azure devops feed.
[`https://dev.azure.com/azure-sdk/public/_packaging?_a=feed&feed=azure-sdk-for-python`](https://dev.azure.com/azure-sdk/public/_packaging?_a=feed&feed=azure-sdk-for-python)
Expand Down
25 changes: 15 additions & 10 deletions common/smoketest/key_vault_base.py
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"]}
5 changes: 5 additions & 0 deletions common/smoketest/key_vault_base_async.py
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
10 changes: 3 additions & 7 deletions common/smoketest/key_vault_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import uuid
from azure.keyvault.certificates import CertificateClient, CertificatePolicy
from key_vault_base import KeyVaultBase


class KeyVaultCertificates(KeyVaultBase):
def __init__(self):

credential = self.get_default_credential()
self.certificate_client = CertificateClient(
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
)

args = self.get_client_args()
self.certificate_client = CertificateClient(**args)
self.certificate_name = "cert-name-" + uuid.uuid1().hex

def create_certificate(self):
Expand Down
9 changes: 3 additions & 6 deletions common/smoketest/key_vault_certificates_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import uuid
from azure.keyvault.certificates import CertificatePolicy
from azure.keyvault.certificates.aio import CertificateClient
from key_vault_base_async import KeyVaultBaseAsync


class KeyVaultCertificates(KeyVaultBaseAsync):
def __init__(self):
credential = self.get_default_credential()
self.certificate_client = CertificateClient(
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
)

args = self.get_client_args()
self.certificate_client = CertificateClient(**args)
self.certificate_name = "cert-name-" + uuid.uuid1().hex

async def create_certificate(self):
Expand Down
8 changes: 2 additions & 6 deletions common/smoketest/key_vault_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import uuid
from azure.keyvault.keys import KeyClient
from key_vault_base import KeyVaultBase


class KeyVaultKeys(KeyVaultBase):
def __init__(self):
credential = self.get_default_credential()
self.key_client = KeyClient(
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
)

args = self.get_client_args()
self.key_client = KeyClient(**args)
self.key_name = "key-name-" + uuid.uuid1().hex

def create_rsa_key(self):
Expand Down
9 changes: 2 additions & 7 deletions common/smoketest/key_vault_keys_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import uuid
from azure.keyvault.keys.aio import KeyClient
from key_vault_base_async import KeyVaultBaseAsync


class KeyVaultKeys(KeyVaultBaseAsync):
def __init__(self):

credential = self.get_default_credential()
self.key_client = KeyClient(
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
)

args = self.get_client_args()
self.key_client = KeyClient(**args)
self.key_name = "key-name-" + uuid.uuid1().hex

async def create_rsa_key(self):
Expand Down
9 changes: 3 additions & 6 deletions common/smoketest/key_vault_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import uuid
from azure.keyvault.secrets import SecretClient
from key_vault_base import KeyVaultBase


class KeyVaultSecrets(KeyVaultBase):
def __init__(self):
credential = self.get_default_credential()
self.secret_client = SecretClient(
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
)

args = self.get_client_args()
self.secret_client = SecretClient(**args)
self.secret_name = "secret-name-" + uuid.uuid1().hex
self.secret_Value = "secret-value"

Expand Down
8 changes: 3 additions & 5 deletions common/smoketest/key_vault_secrets_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import uuid
from azure.keyvault.secrets.aio import SecretClient
from key_vault_base_async import KeyVaultBaseAsync


class KeyVaultSecrets(KeyVaultBaseAsync):
def __init__(self):
credential = self.get_default_credential()
self.secret_client = SecretClient(
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
)
args = self.get_client_args()
self.secret_client = SecretClient(**args)
self.secret_name = "secret-name-" + uuid.uuid1().hex
self.secret_value = "secret-value"

Expand Down
4 changes: 3 additions & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ This folder contains some documentations for this repository:

The folder structure is the following
- [sphinx](./sphinx) : contains the documentation source code for https://azure.github.io/azure-sdk-for-python/
- [dev](./dev) : contains advanced documentation for _developers_ of SDK (not _consumers_ of SDK)
- [dev](./dev) : contains advanced documentation for _developers_ of SDK (not _consumers_ of SDK)

The file [eng_sys_checks](eng_sys_checks.md) is a read up as to what a standard `ci.yml` will actually execute.
Loading

0 comments on commit 6c2df58

Please sign in to comment.