mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-19 14:15:46 +00:00
feat: grant first setup agent gateway operator access
This commit is contained in:
1 parent
95fd1f8f2d
commit
c320de5a87
22 files changed
+1300
-45
No files matched your search
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user