This task is to implement a webhook triggering mechanism for the component-api (API only), this requires:
- Exposing an endpoint to the components api for external webhook calls - this might require either exposing the toolforge APIs (would be nicer, but might take longer) or only exposing the webhook endpoint on the proxies.
- Adding a deployment token management system to the components API
- Component selection is left for later
The user experience would be something like (not to be implemented in this task, cli comes later):
> toolforge component deploy-token get # shows the current token token: 1234567890 webhook urls: all components: https://api.svc.toolforge.org/tool/<mytool>/deployment?token=1234567890 > toolforge component deploy-token new # creates a new token or regenerates an existing one and shows it Generated new token: token: 0987654321 webhook urls: all components: https://api.svc.toolforge.org/tool/<mytool>/deployment?token=0987654321
The token should be a uuid64.
The webhook url should not allow any other parameters, it should use the already existing configuration or fail with a message if no configuration has been set yet (and that should be done in the cli for now).
The webhook url should return the deployment ID for now, we can add a follow option later on after we sort out the background processing tasks.
Tokens should have an expiry date of ~1y (for starters, we can adapt later)