feat(audit,approvals,deliveries): wire audit producers, ITSM change requests, and fix Dockerfile.archie (#2153)
This commit is contained in:
26 files changed
+671
-35
No files matched your search
@@ -20,8 +20,10 @@ import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/platform/seal"
|
||||
"github.com/samcharles93/archie-core/modules/audit"
|
||||
"github.com/samcharles93/archie-core/modules/connectors/internal/catalogue"
|
||||
"github.com/samcharles93/archie-core/modules/connectors/internal/store"
|
||||
"github.com/samcharles93/archie-core/modules/governance"
|
||||
)
|
||||
|
||||
// validName is the shape of a connector name: it appears in logs and URLs.
|
||||
@@ -35,6 +37,7 @@ type Module struct {
|
||||
host *Host
|
||||
store registry
|
||||
sealer *seal.Sealer
|
||||
audit audit.Recorder
|
||||
log *slog.Logger
|
||||
// sources and fetcher read the catalogue and its artifacts, and pkgMu
|
||||
// serialises changes to a package's versions.
|
||||
@@ -80,6 +83,21 @@ func (m *Module) Use(recheck Recheck) {
|
||||
m.recheck = recheck
|
||||
}
|
||||
|
||||
// UseAudit configures the audit recorder notified on extension and catalogue changes.
|
||||
func (m *Module) UseAudit(r audit.Recorder) { m.audit = r }
|
||||
|
||||
func (m *Module) emitAudit(ctx context.Context, action, resourceKind, resourceID string, detail any) {
|
||||
audit.Emit(ctx, m.audit, m.log, audit.Event{
|
||||
Category: "extensions",
|
||||
Action: action,
|
||||
ActorID: governance.CallerID(ctx),
|
||||
ResourceKind: resourceKind,
|
||||
ResourceID: resourceID,
|
||||
Outcome: "success",
|
||||
Detail: detail,
|
||||
})
|
||||
}
|
||||
|
||||
// UseRemotes configures static remote gRPC+mTLS extension endpoints.
|
||||
func (m *Module) UseRemotes(cfg RemoteConfig) error {
|
||||
return m.host.UseRemotes(cfg)
|
||||
|
||||
Reference in new issue
Block a user