rest

package
v0.0.0-...-aa7570c Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeRouter

func MakeRouter(ctx context.Context, cfg Config) *chi.Mux

func Run

func Run(ctx context.Context, cfg Config) error

Types

type Config

type Config struct {
	ListenAddress string
	Pool          *pgxpool.Pool
	PreSharedKey  string
	DynamicClient apply.DynamicClientFactory
	// ContextMiddleware sets up the request context with all loaders and
	// dependencies needed by the apply handler (authz, activitylog, etc.).
	// In production this is the middleware returned by ConfigureGraph.
	// In tests a minimal equivalent can be provided.
	ContextMiddleware    func(http.Handler) http.Handler
	JWTMiddleware        func(http.Handler) http.Handler
	GitHubOIDCMiddleware func(http.Handler) http.Handler
	AuthHandler          authn.Handler
	Fakes                Fakes
	Log                  logrus.FieldLogger
}

Config holds all dependencies needed by the REST server.

type Fakes

type Fakes struct {
	WithInsecureUserHeader bool
}

Fakes contains feature flags for local development and testing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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