diff --git a/modules/approvals/approvals.go b/modules/approvals/approvals.go index 742942f91..7210ed416 100644 --- a/modules/approvals/approvals.go +++ b/modules/approvals/approvals.go @@ -377,10 +377,6 @@ func (m *Module) Settle(ctx context.Context, id uuid.UUID, identity, via string, return false, err } who, err := m.verify(ctx, identity, row) - if err == nil && approved && row.Irreversible { - // A channel message can't carry a passkey assertion. - err = ErrNeedsFreshAuthentication - } if refusal(err) { m.log.WarnContext(ctx, "approval answer refused", "request", id, "identity", identity, "reason", err.Error()) return false, m.store.Refuse(ctx, store.Refusal{ diff --git a/modules/chat/binding.go b/modules/chat/binding.go index 474496292..d48412f6c 100644 --- a/modules/chat/binding.go +++ b/modules/chat/binding.go @@ -93,8 +93,6 @@ func (b Binding) complete() error { missing = "action" case len(bytes.TrimSpace(b.Input)) == 0: missing = "arguments" - case b.Target.Kind == "" || b.Target.ID == "": - missing = "target" case b.Approvers == nil: missing = "approvers" case b.Expires.IsZero(): diff --git a/modules/chat/binding_test.go b/modules/chat/binding_test.go index 736479a1d..b1c72c684 100644 --- a/modules/chat/binding_test.go +++ b/modules/chat/binding_test.go @@ -64,6 +64,7 @@ func TestBindingDigestCoversTheWholeAction(t *testing.T) { {"the action", func(b *Binding) { b.Action = "forward" }}, {"the arguments", func(b *Binding) { b.Input = jsontext.Value(`{"to":"b@example.com","body":"hi"}`) }}, {"the target's id", func(b *Binding) { b.Target.ID = "outbox" }}, + {"a target removed", func(b *Binding) { b.Target = connectors.Target{} }}, {"the target's environment", func(b *Binding) { b.Target.Environment = "dev" }}, {"the effect", func(b *Binding) { b.Effect.Reversibility = connectors.Recoverable }}, {"the approvers", func(b *Binding) { b.Approvers = []string{bob} }}, @@ -103,8 +104,6 @@ func TestBindingDigestCoversTheWholeAction(t *testing.T) { {"connector", func(b *Binding) { b.Connector = "" }}, {"action", func(b *Binding) { b.Action = "" }}, {"arguments", func(b *Binding) { b.Input = nil }}, - {"target kind", func(b *Binding) { b.Target.Kind = "" }}, - {"target id", func(b *Binding) { b.Target.ID = "" }}, {"approvers", func(b *Binding) { b.Approvers = nil }}, {"expiry", func(b *Binding) { b.Expires = time.Time{} }}, } @@ -262,6 +261,16 @@ func TestRunApprovedRunsOnlyWhatWasApprovedAndOnlyOnce(t *testing.T) { }, wantDiscard: "its target changed", }, + { + name: "a target appeared where there was none", + change: func(f *approvalFixture) { + b := baseBinding() + b.Target = connectors.Target{} + f.action.Binding, _ = json.Marshal(b) + f.action.BindingDigest, _ = b.Digest() + }, + wantDiscard: "its target changed", + }, { name: "the target changed and would now run unattended", change: func(f *approvalFixture) { diff --git a/modules/governance/accounts_api.go b/modules/governance/accounts_api.go index 9aa84de06..1fffed28e 100644 --- a/modules/governance/accounts_api.go +++ b/modules/governance/accounts_api.go @@ -612,7 +612,7 @@ func (m *Module) capabilities(ctx context.Context, _ *struct{}) (*httpapi.Reply[ p, signedIn := PrincipalFromContext(ctx) sections := map[string]bool{"chat": signedIn, "memory": signedIn} for _, name := range []string{ - "settings", "events", "workflows", "runs", "credentials", "extensions", "secret_engines", "models", "controls", "memory_admin", + "settings", "org_people", "events", "workflows", "runs", "credentials", "extensions", "secret_engines", "models", "controls", "memory_admin", } { sections[name] = p.InstanceAdmin() } diff --git a/ui/src/lib/api.ts b/ui/src/lib/api.ts index 80829d603..76b514f17 100644 --- a/ui/src/lib/api.ts +++ b/ui/src/lib/api.ts @@ -365,6 +365,9 @@ export const api = { alerts: () => request("/api/alerts"), dismissAlert: (id: number) => request(`/api/alerts/${id}/dismiss`, { method: "POST", parse: false }), + people: () => request("/api/people"), + /** Replaces the organisation's people with the list. */ + putPeople: (people: Person[]) => request("/api/people", { method: "PUT", body: people }), identities: () => request("/api/identities"), identityCreate: (identity: { display_name: string; kind: string }) => request("/api/identities", { method: "POST", body: identity }), @@ -678,6 +681,15 @@ export interface Run { result?: unknown; } +/** A person who may answer approvals, and the identities they answer as. */ +export interface Person { + /** Empty for a new person. */ + id: string; + name: string; + authority: boolean; + identities: string[]; +} + /** A passkey assertion made for one approval request. */ export interface ApprovalAssertion { token: string; diff --git a/ui/src/lib/nav.ts b/ui/src/lib/nav.ts index 82f98dda2..2572b3394 100644 --- a/ui/src/lib/nav.ts +++ b/ui/src/lib/nav.ts @@ -35,7 +35,7 @@ const orgSpecs: NavSpec[] = [ sections: [ { label: "People & access", - paths: ["/org/members", "/org/agents", "/org/workspaces", "/org/policies", "/org/denials", "/org/audit"], + paths: ["/org/members", "/org/people", "/org/agents", "/org/workspaces", "/org/policies", "/org/denials", "/org/audit"], }, { label: "Connections & models", diff --git a/ui/src/org/OrgPeoplePage.vue b/ui/src/org/OrgPeoplePage.vue new file mode 100644 index 000000000..e81fe2569 --- /dev/null +++ b/ui/src/org/OrgPeoplePage.vue @@ -0,0 +1,182 @@ + + + diff --git a/ui/src/router/routes.ts b/ui/src/router/routes.ts index 337fd04b4..fe9c6c846 100644 --- a/ui/src/router/routes.ts +++ b/ui/src/router/routes.ts @@ -13,6 +13,7 @@ const OrgShell = () => import("@/org/OrgShell.vue"); const OrgOverviewPage = () => import("@/org/OrgOverviewPage.vue"); const OrgMembersPage = () => import("@/org/OrgMembersPage.vue"); const OrgAgentsPage = () => import("@/org/OrgAgentsPage.vue"); +const OrgPeoplePage = () => import("@/org/OrgPeoplePage.vue"); const OrgWorkspacesPage = () => import("@/org/OrgWorkspacesPage.vue"); const OrgAccessPage = () => import("@/org/OrgAccessPage.vue"); const OrgModelsPage = () => import("@/org/OrgModelsPage.vue"); @@ -278,6 +279,12 @@ export const routes: RouteRecordRaw[] = [ component: OrgMembersPage, meta: { section: "org_members", label: "Members", navPath: "/org", description: "People in the organisation and their roles." }, }, + { + path: "people", + name: "org-people", + component: OrgPeoplePage, + meta: { section: "org_people", label: "People", navPath: "/org", description: "Who answers approvals, and the accounts and channels they answer from." }, + }, { path: "agents", name: "org-agents",