controller

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2025 License: Apache-2.0 Imports: 43 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HttpHandlers = []interface{}{
	nodeHandlers,
	gwHandlers,
	userHandlers,
	networkHandlers,
	dnsHandlers,
	fileHandlers,
	serverHandlers,
	extClientHandlers,
	ipHandlers,
	loggerHandlers,
	hostHandlers,
	enrollmentKeyHandlers,
	aclHandlers,
	egressHandlers,
	legacyHandlers,
}

HttpHandlers - handler functions for REST interactions

View Source
var HttpMiddlewares = []mux.MiddlewareFunc{
	db.Middleware,
	userMiddleWare,
}

HttpMiddlewares - middleware functions for REST interactions

View Source
var ListRoles = listRoles

Functions

func Authorize

func Authorize(
	hostAllowed, networkCheck bool,
	authNetwork string,
	next http.Handler,
) http.HandlerFunc

The middleware for most requests to the API They all pass through here first This will validate the JWT (or check for master token) This will also check against the authNetwork and make sure the node should be accessing that endpoint, even if it's technically ok This is kind of a poor man's RBAC. There's probably a better/smarter way. TODO: Consider better RBAC implementations

func GetDNSEntry

func GetDNSEntry(domain string, network string) (models.DNSEntry, error)

GetDNSEntry - gets a DNS entry

func HandleRESTRequests

func HandleRESTRequests(wg *sync.WaitGroup, ctx context.Context)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL