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
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/platform/httpapi"
|
||||
"github.com/samcharles93/archie-core/internal/platform/seal"
|
||||
"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.
|
||||
@@ -330,46 +331,46 @@ func listExtensionKinds(context.Context, *struct{}) (*httpapi.Reply[[]ExtensionK
|
||||
|
||||
// Register adds the API for accepted packages and credentials.
|
||||
func (m *Module) Register(api huma.API) {
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionRead, governance.KindConnector), huma.Operation{
|
||||
OperationID: "list-extension-kinds", Method: http.MethodGet, Path: "/api/extension-kinds",
|
||||
Summary: "List the kinds of extension and the group each belongs to", Tags: []string{"Connectors"},
|
||||
}, listExtensionKinds)
|
||||
for _, k := range extensionKinds() {
|
||||
tags := []string{k.tag}
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionRead, governance.KindConnector), huma.Operation{
|
||||
OperationID: "list-" + k.noun + "s", Method: http.MethodGet, Path: k.path,
|
||||
Summary: "List accepted " + k.plural, Tags: tags,
|
||||
}, m.list(k.contract))
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionDelete, governance.KindConnector), huma.Operation{
|
||||
OperationID: "remove-" + k.noun, Method: http.MethodDelete, Path: k.path + "/{name}",
|
||||
Summary: "Remove an accepted package", Tags: tags,
|
||||
}, m.remove(k.contract))
|
||||
if k.contract == store.ContractMCP {
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionUpdate, governance.KindMCPServer), huma.Operation{
|
||||
OperationID: "accept-mcp-server", Method: http.MethodPut, Path: k.path + "/{name}",
|
||||
Summary: "Accept an MCP server and the tools it may offer", Tags: tags,
|
||||
}, m.acceptServer)
|
||||
continue
|
||||
}
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionUpdate, governance.KindConnector), huma.Operation{
|
||||
OperationID: "accept-" + k.noun, Method: http.MethodPut, Path: k.path + "/{name}",
|
||||
Summary: "Accept a package and start it", Tags: tags,
|
||||
}, m.accept(k.contract))
|
||||
}
|
||||
tags := []string{"Credentials"}
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionRead, governance.KindSecret), huma.Operation{
|
||||
OperationID: "list-credentials", Method: http.MethodGet, Path: "/api/credentials",
|
||||
Summary: "List credentials, never their values", Tags: tags,
|
||||
}, m.listCredentials)
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionRead, governance.KindSecret), huma.Operation{
|
||||
OperationID: "get-credential", Method: http.MethodGet, Path: "/api/credentials/{name}",
|
||||
Summary: "Get a credential, never its values", Tags: tags,
|
||||
}, m.getCredential)
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionUpdate, governance.KindSecret), huma.Operation{
|
||||
OperationID: "put-credential", Method: http.MethodPut, Path: "/api/credentials/{name}",
|
||||
Summary: "Store a credential sealed and restart what uses it", Tags: tags,
|
||||
}, m.putCredential)
|
||||
huma.Register(api, huma.Operation{
|
||||
httpapi.Register(api, httpapi.AdminAuthorized(governance.ActionRead, governance.KindSecret), huma.Operation{
|
||||
OperationID: "list-credential-kinds", Method: http.MethodGet, Path: "/api/credential-kinds",
|
||||
Summary: "List credential kinds and the fields each takes", Tags: tags,
|
||||
}, listCredentialKinds)
|
||||
|
||||
Reference in new issue
Block a user