Skip to content

Commit

Permalink
[AutoPR apimanagement/resource-manager] add openid connect in authent…
Browse files Browse the repository at this point in the history
…ication settings (#3612)

* Generated from 0d3fa76ca7abc30f7d80506e5183c45c66aef6d3

add openid connect in authentication settings

* Packaging update of azure-mgmt-apimanagement
  • Loading branch information
AutorestCI authored Oct 15, 2018
1 parent 7d53537 commit d6eebe3
Show file tree
Hide file tree
Showing 14 changed files with 259 additions and 1 deletion.
9 changes: 9 additions & 0 deletions azure-mgmt-apimanagement/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:
Release History
===============

0.1.0 (1970-01-01)
++++++++++++++++++

* Initial Release
1 change: 1 addition & 0 deletions azure-mgmt-apimanagement/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include *.rst
49 changes: 49 additions & 0 deletions azure-mgmt-apimanagement/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure MyService Management Client Library.

Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Compatibility
=============

**IMPORTANT**: If you have an earlier version of the azure package
(version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

.. code:: shell
pip freeze
If you see azure==0.11.0 (or any version below 1.0), uninstall it first:

.. code:: shell
pip uninstall azure
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.
1 change: 1 addition & 0 deletions azure-mgmt-apimanagement/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1 change: 1 addition & 0 deletions azure-mgmt-apimanagement/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from .api_create_or_update_parameter_py3 import ApiCreateOrUpdateParameter
from .api_update_contract_py3 import ApiUpdateContract
from .oauth2_authentication_settings_contract_py3 import OAuth2AuthenticationSettingsContract
from .open_id_authentication_settings_contract_py3 import OpenIdAuthenticationSettingsContract
from .authentication_settings_contract_py3 import AuthenticationSettingsContract
from .subscription_key_parameter_names_contract_py3 import SubscriptionKeyParameterNamesContract
from .api_entity_base_contract_py3 import ApiEntityBaseContract
Expand Down Expand Up @@ -172,6 +173,7 @@
from .api_create_or_update_parameter import ApiCreateOrUpdateParameter
from .api_update_contract import ApiUpdateContract
from .oauth2_authentication_settings_contract import OAuth2AuthenticationSettingsContract
from .open_id_authentication_settings_contract import OpenIdAuthenticationSettingsContract
from .authentication_settings_contract import AuthenticationSettingsContract
from .subscription_key_parameter_names_contract import SubscriptionKeyParameterNamesContract
from .api_entity_base_contract import ApiEntityBaseContract
Expand Down Expand Up @@ -336,6 +338,7 @@
Protocol,
ContentFormat,
SoapApiType,
BearerTokenSendingMethods,
ApiType,
State,
LoggerType,
Expand Down Expand Up @@ -382,6 +385,7 @@
'ApiCreateOrUpdateParameter',
'ApiUpdateContract',
'OAuth2AuthenticationSettingsContract',
'OpenIdAuthenticationSettingsContract',
'AuthenticationSettingsContract',
'SubscriptionKeyParameterNamesContract',
'ApiEntityBaseContract',
Expand Down Expand Up @@ -545,6 +549,7 @@
'Protocol',
'ContentFormat',
'SoapApiType',
'BearerTokenSendingMethods',
'ApiType',
'State',
'LoggerType',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ class SoapApiType(str, Enum):
soap_pass_through = "soap" #: Imports the Soap API having a SOAP front end.


class BearerTokenSendingMethods(str, Enum):

authorization_header = "authorizationHeader" #: Access token will be transmitted in the Authorization header using Bearer schema
query = "query" #: Access token will be transmitted as query parameters.


class ApiType(str, Enum):

http = "http"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,24 @@ class AuthenticationSettingsContract(Model):
:param o_auth2: OAuth2 Authentication settings
:type o_auth2:
~azure.mgmt.apimanagement.models.OAuth2AuthenticationSettingsContract
:param openid: OpenID Connect Authentication Settings
:type openid:
~azure.mgmt.apimanagement.models.OpenIdAuthenticationSettingsContract
:param subscription_key_required: Specifies whether subscription key is
required during call to this API, true - API is included into closed
products only, false - API is included into open products alone, null -
there is a mix of products.
:type subscription_key_required: bool
"""

_attribute_map = {
'o_auth2': {'key': 'oAuth2', 'type': 'OAuth2AuthenticationSettingsContract'},
'openid': {'key': 'openid', 'type': 'OpenIdAuthenticationSettingsContract'},
'subscription_key_required': {'key': 'subscriptionKeyRequired', 'type': 'bool'},
}

def __init__(self, **kwargs):
super(AuthenticationSettingsContract, self).__init__(**kwargs)
self.o_auth2 = kwargs.get('o_auth2', None)
self.openid = kwargs.get('openid', None)
self.subscription_key_required = kwargs.get('subscription_key_required', None)
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,24 @@ class AuthenticationSettingsContract(Model):
:param o_auth2: OAuth2 Authentication settings
:type o_auth2:
~azure.mgmt.apimanagement.models.OAuth2AuthenticationSettingsContract
:param openid: OpenID Connect Authentication Settings
:type openid:
~azure.mgmt.apimanagement.models.OpenIdAuthenticationSettingsContract
:param subscription_key_required: Specifies whether subscription key is
required during call to this API, true - API is included into closed
products only, false - API is included into open products alone, null -
there is a mix of products.
:type subscription_key_required: bool
"""

_attribute_map = {
'o_auth2': {'key': 'oAuth2', 'type': 'OAuth2AuthenticationSettingsContract'},
'openid': {'key': 'openid', 'type': 'OpenIdAuthenticationSettingsContract'},
'subscription_key_required': {'key': 'subscriptionKeyRequired', 'type': 'bool'},
}

def __init__(self, *, o_auth2=None, **kwargs) -> None:
def __init__(self, *, o_auth2=None, openid=None, subscription_key_required: bool=None, **kwargs) -> None:
super(AuthenticationSettingsContract, self).__init__(**kwargs)
self.o_auth2 = o_auth2
self.openid = openid
self.subscription_key_required = subscription_key_required
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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


class OpenIdAuthenticationSettingsContract(Model):
"""API OAuth2 Authentication settings details.
:param openid_provider_id: OAuth authorization server identifier.
:type openid_provider_id: str
:param bearer_token_sending_methods: How to send token to the server.
:type bearer_token_sending_methods: list[str or
~azure.mgmt.apimanagement.models.BearerTokenSendingMethods]
"""

_attribute_map = {
'openid_provider_id': {'key': 'openidProviderId', 'type': 'str'},
'bearer_token_sending_methods': {'key': 'bearerTokenSendingMethods', 'type': '[str]'},
}

def __init__(self, **kwargs):
super(OpenIdAuthenticationSettingsContract, self).__init__(**kwargs)
self.openid_provider_id = kwargs.get('openid_provider_id', None)
self.bearer_token_sending_methods = kwargs.get('bearer_token_sending_methods', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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


class OpenIdAuthenticationSettingsContract(Model):
"""API OAuth2 Authentication settings details.
:param openid_provider_id: OAuth authorization server identifier.
:type openid_provider_id: str
:param bearer_token_sending_methods: How to send token to the server.
:type bearer_token_sending_methods: list[str or
~azure.mgmt.apimanagement.models.BearerTokenSendingMethods]
"""

_attribute_map = {
'openid_provider_id': {'key': 'openidProviderId', 'type': 'str'},
'bearer_token_sending_methods': {'key': 'bearerTokenSendingMethods', 'type': '[str]'},
}

def __init__(self, *, openid_provider_id: str=None, bearer_token_sending_methods=None, **kwargs) -> None:
super(OpenIdAuthenticationSettingsContract, self).__init__(**kwargs)
self.openid_provider_id = openid_provider_id
self.bearer_token_sending_methods = bearer_token_sending_methods
7 changes: 7 additions & 0 deletions azure-mgmt-apimanagement/sdk_packaging.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[packaging]
package_name = "azure-mgmt-apimanagement"
package_nspkg = "azure-mgmt-nspkg"
package_pprint_name = "MyService Management"
package_doc_id = ""
is_stable = false
is_arm = true
2 changes: 2 additions & 0 deletions azure-mgmt-apimanagement/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal=1
87 changes: 87 additions & 0 deletions azure-mgmt-apimanagement/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/usr/bin/env python

#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import re
import os.path
from io import open
from setuptools import find_packages, setup

# Change the PACKAGE_NAME only to change folder and different name
PACKAGE_NAME = "azure-mgmt-apimanagement"
PACKAGE_PPRINT_NAME = "MyService Management"

# a-b-c => a/b/c
package_folder_path = PACKAGE_NAME.replace('-', '/')
# a-b-c => a.b.c
namespace_name = PACKAGE_NAME.replace('-', '.')

# azure v0.x is not compatible with this package
# azure v0.x used to have a __version__ attribute (newer versions don't)
try:
import azure
try:
ver = azure.__version__
raise Exception(
'This package is incompatible with azure=={}. '.format(ver) +
'Uninstall it with "pip uninstall azure".'
)
except AttributeError:
pass
except ImportError:
pass

# Version extraction inspired from 'requests'
with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)

if not version:
raise RuntimeError('Cannot find version information')

with open('README.rst', encoding='utf-8') as f:
readme = f.read()
with open('HISTORY.rst', encoding='utf-8') as f:
history = f.read()

setup(
name=PACKAGE_NAME,
version=version,
description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME),
long_description=readme + '\n\n' + history,
license='MIT License',
author='Microsoft Corporation',
author_email='azpysdkhelp@microsoft.com',
url='https://github.com/Azure/azure-sdk-for-python',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: MIT License',
],
zip_safe=False,
packages=find_packages(exclude=[
'tests',
# Exclude packages that will be covered by PEP420 or nspkg
'azure',
'azure.mgmt',
]),
install_requires=[
'msrest>=0.5.0',
'msrestazure>=0.4.32,<2.0.0',
'azure-common~=1.1',
],
extras_require={
":python_version<'3.0'": ['azure-mgmt-nspkg'],
}
)

0 comments on commit d6eebe3

Please sign in to comment.