auth

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// md5 need 16 byte
	TokenKeyLenth = 16

	TokenHeaderKey = "BLOB-STORE-AUTH-TOKEN"
)

Variables

This section is empty.

Functions

func NewAuthTransport

func NewAuthTransport(tr http.RoundTripper, cfg *Config) http.RoundTripper

Types

type AuthHandler

type AuthHandler struct {
	Secret []byte
}

func NewAuthHandler

func NewAuthHandler(cfg *Config) *AuthHandler

func (*AuthHandler) Handler

func (self *AuthHandler) Handler(w http.ResponseWriter, req *http.Request, f func(http.ResponseWriter, *http.Request))

type AuthTransport

type AuthTransport struct {
	Secret []byte
	Tr     http.RoundTripper
}

func (*AuthTransport) RoundTrip

func (self *AuthTransport) RoundTrip(req *http.Request) (resp *http.Response, err error)

a simple auth token

type Config

type Config struct {
	EnableAuth bool   `json:"enable_auth"`
	Secret     string `json:"secret"`
}

Jump to

Keyboard shortcuts

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