summaryrefslogtreecommitdiff
path: root/designate/api/middleware.py
diff options
context:
space:
mode:
authorEndre Karlson <endre.karlson@gmail.com>2013-11-22 09:23:46 +0100
committerEndre Karlson <endre.karlson@gmail.com>2013-11-22 09:23:46 +0100
commit3388c37be1da37257fa6bbda17f7013f748cbcc5 (patch)
tree9c07f5fff008142000e4c127fe2a3a59c88e87c2 /designate/api/middleware.py
parent2e1c6ca95d924e7d76ae087322a3ca9c82b1d714 (diff)
downloaddesignate-3388c37be1da37257fa6bbda17f7013f748cbcc5.tar.gz
Pass the service-catalog if any to the context
Change-Id: Idc005b39f28a0fd30058d263643a44c777682f35
Diffstat (limited to 'designate/api/middleware.py')
-rw-r--r--designate/api/middleware.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/designate/api/middleware.py b/designate/api/middleware.py
index 0c245f61..e64295d5 100644
--- a/designate/api/middleware.py
+++ b/designate/api/middleware.py
@@ -108,12 +108,18 @@ class KeystoneContextMiddleware(ContextMiddleware):
#If the key is valid, Keystone does not include this header at all
pass
+ if headers.get('X-Service-Catalog'):
+ catalog = json.loads(headers.get('X-Service-Catalog'))
+ else:
+ catalog = None
+
roles = headers.get('X-Roles').split(',')
context = DesignateContext(auth_token=headers.get('X-Auth-Token'),
user=headers.get('X-User-ID'),
tenant=headers.get('X-Tenant-ID'),
- roles=roles)
+ roles=roles,
+ service_catalog=catalog)
# Store the context where oslo-log exepcts to find it.
local.store.context = context