Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion sdk/keyvault/azure-keyvault-certificates/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Release History

## 4.0.0b5

### Breaking changes
- Removed redundant method `get_pending_certificate_signing_request()`. A pending CSR can be retrieved via `get_certificate_operation()`.

## 4.0.0b4 (2019-10-08)
### Breaking changes
Expand All @@ -17,6 +18,7 @@ for details.
- The `vault_url` parameter of `CertificateClient` has been renamed to `vault_endpoint`
- The property `vault_url` has been renamed to `vault_endpoint` in all models


## 4.0.0b3 (2019-09-11)
Version 4.0.0b3 is the first preview of our efforts to create a user-friendly and Pythonic client library for Azure Key Vault's certificates.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# ------------------------------------
# pylint:disable=too-many-lines,too-many-public-methods
import base64
import uuid
from typing import Any, AsyncIterable, Optional, Iterable, List, Dict, Coroutine
from functools import partial

Expand Down Expand Up @@ -705,58 +704,6 @@ async def cancel_certificate_operation(self, name: str, **kwargs: "**Any") -> Ce
)
return CertificateOperation._from_certificate_operation_bundle(certificate_operation_bundle=bundle)

@distributed_trace_async
async def get_pending_certificate_signing_request(
self, name: str, custom_headers: Optional[Dict[str, str]] = None, **kwargs: "**Any"
) -> str:
"""Gets the Base64 pending certificate signing request (PKCS-10).

:param str name: The name of the certificate
:param custom_headers: headers that will be added to the request
:type custom_headers: dict[str, str]
:return: Base64 encoded pending certificate signing request (PKCS-10).
:rtype: str
:raises: :class:`~azure.core.exceptions.HttpResponseError`
"""
vault_base_url = self.vault_endpoint
# Construct URL
url = "/certificates/{certificate-name}/pending"
path_format_arguments = {
"vaultBaseUrl": self._client._serialize.url("vault_base_url", vault_base_url, "str", skip_quote=True),
"certificate-name": self._client._serialize.url("certificate_name", name, "str"),
}
url = self._client._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters["api-version"] = self._client._serialize.query(
name="self.api_version", data=self._client.api_version, data_type="str"
)

# Construct headers
header_parameters = {}
header_parameters["Accept"] = "application/pkcs10"
if self._client._config.generate_client_request_id:
header_parameters["x-ms-client-request-id"] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)

# Construct and send request
request = self._client._client.get(url=url, params=query_parameters, headers=header_parameters)
pipeline_response = await self._client._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

if response.status_code not in [200]:
self._client.map_error(status_code=response.status_code, response=response, error_map=_error_map)
raise self._client.models.KeyVaultErrorException(response, self._client._deserialize)

deserialized = None

if response.status_code == 200:
deserialized = response.body() if hasattr(response, "body") else response.content

return deserialized

@distributed_trace_async
async def merge_certificate(self, name: str, x509_certificates: List[bytearray], **kwargs: "**Any") -> Certificate:
"""Merges a certificate or a certificate chain with a key pair existing on the server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# ------------------------------------
# pylint:disable=too-many-lines,too-many-public-methods
import base64
import uuid
from functools import partial

from azure.core.polling import LROPoller
Expand Down Expand Up @@ -765,59 +764,6 @@ def merge_certificate(
)
return Certificate._from_certificate_bundle(certificate_bundle=bundle)

@distributed_trace
def get_pending_certificate_signing_request(
self,
name, # type: str
**kwargs # type: **Any
):
# type: (...) -> str
"""Gets the Base64 pending certificate signing request (PKCS-10).

:param str name: The name of the certificate
:param custom_headers: headers that will be added to the request
:type custom_headers: dict[str, str]
:return: Base64 encoded pending certificate signing request (PKCS-10).
:rtype: str
:raises: :class:`~azure.core.exceptions.HttpResponseError`
"""
vault_base_url = self.vault_endpoint
# Construct URL
url = "/certificates/{certificate-name}/pending"
path_format_arguments = {
"vaultBaseUrl": self._client._serialize.url("vault_base_url", vault_base_url, "str", skip_quote=True),
"certificate-name": self._client._serialize.url("certificate_name", name, "str"),
}
url = self._client._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters["api-version"] = self._client._serialize.query(
name="self.api_version", data=self._client.api_version, data_type="str"
)

# Construct headers
header_parameters = {}
header_parameters["Accept"] = "application/pkcs10"
if self._client._config.generate_client_request_id:
header_parameters["x-ms-client-request-id"] = str(uuid.uuid1())

# Construct and send request
request = self._client._client.get(url=url, params=query_parameters, headers=header_parameters)
pipeline_response = self._client._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

if response.status_code not in [200]:
self._client.map_error(status_code=response.status_code, response=response, error_map=_error_map)
raise self._client.models.KeyVaultErrorException(response, self._client._deserialize)

deserialized = None

if response.status_code == 200:
deserialized = response.body() if hasattr(response, "body") else response.content

return deserialized

@distributed_trace
def get_issuer(self, name, **kwargs):
# type: (str, **Any) -> Issuer
Expand Down
Loading