diff --git a/requirements.txt b/requirements.txt index 0ef0cb9..28413d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,12 +2,14 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -pbr>=0.6,!=0.7,<1.0 +pbr<2.0,>=1.3 Babel>=1.3 python-redmine paste -pecan>=0.4.5 -oslo.messaging>=1.3.0,<=1.4.1 -oslo.config>=1.4.0 # Apache-2.0 -python-keystoneclient>=0.4.2,<0.12 -WSME>=0.6 +pecan>=0.8.0 +oslo.messaging>=1.3.0,<1.5 +oslo.config>=1.11.0,<=1.15.0 # Apache-2.0 +oslo.utils<2.0.0 +oslo.serialization<1.7.0 +python-keystoneclient>=1.6.0 +WSME>=0.7 diff --git a/setup.py b/setup.py old mode 100755 new mode 100644 index 70c2b3f..d8080d0 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +16,14 @@ # THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT import setuptools +# In python < 2.7.4, a lazy loading of package `pbr` will break +# setuptools if some other modules registered functions in `atexit`. +# solution from: http://bugs.python.org/issue15881#msg170215 +try: + import multiprocessing # noqa +except ImportError: + pass + setuptools.setup( - setup_requires=['pbr'], + setup_requires=['pbr>=1.3'], pbr=True) diff --git a/sticks/api/config.py b/sticks/api/config.py index e96fc69..f5686b4 100644 --- a/sticks/api/config.py +++ b/sticks/api/config.py @@ -24,4 +24,5 @@ app = { 'debug': True, 'enable_acl': False, 'acl_public_routes': ['/', '/v1'], + 'member_routes': ['/v1/ticket', ] } diff --git a/sticks/api/hooks.py b/sticks/api/hooks.py index 4ab06de..fb527ca 100644 --- a/sticks/api/hooks.py +++ b/sticks/api/hooks.py @@ -88,8 +88,16 @@ class AdminAuthHook(hooks.PecanHook): rejects the request if the api is not public. """ + + def is_path_in_routes(self, path): + for p in self.member_routes: + if path.startswith(p): + return True + return False + def before(self, state): ctx = state.request.context - if not ctx.is_admin and not ctx.is_public_api: - raise exc.HTTPForbidden() + if not ctx.is_admin and not ctx.is_public_api and \ + not self.is_path_in_routes(state.request.path): + raise exc.HTTPForbidden() diff --git a/sticks/tracking/__init__.py b/sticks/tracking/__init__.py index 5b8bbf7..da6440f 100644 --- a/sticks/tracking/__init__.py +++ b/sticks/tracking/__init__.py @@ -68,7 +68,7 @@ class TrackingBase(object): def _has_sticks_role(self, user_id, role_id, project_id): """ - Evaluates whether this user has ikare role. Returns + Evaluates whether this user has sticks role. Returns ``True`` or ``False``. """ if self.kc is None: diff --git a/test-requirements.txt b/test-requirements.txt index 129251d..a2b59a6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,21 +2,20 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking>=0.9.2,<0.10 +hacking<0.10,>=0.9.2 # mock object framework -mock>=1.0 +mock>=1.2 coverage>=3.6 discover # fixture stubbing -fixtures>=0.3.14 -oslotest>=1.1.0 # Apache-2.0 -python-subunit -junitxml +fixtures>=1.3.1 +oslotest>=1.10.0 # Apache-2.0 +python-subunit>=0.0.18 nose nose-exclude nosexcover # Doc requirements -sphinx>=1.1.2,!=1.2.0,<1.3 -oslosphinx +sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 +oslosphinx>=2.5.0 # Apache-2.0 sphinxcontrib-httpdomain sphinxcontrib-pecanwsme>=0.8