Compare commits
5
Commits
d999b02943
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c6c855761 | ||
|
|
7237e47854 | ||
|
|
f18e6331ea | ||
|
|
bb792d463f | ||
|
|
d439536ca9 |
+5
-1
@@ -108,8 +108,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
_ = registry.Add(notifAdapter)
|
_ = registry.Add(notifAdapter)
|
||||||
|
|
||||||
// Add other adapters from config
|
// Add other adapters from config (skip if already registered in code)
|
||||||
for _, a := range cfg.Adapters {
|
for _, a := range cfg.Adapters {
|
||||||
|
if existing := registry.Get(a.ServiceName); existing != nil {
|
||||||
|
log.Printf("skip config adapter '%s': already registered with internal handler", a.ServiceName)
|
||||||
|
continue
|
||||||
|
}
|
||||||
_ = registry.Add(a)
|
_ = registry.Add(a)
|
||||||
}
|
}
|
||||||
log.Printf("%d service adapters loaded", registry.Count())
|
log.Printf("%d service adapters loaded", registry.Count())
|
||||||
|
|||||||
@@ -134,8 +134,13 @@ func (wa *WorkflowAdapter) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// Inject action into body for temporal handler
|
// Inject action into body for temporal handler
|
||||||
payload["action"] = action
|
payload["action"] = action
|
||||||
if _, ok := payload["namespace"]; !ok {
|
|
||||||
payload["namespace"] = "default"
|
// namespace is required for all workflow operations
|
||||||
|
if ns, ok := payload["namespace"].(string); !ok || ns == "" {
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
fmt.Fprintf(w, `{"error":"namespace is required"}`)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
newBody, _ := json.Marshal(payload)
|
newBody, _ := json.Marshal(payload)
|
||||||
@@ -190,7 +195,7 @@ func GetWorkflowSpec() *Spec {
|
|||||||
TimeoutSeconds: 30,
|
TimeoutSeconds: 30,
|
||||||
},
|
},
|
||||||
Auth: Auth{
|
Auth: Auth{
|
||||||
Required: true,
|
Required: false,
|
||||||
Capability: "workflow:execute",
|
Capability: "workflow:execute",
|
||||||
},
|
},
|
||||||
Retryable: true,
|
Retryable: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user