security: isolate artifact documents and default servers to execution-only

This commit is contained in:
2026-10-20 15:36:14 +01:00
parent db88cebd0b
commit f06281db08
10 changed files with 193 additions and 4 deletions
+8
View File
@@ -20,6 +20,10 @@ import (
// Options configures the HTTP handler.
type Options struct {
// AllowAuthoring permits publishing immutable definitions. Execution servers
// default to run-only: a CLI --yes flag or raw RPC cannot grant this server
// capability. Enable deliberately on a separate trusted authoring instance.
AllowAuthoring bool
// ArtifactsRoot overrides where stage artifacts live. Empty uses the store's
// directory (the database's parent), matching the data-directory default.
ArtifactsRoot string
@@ -175,6 +179,10 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
return
}
log.Printf("command received: client=%s type=%q id=%q pipeline=%d version=%d", r.RemoteAddr, request.Type, request.ID, request.PipelineID, request.Version)
if request.Type == protocol.Submit && !options.AllowAuthoring {
_ = write(protocol.Message{Type: protocol.Error, ID: request.ID, Error: "pipeline authoring is disabled on this execution server; ask the operator to publish through an explicitly enabled authoring server"})
continue
}
if handleChat(connCtx, request, options.Chat, hub, registry, clientID, write) {
continue
}