http

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientContext

func ClientContext(next http.Handler) http.Handler

ClientContext is http middleware that adds a request's ip address and user agent to the context.

func OptionDB

func OptionDB(db db.DB) func(*Handler) error

OptionDB applies a db connection option.

func OptionGeoResolver

func OptionGeoResolver(geo geo.Resolver) func(*Handler) error

OptionGeoResolver applies a geo resolver option.

func OptionHTTPPort

func OptionHTTPPort(port int) func(*Handler) error

OptionHTTPPort applies a TCP port option, used by the http handler.

func OptionIPAddress

func OptionIPAddress(ipAddress string) func(*Handler) error

OptionIPAddress applies a IP address option.

func OptionKV

func OptionKV(kv store.Manager) func(*Handler) error

OptionKV applies a key value manager option.

func OptionParams

func OptionParams(key, value string) func(*Handler) error

OptionParams applies a name,value option, more than one can be added.

func OptionTLS

func OptionTLS(certFile, keyFile string) func(*Handler) error

OptionTLS applies TLS parameters, used by the http handler.

Types

type AdminHandler

type AdminHandler struct {
	Handler
	// contains filtered or unexported fields
}

AdminHandler implements the Admin REST API.

func NewAdminHandler

func NewAdminHandler(ctx context.Context, options ...func(*Handler) error) (*AdminHandler, error)

NewAdminHandler creates a new Admin API endpoint.

func (*AdminHandler) Init

func (handler *AdminHandler) Init()

Init ...

func (*AdminHandler) Stop

func (handler *AdminHandler) Stop() error

Stop ...

type AuthHandler

type AuthHandler struct {
	Handler
	// contains filtered or unexported fields
}

AuthHandler implements the Auth REST API.

func NewAuthHandler

func NewAuthHandler(ctx context.Context, options ...func(*Handler) error) (*AuthHandler, error)

NewAuthHandler creates a new Auth API endpoint.

func (*AuthHandler) Init

func (handler *AuthHandler) Init()

Init sets up the Dogpark HTTP handlers for FIDO registration and authorization. Note that there is no first factor authn/z employed here.

Suggestions: - restrict the `cors_allowed_origins` to your webapp in which first factor authn is occurring - add your own authz middleware that checks authn header for valid session (and add to client)

func (*AuthHandler) Stop

func (handler *AuthHandler) Stop() error

Stop ...

type Handler

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

Handler is a base http-handling object.

func (*Handler) Start

func (handler *Handler) Start() error

Start commences http handling.

Jump to

Keyboard shortcuts

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