From 1a722cd2043daf4a709419c60ac1c5c5a73e5642 Mon Sep 17 00:00:00 2001 From: Erik Hortsch Date: Fri, 4 Sep 2026 16:52:43 -0700 Subject: [PATCH] auth: add AgentGrant.DispatchAdmin Grants access to manage a project's agent dispatch queue. The service it authorizes is defined in cloud-protocol; only the grant is shared, so only the grant lands here. Co-Authored-By: Claude Opus 5 --- .changeset/agent-dispatch-admin-grant.md | 6 ++++++ auth/grants.go | 3 +++ auth/grants_test.go | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/agent-dispatch-admin-grant.md diff --git a/.changeset/agent-dispatch-admin-grant.md b/.changeset/agent-dispatch-admin-grant.md new file mode 100644 index 000000000..0d4a256ba --- /dev/null +++ b/.changeset/agent-dispatch-admin-grant.md @@ -0,0 +1,6 @@ +--- +"github.com/livekit/protocol": patch +"@livekit/protocol": patch +--- + +Add `AgentGrant.DispatchAdmin` diff --git a/auth/grants.go b/auth/grants.go index 4fe7c57f5..11c27cdd7 100644 --- a/auth/grants.go +++ b/auth/grants.go @@ -583,6 +583,8 @@ type AgentGrant struct { SimulationAdmin bool `json:"simulationAdmin,omitempty"` // DatabaseAdmin grants access to a project's agent databases (AgentDB). DatabaseAdmin bool `json:"databaseAdmin,omitempty"` + // DispatchAdmin grants access to manage a project's agent dispatch queue. + DispatchAdmin bool `json:"dispatchAdmin,omitempty"` } func (s *AgentGrant) Clone() *AgentGrant { @@ -603,6 +605,7 @@ func (s *AgentGrant) MarshalLogObject(e zapcore.ObjectEncoder) error { e.AddBool("Admin", s.Admin) e.AddBool("SimulationAdmin", s.SimulationAdmin) e.AddBool("DatabaseAdmin", s.DatabaseAdmin) + e.AddBool("DispatchAdmin", s.DispatchAdmin) return nil } diff --git a/auth/grants_test.go b/auth/grants_test.go index 211bc2097..042013088 100644 --- a/auth/grants_test.go +++ b/auth/grants_test.go @@ -120,7 +120,8 @@ func TestGrants(t *testing.T) { t.Run("clone with Agent", func(t *testing.T) { agent := &AgentGrant{ - Admin: true, + Admin: true, + DispatchAdmin: true, } grants := &ClaimGrants{ Identity: "identity",