Documentation
¶
Overview ¶
Package gateway implements the internet facing side of the central: enrollment, certificate renewal, edge sessions, result reports and STUN.
Index ¶
- Constants
- func TLSConfig(ca *pki.CA, hosts []string) (*tls.Config, error)
- type Gateway
- func (g *Gateway) Enroll(ctx context.Context, req *connect.Request[netprobev1.EnrollRequest]) (*connect.Response[netprobev1.EnrollResponse], error)
- func (g *Gateway) Handler() http.Handler
- func (g *Gateway) Renew(ctx context.Context, req *connect.Request[netprobev1.RenewRequest]) (*connect.Response[netprobev1.RenewResponse], error)
- func (g *Gateway) Report(ctx context.Context, req *connect.Request[netprobev1.ReportRequest]) (*connect.Response[netprobev1.ReportResponse], error)
- func (g *Gateway) Session(ctx context.Context, ...) error
- type STUNServer
Constants ¶
View Source
const MaxMessageBytes = 1 << 20
Max size of any message sent by an edge. MaxMessageBytes bounds every request body.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Gateway ¶
type Gateway struct {
Store *store.Store
CA *pki.CA
Hub *fleet.Hub
Recorder *fleet.Recorder
Assigner *fleet.Assigner
ASN *asn.DB // AS of traceroute hops, may be nil
CertValidity time.Duration
HeartbeatInterval time.Duration
STUNServer string // host:port advertised to edges
STUNInterval time.Duration
// contains filtered or unexported fields
}
Gateway serves EdgeService (internet facing).
func (*Gateway) Enroll ¶
func (g *Gateway) Enroll(ctx context.Context, req *connect.Request[netprobev1.EnrollRequest]) (*connect.Response[netprobev1.EnrollResponse], error)
func (*Gateway) Renew ¶
func (g *Gateway) Renew(ctx context.Context, req *connect.Request[netprobev1.RenewRequest]) (*connect.Response[netprobev1.RenewResponse], error)
func (*Gateway) Report ¶
func (g *Gateway) Report(ctx context.Context, req *connect.Request[netprobev1.ReportRequest]) (*connect.Response[netprobev1.ReportResponse], error)
Report stores a batch of results from an authenticated edge.
func (*Gateway) Session ¶
func (g *Gateway) Session(ctx context.Context, stream *connect.BidiStream[netprobev1.SessionRequest, netprobev1.SessionResponse]) error
Session runs until the edge leaves, times out or is kicked.
type STUNServer ¶
type STUNServer struct {
Hub *fleet.Hub
Recorder *fleet.Recorder
// contains filtered or unexported fields
}
STUNServer answers authenticated binding requests only; others get silence.
func (*STUNServer) Serve ¶
func (s *STUNServer) Serve(ctx context.Context, conn net.PacketConn) error
Serve answers on conn until ctx ends.
Click to show internal directories.
Click to hide internal directories.