Relocate agent-run authorization to its package

The agent-run actions and policies lived in the core probo policy set,
which forced every authorization change for the agent-run domain to
touch unrelated core files. Move the actions and the OWNER/ADMIN and
VIEWER/AUDITOR policies into the agentrun package and have it expose a
PolicySet that probod registers into the authorizer at composition
time, so the rules live alongside the domain logic they govern.

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-06-08 14:50:23 +02:00
parent f5a73c7be1
commit 98a8d90391
7 changed files with 84 additions and 8 deletions

View File

@@ -12,6 +12,7 @@ import (
"time"
"go.gearno.de/kit/log"
"go.probo.inc/probo/pkg/agentrun"
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/iam"
@@ -1175,7 +1176,7 @@ func (r *organizationResolver) Tasks(ctx context.Context, obj *types.Organizatio
// AgentRuns is the resolver for the agentRuns field.
func (r *organizationResolver) AgentRuns(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.AgentRunOrderBy) (*types.AgentRunConnection, error) {
scope, err := r.authorize(ctx, obj.ID, probo.ActionAgentRunList)
scope, err := r.authorize(ctx, obj.ID, agentrun.ActionAgentRunList)
if err != nil {
return nil, err
}