Fixed glaringly obvious issues with core auth
* Added missing licenses * Added missing super calls to base class for some models * Definitely other issues to address that I'm noting for later (non-pythonic variable names, etc) Change-Id: I1054c4d95a350f4a4b94e20874ef704279ee904e
This commit is contained in:
		@@ -0,0 +1,15 @@
 | 
			
		||||
"""
 | 
			
		||||
Copyright 2013 Rackspace
 | 
			
		||||
 | 
			
		||||
Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
you may not use this file except in compliance with the License.
 | 
			
		||||
You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
    http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
See the License for the specific language governing permissions and
 | 
			
		||||
limitations under the License.
 | 
			
		||||
"""
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,19 @@
 | 
			
		||||
"""
 | 
			
		||||
Copyright 2013 Rackspace
 | 
			
		||||
 | 
			
		||||
Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
you may not use this file except in compliance with the License.
 | 
			
		||||
You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
    http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
See the License for the specific language governing permissions and
 | 
			
		||||
limitations under the License.
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
from cloudcafe.common.models.configuration import ConfigSectionInterface
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,19 @@
 | 
			
		||||
"""
 | 
			
		||||
Copyright 2013 Rackspace
 | 
			
		||||
 | 
			
		||||
Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
you may not use this file except in compliance with the License.
 | 
			
		||||
You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
    http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
See the License for the specific language governing permissions and
 | 
			
		||||
limitations under the License.
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
from cloudcafe.extensions.rax_auth.v2_0.tokens_api.client import \
 | 
			
		||||
    TokenAPI_Client as RaxTokenAPI_Client
 | 
			
		||||
from cloudcafe.extensions.rax_auth.v2_0.tokens_api.behaviors import \
 | 
			
		||||
 
 | 
			
		||||
@@ -25,15 +25,24 @@ class BaseIdentityModel(AutoMarshallingModel):
 | 
			
		||||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def _remove_identity_xml_namespaces(cls, element):
 | 
			
		||||
        cls._remove_namespace(element, V2_0Constants.XML_NS)
 | 
			
		||||
        cls._remove_namespace(element, V2_0Constants.XML_NS_OS_KSADM)
 | 
			
		||||
        cls._remove_namespace(element, V2_0Constants.XML_NS_RAX_KSKEY)
 | 
			
		||||
        cls._remove_namespace(element, V2_0Constants.XML_NS_OS_KSEC2)
 | 
			
		||||
        cls._remove_namespace(element, V2_0Constants.XML_NS_RAX_KSQA)
 | 
			
		||||
        cls._remove_namespace(element, V2_0Constants.XML_NS_RAX_AUTH)
 | 
			
		||||
        cls._remove_namespace(element, V2_0Constants.XML_NS_RAX_KSGRP)
 | 
			
		||||
        cls._remove_namespace(element, V2_0Constants.XML_NS_OPENSTACK_COMMON)
 | 
			
		||||
        cls._remove_namespace(element, V2_0Constants.XML_NS_ATOM)
 | 
			
		||||
        cls._remove_xml_etree_namespace(
 | 
			
		||||
            element, V2_0Constants.XML_NS)
 | 
			
		||||
        cls._remove_xml_etree_namespace(
 | 
			
		||||
            element, V2_0Constants.XML_NS_OS_KSADM)
 | 
			
		||||
        cls._remove_xml_etree_namespace(
 | 
			
		||||
            element, V2_0Constants.XML_NS_RAX_KSKEY)
 | 
			
		||||
        cls._remove_xml_etree_namespace(
 | 
			
		||||
            element, V2_0Constants.XML_NS_OS_KSEC2)
 | 
			
		||||
        cls._remove_xml_etree_namespace(
 | 
			
		||||
            element, V2_0Constants.XML_NS_RAX_KSQA)
 | 
			
		||||
        cls._remove_xml_etree_namespace(
 | 
			
		||||
            element, V2_0Constants.XML_NS_RAX_AUTH)
 | 
			
		||||
        cls._remove_xml_etree_namespace(
 | 
			
		||||
            element, V2_0Constants.XML_NS_RAX_KSGRP)
 | 
			
		||||
        cls._remove_xml_etree_namespace(
 | 
			
		||||
            element, V2_0Constants.XML_NS_OPENSTACK_COMMON)
 | 
			
		||||
        cls._remove_xml_etree_namespace(
 | 
			
		||||
            element, V2_0Constants.XML_NS_ATOM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class BaseIdentityListModel(AutoMarshallingListModel):
 | 
			
		||||
 
 | 
			
		||||
@@ -31,6 +31,7 @@ class Auth(BaseIdentityModel):
 | 
			
		||||
 | 
			
		||||
    def __init__(self, apiKeyCredentials=None,
 | 
			
		||||
                 tenantId=None, token=None):
 | 
			
		||||
        super(Auth, self).__init__()
 | 
			
		||||
        self.apiKeyCredentials = apiKeyCredentials
 | 
			
		||||
        self.token = token
 | 
			
		||||
        self.tenantId = tenantId
 | 
			
		||||
 
 | 
			
		||||
@@ -24,6 +24,7 @@ class Access(BaseIdentityModel):
 | 
			
		||||
    TAG = 'access'
 | 
			
		||||
 | 
			
		||||
    def __init__(self):
 | 
			
		||||
        super(Access, self).__init__()
 | 
			
		||||
        self.metadata = {}
 | 
			
		||||
        self.service_catalog = ServiceCatalog()
 | 
			
		||||
        self.user = User()
 | 
			
		||||
@@ -68,6 +69,7 @@ class ServiceCatalog(BaseIdentityListModel):
 | 
			
		||||
class Service(BaseIdentityModel):
 | 
			
		||||
 | 
			
		||||
    def __init__(self):
 | 
			
		||||
        super(Service, self).__init__()
 | 
			
		||||
        self.endpoints = EndpointList()
 | 
			
		||||
        self.endpoint_links = []
 | 
			
		||||
        self.name = None
 | 
			
		||||
@@ -112,6 +114,7 @@ class Endpoint(BaseIdentityModel):
 | 
			
		||||
 | 
			
		||||
    def __init__(self, admin_url, internal_url, public_url,
 | 
			
		||||
                 region, id, tenant_id=None):
 | 
			
		||||
        super(Endpoint, self).__init__()
 | 
			
		||||
        self.admin_url = admin_url
 | 
			
		||||
        self.internal_url = internal_url
 | 
			
		||||
        self.public_url = public_url
 | 
			
		||||
@@ -134,6 +137,7 @@ class Token(BaseIdentityModel):
 | 
			
		||||
    TAG = 'token'
 | 
			
		||||
 | 
			
		||||
    def __init__(self):
 | 
			
		||||
        super(Token, self).__init__()
 | 
			
		||||
        self.expires = None
 | 
			
		||||
        self.issued_at = None
 | 
			
		||||
        self.id_ = None
 | 
			
		||||
@@ -154,6 +158,7 @@ class Tenant(BaseIdentityModel):
 | 
			
		||||
    TAG = 'tenant'
 | 
			
		||||
 | 
			
		||||
    def __init__(self):
 | 
			
		||||
        super(Tenant, self).__init__()
 | 
			
		||||
        self.description = None
 | 
			
		||||
        self.enabled = None
 | 
			
		||||
        self.id_ = None
 | 
			
		||||
@@ -174,6 +179,7 @@ class User(BaseIdentityModel):
 | 
			
		||||
    TAG = 'user'
 | 
			
		||||
 | 
			
		||||
    def __init__(self):
 | 
			
		||||
        super(User, self).__init__()
 | 
			
		||||
        self.id_ = None
 | 
			
		||||
        self.name = None
 | 
			
		||||
        self.roles = RoleList()
 | 
			
		||||
@@ -208,4 +214,5 @@ class RoleList(BaseIdentityListModel):
 | 
			
		||||
class Role(BaseIdentityListModel):
 | 
			
		||||
 | 
			
		||||
    def __init__(self, name=None):
 | 
			
		||||
        super(Role, self).__init__()
 | 
			
		||||
        self.name = name
 | 
			
		||||
 
 | 
			
		||||
@@ -60,7 +60,6 @@ class Endpoint(BaseIdentityModel):
 | 
			
		||||
    def __init__(self, tenantId=None, region=None, id=None, publicURL=None,
 | 
			
		||||
                 name=None, adminURL=None, type=None, internalURL=None,
 | 
			
		||||
                 versionId=None, versionInfo=None, versionList=None):
 | 
			
		||||
    #                 version=None
 | 
			
		||||
        super(Endpoint, self).__init__()
 | 
			
		||||
        self.tenantId = tenantId
 | 
			
		||||
        self.region = region
 | 
			
		||||
@@ -74,8 +73,7 @@ class Endpoint(BaseIdentityModel):
 | 
			
		||||
        self.versionInfo = versionInfo
 | 
			
		||||
        self.versionList = versionList
 | 
			
		||||
        # currently json has version attributes as part of the Endpoint
 | 
			
		||||
        #xml has it as a seprate element.
 | 
			
		||||
    #        self.version = version
 | 
			
		||||
        # xml has it as a separate element.
 | 
			
		||||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def _json_to_obj(cls, serialized_str):
 | 
			
		||||
@@ -122,6 +120,7 @@ class Version(BaseIdentityModel):
 | 
			
		||||
    ROOT_TAG = 'version'
 | 
			
		||||
 | 
			
		||||
    def __init__(self, id=None, info=None, list=None):
 | 
			
		||||
        super(Version, self).__init__()
 | 
			
		||||
        self.id = id
 | 
			
		||||
        self.info = info
 | 
			
		||||
        self.list = list
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user