Merge branch 'worktree-agent-a82ec64b6cc1a2809'
# Conflicts: # internal/app/archie/operations.go # modules/events/events.go # modules/governance/accounts_api.go # modules/governance/governance.go
This commit is contained in:
44 files changed
+1462
-266
No files matched your search
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/platform/httpapi"
|
||||
"github.com/samcharles93/archie-core/modules/governance"
|
||||
"github.com/samcharles93/archie-core/modules/judgement/internal/store"
|
||||
)
|
||||
|
||||
@@ -321,15 +322,15 @@ const bootstrapAdmin = "admin"
|
||||
// Register adds the action classes API.
|
||||
func (c *Classes) Register(api huma.API, outcomes Outcomes) {
|
||||
tags := []string{"Controls"}
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionRead, governance.KindClass), huma.Operation{
|
||||
OperationID: "list-classes", Method: http.MethodGet, Path: "/api/classes",
|
||||
Summary: "List action classes with their earned levels", Tags: tags,
|
||||
}, c.list)
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionRead, governance.KindClass), huma.Operation{
|
||||
OperationID: "get-class", Method: http.MethodGet, Path: "/api/classes/{id}",
|
||||
Summary: "Get an action class with its history and outcomes", Tags: tags,
|
||||
}, c.detail(outcomes))
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionUpdate, governance.KindClass), huma.Operation{
|
||||
OperationID: "reset-class", Method: http.MethodPost, Path: "/api/classes/{id}/reset",
|
||||
Summary: "Reset an action class to its default level", Tags: tags,
|
||||
}, c.reset)
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/platform/httpapi"
|
||||
"github.com/samcharles93/archie-core/modules/connectors"
|
||||
"github.com/samcharles93/archie-core/modules/governance"
|
||||
)
|
||||
|
||||
// judgeScanLimit bounds the decisions the control page reads to find a
|
||||
@@ -90,7 +91,7 @@ func (m *Module) latestJudge(ctx context.Context, guard string) (*JudgeStanding,
|
||||
|
||||
// Register adds the judgement controls API.
|
||||
func (m *Module) Register(api huma.API) {
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionRead, governance.KindGuard), huma.Operation{
|
||||
OperationID: "list-judges", Method: http.MethodGet, Path: "/api/controls/judges",
|
||||
Summary: "List each guard's judge, its standing and its eval date", Tags: []string{"Controls"},
|
||||
}, m.listJudges)
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/platform/httpapi"
|
||||
"github.com/samcharles93/archie-core/modules/connectors"
|
||||
"github.com/samcharles93/archie-core/modules/governance"
|
||||
"github.com/samcharles93/archie-core/modules/judgement/internal/store"
|
||||
)
|
||||
|
||||
@@ -389,11 +390,11 @@ func (p *Policies) Register(api huma.API) {
|
||||
{KindHardRules, "/api/policies/hard-rules", "hard-rules", "hard rules"},
|
||||
{KindChangeRequest, "/api/policies/change-request", "change-request-rules", "change-request rules"},
|
||||
} {
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionRead, governance.KindGuard), huma.Operation{
|
||||
OperationID: "get-" + k.id, Method: http.MethodGet, Path: k.path,
|
||||
Summary: "Get the " + k.noun, Tags: tags,
|
||||
}, p.get(k.kind))
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionUpdate, governance.KindGuard), huma.Operation{
|
||||
OperationID: "put-" + k.id, Method: http.MethodPut, Path: k.path,
|
||||
Summary: "Replace the " + k.noun + " with a new version", Tags: tags,
|
||||
}, p.put(k.kind))
|
||||
|
||||
Reference in new issue
Block a user