mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-10-06 10:39:06 +00:00
- 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
14 lines
264 B
Go
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)
|
|
}
|
|
}
|