Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
84e325f
working test case
samvaity Jul 1, 2019
3c4baeb
adding more impl
samvaity Jul 2, 2019
ec9a925
crud working
samvaity Jul 2, 2019
4f35316
working until contacts
samvaity Jul 3, 2019
e121e4d
all working
samvaity Jul 3, 2019
e53155c
working all
samvaity Jul 4, 2019
45559a2
passes initial tests
iscai-msft Jul 12, 2019
f26938d
Merge branch 'master' into keyvault-certs
iscai-msft Jul 15, 2019
bb2bf3f
added some changes after design meeting, crud issuers passes
iscai-msft Jul 17, 2019
955da45
added list to crud issuers and passes, merge certs not passing
iscai-msft Jul 18, 2019
c87f6dd
fixed CeritificatePolicy wrapper class, all tests besides merge certi…
iscai-msft Jul 19, 2019
5a6c05a
hello world sample works
iscai-msft Jul 19, 2019
3a0d425
list operations sample passing
iscai-msft Jul 19, 2019
7c592f6
all sync samples working
iscai-msft Jul 19, 2019
8aa6eb8
get_pending_csr test passes
iscai-msft Jul 19, 2019
0acec0c
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Jul 19, 2019
6bfa74e
switched import certificates parameter to bytes
iscai-msft Jul 22, 2019
2485f02
modified wrapped models, added docstrings
iscai-msft Jul 22, 2019
9c6fd42
uncommented tests
iscai-msft Jul 22, 2019
c5825ad
added readme for certificates
iscai-msft Jul 22, 2019
d8e59e8
deleted pip and lock file
iscai-msft Jul 22, 2019
aaf9220
deleted copied secret aio implementation
iscai-msft Jul 22, 2019
86746f9
pulled origin master key recordings
iscai-msft Jul 22, 2019
835ad10
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft Jul 22, 2019
043de50
added _shared folder
iscai-msft Jul 22, 2019
40528c5
added test recordings for secrets and keys for CI
iscai-msft Jul 23, 2019
3f57c36
passes hello word sample test
iscai-msft Jul 23, 2019
d73cf66
adding samples tests, waiting to hear from keyvault team about questions
iscai-msft Jul 23, 2019
6119001
changed default enabled value to True
iscai-msft Jul 23, 2019
328c3fa
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft Jul 24, 2019
3a43cb4
got rid of config in client
iscai-msft Jul 24, 2019
2cc9966
got rid of unnecessary variables
iscai-msft Jul 24, 2019
b73ab20
fixed import statements
iscai-msft Jul 25, 2019
5908047
Merge remote-tracking branch 'origin/master' into keyvault-certs
iscai-msft Jul 25, 2019
0105b74
complying with latest core changes
iscai-msft Jul 25, 2019
b07585e
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Jul 25, 2019
edb73e4
fixed import statement
iscai-msft Jul 25, 2019
12ca6cd
moved _to_certificate_policy_bundle and ActionType enum
iscai-msft Jul 26, 2019
4a164ee
implemented charles' comments
iscai-msft Jul 26, 2019
2bd021d
using master recordings for keys and secrets
iscai-msft Jul 26, 2019
25e231c
added distributed trace decorators
iscai-msft Jul 26, 2019
a61674c
fixed import statements
iscai-msft Jul 26, 2019
b9c7595
removed unnecessary async samples from sync pr
iscai-msft Jul 26, 2019
2b0d4ce
working on charles' latest comments
iscai-msft Aug 2, 2019
67229b2
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft Aug 2, 2019
fc9341d
still working on comments
iscai-msft Aug 2, 2019
b0e01df
async_request_cancellation_and_deletion now passing in playback
iscai-msft Aug 2, 2019
da7537d
cleaned up async request test
iscai-msft Aug 5, 2019
1c58b5c
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft Aug 5, 2019
2e9525f
added challenge based auth code
iscai-msft Aug 5, 2019
e6a519d
renamed client and models file
iscai-msft Aug 5, 2019
b5198bc
removed keyvaultid module
iscai-msft Aug 5, 2019
ddb76a2
added check if none for admin details
iscai-msft Aug 6, 2019
45d2d6d
added examples to docstrings
iscai-msft Aug 6, 2019
16b6e11
fixed get certificate example
iscai-msft Aug 6, 2019
918b556
removed samples testing
iscai-msft Aug 6, 2019
37b72d0
added challenge auth testing
iscai-msft Aug 6, 2019
8000a27
fixed type hinting in certs client to work with python 2.x
iscai-msft Aug 9, 2019
e8f2a5a
began pylint errors
iscai-msft Aug 9, 2019
ce7fe78
pylinting
iscai-msft Aug 12, 2019
56c5a48
pylinted samples
iscai-msft Aug 12, 2019
6ff1bdb
passing pylint
iscai-msft Aug 16, 2019
b46c728
rewriting merge test
iscai-msft Aug 16, 2019
4283000
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft Aug 16, 2019
e6cc5f3
switched san_dns names
iscai-msft Aug 16, 2019
c58b315
updating recordings with new san DNS names
iscai-msft Aug 16, 2019
5ce7a42
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft Aug 20, 2019
e971659
used pre-hashed certificate bytes for merge_certificate, not working
iscai-msft Aug 20, 2019
22bfb69
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft Aug 21, 2019
e3103a7
clean after Krista's pylint changes
iscai-msft Aug 21, 2019
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
Prev Previous commit
Next Next commit
fixed type hinting in certs client to work with python 2.x
  • Loading branch information
iscai-msft committed Aug 9, 2019
commit 8000a272c749d2f838718193c94576fb5a83f016
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ class CertificateClient(KeyVaultClientBase):
@distributed_trace
def create_certificate(
self,
name: str,
policy: CertificatePolicy,
enabled: Optional[bool] = None,
not_before: Optional[datetime] = None,
expires: Optional[datetime] = None,
tags: Optional[Dict[str, str]] = None,
**kwargs: Mapping[str, Any]
) -> CertificateOperation:
name, # type: str
policy, # type: CertificatePolicy
enabled=None, # type: Optional[bool]
not_before=None, # type: Optional[datetime]
expires=None, # type: Optional[datetime]
tags=None, # type: Optional[Dict[str, str]]
**kwargs # type: Mapping[str, Any]
):
# type: (...) -> CertificateOperation
"""Creates a new certificate.

If this is the first version, the certificate resource is created. This
Expand Down Expand Up @@ -100,7 +101,8 @@ def create_certificate(
return CertificateOperation._from_certificate_operation_bundle(certificate_operation_bundle=bundle)

@distributed_trace
def get_certificate(self, name: str, version: Optional[str] = None, **kwargs: Mapping[str, Any]) -> Certificate:
def get_certificate(self, name, version=None, **kwargs):
# type: (str, Optional[str], Mapping[str, Any]) -> Certificate
"""Gets information about a certificate.

Gets information about a specific certificate. This operation requires
Expand Down Expand Up @@ -136,7 +138,8 @@ def get_certificate(self, name: str, version: Optional[str] = None, **kwargs: Ma
return Certificate._from_certificate_bundle(certificate_bundle=bundle)

@distributed_trace
def delete_certificate(self, name: str, **kwargs: Mapping[str, Any]) -> DeletedCertificate:
def delete_certificate(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> DeletedCertificate
"""Deletes a certificate from the key vault.

Deletes all versions of a certificate object along with its associated
Expand All @@ -163,7 +166,8 @@ def delete_certificate(self, name: str, **kwargs: Mapping[str, Any]) -> DeletedC
return DeletedCertificate._from_deleted_certificate_bundle(deleted_certificate_bundle=bundle)

@distributed_trace
def get_deleted_certificate(self, name: str, **kwargs: Mapping[str, Any]) -> DeletedCertificate:
def get_deleted_certificate(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> DeletedCertificate
"""Retrieves information about the specified deleted certificate.

Retrieves the deleted certificate information plus its attributes,
Expand Down Expand Up @@ -195,7 +199,8 @@ def get_deleted_certificate(self, name: str, **kwargs: Mapping[str, Any]) -> Del
return DeletedCertificate._from_deleted_certificate_bundle(deleted_certificate_bundle=bundle)

@distributed_trace
def purge_deleted_certificate(self, name: str, **kwargs: Mapping[str, Any]) -> None:
def purge_deleted_certificate(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> None
"""Permanently deletes the specified deleted certificate.

Performs an irreversible deletion of the specified certificate, without
Expand All @@ -213,7 +218,8 @@ def purge_deleted_certificate(self, name: str, **kwargs: Mapping[str, Any]) -> N
self._client.purge_deleted_certificate(vault_base_url=self.vault_url, certificate_name=name, **kwargs)

@distributed_trace
def recover_deleted_certificate(self, name: str, **kwargs: Mapping[str, Any]) -> Certificate:
def recover_deleted_certificate(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> Certificate
"""Recovers the deleted certificate back to its current version under
/certificates.

Expand Down Expand Up @@ -243,16 +249,17 @@ def recover_deleted_certificate(self, name: str, **kwargs: Mapping[str, Any]) ->
@distributed_trace
def import_certificate(
self,
name: str,
certificate_bytes: bytes,
password: Optional[str] = None,
policy: Optional[CertificatePolicy] = None,
enabled: Optional[bool] = None,
not_before: Optional[datetime] = None,
expires: Optional[datetime] = None,
tags: Optional[Dict[str, str]] = None,
**kwargs: Mapping[str, Any]
) -> Certificate:
name, # type: str
certificate_bytes, # type: bytes
password=None, # type: Optional[str]
policy=None, # type: Optional[CertificatePolicy]
enabled=None, # type: Optional[bool]
not_before=None, # type: Optional[datetime]
expires=None, # type: Optional[datetime]
tags=None, # type: Optional[Dict[str, str]]
**kwargs # type: Mapping[str, Any]
):
# type: (...) -> Certificate
"""Imports a certificate into a specified key vault.

Imports an existing valid certificate, containing a private key, into
Expand Down Expand Up @@ -304,7 +311,8 @@ def import_certificate(
return Certificate._from_certificate_bundle(certificate_bundle=bundle)

@distributed_trace
def get_policy(self, name: str, **kwargs: Mapping[str, Any]) -> CertificatePolicy:
def get_policy(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> CertificatePolicy
"""Gets the policy for a certificate.

Returns the specified certificate policy resources in the key
Expand All @@ -321,7 +329,8 @@ def get_policy(self, name: str, **kwargs: Mapping[str, Any]) -> CertificatePolic
return CertificatePolicy._from_certificate_policy_bundle(certificate_policy_bundle=bundle)

@distributed_trace
def update_policy(self, name: str, policy: CertificatePolicy, **kwargs: Mapping[str, Any]) -> CertificatePolicy:
def update_policy(self, name, policy, **kwargs) -> CertificatePolicy:
# type: (str, CertificatePolicy, Mapping[str, Any]) -> CertificatePolicy
"""Updates the policy for a certificate.

Set specified members in the certificate policy. Leaves others as null.
Expand All @@ -347,14 +356,15 @@ def update_policy(self, name: str, policy: CertificatePolicy, **kwargs: Mapping[
@distributed_trace
def update_certificate(
self,
name: str,
version: Optional[str] = None,
not_before: Optional[datetime] = None,
expires: Optional[datetime] = None,
enabled: Optional[bool] = None,
tags: Optional[Dict[str, str]] = None,
**kwargs: Mapping[str, Any]
) -> Certificate:
name, # type: str
version=None, # type: Optional[str]
not_before=None, # type: Optional[datetime]
expires=None, # type: Optional[datetime]
enabled=None, # type: Optional[bool]
tags=None, # type: Optional[Dict[str, str]]
**kwargs # type: Mapping[str, Any]
):
# type: (...) -> Certificate
"""Updates the specified attributes associated with the given certificate.

The UpdateCertificate operation applies the specified update on the
Expand Down Expand Up @@ -405,7 +415,8 @@ def update_certificate(
return Certificate._from_certificate_bundle(certificate_bundle=bundle)

@distributed_trace
def backup_certificate(self, name: str, **kwargs: Mapping[str, Any]) -> bytes:
def backup_certificate(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> bytes
"""Backs up the specified certificate.

Requests that a backup of the specified certificate be downloaded
Expand Down Expand Up @@ -436,7 +447,8 @@ def backup_certificate(self, name: str, **kwargs: Mapping[str, Any]) -> bytes:
return backup_result.value

@distributed_trace
def restore_certificate(self, backup: bytes, **kwargs: Mapping[str, Any]) -> Certificate:
def restore_certificate(self, backup, **kwargs):
# type: (bytes, Mapping[str, Any]) -> Certificate
"""Restores a backed up certificate to a vault.

Restores a backed up certificate, and all its versions, to a vault.
Expand Down Expand Up @@ -466,7 +478,8 @@ def restore_certificate(self, backup: bytes, **kwargs: Mapping[str, Any]) -> Cer
return Certificate._from_certificate_bundle(certificate_bundle=bundle)

@distributed_trace
def list_deleted_certificates(self, include_pending: Optional[bool] = None, **kwargs: Mapping[str, Any]) -> Iterable[DeletedCertificate]:
def list_deleted_certificates(self, include_pending=None, **kwargs) -> Iterable[DeletedCertificate]:
# type: (Optional[bool], Mapping[str, Any]) -> Iterable[DeletedCertificate]
"""Lists the deleted certificates in the specified vault currently
available for recovery.

Expand Down Expand Up @@ -502,7 +515,8 @@ def list_deleted_certificates(self, include_pending: Optional[bool] = None, **kw
)

@distributed_trace
def list_certificates(self, include_pending: Optional[bool] = None, **kwargs: Mapping[str, Any]) -> Iterable[CertificateBase]:
def list_certificates(self, include_pending=None, **kwargs):
# type: (Optional[bool], Mapping[str, Any]) -> Iterable[CertificateBase]
"""List certificates in the key vault.

The GetCertificates operation returns the set of certificates resources
Expand Down Expand Up @@ -536,7 +550,8 @@ def list_certificates(self, include_pending: Optional[bool] = None, **kwargs: Ma
)

@distributed_trace
def list_certificate_versions(self, name: str, **kwargs: Mapping[str, Any]) -> Iterable[CertificateBase]:
def list_certificate_versions(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> Iterable[CertificateBase]
"""List the versions of a certificate.

The GetCertificateVersions operation returns the versions of a
Expand Down Expand Up @@ -568,7 +583,8 @@ def list_certificate_versions(self, name: str, **kwargs: Mapping[str, Any]) -> I
**kwargs)

@distributed_trace
def create_contacts(self, contacts: Iterable[Contact], **kwargs: Mapping[str, Any]) -> Iterable[Contact]:
def create_contacts(self, contacts, **kwargs):
# type: (Iterable[Contact], Mapping[str, Any]) -> Iterable[Contact]
"""Sets the certificate contacts for the key vault.

Sets the certificate contacts for the key vault. This
Expand All @@ -585,7 +601,8 @@ def create_contacts(self, contacts: Iterable[Contact], **kwargs: Mapping[str, An
return (Contact._from_certificate_contacts_item(contact_item=item) for item in bundle.contact_list)

@distributed_trace
def get_contacts(self, **kwargs: Mapping[str, Any]) -> Iterable[Contact]:
def get_contacts(self, **kwargs):
# type: (Mapping[str, Any]) -> Iterable[Contact]
"""Gets the certificate contacts for the key vault.

Returns the set of certificate contact resources in the specified
Expand All @@ -599,7 +616,8 @@ def get_contacts(self, **kwargs: Mapping[str, Any]) -> Iterable[Contact]:
return (Contact._from_certificate_contacts_item(contact_item=item) for item in pages.contact_list)

@distributed_trace
def delete_contacts(self, **kwargs: Mapping[str, Any]) -> Iterable[Contact]:
def delete_contacts(self, **kwargs):
# type: (Mapping[str, Any]) -> Iterable[Contact]
"""Deletes the certificate contacts for the key vault.

Deletes the certificate contacts for the key vault certificate.
Expand All @@ -614,7 +632,8 @@ def delete_contacts(self, **kwargs: Mapping[str, Any]) -> Iterable[Contact]:
return (Contact._from_certificate_contacts_item(contact_item=item) for item in bundle.contact_list)

@distributed_trace
def get_certificate_operation(self, name: str, **kwargs: Mapping[str, Any]) -> CertificateOperation:
def get_certificate_operation(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> CertificateOperation
"""Gets the creation operation of a certificate.

Gets the creation operation associated with a specified certificate.
Expand All @@ -632,7 +651,8 @@ def get_certificate_operation(self, name: str, **kwargs: Mapping[str, Any]) -> C
return CertificateOperation._from_certificate_operation_bundle(certificate_operation_bundle=bundle)

@distributed_trace
def delete_certificate_operation(self, name: str, **kwargs: Mapping[str, Any]) -> CertificateOperation:
def delete_certificate_operation(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> CertificateOperation
"""Deletes the creation operation for a specific certificate.

Deletes the creation operation for a specified certificate that is in
Expand All @@ -650,7 +670,8 @@ def delete_certificate_operation(self, name: str, **kwargs: Mapping[str, Any]) -
return CertificateOperation._from_certificate_operation_bundle(certificate_operation_bundle=bundle)

@distributed_trace
def cancel_certificate_operation(self, name: str, **kwargs: Mapping[str, Any]) -> CertificateOperation:
def cancel_certificate_operation(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> CertificateOperation
"""Updates a certificate operation.

Updates a certificate creation operation that is already in progress.
Expand All @@ -674,14 +695,15 @@ def cancel_certificate_operation(self, name: str, **kwargs: Mapping[str, Any]) -
@distributed_trace
def merge_certificate(
self,
name: str,
x509_certificates: List[bytearray],
enabled: Optional[bool] = None,
not_before: Optional[datetime] = None,
expires: Optional[datetime] = None,
tags: Optional[Dict[str, str]] = None,
**kwargs: Mapping[str, Any]
) -> Certificate:
name, # type: str
x509_certificates, # type: List[bytearray]
enabled=None, # type: Optional[bool]
not_before=None, # type: Optional[datetime]
expires=None, # type: Optional[datetime]
tags=None, # type: Optional[Dict[str, str]]
**kwargs # type: Mapping[str, Any]
):
# type: (...) -> Certificate
"""Merges a certificate or a certificate chain with a key pair existing on the server.

Performs the merging of a certificate or certificate chain with a key pair currently
Expand Down Expand Up @@ -723,10 +745,11 @@ def merge_certificate(
@distributed_trace
def get_pending_certificate_signing_request(
self,
name: str,
custom_headers: Optional[Dict[str, str]] = None,
**kwargs: Mapping[str, Any]
) -> str:
name, # type: str
custom_headers=None, # type: Optional[Dict[str, str]]
**kwargs # type: Mapping[str, Any]
):
# type: (...) -> str
"""Gets the Base64 pending certificate signing request (PKCS-10).
:param name: The name of the certificate
:type name: str
Expand Down Expand Up @@ -777,7 +800,8 @@ def get_pending_certificate_signing_request(
return deserialized

@distributed_trace
def get_issuer(self, name: str, **kwargs: Mapping[str, Any]) -> Issuer:
def get_issuer(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> Issuer
"""Gets the specified certificate issuer.

Returns the specified certificate issuer resources in the key vault.
Expand All @@ -796,15 +820,16 @@ def get_issuer(self, name: str, **kwargs: Mapping[str, Any]) -> Issuer:
@distributed_trace
def create_issuer(
self,
name: str,
provider: str,
account_id: Optional[str] = None,
password: Optional[str] = None,
organization_id: Optional[str] = None,
admin_details: Optional[List[AdministratorDetails]] = None,
enabled: Optional[bool] = None,
**kwargs: Mapping[str, Any]
) -> Issuer:
name, # type: str,
provider, # type: str,
account_id=None, # type: Optional[str]
password=None, # type: Optional[str]
organization_id=None, # type: Optional[str]
admin_details=None, # type: Optional[List[AdministratorDetails]]
enabled=None, # type: Optional[bool]
**kwargs # type: Mapping[str, Any]
):
# type: (...) -> Issuer
"""Sets the specified certificate issuer.

The SetCertificateIssuer operation adds or updates the specified
Expand Down Expand Up @@ -865,15 +890,16 @@ def create_issuer(
@distributed_trace
def update_issuer(
self,
name: str,
provider: Optional[str] = None,
account_id: Optional[str] = None,
password: Optional[str] = None,
organization_id: Optional[str] = None,
admin_details: Optional[List[AdministratorDetails]] = None,
enabled: Optional[bool] = None,
**kwargs: Mapping[str, Any]
) -> Issuer:
name, # type: str,
provider=None, # type: Optional[str],
account_id=None, # type: Optional[str]
password=None, # type: Optional[str]
organization_id=None, # type: Optional[str]
admin_details=None, # type: Optional[List[AdministratorDetails]]
enabled=None, # type: Optional[bool]
**kwargs # type: Mapping[str, Any]
):
# type: (...) -> Issuer
"""Updates the specified certificate issuer.

Performs an update on the specified certificate issuer entity.
Expand Down Expand Up @@ -931,7 +957,8 @@ def update_issuer(
return Issuer._from_issuer_bundle(issuer_bundle=issuer_bundle)

@distributed_trace
def delete_issuer(self, name: str, **kwargs: Mapping[str, Any]) -> Issuer:
def delete_issuer(self, name, **kwargs):
# type: (str, Mapping[str, Any]) -> Issuer
"""Deletes the specified certificate issuer.

Permanently removes the specified certificate issuer from the vault.
Expand All @@ -948,7 +975,8 @@ def delete_issuer(self, name: str, **kwargs: Mapping[str, Any]) -> Issuer:
return Issuer._from_issuer_bundle(issuer_bundle=issuer_bundle)

@distributed_trace
def list_issuers(self, **kwargs: Mapping[str, Any]) -> Iterable[IssuerBase]:
def list_issuers(self, **kwargs):
# type: (Mapping[str, Any]) -> Iterable[IssuerBase]
"""List certificate issuers for the key vault.

Returns the set of certificate issuer resources in the key
Expand Down