network/pkg/gateway/pubsub_handlers_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

13 lines
293 B
Go

package gateway
import "testing"
func TestNamespaceHelpers(t *testing.T) {
if p := namespacePrefix("ns"); p != "ns::ns::" {
t.Fatalf("unexpected prefix: %q", p)
}
if tpc := namespacedTopic("ns", "topic"); tpc != "ns::ns::topic" {
t.Fatalf("unexpected namespaced topic: %q", tpc)
}
}