Agent Mesh
Go a2aa2a-protocolagent-meshagentic-aiinferencemcpmeshmesh-networknetwork-securitynetworking-aip2p-network
biscuit authorizer to 500ms
Antonio Ojea485e71ba580e
diff --git a/cmd/sam-hub/biscuit_test.go b/cmd/sam-hub/biscuit_test.goindex 5a022faa..1fef5aa6 100644--- a/cmd/sam-hub/biscuit_test.go+++ b/cmd/sam-hub/biscuit_test.go@@ -101,7 +101,7 @@ func TestMintBiscuitToken(t *testing.T) {if err != nil {t.Fatal(err)}- authorizer1, err := b1.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(5*time.Second)))+ authorizer1, err := b1.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(500 * time.Millisecond)))if err != nil {t.Fatal(err)}@@ -134,7 +134,7 @@ func TestMintBiscuitToken(t *testing.T) {if err != nil {t.Fatal(err)}- authorizer2, err := b2.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(5*time.Second)))+ authorizer2, err := b2.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(500 * time.Millisecond)))if err != nil {t.Fatal(err)}@@ -164,7 +164,7 @@ func TestMintBiscuitToken(t *testing.T) {if err != nil {t.Fatal(err)}- authorizer3, err := b3.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(5*time.Second)))+ authorizer3, err := b3.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(500 * time.Millisecond)))if err != nil {t.Fatal(err)}@@ -194,7 +194,7 @@ func TestMintBiscuitToken(t *testing.T) {if err != nil {t.Fatal(err)}- authorizer4, err := b4.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(5*time.Second)))+ authorizer4, err := b4.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(500 * time.Millisecond)))if err != nil {t.Fatal(err)}@@ -339,7 +339,7 @@ func TestMintBiscuitToken_ClaimsTranslation(t *testing.T) {t.Fatalf("Failed to unmarshal biscuit: %v", err)}- authorizer, err := b.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(5*time.Second)))+ authorizer, err := b.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(500 * time.Millisecond)))if err != nil {t.Fatalf("Failed to get authorizer: %v", err)}@@ -560,7 +560,7 @@ func TestMintBiscuitToken_VariousClaimsTypes(t *testing.T) {t.Fatalf("Unmarshal biscuit failed: %v", err)}- authorizer, err := b.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(5*time.Second)))+ authorizer, err := b.Authorizer(kr.GetCurrentPublicKey(), biscuit.WithWorldOptions(datalog.WithMaxDuration(500 * time.Millisecond)))if err != nil {t.Fatalf("Authorizer failed: %v", err)}diff --git a/cmd/sam-node/mcp_handlers_test.go b/cmd/sam-node/mcp_handlers_test.goindex f1d1e56a..eaafc8c6 100644--- a/cmd/sam-node/mcp_handlers_test.go+++ b/cmd/sam-node/mcp_handlers_test.go@@ -293,7 +293,7 @@ func TestHandleFindRemoteTools_MeshWideViaHandler(t *testing.T) {}// Give the DHT a moment to record the provider.- time.Sleep(5 * time.Second)+ time.Sleep(500 * time.Millisecond)res, _, err := nodeA.handleFindRemoteTools(ctx, &mcp.CallToolRequest{}, FindRemoteToolsParams{})if err != nil {diff --git a/cmd/sam-node/node_test.go b/cmd/sam-node/node_test.goindex 9d797ea7..611cc29d 100644--- a/cmd/sam-node/node_test.go+++ b/cmd/sam-node/node_test.go@@ -82,7 +82,7 @@ func TestStartRenewalLoop_ExpiredAndFails(t *testing.T) {// Run the renewal loop. Since there's no JWT/Issuer provided, it fails to renew.// It will see that it's expired and it failed to renew, so it will log.Fatalfnode.StartRenewalLoop(context.Background(), "", "", "", "")- time.Sleep(5 * time.Second)+ time.Sleep(500 * time.Millisecond)os.Exit(0) // should not be reachedreturn}