-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Key Vault Certificates #6467
Closed
Closed
Key Vault Certificates #6467
Changes from 60 commits
Commits
Show all changes
166 commits
Select commit
Hold shift + click to select a range
84e325f
working test case
samvaity 3c4baeb
adding more impl
samvaity ec9a925
crud working
samvaity 4f35316
working until contacts
samvaity e121e4d
all working
samvaity e53155c
working all
samvaity 45559a2
passes initial tests
iscai-msft f26938d
Merge branch 'master' into keyvault-certs
iscai-msft bb2bf3f
added some changes after design meeting, crud issuers passes
iscai-msft 955da45
added list to crud issuers and passes, merge certs not passing
iscai-msft c87f6dd
fixed CeritificatePolicy wrapper class, all tests besides merge certi…
iscai-msft 5a6c05a
hello world sample works
iscai-msft 3a0d425
list operations sample passing
iscai-msft 7c592f6
all sync samples working
iscai-msft 8aa6eb8
get_pending_csr test passes
iscai-msft 0acec0c
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 6bfa74e
switched import certificates parameter to bytes
iscai-msft 2485f02
modified wrapped models, added docstrings
iscai-msft 9c6fd42
uncommented tests
iscai-msft c5825ad
added readme for certificates
iscai-msft d8e59e8
deleted pip and lock file
iscai-msft aaf9220
deleted copied secret aio implementation
iscai-msft 86746f9
pulled origin master key recordings
iscai-msft 835ad10
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft 043de50
added _shared folder
iscai-msft 40528c5
added test recordings for secrets and keys for CI
iscai-msft 3f57c36
passes hello word sample test
iscai-msft d73cf66
adding samples tests, waiting to hear from keyvault team about questions
iscai-msft 6119001
changed default enabled value to True
iscai-msft e6e1aa3
implemented async client
iscai-msft 715151a
added get_pending_csr async implementation
iscai-msft 8b08df8
added distributed_trace_async decorator
iscai-msft 328c3fa
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft 3a43cb4
got rid of config in client
iscai-msft f59da85
made lists not async
iscai-msft 91a6206
list testing passes
iscai-msft 2cc9966
got rid of unnecessary variables
iscai-msft b73ab20
fixed import statements
iscai-msft f4d0061
fixed merge conflict
iscai-msft 2a71649
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into c…
iscai-msft b40c0ad
fixed transport error, still have contacts error
iscai-msft 1e0a445
all pass but merge and async request in playback
iscai-msft 5908047
Merge remote-tracking branch 'origin/master' into keyvault-certs
iscai-msft 0105b74
complying with latest core changes
iscai-msft b07585e
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft edb73e4
fixed import statement
iscai-msft 12ca6cd
moved _to_certificate_policy_bundle and ActionType enum
iscai-msft 4a164ee
implemented charles' comments
iscai-msft 2bd021d
using master recordings for keys and secrets
iscai-msft 70c0945
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 6d6095d
implemented charles' comments
iscai-msft 25e231c
added distributed trace decorators
iscai-msft cd579a2
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft ba62e63
samples running in asyncio loop, not passing
iscai-msft 95e4ffa
integrated core changes
iscai-msft 7949b24
included async client exposure
iscai-msft 4df00d6
samples running
iscai-msft e96ba8c
fixed import statement
iscai-msft a61674c
fixed import statements
iscai-msft 77cf453
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft b9c7595
removed unnecessary async samples from sync pr
iscai-msft 2b0d4ce
working on charles' latest comments
iscai-msft 67229b2
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft fc9341d
still working on comments
iscai-msft b3f64ec
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 82e03b8
fixed docstring
iscai-msft b0e01df
async_request_cancellation_and_deletion now passing in playback
iscai-msft 8d6f30e
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft da7537d
cleaned up async request test
iscai-msft 4c759fb
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 86a061f
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into c…
iscai-msft 74722da
async request test works in playback, added challenged based auth
iscai-msft 1c58b5c
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft 2e9525f
added challenge based auth code
iscai-msft be3a83c
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft e6a519d
renamed client and models file
iscai-msft db85bbd
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft d2676bf
renamed async client file
iscai-msft dd1271a
fixed imports
iscai-msft b5198bc
removed keyvaultid module
iscai-msft b9e3f32
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 8b37c4e
removed references to keyvaultid module
iscai-msft ddb76a2
added check if none for admin details
iscai-msft bcfc179
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 45d2d6d
added examples to docstrings
iscai-msft fd06b29
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 16b6e11
fixed get certificate example
iscai-msft 4d9aed4
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 63371e5
added examples in docstrings
iscai-msft 918b556
removed samples testing
iscai-msft 43c8682
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 37b72d0
added challenge auth testing
iscai-msft 3cbd714
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 3777fc6
added challenge auth testing
iscai-msft 8000a27
fixed type hinting in certs client to work with python 2.x
iscai-msft e8f2a5a
began pylint errors
iscai-msft 13d85a7
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 05bb7f3
pylint on aio done except exceptions
iscai-msft ce7fe78
pylinting
iscai-msft 56c5a48
pylinted samples
iscai-msft 6ff1bdb
passing pylint
iscai-msft 73d3fbf
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft b46c728
rewriting merge test
iscai-msft 4283000
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft e6cc5f3
switched san_dns names
iscai-msft 69ddc9f
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft e5abe2f
changing san_dns_names
iscai-msft c58b315
updating recordings with new san DNS names
iscai-msft 5444cfe
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 5ce7a42
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft e971659
used pre-hashed certificate bytes for merge_certificate, not working
iscai-msft 22bfb69
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft e3103a7
clean after Krista's pylint changes
iscai-msft 3f56d26
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 2987092
async clean after Krista's pylint changes
iscai-msft 91951af
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft 783199e
trying to add backup restore test
iscai-msft 1f92178
added backup restore test, passing
iscai-msft 425db1c
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft 1dcb7ef
added backup restore test
iscai-msft 546676f
got rid of unnecessary waiting and print statements
iscai-msft 7c85af6
fixed small errors in readme
iscai-msft 981d2ca
fixed samples commenting
iscai-msft f3a3ed4
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into c…
iscai-msft b17354d
fixing mypy issues
iscai-msft c114701
added new seed testing
iscai-msft 88ef59b
working on merge certificate test
iscai-msft 46263b5
got rid of not before and expires
iscai-msft 5cc2a75
got rid of not before and expires
iscai-msft 4b5722c
added Charles' comments from other pylint pr
iscai-msft deefd92
added SecretContentType enum for CertificatePolicy
iscai-msft cfc8444
added KeyUsageType enum
iscai-msft ad4db88
added default policy, tests passing
iscai-msft b98e47c
before switching to shell commands
iscai-msft fdbce63
using shell commands
iscai-msft 359ebbf
Revert "using shell commands"
iscai-msft 7120f72
merge certificate passing!!!!
iscai-msft f63d97a
added seeding, all tests passing
iscai-msft dccd338
Merge branch 'certs-async' of github.com:iscai-msft/azure-sdk-for-pyt…
iscai-msft 6b14fe1
fixed weird conflict error
iscai-msft 17b49ae
fixing dev requirements and test to pass ci
iscai-msft 59bda52
removed itertools to be compatible with python 2.7
iscai-msft b3709ab
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into c…
iscai-msft 6aaee8b
reset changes to mgmt plane test
iscai-msft 2a5516c
changed default certificate policy
iscai-msft 3fe5db7
getting rid of erroneous certificate policy model change
iscai-msft 9fb3745
implemented lro for create certificate, all tests passing
iscai-msft c2d584e
implemented Charles' suggestions
iscai-msft c6ae595
implemented Charles' comments
iscai-msft b7d3d24
moved sans to kwargs, added comments to models
iscai-msft c18a9a1
fixed links in samples
iscai-msft 80d189d
Merge remote-tracking branch 'origin/master' into certs-async
iscai-msft eb7922c
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into c…
iscai-msft b2fb410
fixed typing error, awaited all async pollers
iscai-msft a681e89
updated lowerbound for azure core version
iscai-msft 901dcae
fixed linting errors
iscai-msft c820f00
updated readme
iscai-msft 98ff072
parsing out certificate id in poller
iscai-msft 5e4d99e
added model imports in aio init
iscai-msft 6b4a33a
fixed init files to just use models passed to methods
iscai-msft 84ced76
fixed enum conversion and import statements
iscai-msft 1840071
split get_certificate into one with version and one with policy
iscai-msft 390e692
fixed docstrings, added ResourceNotFoundError and ResourceExistError …
iscai-msft 1e9bf73
fixed linting error
iscai-msft 960a9b4
reordered logic in conftest for RUN_IDENTIFIER
iscai-msft 69808a4
reverted SecretContentType types and get_pending_csr
iscai-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Release History | ||
|
||
## 4.0.0b1 (2019-06-28) | ||
For release notes and more information please visit | ||
https://aka.ms/azure-sdk-preview1-python |
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,6 @@ | ||
include *.md | ||
include azure/__init__.py | ||
include azure/keyvault/__init__.py | ||
include azure/keyvault/secrets/__init__.py | ||
include azure/keyvault/secrets/_generated/__init__.py | ||
include azure/keyvault/secrets/aio/__init__.py |
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,240 @@ | ||
# Azure Key Vault Certificates client library for Python | ||
Azure Key Vault is a cloud service that provides a secure management of certificates, which are built on top of keys and secrets and adds an automated renewal feature. The certificate client library allows you securely store and manage the life-cycle of your certificate, be notified about certificate life-cycle events, and supports automatic renewal with selected issuers. This library offers operations to create, retrieve, update, delete, purge, backup, restore and list the certificates and its versions, and offers CRUD operations for the certificate issuers, contacts, and management policies of the certificates.. | ||
|
||
[Source code][certificates_client_src] | [Package (PyPI)](TODO) | [API reference documentation](TODO) | [Product documentation][keyvault_docs] | [Samples][certificates_samples] | ||
## Getting started | ||
### Install the package | ||
Install the Azure Key Vault client library for Python with [pip][pip]: | ||
|
||
```Bash | ||
pip install azure-keyvault-certificates | ||
``` | ||
|
||
### Prerequisites | ||
* An [Azure subscription][azure_sub]. | ||
* Python 2.7, 3.5.3 or later to use this package. | ||
* An existing Key Vault. If you need to create a Key Vault, you can use the [Azure Cloud Shell][azure_cloud_shell] to create one with this Azure CLI command. Replace `<your-resource-group-name>` and `<your-key-vault-name>` with your own, unique names: | ||
|
||
```Bash | ||
az keyvault create --resource-group <your-resource-group-name> --name <your-key-vault-name> | ||
``` | ||
|
||
### Authenticate the client | ||
In order to interact with the Key Vault service, you'll need to create an instance of the [CertificateClient](TODO-rst-docs) class. You would need a **vault url** and **client certificate credentials (client id, client secret, tenant id)** to instantiate a client object for using the `DefaultAzureCredential` examples in the README. `DefaultAzureCredential` authentication is achieved by providing client certificate credentials as seen in this getting started section, but you can find more ways to authenticate with [azure-identity][azure_identity]. | ||
|
||
#### Create/Get credentials | ||
Use the [Azure Cloud Shell][azure_cloud_shell] snippet below to create/get client certificate credentials. | ||
|
||
* Create a service principal and configure its access to Azure resources: | ||
```Bash | ||
az ad sp create-for-rbac -n <your-application-name> --skip-assignment | ||
``` | ||
Output: | ||
```json | ||
{ | ||
"appId": "generated-app-ID", | ||
"displayName": "dummy-app-name", | ||
"name": "http://dummy-app-name", | ||
"password": "random-password", | ||
"tenant": "tenant-ID" | ||
} | ||
``` | ||
* Use the credentials returned above to set **AZURE_CLIENT_ID**(appId), **AZURE_CLIENT_SECRET**(password) and (password) and **AZURE_TENANT_ID**(tenant) environment variables. The following example shows a way to do this in Bash: | ||
```Bash | ||
export AZURE_CLIENT_ID="generated-app-ID" | ||
export AZURE_CLIENT_SECRET="random-password" | ||
export AZURE_TENANT_ID="tenant-ID" | ||
``` | ||
|
||
* Grant the above mentioned application authorization to perform certificate operations on the keyvault: | ||
```Bash | ||
az keyvault set-policy --name <your-key-vault-name> --spn $AZURE_CLIENT_ID --certificate-permissions backup create delete get import list purge recover restore update | ||
``` | ||
> --certificate-permissions: | ||
> Accepted values: backup, create, delete, deleteissuers, get, getissuers, import, list, listissuers, managecontacts, manageissuers, purge, recover, restore, setissuers, update | ||
|
||
* Use the above mentioned Key Vault name to retrieve details of your Vault which also contains your Key Vault URL: | ||
```Bash | ||
az keyvault show --name <your-key-vault-name> | ||
``` | ||
|
||
#### Create Certificate client | ||
Once you've populated the **AZURE_CLIENT_ID**, **AZURE_CLIENT_SECRET** and **AZURE_TENANT_ID** environment variables and replaced **your-vault-url** with the above returned URI, you can create the [CertificateClient](TODO-rst-docs): | ||
|
||
```python | ||
from azure.identity import DefaultAzureCredential | ||
from azure.keyvault.certificates import CertificateClient | ||
|
||
credential = DefaultAzureCredential() | ||
|
||
# Create a new certificate client using the default credential | ||
certificate_client = CertificateClient(vault_url=<your-vault-url>, credential=credential) | ||
``` | ||
## Key concepts | ||
### Certificate | ||
A certificate is the fundamental resource within Azure KeyVault. From a developer's perspective, Key Vault APIs accept and return certificates as the Certificate type. In addition to the certificate data, the following attributes may be specified: | ||
* expires: Identifies the expiration time on or after which the certificate data should not be retrieved. | ||
* not_before: Identifies the time after which the certificate will be active. | ||
* enabled: Specifies whether the certificate data can be retrieved. | ||
* created: Indicates when this version of the certificate was created. | ||
* updated: Indicates when this version of the certificate was updated. | ||
|
||
### Certificate Client: | ||
The Certificate client performs the interactions with the Azure Key Vault service for getting, setting, updating, deleting, and listing secrets and its versions. An asynchronous and synchronous, SecretClient, client exists in the SDK allowing for selection of a client based on an application's use case. Once you've initialized a CertificateClient, you can interact with the primary resource types in Key Vault. | ||
|
||
## Examples | ||
The following section provides several code snippets using the above created `certificate_client`, covering some of the most common Azure Key Vault Certificate service related tasks, including: | ||
* [Create a Certificate](#create-a-certificate) | ||
* [Retrieve a Certificate](#retrieve-a-certificate) | ||
* [Update an existing Certificate](#update-an-existing-certificate) | ||
* [Delete a Certificate](#delete-a-certificate) | ||
* [List Certificates](#list-certificates) | ||
* | ||
|
||
### Create a Certificate | ||
`create_certificate` creates a Certificate to be stored in the Azure Key Vault. If a certificate with the same name already exists, then a new version of the certificate is created. | ||
Before creating a certificate, a management policy for the certificate must be created. Following the service's guidelines, create_certificate returns a CertificateOperation, as | ||
`create_certificate` is an asynchronous request to the server. | ||
```python | ||
cert_policy = CertificatePolicy(key_properties=KeyProperties(exportable=True, | ||
key_type='RSA', | ||
key_size=2048, | ||
reuse_key=False), | ||
content_type='application/x-pkcs12', | ||
issuer_name='Self', | ||
subject_name='CN=*.microsoft.com', | ||
san_dns_names=['onedrive.microsoft.com', 'xbox.microsoft.com'], | ||
validity_in_months=24, | ||
lifetime_actions=lifetime_actions, | ||
attributes=CertificateAttributes(recovery_level="Purgeable") | ||
) | ||
cert_operation = certificate_client.create_certificate(name="cert-name", policy=cert-policy) | ||
|
||
print(cert_operation.name) | ||
print(cert_operation.id) | ||
``` | ||
|
||
### Retrieve a Certificate | ||
`get_certificate` retrieves a certificate previously stored in the Key Vault. | ||
```python | ||
certificate = certificate_client.get_certificate(name="cert-name") | ||
|
||
print(certificate.name) | ||
print(certificate.version) | ||
``` | ||
|
||
### Update an existing Certificate | ||
`update_certificate` updates a certificate previously stored in the Key Vault. | ||
```python | ||
# You can specify additional application-specific metadata in the form of tags. | ||
tags = {"foo": "updated tag"} | ||
|
||
updated_certificate= certificate_client.update_certificate(name="cert-name", tags=tags) | ||
|
||
print(updated_certificate.name) | ||
print(updated_certificate.version) | ||
print(updated_certificate.updated) | ||
print(updated_certificate.tags) | ||
|
||
``` | ||
|
||
### Delete a Certificate | ||
`delete_certificate` deletes a certificate previously stored in the Key Vault. When [soft-delete][soft_delete] is not enabled for the Key Vault, this operation permanently deletes the certificate. | ||
```python | ||
deleted_certificate = certificate_client.delete_certificate(name="cert-name") | ||
|
||
print(deleted_certificate.name) | ||
print(deleted_certificate.deleted_date) | ||
``` | ||
### List Certificates | ||
This example lists all the certificates in the specified Key Vault. | ||
```python | ||
certificates = certificate_client.list_certificates() | ||
|
||
for certificate in certificates: | ||
# the list doesn't include versions of the certificates | ||
print(certificate.name) | ||
``` | ||
|
||
## Troubleshooting | ||
### General | ||
Key Vault clients raise exceptions defined in azure-core. For more detailed information about exceptions and how to deal with them, see [Azure Core exceptions][azure_core_exceptions]. | ||
|
||
For example, if you try to retrieve a certificate after it is deleted a `404` error is returned, indicating resource not found. In the following snippet, the error is handled gracefully by catching the exception and displaying additional information about the error. | ||
```python | ||
try: | ||
certificate_client.get_certificate(name="deleted_certificate") | ||
except ResourceNotFoundError as e: | ||
print(e.message) | ||
|
||
Output: "certificatenot found:deleted_certificate" | ||
``` | ||
### Logging | ||
Network trace logging is disabled by default for this library. When enabled, this will be logged at DEBUG level. The logging policy is used to output the HTTP network trace to the configured logger. You can configure logging to print out debugging information to the stdout or write it to a file using the following example: | ||
|
||
```python | ||
import sys | ||
import logging | ||
# Create a logger for the 'azure' SDK | ||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.DEBUG) | ||
# Configure a console output | ||
handler = logging.StreamHandler(stream=sys.stdout) | ||
logger.addHandler(handler) | ||
# Configure a file output | ||
file_handler = logging.FileHandler(filename) | ||
logger.addHandler(file_handler) | ||
|
||
# Enable network trace logging. This will be logged at DEBUG level. | ||
# By default, network trace logging is disabled. | ||
config = CertificateClient.create_config(credential=credential, logging_enable=True) | ||
client = CertificateClient(vault_url=url, credential=credential, config=config) | ||
``` | ||
The logger can also be enabled per operation. | ||
|
||
```python | ||
certificate = client.get_certificate(name="cert-name", logging_enable=True) | ||
``` | ||
|
||
## Next steps | ||
Several KeyVault Python SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered while working with Key Vault: | ||
* [test_examples_certificates.py][test_examples_certificates] - Contains the code snippets working with Key Vault certificates. | ||
* [hello_world.py][hello_world_sample] and [hello_world_async.py][hello_world_async_sample] - Python code for working with Azure Key Vault, including: | ||
* Create a new certificate | ||
* Get an existing certificate | ||
* Update an existing certificate | ||
* Delete certificate | ||
* [list_operations.py][list_operations_sample] and [list_operations_async.py][list_operations_async_sample] - Example code for working with Key Vault certificates backup and recovery, including: | ||
* Create a certificate | ||
* List all certificates in the Key Vault | ||
* List versions of a specified certificate | ||
* Delete certificates from the Key Vault | ||
* List deleted certificates in the Key Vault | ||
|
||
### Additional Documentation | ||
For more extensive documentation on Azure Key Vault, see the [API reference documentation](TODO). | ||
|
||
## Contributing | ||
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. | ||
|
||
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments. | ||
|
||
<!-- LINKS --> | ||
[asyncio_package]: https://docs.python.org/3/library/asyncio.html | ||
[azure_cloud_shell]: https://shell.azure.com/bash | ||
[azure_core_exceptions]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/docs/exceptions.md | ||
[azure_identity]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/identity/azure-identity | ||
[azure_sub]: https://azure.microsoft.com/free/ | ||
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ | ||
[hello_world_sample]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/keyvault/azure-keyvault-certificates/samples/hello_world.py | ||
[keyvault_docs]: https://docs.microsoft.com/en-us/azure/key-vault/ | ||
[list_operations_sample]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/keyvault/azure-keyvault-certificates/samples/list_operations.py | ||
[pip]: https://pypi.org/project/pip/ | ||
[certificates_client_src]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/keyvault/azure-keyvault/azure/keyvault/certificates | ||
[certificates_samples]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/keyvault/azure-keyvault-certificates/samples | ||
[soft_delete]: https://docs.microsoft.com/en-us/azure/key-vault/key-vault-ovw-soft-delete | ||
[test_example_certificates]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/keyvault/azure-keyvault-certificates/tests/test_example_certificates.py | ||
|
||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fsdk%2Fkeyvault%2Fazure-keyvault-certificates%2FFREADME.png) |
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,6 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
# pylint:disable=missing-docstring | ||
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore |
6 changes: 6 additions & 0 deletions
6
sdk/keyvault/azure-keyvault-certificates/azure/keyvault/__init__.py
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,6 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
# pylint:disable=missing-docstring | ||
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore |
37 changes: 37 additions & 0 deletions
37
sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/__init__.py
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,37 @@ | ||
# -------------------------------------------------------------------------- | ||
iscai-msft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See LICENSE.txt in the project root for | ||
# license information. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._client import CertificateClient | ||
from ._models import ( | ||
AdministratorDetails, | ||
Certificate, | ||
CertificateBase, | ||
DeletedCertificate, | ||
Error, | ||
CertificateOperation, | ||
CertificatePolicy, | ||
Contact, | ||
Issuer, | ||
IssuerBase, | ||
KeyProperties, | ||
LifetimeAction | ||
) | ||
|
||
__all__ = [ | ||
"AdministratorDetails", | ||
"Certificate", | ||
"CertificateBase", | ||
"CertificateClient", | ||
"CertificateOperation", | ||
"CertificatePolicy", | ||
"Contact", | ||
"DeletedCertificate", | ||
"Error", | ||
"Issuer", | ||
"IssuerBase", | ||
"KeyProperties", | ||
"LifetimeAction" | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this override & call super needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@annatisch was adding it to her transport PR, there's a problem in azure-core where the async transport was calling a synchronous sleep which resulted in an error because None can't be awaited. Anna thinks it's because the AsyncioRequestsTransport was calling its two base classes in the wrong order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That PR merged, so this should rebase out.