network/pkg/discovery/discovery_test.go
anonpenguin 917b0e5acd Enforce API key/JWT authentication and namespace gating in client
- Require API key or JWT by default for client connections - Auto-derive
namespace from JWT claim or API key format `ak_<rand>:<namespace>` -
Deny calls if per-call namespace override mismatches resolved namespace
- Guard Storage, PubSub, Database, and NetworkInfo operations with
access checks - Add context helpers for consistent namespace override
handling - Update docs and add end-to-end and unit tests for
authentication logic
2025-08-20 23:01:51 +03:00

14 lines
264 B
Go

package discovery
import (
"testing"
"time"
)
func TestConfigDefaults(t *testing.T) {
cfg := Config{DiscoveryInterval: 5 * time.Second, MaxConnections: 3}
if cfg.DiscoveryInterval <= 0 || cfg.MaxConnections <= 0 {
t.Fatalf("invalid config: %+v", cfg)
}
}