summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/resources
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-09-11 12:37:22 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-09-12 14:23:18 +0800
commit7479f29b3d0a613d459cd26b31eab38f00a00b22 (patch)
tree2a763a2de3bd25cdddd49d5efb1eacc7036741e8 /testapi/opnfv_testapi/resources
parent28d5b3d14a6354ec170ebaea7f0f6ba342375b61 (diff)
leverage LFID authentication to pod creation
only valid linux foundation user is allowed to create the new pod add owner field in pods to track the pod creator Change-Id: Icada07152069f7c826bfa6122cb86db8c4e3bf68 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/opnfv_testapi/resources')
-rw-r--r--testapi/opnfv_testapi/resources/handlers.py1
-rw-r--r--testapi/opnfv_testapi/resources/pod_models.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/testapi/opnfv_testapi/resources/handlers.py b/testapi/opnfv_testapi/resources/handlers.py
index 757c817..8e5dab2 100644
--- a/testapi/opnfv_testapi/resources/handlers.py
+++ b/testapi/opnfv_testapi/resources/handlers.py
@@ -75,6 +75,7 @@ class GenericApiHandler(web.RequestHandler):
@web.asynchronous
@gen.coroutine
+ @check.is_authorized
@check.valid_token
@check.no_body
@check.miss_fields
diff --git a/testapi/opnfv_testapi/resources/pod_models.py b/testapi/opnfv_testapi/resources/pod_models.py
index 2c3ea97..415d3d6 100644
--- a/testapi/opnfv_testapi/resources/pod_models.py
+++ b/testapi/opnfv_testapi/resources/pod_models.py
@@ -29,13 +29,14 @@ class PodCreateRequest(models.ModelBase):
class Pod(models.ModelBase):
def __init__(self,
name='', mode='', details='',
- role="", _id='', create_date=''):
+ role="", _id='', create_date='', owner=''):
self.name = name
self.mode = mode
self.details = details
self.role = role
self._id = _id
self.creation_date = create_date
+ self.owner = owner
@swagger.model()