authhandler

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(channelID string, tokens []string, handler common.HTTPHandler) common.HTTPHandler

New returns a new auth handler

Types

type Config

type Config struct {
	// ReadTokens contains a set of names of tokens for authorizing read requests
	ReadTokens []string
	// WriteTokens contains a set of names of tokens for authorizing write requests
	WriteTokens []string
}

Config contains the config for endpoint authorization

type Handler

type Handler struct {
	common.HTTPHandler
	// contains filtered or unexported fields
}

Handler authorizes the request before delegating to the target handler

func (*Handler) Handler

func (h *Handler) Handler() common.HTTPRequestHandler

Handler returns the HTTP request handler

func (*Handler) Params

func (h *Handler) Params() map[string]string

Params returns the parameters

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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