enrollprofile

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context map[string]any

Context stores custom context data for generating an enrollment profile

type FileGenerator

type FileGenerator struct {
	Path string
}

FileGenerator generates a profile by reading a file. The file is read every time GenerateEnrollProfile is called

func (*FileGenerator) GenerateEnrollProfile

func (g *FileGenerator) GenerateEnrollProfile(_ context.Context, _ Context) ([]byte, error)

type Generator

type Generator interface {
	// GenerateEnrollProfile returns the a new enrollment profile generated from ctx
	GenerateEnrollProfile(reqctx context.Context, ctx Context) ([]byte, error)
}

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

Signer wraps a Generator and signs the profile after it is generated

func NewSigner

func NewSigner(gen Generator, identityPath, pass string, opts ...SignerOption) (*Signer, error)

NewSigner reads the identity keypair and returns the wrapped generator

func (*Signer) GenerateEnrollProfile

func (s *Signer) GenerateEnrollProfile(reqctx context.Context, ctx Context) ([]byte, error)

type SignerOption

type SignerOption func(s *Signer)

func WithLogger

func WithLogger(logger *slog.Logger) SignerOption

WithLogger configures the service with the given logger If left unconfigured, logging will be disabled

type StaticGenerator

type StaticGenerator struct {
	Profile []byte
}

StaticGenerator generates a static profile

func NewStaticGenerator

func NewStaticGenerator(filepath string) (*StaticGenerator, error)

NewStaticGenerator returns a new StaticGenerator by reading the profile at filepath. The file is only read once at creation time

func (*StaticGenerator) GenerateEnrollProfile

func (g *StaticGenerator) GenerateEnrollProfile(_ context.Context, _ Context) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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