From 999ebc79587ac0e4d12f674e7e8adc09256f525e Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 19 Nov 2017 20:37:56 +0100 Subject: Add: a temporary authz-less trigger endpoint for pipelines This will be necessary until we have a trigger service. --- ick2/projectapi.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ick2/projectapi.py') diff --git a/ick2/projectapi.py b/ick2/projectapi.py index 71fe5ee..89cad8f 100644 --- a/ick2/projectapi.py +++ b/ick2/projectapi.py @@ -40,6 +40,12 @@ class ProjectAPI(ick2.ResourceApiBase): 'path': pipeline_path, 'callback': self.PUT(self.set_pipeline_callback), }, + { + 'needs-authorization': False, + 'method': 'GET', + 'path': pipeline_path + '/+trigger', + 'callback': self.GET(self.trigger_pipeline), + }, ] def get_pipeline(self, project, pipeline): @@ -71,3 +77,8 @@ class ProjectAPI(ick2.ResourceApiBase): self._state.update_resource(self._type_name, project, p) return {'status': state} raise ick2.NotFound() + + # This needs to go away as it is not protected. Once an IDP is + # added. + def trigger_pipeline(self, project, pipeline): # pragma: no cover + return self.set_pipeline('triggered', project, pipeline) -- cgit v1.2.1