Skip to content
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b0cc027
regen
cperaltah Jul 7, 2025
478d508
add default cert endpoint with tsp
cperaltah Jul 17, 2025
8fb5012
remove refs to old namespace
cperaltah Jul 17, 2025
6aacc9f
update async operation patch
cperaltah Jul 18, 2025
59c4561
fix operations patch
cperaltah Jul 19, 2025
3e5a2b6
fix header impl
cperaltah Jul 19, 2025
8d41c41
more header fixes
cperaltah Jul 19, 2025
3798c78
revert receipt directory removal
cperaltah Jul 22, 2025
45d6331
cspell
cperaltah Jul 22, 2025
75cf5fc
regen certificates under correct namespace
cperaltah Jul 24, 2025
791dcd7
regen ledger client
cperaltah Jul 24, 2025
0d1fe9f
update namespace name
cperaltah Jul 24, 2025
8077715
revert certificate change
cperaltah Jul 24, 2025
565616d
update shared files after regen
cperaltah Jul 24, 2025
2b7087b
updates
cperaltah Jul 24, 2025
49553eb
delete extra files
cperaltah Jul 24, 2025
f710421
cspell
cperaltah Jul 28, 2025
8b96906
match return type to current behavior
cperaltah Jul 29, 2025
ab4c755
cspell
cperaltah Jul 29, 2025
6351ead
mypy
cperaltah Jul 29, 2025
4fc6c71
pylint
cperaltah Jul 29, 2025
061a7f0
update docs
cperaltah Jul 29, 2025
a696a8d
regen
cperaltah Jul 29, 2025
0028d3e
regen
cperaltah Jul 29, 2025
3774f80
fix patch
cperaltah Jul 29, 2025
6c6f63a
Revert "mypy"
cperaltah Jul 29, 2025
d2d2a0f
add info in tsp_location.yaml
cperaltah Aug 1, 2025
85b6c32
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
cperaltah Aug 12, 2025
69d8bf1
regen
cperaltah Aug 12, 2025
a559ed0
update patch files
cperaltah Aug 12, 2025
5967467
update patch files
cperaltah Aug 13, 2025
1b2d6fd
fix patch
cperaltah Aug 13, 2025
07e00ea
update patch files
cperaltah Aug 15, 2025
0d2eb39
regen
cperaltah Aug 22, 2025
eedb7f9
update tsp-location.yaml
cperaltah Aug 22, 2025
737f08a
generate certificate client
cperaltah Aug 22, 2025
5ea8070
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
cperaltah Aug 23, 2025
0476f0a
update patch files
cperaltah Aug 27, 2025
c535d46
fixes
cperaltah Aug 30, 2025
c01e738
regen clients
cperaltah Sep 9, 2025
18f7ec2
update pyproject.toml deps
cperaltah Sep 12, 2025
7a31639
update assets
cperaltah Sep 19, 2025
c9e1eef
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
cperaltah Sep 24, 2025
24453b2
regen
cperaltah Sep 24, 2025
3ca67c0
revert test change
cperaltah Sep 24, 2025
a57481a
nit
cperaltah Sep 24, 2025
b6f16ab
fix test input
cperaltah Sep 25, 2025
0fb76c7
regen with new model
cperaltah Sep 25, 2025
9938cac
update tests
cperaltah Sep 25, 2025
be3166e
update tests
cperaltah Sep 25, 2025
16d54d9
apiview props
cperaltah Sep 25, 2025
7688120
regen
cperaltah Sep 26, 2025
9a2fb64
update tests
cperaltah Sep 26, 2025
4e01709
update assets
cperaltah Sep 26, 2025
e5dab85
apiview props
cperaltah Sep 26, 2025
48fd9f1
temp relative package updates
cperaltah Sep 26, 2025
45f2ce0
fix name
cperaltah Sep 26, 2025
5481087
fix ledger ci (#43181)
catalinaperalta Oct 1, 2025
f09abca
rm certificate files
cperaltah Oct 7, 2025
0105b75
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
cperaltah Oct 14, 2025
cc44fba
update changelog
cperaltah Oct 14, 2025
6a468e0
misc fixes
cperaltah Oct 14, 2025
aa2aac2
update shared reqs
cperaltah Oct 15, 2025
dd41d57
test
cperaltah Oct 15, 2025
860e7d5
pylint
cperaltah Oct 17, 2025
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
8 changes: 8 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1766,6 +1766,14 @@
"Onvif"
]
},
{
"filename": "sdk/confidentialledger/azure-confidentialledger/**",
"words": [
"mrenclave",
"MRENCLAVE",
"oeverify"
]
},
{
"filename": "sdk/confidentialledger/azure-confidentialledger/azure/confidentialledger/_operations/*.py",
"words": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History

## 1.0.0b1 (TBD)

- Initial version
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include *.md
include LICENSE
include azure/confidentialledger/certificate/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include azure/__init__.py
include azure/confidentialledger/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Confidential Ledger Certificate client library for Python

The Confidential Ledger Certificate client library is used to retrieve the TLS certificate required for connecting to a Confidential Ledger.

## Getting started

### Install the package

```bash
python -m pip install azure-confidentialledger-certificate
```

#### Prequisites

- Python 3.9 or later is required to use this package.
- You need an [Azure subscription][azure_sub] to use this package.
- An existing Confidential Ledger Certificate instance.

## 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 opencode@microsoft.com with any
additional questions or comments.

<!-- LINKS -->

[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
[azure_identity_pip]: https://pypi.org/project/azure-identity/
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
[pip]: https://pypi.org/project/pip/
[azure_sub]: https://azure.microsoft.com/free/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"apiVersion": "2024-12-09-preview"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"CrossLanguagePackageId": "ConfidentialLedgerCertificate",
"CrossLanguageDefinitionId": {
"azure.confidentialledger.certificate.models.ConfidentialLedgerError": "ConfidentialLedgerCommon.ConfidentialLedgerError",
"azure.confidentialledger.certificate.models.ConfidentialLedgerErrorBody": "ConfidentialLedgerCommon.ConfidentialLedgerErrorBody",
"azure.confidentialledger.certificate.models.LedgerIdentityInformation": "ConfidentialLedgerCertificate.LedgerIdentityInformation",
"azure.confidentialledger.certificate.ConfidentialLedgerCertificateClient.get_ledger_identity": "ConfidentialLedgerCertificate.getLedgerIdentity",
"azure.confidentialledger.certificate.aio.ConfidentialLedgerCertificateClient.get_ledger_identity": "ConfidentialLedgerCertificate.getLedgerIdentity"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand All @@ -15,27 +15,32 @@
from azure.core.rest import HttpRequest, HttpResponse

from ._configuration import ConfidentialLedgerCertificateClientConfiguration
from ._operations import ConfidentialLedgerCertificateClientOperationsMixin
from ._operations import _ConfidentialLedgerCertificateClientOperationsMixin
from ._utils.serialization import Deserializer, Serializer


class ConfidentialLedgerCertificateClient(ConfidentialLedgerCertificateClientOperationsMixin):
"""The ConfidentialLedgerCertificateClient is used to retrieve the TLS certificate required for
connecting to a Confidential Ledger.
class ConfidentialLedgerCertificateClient(_ConfidentialLedgerCertificateClientOperationsMixin):
"""The Confidential Ledger Certificate endpoint is used to retrieve the TLS certificate
required for connecting to a Confidential Ledger.

:param endpoint: The certificate endpoint (or "Identity Service Endpoint" in the Azure portal),
for example https://identity.confidential-ledger.core.azure.com. Required.
:type endpoint: str
:keyword api_version: Api Version. Default value is "2024-12-09-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword certificate_endpoint: The certificate endpoint (or "Identity Service Endpoint" in the
Azure portal), for example `https://identity.confidential-ledger.core.azure.com
<https://identity.confidential-ledger.core.azure.com>`_. Default value is
"https://identity.confidential-ledger.core.azure.com".
:paramtype certificate_endpoint: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-12-09-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
"""

def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, endpoint: str, **kwargs: Any
self, *, certificate_endpoint: str = "https://identity.confidential-ledger.core.azure.com", **kwargs: Any
) -> None:
_endpoint = "{endpoint}"
self._config = ConfidentialLedgerCertificateClientConfiguration(endpoint=endpoint, **kwargs)
_endpoint = "{certificateEndpoint}"
self._config = ConfidentialLedgerCertificateClientConfiguration(
certificate_endpoint=certificate_endpoint, **kwargs
)

_policies = kwargs.pop("policies", None)
if _policies is None:
Expand Down Expand Up @@ -80,7 +85,9 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:

request_copy = deepcopy(request)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
"certificateEndpoint": self._serialize.url(
"self._config.certificate_endpoint", self._config.certificate_endpoint, "str", skip_quote=True
),
}

request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand All @@ -19,21 +19,23 @@ class ConfidentialLedgerCertificateClientConfiguration: # pylint: disable=too-m
Note that all parameters used to create this instance are saved as instance
attributes.

:param endpoint: The certificate endpoint (or "Identity Service Endpoint" in the Azure portal),
for example https://identity.confidential-ledger.core.azure.com. Required.
:type endpoint: str
:keyword api_version: Api Version. Default value is "2024-12-09-preview". Note that overriding
this default value may result in unsupported behavior.
:param certificate_endpoint: The certificate endpoint (or "Identity Service Endpoint" in the
Azure portal), for example `https://identity.confidential-ledger.core.azure.com
<https://identity.confidential-ledger.core.azure.com>`_. Default value is
"https://identity.confidential-ledger.core.azure.com".
:type certificate_endpoint: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-12-09-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
"""

def __init__(self, endpoint: str, **kwargs: Any) -> None:
def __init__(
self, certificate_endpoint: str = "https://identity.confidential-ledger.core.azure.com", **kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2024-12-09-preview")

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")

self.endpoint = endpoint
self.certificate_endpoint = certificate_endpoint
self.api_version = api_version
kwargs.setdefault("sdk_moniker", "confidentialledger-certificate/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pylint: disable=line-too-long,useless-suppression
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position
Expand All @@ -12,14 +13,12 @@
if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._operations import ConfidentialLedgerCertificateClientOperationsMixin # type: ignore
from ._operations import _ConfidentialLedgerCertificateClientOperationsMixin # type: ignore # pylint: disable=unused-import

from ._patch import __all__ as _patch_all
from ._patch import *
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"ConfidentialLedgerCertificateClientOperationsMixin",
]
__all__ = []
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from collections.abc import MutableMapping
from typing import Any, Callable, Dict, Optional, TypeVar, cast
from typing import Any, Callable, Dict, Optional, TypeVar

from azure.core import PipelineClient
from azure.core.exceptions import (
Expand All @@ -15,18 +15,21 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
StreamClosedError,
StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict

from .. import models as _models
from .._configuration import ConfidentialLedgerCertificateClientConfiguration
from .._utils.model_base import _deserialize, _failsafe_deserialize
from .._utils.serialization import Serializer
from .._utils.utils import ClientMixinABC

JSON = MutableMapping[str, Any]
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]

Expand Down Expand Up @@ -60,30 +63,22 @@ def build_confidential_ledger_certificate_get_ledger_identity_request( # pylint
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)


class ConfidentialLedgerCertificateClientOperationsMixin( # pylint: disable=name-too-long
class _ConfidentialLedgerCertificateClientOperationsMixin(
ClientMixinABC[PipelineClient[HttpRequest, HttpResponse], ConfidentialLedgerCertificateClientConfiguration]
):

@distributed_trace
def get_ledger_identity(self, ledger_id: str, **kwargs: Any) -> JSON:
def get_ledger_identity(self, ledger_id: str, **kwargs: Any) -> _models.LedgerIdentityInformation:
"""Gets identity information for a Confidential Ledger instance.

Gets identity information for a Confidential Ledger instance.

:param ledger_id: Id of the Confidential Ledger instance to get information for. Required.
:type ledger_id: str
:return: JSON object
:rtype: JSON
:return: LedgerIdentityInformation. The LedgerIdentityInformation is compatible with
MutableMapping
:rtype: ~azure.confidentialledger.certificate.models.LedgerIdentityInformation
:raises ~azure.core.exceptions.HttpResponseError:

Example:
.. code-block:: python

# response body for status code(s): 200
response == {
"ledgerTlsCertificate": "str",
"ledgerId": "str"
}
"""
error_map: MutableMapping = {
401: ClientAuthenticationError,
Expand All @@ -96,7 +91,7 @@ def get_ledger_identity(self, ledger_id: str, **kwargs: Any) -> JSON:
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}

cls: ClsType[JSON] = kwargs.pop("cls", None)
cls: ClsType[_models.LedgerIdentityInformation] = kwargs.pop("cls", None)

_request = build_confidential_ledger_certificate_get_ledger_identity_request(
ledger_id=ledger_id,
Expand All @@ -105,27 +100,35 @@ def get_ledger_identity(self, ledger_id: str, **kwargs: Any) -> JSON:
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
"certificateEndpoint": self._serialize.url(
"self._config.certificate_endpoint", self._config.certificate_endpoint, "str", skip_quote=True
),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)

_stream = False
_stream = kwargs.pop("stream", False)
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)

response = pipeline_response.http_response

if response.status_code not in [200]:
if _stream:
try:
response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response)
error = _failsafe_deserialize(_models.ConfidentialLedgerError, response)
raise HttpResponseError(response=response, model=error)

if response.content:
deserialized = response.json()
if _stream:
deserialized = response.iter_bytes()
else:
deserialized = None
deserialized = _deserialize(_models.LedgerIdentityInformation, response.json())

if cls:
return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore
return cls(pipeline_response, deserialized, {}) # type: ignore

return cast(JSON, deserialized) # type: ignore
return deserialized # type: ignore
Loading
Loading