-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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' into restapi_auto_sql/resource-manager
- Loading branch information
Showing
4,410 changed files
with
837,992 additions
and
852,212 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
import os | ||
import uuid | ||
from azure.identity import DefaultAzureCredential | ||
from azure.keyvault.certificates import CertificateClient, CertificatePolicy | ||
|
||
|
||
class KeyVaultCertificates: | ||
def __init__(self): | ||
# DefaultAzureCredential() expects the following environment variables: | ||
# * AZURE_CLIENT_ID | ||
# * AZURE_CLIENT_SECRET | ||
# * AZURE_TENANT_ID | ||
credential = DefaultAzureCredential() | ||
self.certificate_client = CertificateClient( | ||
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential | ||
) | ||
|
||
self.certificate_name = "cert-name-" + uuid.uuid1().hex | ||
|
||
def create_certificate(self): | ||
print("creating certificate...") | ||
self.certificate_client.create_certificate(name=self.certificate_name) | ||
print("\tdone") | ||
|
||
def get_certificate(self): | ||
print("Getting a certificate...") | ||
certificate = self.certificate_client.get_certificate_with_policy(name=self.certificate_name) | ||
print("\tdone, certificate: %s." % certificate.name) | ||
|
||
def delete_certificate(self): | ||
print("Deleting a certificate...") | ||
deleted_certificate = self.certificate_client.delete_certificate(name=self.certificate_name) | ||
print("\tdone: " + deleted_certificate.name) | ||
|
||
def run(self): | ||
print("") | ||
print("------------------------") | ||
print("Key Vault - Certificates\nIdentity - Credential") | ||
print("------------------------") | ||
print("1) Create a certificate") | ||
print("2) Get that certificate") | ||
print("3) Delete that certificate (Clean up the resource)") | ||
print("") | ||
|
||
try: | ||
self.create_certificate() | ||
self.get_certificate() | ||
finally: | ||
self.delete_certificate() |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
import os | ||
import uuid | ||
from azure.identity.aio import DefaultAzureCredential | ||
from azure.keyvault.certificates import CertificatePolicy | ||
from azure.keyvault.certificates.aio import CertificateClient | ||
|
||
|
||
class KeyVaultCertificates: | ||
def __init__(self): | ||
# DefaultAzureCredential() expects the following environment variables: | ||
# * AZURE_CLIENT_ID | ||
# * AZURE_CLIENT_SECRET | ||
# * AZURE_TENANT_ID | ||
credential = DefaultAzureCredential() | ||
self.certificate_client = CertificateClient( | ||
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential | ||
) | ||
|
||
self.certificate_name = "cert-name-" + uuid.uuid1().hex | ||
|
||
async def create_certificate(self): | ||
create_certificate_poller = await self.certificate_client.create_certificate(name=self.certificate_name) | ||
await create_certificate_poller | ||
print("\tdone") | ||
|
||
async def get_certificate(self): | ||
print("Getting a certificate...") | ||
certificate = await self.certificate_client.get_certificate_with_policy(name=self.certificate_name) | ||
print(f"\tdone, certificate: {certificate.name}.") | ||
|
||
async def delete_certificate(self): | ||
print("Deleting a certificate...") | ||
deleted_certificate = await self.certificate_client.delete_certificate(name=self.certificate_name) | ||
print("\tdone: " + deleted_certificate.name) | ||
|
||
async def run(self): | ||
print("") | ||
print("------------------------") | ||
print("Key Vault - Certificates\nIdentity - Credential") | ||
print("------------------------") | ||
print("1) Create a certificate") | ||
print("2) Get that certificate") | ||
print("3) Delete that certificate (Clean up the resource)") | ||
print("") | ||
|
||
try: | ||
await self.create_certificate() | ||
await self.get_certificate() | ||
finally: | ||
await self.delete_certificate() |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
import os | ||
import uuid | ||
from azure.identity import DefaultAzureCredential | ||
from azure.keyvault.keys import KeyClient | ||
|
||
|
||
class KeyVaultKeys: | ||
def __init__(self): | ||
# DefaultAzureCredential() expects the following environment variables: | ||
# * AZURE_CLIENT_ID | ||
# * AZURE_CLIENT_SECRET | ||
# * AZURE_TENANT_ID | ||
credential = DefaultAzureCredential() | ||
self.key_client = KeyClient( | ||
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential | ||
) | ||
|
||
self.key_name = "key-name-" + uuid.uuid1().hex | ||
|
||
def create_rsa_key(self): | ||
print("Creating an RSA key...") | ||
self.key_client.create_rsa_key(name=self.key_name, size=2048, hsm=False) | ||
print("\tdone") | ||
|
||
def get_key(self): | ||
print("Getting a key...") | ||
key = self.key_client.get_key(name=self.key_name) | ||
print("\tdone, key: %s." % key.name) | ||
|
||
def delete_key(self): | ||
print("Deleting a key...") | ||
deleted_key = self.key_client.delete_key(name=self.key_name) | ||
print("\tdone: " + deleted_key.name) | ||
|
||
def run(self): | ||
print("") | ||
print("------------------------") | ||
print("Key Vault - Keys\nIdentity - Credential") | ||
print("------------------------") | ||
print("1) Create a key") | ||
print("2) Get that key") | ||
print("3) Delete that key (Clean up the resource)") | ||
print("") | ||
|
||
try: | ||
self.create_rsa_key() | ||
self.get_key() | ||
finally: | ||
self.delete_key() |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
import os | ||
import uuid | ||
from azure.identity.aio import DefaultAzureCredential | ||
from azure.keyvault.keys.aio import KeyClient | ||
|
||
|
||
class KeyVaultKeys: | ||
def __init__(self): | ||
# DefaultAzureCredential() expects the following environment variables: | ||
# * AZURE_CLIENT_ID | ||
# * AZURE_CLIENT_SECRET | ||
# * AZURE_TENANT_ID | ||
credential = DefaultAzureCredential() | ||
self.key_client = KeyClient( | ||
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential | ||
) | ||
|
||
self.key_name = "key-name-" + uuid.uuid1().hex | ||
|
||
async def create_rsa_key(self): | ||
print("Creating an RSA key...") | ||
await self.key_client.create_rsa_key(name=self.key_name, size=2048, hsm=False) | ||
print("\tdone") | ||
|
||
async def get_key(self): | ||
print("Getting a key...") | ||
key = await self.key_client.get_key(name=self.key_name) | ||
print(f"\tdone, key: {key.name}.") | ||
|
||
async def delete_key(self): | ||
print("Deleting a key...") | ||
deleted_key = await self.key_client.delete_key(name=self.key_name) | ||
print("\tdone: " + deleted_key.name) | ||
|
||
async def run(self): | ||
|
||
print("") | ||
print("------------------------") | ||
print("Key Vault - Keys\nIdentity - Credential") | ||
print("------------------------") | ||
print("1) Create a key") | ||
print("2) Get that key") | ||
print("3) Delete that key (Clean up the resource)") | ||
print("") | ||
|
||
try: | ||
await self.create_rsa_key() | ||
await self.get_key() | ||
finally: | ||
await self.delete_key() |
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.