Feat v0.3.3 public entry background jobs (#17)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #17.
This commit is contained in:
@@ -359,6 +359,24 @@ func main() {
|
||||
api.POST("/hooks/:package_id/:slug", triggerEngine.HandleWebhook)
|
||||
api.GET("/hooks/:package_id/:slug", triggerEngine.HandleWebhook)
|
||||
|
||||
// ── Workflow Engine (shared by public + protected routes) ──
|
||||
wfEngine := workflow.NewEngine(stores, bus, starlarkRunner)
|
||||
|
||||
// ── Public Workflow Entry (v0.3.3) ─────
|
||||
publicWfH := handlers.NewWorkflowPublicHandler(wfEngine, stores)
|
||||
publicWf := api.Group("/public/workflows")
|
||||
publicWf.Use(authLimiter.Limit())
|
||||
{
|
||||
publicWf.POST("/:id/start", publicWfH.StartPublic)
|
||||
publicWf.GET("/resume/:token", publicWfH.ResumePublic)
|
||||
publicWf.POST("/advance/:token", publicWfH.AdvancePublic)
|
||||
}
|
||||
|
||||
// ── Workflow Scanner (v0.3.3) ──────────
|
||||
wfScanner := workflow.NewScanner(stores, bus)
|
||||
wfScanner.Start()
|
||||
defer wfScanner.Stop()
|
||||
|
||||
// ── Protected routes ────────────────────
|
||||
protected := api.Group("")
|
||||
protected.Use(middleware.Auth(cfg, stores.Users, userCache))
|
||||
@@ -401,7 +419,6 @@ func main() {
|
||||
protected.GET("/workflows/:id/versions/:version", wfH.GetVersion)
|
||||
|
||||
// Workflow instances + assignments (v0.3.2)
|
||||
wfEngine := workflow.NewEngine(stores, bus, starlarkRunner)
|
||||
wfInstH := handlers.NewWorkflowInstanceHandler(wfEngine, stores)
|
||||
protected.POST("/workflows/:id/instances", middleware.RequirePermission(auth.PermWorkflowSubmit, stores), wfInstH.Start)
|
||||
protected.GET("/workflows/:id/instances", wfInstH.ListInstances)
|
||||
|
||||
Reference in New Issue
Block a user