Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateNoiseKeyAttestation(ctx context.Context, ident *identity.FullIdentity, info *pb.NoiseInfo) (_ *pb.NoiseKeyAttestation, err error)
- func GenerateNoiseSessionAttestation(ctx context.Context, ident *identity.FullIdentity, handshakeHash []byte) (_ *pb.NoiseSessionAttestation, err error)
- func NewPrefixedListener(prefix []byte, listener net.Listener) net.Listener
- func ValidateNoiseKeyAttestation(ctx context.Context, attestation *pb.NoiseKeyAttestation) (err error)
- func ValidateNoiseSessionAttestation(ctx context.Context, attestation *pb.NoiseSessionAttestation) (err error)
- type Config
- type PrefixedListener
- type Server
- func (p *Server) AddHTTPFallback(httpHandler http.HandlerFunc)
- func (p *Server) Addr() net.Addr
- func (p *Server) Close() error
- func (p *Server) DRPC() drpc.Mux
- func (p *Server) Identity() *identity.FullIdentity
- func (p *Server) IsQUICEnabled() bool
- func (p *Server) NoiseInfo() *pb.NoiseInfo
- func (p *Server) NoiseKeyAttestation(ctx context.Context) (_ *pb.NoiseKeyAttestation, err error)
- func (p *Server) PrivateAddr() net.Addr
- func (p *Server) PrivateDRPC() drpc.Mux
- func (p *Server) Run(ctx context.Context) (err error)
Constants ¶
const NoiseHeader = "DRPC!N!1"
NoiseHeader is the drpcmigrate.Header prefix for DRPC over Noise.
Variables ¶
var ( // Error is a pkg/server error. Error = errs.Class("server") )
Functions ¶
func GenerateNoiseKeyAttestation ¶ added in v1.72.2
func GenerateNoiseKeyAttestation(ctx context.Context, ident *identity.FullIdentity, info *pb.NoiseInfo) (_ *pb.NoiseKeyAttestation, err error)
GenerateNoiseKeyAttestation will sign a given Noise public key using the Node's leaf key and certificate chain, generating a pb.NoiseKeyAttestation.
func GenerateNoiseSessionAttestation ¶ added in v1.72.2
func GenerateNoiseSessionAttestation(ctx context.Context, ident *identity.FullIdentity, handshakeHash []byte) (_ *pb.NoiseSessionAttestation, err error)
GenerateNoiseSessionAttestation will sign a given Noise session handshake hash using the Node's leaf key and certificate chain, generating a pb.NoiseSessionAttestation.
func NewPrefixedListener ¶ added in v1.63.1
NewPrefixedListener creates a new PrefixedListener.
func ValidateNoiseKeyAttestation ¶ added in v1.72.2
func ValidateNoiseKeyAttestation(ctx context.Context, attestation *pb.NoiseKeyAttestation) (err error)
ValidateNoiseKeyAttestation will confirm that a provided *pb.NoiseKeyAttestation was signed correctly.
func ValidateNoiseSessionAttestation ¶ added in v1.72.2
func ValidateNoiseSessionAttestation(ctx context.Context, attestation *pb.NoiseSessionAttestation) (err error)
ValidateNoiseSessionAttestation will confirm that a provided *pb.NoiseSessionAttestation was signed correctly.
Types ¶
type Config ¶
type Config struct { tlsopts.Config Address string `user:"true" help:"public address to listen on" default:":7777"` PrivateAddress string `user:"true" help:"private address to listen on" default:"127.0.0.1:7778"` DisableQUIC bool `help:"disable QUIC listener on a server" hidden:"true" default:"false"` DisableTCP bool `help:"disable TCP listener on a server" internal:"true"` DebugLogTraffic bool `hidden:"true" default:"false"` // Deprecated TCPFastOpen bool `help:"enable support for tcp fast open experiment" default:"true"` TCPFastOpenQueue int `help:"the size of the tcp fast open queue" default:"256"` }
Config holds server specific configuration parameters.
type PrefixedListener ¶ added in v1.63.1
PrefixedListener injects prefix bytes to the beginning of every new connection.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a bundle of services defined by a specific ID. Examples of servers are the satellite, the storagenode, and the uplink.
func (*Server) AddHTTPFallback ¶ added in v1.63.1
func (p *Server) AddHTTPFallback(httpHandler http.HandlerFunc)
AddHTTPFallback adds http fallback to the drpc endpoint.
func (*Server) Identity ¶
func (p *Server) Identity() *identity.FullIdentity
Identity returns the server's identity.
func (*Server) IsQUICEnabled ¶ added in v1.47.3
IsQUICEnabled checks if QUIC is enabled by config and udp port is open.
func (*Server) NoiseInfo ¶ added in v1.72.2
NoiseInfo returns the noise configuration for this server. This includes the keypair in use.
func (*Server) NoiseKeyAttestation ¶ added in v1.72.2
NoiseKeyAttestation returns the noise key attestation for this server.
func (*Server) PrivateAddr ¶
PrivateAddr returns the server's private listener address.
func (*Server) PrivateDRPC ¶
PrivateDRPC returns the server's DRPC mux for registration purposes.