fix(identity): use System as the one root identity and record who created every task (#1851)
Drop the bot_user-derived root identity and the empty-identity sentinel. System polls forge connections and owns instance-level work; a polled task stores the polling identity, task_queued and work_request_submitted carry task id, actor and principal, and an empty task identity is refused. Migration 0072 moves empty tasks.identity, the identity-grants root key and the old root's connection permits to System so a re-poll dedups.
This commit is contained in:
36 files changed
+283
-189
No files matched your search
@@ -150,7 +150,10 @@ func (a *workflowsAPI) handleWorkRequest(w http.ResponseWriter, r *http.Request)
|
||||
http.Error(w, "work request rejected", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
a.emit(r.Context(), events.Event{Kind: events.KindWorkRequestSubmitted, TaskID: created.ID, Repo: request.Repository, Workflow: request.Workflow, Detail: request.Title})
|
||||
a.emit(r.Context(), events.Event{
|
||||
Kind: events.KindWorkRequestSubmitted, TaskID: created.ID, Repo: request.Repository, Workflow: request.Workflow, Detail: request.Title,
|
||||
ActorID: string(principal.IdentityID), ActorKind: string(principal.Kind), PrincipalID: string(principal.IdentityID),
|
||||
})
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
writeJSON(w, map[string]any{"ok": true, "task_id": created.ID})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user