Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
166 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
e6e1aa3
implemented async client
iscai-msft Jul 23, 2019
715151a
added get_pending_csr async implementation
iscai-msft Jul 24, 2019
8b08df8
added distributed_trace_async decorator
iscai-msft Jul 24, 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
f59da85
made lists not async
iscai-msft Jul 24, 2019
91a6206
list testing passes
iscai-msft Jul 25, 2019
2cc9966
got rid of unnecessary variables
iscai-msft Jul 24, 2019
b73ab20
fixed import statements
iscai-msft Jul 25, 2019
f4d0061
fixed merge conflict
iscai-msft Jul 25, 2019
2a71649
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into c…
iscai-msft Jul 25, 2019
b40c0ad
fixed transport error, still have contacts error
iscai-msft Jul 25, 2019
1e0a445
all pass but merge and async request in playback
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
70c0945
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Jul 26, 2019
6d6095d
implemented charles' comments
iscai-msft Jul 26, 2019
25e231c
added distributed trace decorators
iscai-msft Jul 26, 2019
cd579a2
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Jul 26, 2019
ba62e63
samples running in asyncio loop, not passing
iscai-msft Jul 26, 2019
95e4ffa
integrated core changes
iscai-msft Jul 26, 2019
7949b24
included async client exposure
iscai-msft Jul 26, 2019
4df00d6
samples running
iscai-msft Jul 26, 2019
e96ba8c
fixed import statement
iscai-msft Jul 26, 2019
a61674c
fixed import statements
iscai-msft Jul 26, 2019
77cf453
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
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
b3f64ec
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 2, 2019
82e03b8
fixed docstring
iscai-msft Aug 2, 2019
b0e01df
async_request_cancellation_and_deletion now passing in playback
iscai-msft Aug 2, 2019
8d6f30e
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 2, 2019
da7537d
cleaned up async request test
iscai-msft Aug 5, 2019
4c759fb
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 5, 2019
86a061f
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into c…
iscai-msft Aug 5, 2019
74722da
async request test works in playback, added challenged based auth
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
be3a83c
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 5, 2019
e6a519d
renamed client and models file
iscai-msft Aug 5, 2019
db85bbd
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 5, 2019
d2676bf
renamed async client file
iscai-msft Aug 5, 2019
dd1271a
fixed imports
iscai-msft Aug 5, 2019
b5198bc
removed keyvaultid module
iscai-msft Aug 5, 2019
b9e3f32
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 5, 2019
8b37c4e
removed references to keyvaultid module
iscai-msft Aug 5, 2019
ddb76a2
added check if none for admin details
iscai-msft Aug 6, 2019
bcfc179
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 6, 2019
45d2d6d
added examples to docstrings
iscai-msft Aug 6, 2019
fd06b29
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 6, 2019
16b6e11
fixed get certificate example
iscai-msft Aug 6, 2019
4d9aed4
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 6, 2019
63371e5
added examples in docstrings
iscai-msft Aug 6, 2019
918b556
removed samples testing
iscai-msft Aug 6, 2019
43c8682
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 6, 2019
37b72d0
added challenge auth testing
iscai-msft Aug 6, 2019
3cbd714
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 6, 2019
3777fc6
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
13d85a7
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 9, 2019
05bb7f3
pylint on aio done except exceptions
iscai-msft Aug 12, 2019
ce7fe78
pylinting
iscai-msft Aug 12, 2019
56c5a48
pylinted samples
iscai-msft Aug 12, 2019
6ff1bdb
passing pylint
iscai-msft Aug 16, 2019
73d3fbf
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
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
69ddc9f
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 16, 2019
e5abe2f
changing san_dns_names
iscai-msft Aug 16, 2019
c58b315
updating recordings with new san DNS names
iscai-msft Aug 16, 2019
5444cfe
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
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
3f56d26
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 21, 2019
2987092
async clean after Krista's pylint changes
iscai-msft Aug 21, 2019
91951af
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into k…
iscai-msft Aug 22, 2019
783199e
trying to add backup restore test
iscai-msft Aug 22, 2019
1f92178
added backup restore test, passing
iscai-msft Aug 22, 2019
425db1c
Merge branch 'keyvault-certs' of github.com:iscai-msft/azure-sdk-for-…
iscai-msft Aug 22, 2019
1dcb7ef
added backup restore test
iscai-msft Aug 22, 2019
546676f
got rid of unnecessary waiting and print statements
iscai-msft Aug 23, 2019
7c85af6
fixed small errors in readme
iscai-msft Aug 23, 2019
981d2ca
fixed samples commenting
iscai-msft Aug 23, 2019
f3a3ed4
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into c…
iscai-msft Aug 26, 2019
b17354d
fixing mypy issues
iscai-msft Aug 26, 2019
c114701
added new seed testing
iscai-msft Aug 26, 2019
88ef59b
working on merge certificate test
iscai-msft Aug 27, 2019
46263b5
got rid of not before and expires
iscai-msft Aug 27, 2019
5cc2a75
got rid of not before and expires
iscai-msft Aug 27, 2019
4b5722c
added Charles' comments from other pylint pr
iscai-msft Aug 27, 2019
deefd92
added SecretContentType enum for CertificatePolicy
iscai-msft Aug 27, 2019
cfc8444
added KeyUsageType enum
iscai-msft Aug 28, 2019
ad4db88
added default policy, tests passing
iscai-msft Aug 28, 2019
b98e47c
before switching to shell commands
iscai-msft Aug 29, 2019
fdbce63
using shell commands
iscai-msft Aug 29, 2019
359ebbf
Revert "using shell commands"
iscai-msft Aug 29, 2019
7120f72
merge certificate passing!!!!
iscai-msft Aug 29, 2019
f63d97a
added seeding, all tests passing
iscai-msft Aug 29, 2019
dccd338
Merge branch 'certs-async' of github.com:iscai-msft/azure-sdk-for-pyt…
iscai-msft Aug 29, 2019
6b14fe1
fixed weird conflict error
iscai-msft Aug 29, 2019
17b49ae
fixing dev requirements and test to pass ci
iscai-msft Aug 29, 2019
59bda52
removed itertools to be compatible with python 2.7
iscai-msft Aug 29, 2019
b3709ab
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into c…
iscai-msft Aug 29, 2019
6aaee8b
reset changes to mgmt plane test
iscai-msft Aug 29, 2019
2a5516c
changed default certificate policy
iscai-msft Aug 29, 2019
3fe5db7
getting rid of erroneous certificate policy model change
iscai-msft Aug 29, 2019
9fb3745
implemented lro for create certificate, all tests passing
iscai-msft Aug 30, 2019
c2d584e
implemented Charles' suggestions
iscai-msft Aug 30, 2019
c6ae595
implemented Charles' comments
iscai-msft Sep 3, 2019
b7d3d24
moved sans to kwargs, added comments to models
iscai-msft Sep 3, 2019
c18a9a1
fixed links in samples
iscai-msft Sep 3, 2019
80d189d
Merge remote-tracking branch 'origin/master' into certs-async
iscai-msft Sep 3, 2019
eb7922c
Merge branch 'master' of github.com:Azure/azure-sdk-for-python into c…
iscai-msft Sep 4, 2019
b2fb410
fixed typing error, awaited all async pollers
iscai-msft Sep 4, 2019
a681e89
updated lowerbound for azure core version
iscai-msft Sep 4, 2019
901dcae
fixed linting errors
iscai-msft Sep 4, 2019
c820f00
updated readme
iscai-msft Sep 4, 2019
98ff072
parsing out certificate id in poller
iscai-msft Sep 4, 2019
5e4d99e
added model imports in aio init
iscai-msft Sep 4, 2019
6b4a33a
fixed init files to just use models passed to methods
iscai-msft Sep 4, 2019
84ced76
fixed enum conversion and import statements
iscai-msft Sep 4, 2019
1840071
split get_certificate into one with version and one with policy
iscai-msft Sep 4, 2019
390e692
fixed docstrings, added ResourceNotFoundError and ResourceExistError …
iscai-msft Sep 5, 2019
1e9bf73
fixed linting error
iscai-msft Sep 5, 2019
960a9b4
reordered logic in conftest for RUN_IDENTIFIER
iscai-msft Sep 5, 2019
69808a4
reverted SecretContentType types and get_pending_csr
iscai-msft Sep 5, 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
got rid of not before and expires
  • Loading branch information
iscai-msft committed Aug 27, 2019
commit 46263b5a3d1ff2e0f30a342e326255d0c4b361bb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ async def create_certificate(
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:
Expand All @@ -62,10 +60,6 @@ async def create_certificate(
~azure.security.keyvault.certificates._models.CertificatePolicy
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date of the secret in UTC
:type not_before: datetime.datetime
:param expires: Expiry date of the secret in UTC.
:type expires: datetime.datetime
:param tags: Application specific metadata in the form of key-value pairs.
:type tags: dict(str, str)
:returns: The created CertificateOperation
Expand All @@ -81,11 +75,9 @@ async def create_certificate(
:caption: Create a certificate
:dedent: 8
"""
if enabled is not None or not_before is not None or expires is not None:
if enabled is not None:
attributes = self._client.models.CertificateAttributes(
enabled=enabled,
not_before=not_before,
expires=expires
enabled=enabled
)
else:
attributes = None
Expand Down Expand Up @@ -259,8 +251,6 @@ async def import_certificate(
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:
Expand All @@ -285,19 +275,15 @@ async def import_certificate(
~azure.security.keyvault.v7_0.models.CertificatePolicy
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date of the secret in UTC
:type not_before: datetime.datetime
:param expires: Expiry date of the secret in UTC.
:type expires: datetime.datetime
:param tags: Application specific metadata in the form of key-value
pairs.
:type tags: dict[str, str]
:returns: The imported Certificate
:rtype: ~azure.security.keyvault.certificates._models.Certificate
"""
if enabled is not None or not_before is not None or expires is not None:
if enabled is not None:
attributes = self._client.models.CertificateAttributes(
enabled=enabled, not_before=not_before, expires=expires
enabled=enabled
)
else:
attributes = None
Expand Down Expand Up @@ -369,8 +355,6 @@ async 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]
Expand All @@ -386,10 +370,6 @@ async def update_certificate(
:type name: str
:param version: The version of the certificate.
:type version: str
:param not_before: Not before date of the secret in UTC
:type not_before: datetime.datetime
:param expires: Expiry date of the secret in UTC.
:type expires: datetime.datetime
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param tags: Application specific metadata in the form of key-value pairs.
Expand All @@ -407,9 +387,9 @@ async def update_certificate(
:caption: Update a certificate's attributes
:dedent: 8
"""
if enabled is not None or not_before is not None or expires is not None:
if enabled is not None:
attributes = self._client.models.CertificateAttributes(
enabled=enabled, not_before=not_before, expires=expires
enabled=enabled
)
else:
attributes = None
Expand Down Expand Up @@ -780,8 +760,6 @@ async def merge_certificate(
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:
Expand All @@ -796,20 +774,16 @@ async def merge_certificate(
:type x509_certificates: list[bytearray]
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date of the secret in UTC
:type not_before: datetime.datetime
:param expires: Expiry date of the secret in UTC.
:type expires: datetime.datetime
:param tags: Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:return: The merged certificate operation
:rtype: ~azure.security.keyvault.certificates._models.CertificateOperation
:raises:
:class:`KeyVaultErrorException<azure.keyvault.v7_0.models.KeyVaultErrorException>`
"""
if enabled is not None or not_before is not None or expires is not None:
if enabled is not None:
attributes = self._client.models.CertificateAttributes(
enabled=enabled, not_before=not_before, expires=expires
enabled=enabled
)
else:
attributes = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import base64
import uuid
from typing import Any, Dict, List, Mapping, Optional, Iterable
from datetime import datetime
from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError
from azure.core.tracing.decorator import distributed_trace

Expand Down Expand Up @@ -45,8 +44,6 @@ def create_certificate(
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]
):
Expand All @@ -62,10 +59,6 @@ def create_certificate(
:type policy:
~azure.security.keyvault.certificates._models.CertificatePolicy
:param bool enabled: Determines whether the object is enabled.
:param not_before: Not before date of the secret in UTC
:type not_before: datetime.datetime
:param expires: Expiry date of the secret in UTC.
:type expires: datetime.datetime
:param tags: Application specific metadata in the form of key-value pairs.
:type tags: dict(str, str)
:returns: The created CertificateOperation
Expand All @@ -82,11 +75,9 @@ def create_certificate(
:dedent: 8
"""

if enabled is not None or not_before is not None or expires is not None:
if enabled is not None:
attributes = self._client.models.CertificateAttributes(
enabled=enabled,
not_before=not_before,
expires=expires
enabled=enabled
)
else:
attributes = None
Expand Down Expand Up @@ -260,8 +251,6 @@ def import_certificate(
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]
):
Expand All @@ -287,19 +276,15 @@ def import_certificate(
~azure.security.keyvault.v7_0.models.CertificatePolicy
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date of the secret in UTC
:type not_before: datetime.datetime
:param expires: Expiry date of the secret in UTC.
:type expires: datetime.datetime
:param tags: Application specific metadata in the form of key-value
pairs.
:type tags: dict[str, str]
:returns: The imported Certificate
:rtype: ~azure.security.keyvault.certificates._models.Certificate
"""
if enabled is not None or not_before is not None or expires is not None:
if enabled is not None:
attributes = self._client.models.CertificateAttributes(
enabled=enabled, not_before=not_before, expires=expires
enabled=enabled
)
else:
attributes = None
Expand Down Expand Up @@ -364,8 +349,6 @@ def update_certificate(
self,
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]
Expand All @@ -382,10 +365,6 @@ def update_certificate(
:type name: str
:param version: The version of the certificate.
:type version: str
:param not_before: Not before date of the secret in UTC
:type not_before: datetime.datetime
:param expires: Expiry date of the secret in UTC.
:type expires: datetime.datetime
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param tags: Application specific metadata in the form of key-value pairs.
Expand All @@ -403,9 +382,9 @@ def update_certificate(
:caption: Update a certificate's attributes
:dedent: 8
"""
if enabled is not None or not_before is not None or expires is not None:
if enabled is not None :
attributes = self._client.models.CertificateAttributes(
enabled=enabled, not_before=not_before, expires=expires
enabled=enabled
)
else:
attributes = None
Expand Down Expand Up @@ -711,8 +690,6 @@ def merge_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]
):
Expand All @@ -728,20 +705,16 @@ def merge_certificate(
:type x509_certificates: list[bytearray]
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date of the secret in UTC
:type not_before: datetime.datetime
:param expires: Expiry date of the secret in UTC.
:type expires: datetime.datetime
:param tags: Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:return: The merged certificate
:rtype: ~azure.security.keyvault.certificates._models.Certificate
:raises:
:class:`KeyVaultErrorException<azure.keyvault.v7_0.models.KeyVaultErrorException>`
"""
if enabled is not None or not_before is not None or expires is not None:
if enabled is not None:
attributes = self._client.models.CertificateAttributes(
enabled=enabled, not_before=not_before, expires=expires
enabled=enabled
)
else:
attributes = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def test_example_certificate_crud_operations(self, vault_client, **kwargs):

certificate_client = vault_client.certificates
# [START create_certificate]
from dateutil import parser as date_parse
from azure.keyvault.certificates import CertificatePolicy, KeyProperties
import time
# specify the certificate policy
Expand All @@ -52,11 +51,8 @@ def test_example_certificate_crud_operations(self, vault_client, **kwargs):
validity_in_months=24
)

expires = date_parse.parse("2050-02-02T08:00:00.000Z")

# create a certificate with optional arguments, returns a certificate operation that is creating the certificate
certificate_operation = certificate_client.create_certificate(name="cert-name", policy=cert_policy,
expires=expires)
certificate_operation = certificate_client.create_certificate(name="cert-name", policy=cert_policy)

print(certificate_operation.name)
print(certificate_operation.id)
Expand All @@ -81,7 +77,6 @@ def test_example_certificate_crud_operations(self, vault_client, **kwargs):

print(certificate.id)
print(certificate.name)
print(certificate.expires)
print(certificate.policy.key_properties.exportable)
print(certificate.policy.key_properties.key_type)
print(certificate.policy.key_properties.key_size)
Expand All @@ -96,13 +91,11 @@ def test_example_certificate_crud_operations(self, vault_client, **kwargs):
# [START update_certificate]

# update attributes of an existing certificate
expires = date_parse.parse("2050-01-02T08:00:00.000Z")
tags = {"foo": "updated tag"}
updated_certificate = certificate_client.update_certificate(name=certificate.name, expires=expires, tags=tags)
updated_certificate = certificate_client.update_certificate(name=certificate.name, tags=tags)

print(updated_certificate.version)
print(updated_certificate.updated)
print(updated_certificate.expires)
print(updated_certificate.tags)

# [END update_certificate]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ async def test_example_certificate_crud_operations(self, vault_client, **kwargs)
import asyncio
certificate_client = vault_client.certificates
# [START create_certificate]
from dateutil import parser as date_parse
from azure.keyvault.certificates import CertificatePolicy, KeyProperties
# specify the certificate policy
cert_policy = CertificatePolicy(key_properties=KeyProperties(exportable=True,
Expand All @@ -49,10 +48,8 @@ async def test_example_certificate_crud_operations(self, vault_client, **kwargs)
validity_in_months=24
)

expires = date_parse.parse("2050-02-02T08:00:00.000Z")

# create a certificate with optional arguments, returns a certificate operation that is creating the certificate
certificate_operation = await certificate_client.create_certificate(name="cert-name", policy=cert_policy, expires=expires)
certificate_operation = await certificate_client.create_certificate(name="cert-name", policy=cert_policy)

print(certificate_operation.name)
print(certificate_operation.id)
Expand All @@ -78,7 +75,6 @@ async def test_example_certificate_crud_operations(self, vault_client, **kwargs)

print(certificate.id)
print(certificate.name)
print(certificate.expires)
print(certificate.policy.key_properties.exportable)
print(certificate.policy.key_properties.key_type)
print(certificate.policy.key_properties.key_size)
Expand All @@ -93,13 +89,11 @@ async def test_example_certificate_crud_operations(self, vault_client, **kwargs)
# [START update_certificate]

# update attributes of an existing certificate
expires = date_parse.parse("2050-01-02T08:00:00.000Z")
tags = {"foo": "updated tag"}
updated_certificate = await certificate_client.update_certificate(certificate.name, expires=expires, tags=tags)
updated_certificate = await certificate_client.update_certificate(certificate.name, tags=tags)

print(updated_certificate.version)
print(updated_certificate.updated)
print(updated_certificate.expires)
print(updated_certificate.tags)

# [END update_certificate]
Expand Down Expand Up @@ -162,7 +156,6 @@ async def test_example_certificate_list_operations(self, vault_client, **kwargs)
print(certificate.id)
print(certificate.updated)
print(certificate.version)
print(certificate.expires)

# [END list_certificate_versions]
# [START list_deleted_certificates]
Expand Down