mgmtapi

package
v0.229.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package mgmtapi mounts the spec-driven Management API surface onto chi: one generic, bearer-protected handler per Auth0 Management API operation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(opts MountOpts) error

Mount walks the spec and registers one bearer-protected generic handler per Management API operation. Canned responses are registered out-of-band via the /admin0/expectations control plane, not per-operation siblings.

Types

type GenericHandler

type GenericHandler struct {
	Op        spec.Operation
	Validator *spec.Validator
	Store     *matches.Store
	Log       zerolog.Logger
	Strict    bool
}

GenericHandler is the main spec-driven handler for a Management API operation.

func (*GenericHandler) ServeHTTP

func (h *GenericHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type MountOpts

type MountOpts struct {
	Router    chi.Router
	Spec      *spec.Spec
	Validator *spec.Validator
	Store     *matches.Store
	Keys      *jwks.KeySet
	Log       zerolog.Logger
	Strict    bool // SPEC_VALIDATION_STRICT.
	// RequireAudience, when non-empty, makes the bearer middleware reject
	// tokens whose `aud` claim doesn't contain this value. Empty = no
	// audience enforcement (the documented default).
	RequireAudience string
	// EventsHandler replaces the generic stub-driven handler for the
	// subscribe_events operation (GET /events). When non-nil, Mount
	// registers bearerMW(EventsHandler) for that one route. When nil,
	// the generic handler is used (the old behaviour — useful in tests
	// that don't care about the SSE surface).
	EventsHandler http.Handler
}

MountOpts is the parameter object for Mount.

Jump to

Keyboard shortcuts

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