token

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CapabilityStdio uint32 = 1 << iota
	CapabilityShare
	CapabilityAttach
	CapabilityStdioOffer
	CapabilityWebFile
	CapabilityDerptunTCP

	CapabilityTransferV2
)
View Source
const (
	SupportedVersion  uint8 = 5
	CustomDERPVersion uint8 = 6
)

Variables

View Source
var (
	ErrExpired            = errors.New("token expired")
	ErrChecksum           = errors.New("token checksum mismatch")
	ErrUnsupportedVersion = errors.New("token unsupported version")
	ErrInvalidLength      = errors.New("token invalid length")
)

Functions

func Encode

func Encode(tok Token) (string, error)

func IsSupportedVersion added in v0.17.0

func IsSupportedVersion(version uint8) bool

func VersionForRoute added in v0.17.0

func VersionForRoute(route derpbind.Route) uint8

Types

type Token

type Token struct {
	Version         uint8
	SessionID       [16]byte
	ExpiresUnix     int64
	BootstrapRegion uint16
	DERPPublic      [32]byte
	QUICPublic      [32]byte
	BearerSecret    [32]byte
	Capabilities    uint32
	DERPRoute       derpbind.Route
}

func Decode

func Decode(encoded string, now time.Time) (Token, error)

Jump to

Keyboard shortcuts

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