server

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAddress

func WithAddress(address string) func(*Server)

func WithCA

func WithCA(key []byte, curve cert.Curve, cert *cert.NebulaCertificate) func(*Server)

func WithDatabase

func WithDatabase(db *gorm.DB) func(*Server)

func WithTLS

func WithTLS(tls *TLS) func(*Server)

Types

type CA

type CA struct {
	// contains filtered or unexported fields
}

type ClientGetter

type ClientGetter interface {
	GetClient(id string) (*types.Client, error)
	GetClientByMAC(mac string) (*types.Client, error)
	GetClientByPublicKey(pubKeyHash string) (*types.Client, error)
}

type ClientNetworkResponse

type ClientNetworkResponse struct {
	PublicKeyHash string      `json:"publicKeyHash"`
	Address       *netip.Addr `json:"address"`
	Groups        []string    `json:"groups"`
}

type CreateCertificateRequest

type CreateCertificateRequest struct {
	PubPEM []byte `json:"pubPem"`
}

type CreateCertificateResponse

type CreateCertificateResponse struct {
	GetCertificateResponse
	PEM []byte `json:"pem"`
}

type CreateClientRequest

type CreateClientRequest struct {
}

type CreateClientResponse

type CreateClientResponse GetClientResponse

type CreateLighthouseRequest

type CreateLighthouseRequest struct {
	PublicAddr netip.AddrPort
}

type CreateLighthouseResponse

type CreateLighthouseResponse Lighthouse

type CreateNetworkClientRequest

type CreateNetworkClientRequest struct {
	PublicKeyHash string         `json:"publicKeyHash"`
	Address       *netip.Addr    `json:"address"`
	Groups        []string       `json:"groups"`
	Subnets       []netip.Prefix `json:"subnets"`
	IsLighthouse  bool           `json:"isLighthouse"`
}

type CreateNetworkClientResponse

type CreateNetworkClientResponse struct {
	Network      string         `json:"network"`
	Address      netip.Addr     `json:"address"`
	Groups       []string       `json:"groups"`
	IsLighthouse bool           `json:"isLighthouse"`
	Subnets      []netip.Prefix `json:"subnets"`
}

type CreateNetworkRequest

type CreateNetworkRequest struct {
	Name    string       `json:"name"`
	Network netip.Prefix `json:"network"`
}

type CreateNetworkResponse

type CreateNetworkResponse GetNetworkResponse

type CreateRouterRequest

type CreateRouterRequest struct {
	Subnet netip.Prefix
}

type CreateRouterResponse

type CreateRouterResponse Router

type DeleteClientResponse

type DeleteClientResponse GetClientResponse

type DeleteNetworkClientResponse

type DeleteNetworkClientResponse CreateNetworkClientResponse

type GetCAResponse

type GetCAResponse struct {
	PEM []byte `json:"pem"`
}

type GetCertificateResponse

type GetCertificateResponse struct {
	Address        netip.Addr `json:"address"`
	Hash           string     `json:"hash"`
	Groups         []string   `json:"groups"`
	NotAfter       time.Time  `json:"notAfter"`
	RevokedAfter   time.Time  `json:"revokedAfter"`
	RenewableAfter time.Time  `json:"renewableAfter"`
}

type GetClientNetworkResponse

type GetClientNetworkResponse struct {
	PublicKeyHash string         `json:"publicKeyHash"`
	Address       *netip.Addr    `json:"address"`
	Groups        []string       `json:"groups"`
	Subnets       []netip.Prefix `json:"subnets"`
	IsLighthouse  bool           `json:"isLighthouse"`
}

type GetClientResponse

type GetClientResponse struct {
	PublicKeyHash   string   `json:"publicKeyHash"`
	CommonName      string   `json:"commonName"`
	HardwareAddress string   `json:"hardwareAddress,omitempty"`
	Networks        []string `json:"networks"`
}

type GetNetworkResponse

type GetNetworkResponse struct {
	Name   string       `json:"name"`
	Prefix netip.Prefix `json:"prefix"`
	Groups []string     `json:"groups"`
}

type HardwareAddressAuthenticator

type HardwareAddressAuthenticator struct {
	// contains filtered or unexported fields
}

func NewHardwareAddressAuthenticator

func NewHardwareAddressAuthenticator(localNetwork net.IPNet, errorHandler func(err error, w http.ResponseWriter)) *HardwareAddressAuthenticator

func (HardwareAddressAuthenticator) Middleware

type Lighthouse

type Lighthouse struct {
	PublicAddr netip.AddrPort
	NebulaIP   netip.Addr
}

type ListCertificatesResponse

type ListCertificatesResponse struct {
	Items []GetCertificateResponse `json:"items"`
}

type ListClientNetworkResponse

type ListClientNetworkResponse struct {
	Items []ClientNetworkResponse `json:"items"`
}

type ListClientNetworksResponse

type ListClientNetworksResponse struct {
	Items []GetClientNetworkResponse `json:"items"`
}

type ListClientsResponse

type ListClientsResponse struct {
	Items []GetClientResponse `json:"items"`
}

type ListLighthousesResponse

type ListLighthousesResponse struct {
	Items []Lighthouse
}

type ListNetworksResponse

type ListNetworksResponse struct {
	Items []GetNetworkResponse `json:"items"`
}

type ListRevocationsResponse

type ListRevocationsResponse struct {
	Items []Revocation
}

type ListRoutersResponse

type ListRoutersResponse struct {
	Items []Router `json:"items"`
}

type PublicKeyAuthHeader

type PublicKeyAuthHeader struct {
	PublicKey []byte   `json:"k"`
	Challenge [40]byte `json:"c"`
	Nonce     [8]byte  `json:"n"`
	Signature []byte   `json:"s"`
}

type PublicKeyAuthenticator

type PublicKeyAuthenticator struct {
	// contains filtered or unexported fields
}

func NewPublicKeyAuthenticator

func NewPublicKeyAuthenticator(salt [32]byte, errorHandler func(err error, w http.ResponseWriter)) *PublicKeyAuthenticator

func (PublicKeyAuthenticator) Middleware

type Revocation

type Revocation struct {
	Hash string
}

type Router

type Router struct {
	NebulaIP netip.Addr
	Subnet   netip.Prefix
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(options ...func(*Server)) *Server

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) ServeTLS

func (s *Server) ServeTLS() error

type TLS

type TLS struct {
	// contains filtered or unexported fields
}

func NewTLS

func NewTLS(keyPath, certPath string) *TLS

type UpdateNetworkClientRequest

type UpdateNetworkClientRequest struct {
	Address      *netip.Addr    `json:"address"`
	Groups       []string       `json:"groups"`
	Subnets      []netip.Prefix `json:"subnets"`
	IsLighthouse bool           `json:"isLighthouse"`
}

type UpdateNetworkClientResponse

type UpdateNetworkClientResponse CreateNetworkClientResponse

type WhoamiResponse

type WhoamiResponse struct {
	PublicKeyHash string `json:"publicKeyHash"`
}

Jump to

Keyboard shortcuts

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