bootstraptoken

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 5 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 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