micromdm

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

View Source
const (
	KeyPayloadContent = "PayloadContent"
	KeyPayloadType    = "PayloadType"
	KeyChallenge      = "Challenge"

	PayloadTypeSCEP = "com.apple.security.scep"
)

Variables

View Source
var ErrEmptyChallenge = errors.New("empty challenge")

Functions

This section is empty.

Types

type DynamicGenerator

type DynamicGenerator struct {
	enrollprofile.Generator
	// contains filtered or unexported fields
}

DynamicGenerator wraps an enrollprofile.Generator, getting a MicroMDM dynamic SCEP challenge and inserting it into the generated profile. The wrapped generator is expected to return a plain XML profile that is not signed

func New

func New(gen enrollprofile.Generator, baseURL, apiKey string, opts ...Option) *DynamicGenerator

New returns a new DynamicGenerator with the wrapped generator and MicroMDM API URL and key. baseurl should be of the form http(s)://host[:port], e.g. "https://mdm.example.com"

func (*DynamicGenerator) GenerateEnrollProfile

func (g *DynamicGenerator) GenerateEnrollProfile(reqctx context.Context, ctx enrollprofile.Context) ([]byte, error)

type MalformedProfileError

type MalformedProfileError struct {
	Err string
}

func (*MalformedProfileError) Error

func (e *MalformedProfileError) Error() string

type Option

type Option func(g *DynamicGenerator)

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient configured the generator to use the http client. If left unconfigured, http.DefaultClient will be used

func WithLogger

func WithLogger(logger *slog.Logger) Option

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

Jump to

Keyboard shortcuts

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