admin

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextSessionValid added in v0.8.1

func ContextSessionValid(ctx context.Context) bool

func IsSuperUserContext added in v0.8.1

func IsSuperUserContext(ctx context.Context) bool

func RequireSessionMiddleware added in v0.8.1

func RequireSessionMiddleware() adminapigen.StrictMiddlewareFunc

func SessionMiddleware added in v0.8.1

SessionMiddleware provides context population of administration session information. If put in front of a handler, the context to the handler will contain information that can be used to determine if a KRB admin made the call, or if it was external.

Types

type Admin

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

func New

func New(opts *Opts) (*Admin, error)

Runs the administration API.

func (*Admin) RegisterAPIProvider added in v0.8.1

func (a *Admin) RegisterAPIProvider(apiProvider adminext.APIProvider) error

RegisterAPIProvider registers an API provider with the admin API. All adminext.APIProvider implementations must be registered using this method in order for their routes to be served by the admin API.

func (*Admin) SetFlowFetcher added in v0.8.1

func (a *Admin) SetFlowFetcher(ff adminext.FlowFetcher)

SetFlowFetcher sets the flow fetcher for the admin component. This allows the admin API to serve flow metadata API calls.

func (*Admin) SetOASBackend added in v0.8.1

func (a *Admin) SetOASBackend(backend adminext.OASBackend)

SetOASBackend sets the OAS backend for the admin component. This allows the admin API to serve OAS to clients per backend providing an OAS.

type Opts

type Opts struct {
	// Mux is the HTTP ServeMux on which the admin API will be registered.
	Mux *http.ServeMux

	// SQLClient for the admin API to use.
	SQLClient db.SQLClient

	// Directory where OAS for the admin API can be found.
	OASDir string

	// Admin configuration.
	Cfg *config.AdminConfig
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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