diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-11-19 20:37:56 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-11-19 20:37:56 +0100 |
commit | 999ebc79587ac0e4d12f674e7e8adc09256f525e (patch) | |
tree | ba7bf473d758710d835b5cb3e99e51a4aa54d92b /ick2/projectapi.py | |
parent | 408a2620b31d61891de0cae78d9e76d60e00b0d8 (diff) | |
download | ick2-999ebc79587ac0e4d12f674e7e8adc09256f525e.tar.gz |
Add: a temporary authz-less trigger endpoint for pipelines
This will be necessary until we have a trigger service.
Diffstat (limited to 'ick2/projectapi.py')
-rw-r--r-- | ick2/projectapi.py | 11 |
1 files changed, 11 insertions, 0 deletions
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) |