Merge "Updating clients for RBAC integration"
This commit is contained in:
commit
85b6ae4232
|
@ -0,0 +1,28 @@
|
|||
"""
|
||||
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 cafe.engine.clients.rest import AutoMarshallingRestClient
|
||||
|
||||
|
||||
class BarbicanRestClient(AutoMarshallingRestClient):
|
||||
def __init__(self, token=None, serialize_format=None,
|
||||
deserialize_format=None):
|
||||
super(BarbicanRestClient, self).__init__(
|
||||
serialize_format=serialize_format,
|
||||
deserialize_format=deserialize_format)
|
||||
|
||||
self.token = token
|
||||
if self.token is not None:
|
||||
self.default_headers['X-Auth-Token'] = self.token
|
|
@ -13,18 +13,19 @@ 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 cafe.engine.clients.rest import AutoMarshallingRestClient
|
||||
from cloudcafe.cloudkeep.barbican.client import BarbicanRestClient
|
||||
from cloudcafe.cloudkeep.barbican.secrets.models.secret import Secret
|
||||
from cloudcafe.cloudkeep.barbican.orders.models.order \
|
||||
import Order, OrderRef, OrderGroup
|
||||
|
||||
|
||||
class OrdersClient(AutoMarshallingRestClient):
|
||||
class OrdersClient(BarbicanRestClient):
|
||||
|
||||
def __init__(self, url, api_version, tenant_id, serialize_format,
|
||||
deserialize_format):
|
||||
super(OrdersClient, self).__init__(serialize_format,
|
||||
deserialize_format)
|
||||
def __init__(self, url, api_version, tenant_id, token=None,
|
||||
serialize_format=None, deserialize_format=None):
|
||||
super(OrdersClient, self).__init__(
|
||||
token=token, serialize_format=serialize_format,
|
||||
deserialize_format=deserialize_format)
|
||||
self.url = url
|
||||
self.api_version = api_version
|
||||
self.tenant_id = tenant_id
|
||||
|
|
|
@ -13,16 +13,17 @@ 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 cafe.engine.clients.rest import AutoMarshallingRestClient
|
||||
from cloudcafe.cloudkeep.barbican.client import BarbicanRestClient
|
||||
from cloudcafe.cloudkeep.barbican.secrets.models.secret \
|
||||
import Secret, SecretGroup, SecretRef, SecretMetadata
|
||||
|
||||
|
||||
class SecretsClient(AutoMarshallingRestClient):
|
||||
def __init__(self, url, api_version, tenant_id, serialize_format=None,
|
||||
deserialize_format=None):
|
||||
super(SecretsClient, self).__init__(serialize_format,
|
||||
deserialize_format)
|
||||
class SecretsClient(BarbicanRestClient):
|
||||
def __init__(self, url, api_version, tenant_id, token=None,
|
||||
serialize_format=None, deserialize_format=None):
|
||||
super(SecretsClient, self).__init__(
|
||||
token=token, serialize_format=serialize_format,
|
||||
deserialize_format=deserialize_format)
|
||||
self.url = url
|
||||
self.api_version = api_version
|
||||
self.tenant_id = tenant_id
|
||||
|
|
|
@ -13,19 +13,20 @@ 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 cafe.engine.clients.rest import AutoMarshallingRestClient
|
||||
from cloudcafe.cloudkeep.barbican.client import BarbicanRestClient
|
||||
from cloudcafe.cloudkeep.barbican.version.models.version import Version
|
||||
|
||||
|
||||
class VersionClient(AutoMarshallingRestClient):
|
||||
def __init__(self, url, serialize_format=None, deserialize_format=None):
|
||||
class VersionClient(BarbicanRestClient):
|
||||
def __init__(self, url, token=None, serialize_format=None,
|
||||
deserialize_format=None):
|
||||
"""
|
||||
@param url: Base URL of Barbican api
|
||||
@type url: String
|
||||
"""
|
||||
super(VersionClient, self).__init__(serialize_format,
|
||||
deserialize_format)
|
||||
super(VersionClient, self).__init__(
|
||||
token=token, serialize_format=serialize_format,
|
||||
deserialize_format=deserialize_format)
|
||||
self.url = url
|
||||
|
||||
def get_version(self, headers=None):
|
||||
|
|
|
@ -42,11 +42,11 @@ username=user
|
|||
key=key
|
||||
token=bypass
|
||||
|
||||
[token_api]
|
||||
[tokens_api]
|
||||
authentication_endpoint=<auth_endpoint>
|
||||
username=demo
|
||||
password=password
|
||||
tenant_name=demo
|
||||
username=<keystone_user>
|
||||
password=<keystone_password>
|
||||
tenant_name=<keystone_tenant_name>
|
||||
|
||||
[GITHUB]
|
||||
token=<github_token>
|
||||
|
|
Loading…
Reference in New Issue