bootstraptoken

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownPurpose = errors.New("bootstrap token purpose is unknown")
	ErrWrongPurpose   = errors.New("bootstrap token has the wrong purpose")
)

Functions

func Generate

func Generate(purpose Purpose) (string, error)

func Hash

func Hash(token string) string

func ValidatePurpose

func ValidatePurpose(token string, expected Purpose, allowLegacyEnrollment bool) error

Types

type Purpose

type Purpose string
const (
	PurposeEnrollment Purpose = "enrollment"
	PurposeMeshImport Purpose = "mesh_import"
)

func PurposeOf

func PurposeOf(token string) (Purpose, bool)

PurposeOf returns the purpose encoded in a prefixed bootstrap token. Legacy unprefixed enrollment tokens intentionally return known=false; callers may accept them only in the explicit backward-compatible enrollment path.

Jump to

Keyboard shortcuts

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