admin

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package admin provides the admin API HTTP server. It runs on a separate port from the public OAuth server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditRecorder

type AuditRecorder interface {
	Record(ctx context.Context, e audit.Event)
}

AuditRecorder records audit events. Matches services.AuditRecorder.

type BrokerProviderAdminDeps

type BrokerProviderAdminDeps struct {
	BrokerProviders input.BrokerProviderAdminPort
}

BrokerProviderAdminDeps holds optional broker-provider admin dependencies.

type DCRAdmin

type DCRAdmin interface {
	GetMode() string
	SetMode(mode string)
}

DCRAdmin is the local interface for reading/setting DCR mode at runtime.

type DCRDeps

type DCRDeps struct {
	DCR      DCRAdmin
	Settings SettingsStore
	Audit    AuditRecorder
}

DCRDeps holds DCR settings management dependencies for the admin server.

type FrontingAdminDeps

type FrontingAdminDeps struct {
	Fronting input.FrontingAdminPort
}

FrontingAdminDeps holds optional fronting-admin dependencies.

type GrantAdminDeps

type GrantAdminDeps struct {
	Grants input.GrantAdminPort
}

GrantAdminDeps holds optional grant-admin dependencies.

type IssuanceAdminDeps

type IssuanceAdminDeps struct {
	Issuances input.IssuanceAdminPort
}

IssuanceAdminDeps holds optional issuance-admin dependencies.

type KeyAdmin

type KeyAdmin interface {
	BuildJWKS(ctx context.Context) (*jose.JSONWebKeySet, error)
	RotateKey(ctx context.Context) (*output.SigningKey, error)
}

KeyAdmin is the local interface for key administration. The JWKSService implements both methods.

type KeysDeps

type KeysDeps struct {
	KeyAdmin KeyAdmin
	Audit    AuditRecorder
}

KeysDeps holds optional key management dependencies for the admin server.

type OptionalDeps

type OptionalDeps struct {
	System          *SystemDeps
	Keys            *KeysDeps
	DCR             *DCRDeps
	XAA             *XAADeps
	Resources       *ResourceAdminDeps
	BrokerProviders *BrokerProviderAdminDeps
	Grants          *GrantAdminDeps
	Issuances       *IssuanceAdminDeps
	Fronting        *FrontingAdminDeps
}

OptionalDeps groups optional admin server dependencies. All fields are nil-safe — omit any that are not configured.

type Provider

type Provider interface {
	input.AdminPort
}

Provider is the local interface mirroring input.AdminPort.

type ResourceAdminDeps

type ResourceAdminDeps struct {
	Resources input.ResourceAdminPort
}

ResourceAdminDeps holds optional unified-resource admin dependencies.

type Server

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

Server is the admin API HTTP server.

func NewServer

func NewServer(ctx context.Context, cfg config.AdminConfig, admin Provider, obs *observability.Provider, opts OptionalDeps) *Server

NewServer creates the admin HTTP server with routes wired. opts fields are all optional (nil if not configured).

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the server's HTTP handler for testing.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully drains in-flight requests.

func (*Server) Start

func (s *Server) Start() error

Start begins listening.

type SettingsStore

type SettingsStore interface {
	Get(ctx context.Context, key string) (string, error)
	Set(ctx context.Context, key, value string) error
}

SettingsStore is the local interface for persisting runtime settings.

type SystemDeps

type SystemDeps struct {
	Version          string
	StartTime        time.Time
	DBPing           func(ctx context.Context) error
	StorageDriver    string
	KeyStoreDriver   string
	EncryptionDriver string
	SigningAlgorithm string
	Issuer           string
	Audit            AuditRecorder

	// Feature flags — sanitized, no secrets.
	ClientCredentialsEnabled bool
	DPoPEnabled              bool
	DPoPNonceTTL             string
	DPoPRequireNonce         bool
	TokenExchangeEnabled     bool
	TokenExchangeMaxChain    int
	AgentsEnabled            bool
	AgentsJWKSListing        bool
	OIDCEnabled              bool
	DCRMode                  string
	RateLimitEnabled         bool
	XAAEnabled               bool
}

SystemDeps holds optional system dependencies for admin system endpoints. All fields are sanitized — no secrets, DSNs, or private key material.

type XAADeps

type XAADeps struct {
	IDP            input.XAAIDPPort
	Policy         input.XAAPolicyPort
	SubjectMapping input.SubjectMappingPort
}

XAADeps holds optional XAA dependencies for the admin server.

Jump to

Keyboard shortcuts

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