summaryrefslogtreecommitdiff
path: root/keystone_tempest_plugin/services/identity/v3/auth_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'keystone_tempest_plugin/services/identity/v3/auth_client.py')
-rw-r--r--keystone_tempest_plugin/services/identity/v3/auth_client.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/keystone_tempest_plugin/services/identity/v3/auth_client.py b/keystone_tempest_plugin/services/identity/v3/auth_client.py
deleted file mode 100644
index f6cd660..0000000
--- a/keystone_tempest_plugin/services/identity/v3/auth_client.py
+++ /dev/null
@@ -1,40 +0,0 @@
1# Copyright 2016 Red Hat, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15import json
16
17import six
18from tempest.lib.common import rest_client
19
20from keystone_tempest_plugin.services.identity import clients
21
22
23class AuthClient(clients.Identity):
24
25 def _get_scopes(self, url, token_id):
26 resp, body = self.raw_request(
27 url, 'GET', headers={'X-Auth-Token': token_id})
28 self.expected_success(200, resp.status)
29 body = json.loads(body if six.PY2 else body.decode('utf-8'))
30 return rest_client.ResponseBody(resp, body)
31
32 def get_available_projects_scopes(self, keystone_v3_endpoint, token_id):
33 """Get projects that are available to be scoped to based on a token."""
34 url = '%s/auth/projects' % keystone_v3_endpoint
35 return self._get_scopes(url, token_id)
36
37 def get_available_domains_scopes(self, keystone_v3_endpoint, token_id):
38 """Get domains that are available to be scoped to based on a token."""
39 url = '%s/auth/domains' % keystone_v3_endpoint
40 return self._get_scopes(url, token_id)