Skip to content
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

[AutoPR azure-attestation] Add data plane support of go SDK in attestation #2163

Closed
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
5 changes: 5 additions & 0 deletions sdk/attestation/azure-attestation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History

## 0.1.0 (1970-01-01)

* Initial Release
4 changes: 4 additions & 0 deletions sdk/attestation/azure-attestation/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py

21 changes: 21 additions & 0 deletions sdk/attestation/azure-attestation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Microsoft Azure SDK for Python

This is the Microsoft Azure MyService Management Client Library.
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).


# Usage

For code examples, see [MyService Management](https://docs.microsoft.com/python/api/overview/azure/)
on docs.microsoft.com.


# Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
section of the project.


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-attestation%2FREADME.png)
1 change: 1 addition & 0 deletions sdk/attestation/azure-attestation/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
19 changes: 19 additions & 0 deletions sdk/attestation/azure-attestation/azure/attestation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._configuration import AttestationClientConfiguration
from ._attestation_client import AttestationClient
__all__ = ['AttestationClient', 'AttestationClientConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import AttestationClientConfiguration
from .operations import PolicyOperations
from .operations import PolicyCertificatesOperations
from .operations import SigningCertificatesOperations
from .operations import MetadataConfigurationOperations
from . import models


class AttestationClient(SDKClient):
"""Describes the interface for the per-tenant enclave service.

:ivar config: Configuration for client.
:vartype config: AttestationClientConfiguration

:ivar policy: Policy operations
:vartype policy: azure.attestation.operations.PolicyOperations
:ivar policy_certificates: PolicyCertificates operations
:vartype policy_certificates: azure.attestation.operations.PolicyCertificatesOperations
:ivar signing_certificates: SigningCertificates operations
:vartype signing_certificates: azure.attestation.operations.SigningCertificatesOperations
:ivar metadata_configuration: MetadataConfiguration operations
:vartype metadata_configuration: azure.attestation.operations.MetadataConfigurationOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
"""

def __init__(
self, credentials):

self.config = AttestationClientConfiguration(credentials)
super(AttestationClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2018-09-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.policy = PolicyOperations(
self._client, self.config, self._serialize, self._deserialize)
self.policy_certificates = PolicyCertificatesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.signing_certificates = SigningCertificatesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.metadata_configuration = MetadataConfigurationOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrestazure import AzureConfiguration

from .version import VERSION


class AttestationClientConfiguration(AzureConfiguration):
"""Configuration for AttestationClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
"""

def __init__(
self, credentials):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
base_url = '{tenantBaseUrl}'

super(AttestationClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

self.add_user_agent('azure-attestation/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

try:
from ._models_py3 import AttestationPolicy
except (SyntaxError, ImportError):
from ._models import AttestationPolicy
from ._attestation_client_enums import (
TeeKind,
)

__all__ = [
'AttestationPolicy',
'TeeKind',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from enum import Enum


class TeeKind(str, Enum):

sgx_enclave = "SgxEnclave" #: Intel Software Guard eXtensions
open_enclave = "OpenEnclave" #: OpenEnclave extensions to SGX
cy_res_component = "CyResComponent" #: IoT Edge validation
vsm_enclave = "VSMEnclave" #: VSM Enclave Attestation
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from msrest.exceptions import HttpOperationError


class AttestationPolicy(Model):
"""AttestationPolicy.

:param policy: String-encoded attestation policy document.
:type policy: str
"""

_attribute_map = {
'policy': {'key': 'policy', 'type': 'str'},
}

def __init__(self, **kwargs):
super(AttestationPolicy, self).__init__(**kwargs)
self.policy = kwargs.get('policy', None)


class CloudError(Model):
"""An error response from Attestation.

:param error:
:type error: ~azure.attestation.models.CloudErrorBody
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'CloudErrorBody'},
}

def __init__(self, **kwargs):
super(CloudError, self).__init__(**kwargs)
self.error = kwargs.get('error', None)


class CloudErrorException(HttpOperationError):
"""Server responsed with exception of type: 'CloudError'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args)


class CloudErrorBody(Model):
"""An error response from Attestation.

:param code: An identifier for the error. Codes are invariant and are
intended to be consumed programmatically.
:type code: str
:param message: A message describing the error, intended to be suitable
for displaying in a user interface.
:type message: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs):
super(CloudErrorBody, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from msrest.exceptions import HttpOperationError


class AttestationPolicy(Model):
"""AttestationPolicy.

:param policy: String-encoded attestation policy document.
:type policy: str
"""

_attribute_map = {
'policy': {'key': 'policy', 'type': 'str'},
}

def __init__(self, *, policy: str=None, **kwargs) -> None:
super(AttestationPolicy, self).__init__(**kwargs)
self.policy = policy


class CloudError(Model):
"""An error response from Attestation.

:param error:
:type error: ~azure.attestation.models.CloudErrorBody
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'CloudErrorBody'},
}

def __init__(self, *, error=None, **kwargs) -> None:
super(CloudError, self).__init__(**kwargs)
self.error = error


class CloudErrorException(HttpOperationError):
"""Server responsed with exception of type: 'CloudError'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args)


class CloudErrorBody(Model):
"""An error response from Attestation.

:param code: An identifier for the error. Codes are invariant and are
intended to be consumed programmatically.
:type code: str
:param message: A message describing the error, intended to be suitable
for displaying in a user interface.
:type message: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None:
super(CloudErrorBody, self).__init__(**kwargs)
self.code = code
self.message = message
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._policy_operations import PolicyOperations
from ._policy_certificates_operations import PolicyCertificatesOperations
from ._signing_certificates_operations import SigningCertificatesOperations
from ._metadata_configuration_operations import MetadataConfigurationOperations

__all__ = [
'PolicyOperations',
'PolicyCertificatesOperations',
'SigningCertificatesOperations',
'MetadataConfigurationOperations',
]
Loading