- Introduced ExpandHosts function to parse and expand comma-separated host entries, including special values like "internal" and "localhost". - Updated gRPC server to utilize the new ExpandHosts function for improved host management. - Added HostHasInternal function to check for "internal" in host strings, enhancing configuration flexibility. - Implemented new gRPC endpoints for TaiTunnel registration and forwarding, improving tunnel communication capabilities. - Refactored authentication logic to include new TaiTunnel endpoints, ensuring proper access control. Made-with: Cursor
20 lines
417 B
Go
20 lines
417 B
Go
package registry
|
|
|
|
import (
|
|
"log/slog"
|
|
)
|
|
|
|
// NewForTest creates a standalone Registry for use in tests.
|
|
// Not intended for production use.
|
|
func NewForTest() *Registry {
|
|
return &Registry{
|
|
nodes: make(map[string]*TaiNode),
|
|
logger: slog.Default(),
|
|
}
|
|
}
|
|
|
|
// SetGlobalForTest replaces the global registry singleton for testing.
|
|
// Not intended for production use.
|
|
func SetGlobalForTest(r *Registry) {
|
|
global = r
|
|
}
|