proxyclient

package
v0.10.9 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package proxyclient forwards MDM declarative check-ins to a separately deployed declaration engine in a custom application composition. The unified reference server uses the in-process adapter.

Design

The service.DMHandler forwards original plist bytes, applies configured request signing and response verification, and bounds response size and time. Device-facing 200, empty status responses and declaration 404 responses are preserved. Transport, authentication and upstream server failures become internal service errors rather than declaration-removal responses. URL joining preserves a configured path prefix.

Callers supply HTTPS and independent request/response HMAC keys. The request envelope binds method, target, content type, timestamp, nonce and body; replies bind that envelope to their status, content type and body. The receiving adapter requires shared replay state. Insecure transport is an explicit literal-loopback test option, not a reference-server deployment setting.

References

Index

Constants

View Source
const DefaultTimeout = 30 * time.Second

DefaultTimeout bounds one forwarded check-in.

Variables

View Source
var (
	// ErrUpstream wraps every failure of the remote declaration backend or the network.
	ErrUpstream = errors.New("proxyclient: upstream failure")
	// ErrBadURL is returned by Handler for an empty or unusable URL.
	ErrBadURL = errors.New("proxyclient: invalid URL")
)

Errors.

Functions

func Handler

func Handler(cfg Config) (service.DMHandler, error)

Handler validates cfg and returns the forwarding handler.

Types

type Config

type Config struct {
	// AllowInsecureForTests permits HTTP only to a literal loopback address.
	AllowInsecureForTests bool
	// URL is the base URL of the remote declaration backend; proxywire.Path is appended.
	URL string
	// Client defaults to an http.Client with DefaultTimeout. Set TLS
	// client certificates on its transport for mutual TLS.
	Client *http.Client
	// Timeout bounds each request through its context; default
	// DefaultTimeout.
	Timeout time.Duration
	// SendKey signs every request; RecvKey verifies every response.
	SendKey, RecvKey []byte
	// MaxBody bounds the response body; default proxywire.DefaultMaxBody.
	MaxBody int64
	// Auth, when set, adds headers to every request (a bearer token, for
	// example).
	Auth func(*http.Request)
}

Config builds a Handler.

type ConfigurationProfileFetcher added in v0.9.4

type ConfigurationProfileFetcher func(context.Context, mdm.EnrollmentID, string) (service.DMResponse, error)

ConfigurationProfileFetcher runs only after the MDM ingress authenticates the full identity.

func ConfigurationProfiles added in v0.9.4

func ConfigurationProfiles(cfg Config) (ConfigurationProfileFetcher, error)

ConfigurationProfiles uses the authenticated private hop for profile delivery.

Jump to

Keyboard shortcuts

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