feat: grant first setup agent gateway operator access

This commit is contained in:
Goon committed 2026-06-12 10:40:59 +07:00
1 parent 95fd1f8f2d
commit c320de5a87
22 files changed
+1300 -45

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
package cmd
import "testing"
func TestSetupAgentCreatePayloadIncludesGatewayOperatorConsentOnlyWhenTrue(t *testing.T) {
withoutConsent := setupAgentCreatePayload("assistant", "Assistant", "predefined", "anthropic", "claude", false)
if _, ok := withoutConsent["grant_gateway_operator_access"]; ok {
t.Fatalf("grant_gateway_operator_access must be absent without explicit consent: %#v", withoutConsent)
}
withConsent := setupAgentCreatePayload("assistant", "Assistant", "predefined", "anthropic", "claude", true)
if got, ok := withConsent["grant_gateway_operator_access"].(bool); !ok || !got {
t.Fatalf("grant_gateway_operator_access missing after consent: %#v", withConsent)
}
}