auth

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HMACSignaturePrefix = "dumbproxy grant token v1"
	HMACSignatureSize   = 32
	HMACTimestampSize   = 8
	EnvVarHMACSecret    = "DUMBPROXY_HMAC_SECRET"
)
View Source
const AUTH_REQUIRED_MSG = "Proxy authentication required.\n"
View Source
const AUTH_TRIGGERED_MSG = "Browser auth triggered!\n"
View Source
const BAD_REQ_MSG = "Bad Request\n"
View Source
const EPOCH_EXPIRE = "Thu, 01 Jan 1970 00:00:01 GMT"

Variables

This section is empty.

Functions

func CalculateHMACSignature added in v1.14.0

func CalculateHMACSignature(secret []byte, username string, expire int64) []byte

func VerifyHMACLoginAndPassword added in v1.14.1

func VerifyHMACLoginAndPassword(secret []byte, login, password string) bool

Types

type Auth

type Auth interface {
	Validate(ctx context.Context, wr http.ResponseWriter, req *http.Request) (string, bool)
	Stop()
}

func NewAuth

func NewAuth(paramstr string, logger *clog.CondLogger) (Auth, error)

type BasicAuth

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

func NewBasicFileAuth

func NewBasicFileAuth(param_url *url.URL, logger *clog.CondLogger) (*BasicAuth, error)

func NewStaticAuth

func NewStaticAuth(param_url *url.URL, logger *clog.CondLogger) (*BasicAuth, error)

func (*BasicAuth) Stop

func (auth *BasicAuth) Stop()

func (*BasicAuth) Validate

func (auth *BasicAuth) Validate(_ context.Context, wr http.ResponseWriter, req *http.Request) (string, bool)

type CertAuth

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

func NewCertAuth

func NewCertAuth(param_url *url.URL, logger *clog.CondLogger) (*CertAuth, error)

func (*CertAuth) Stop

func (auth *CertAuth) Stop()

func (*CertAuth) Validate

func (auth *CertAuth) Validate(_ context.Context, wr http.ResponseWriter, req *http.Request) (string, bool)

type HMACAuth added in v1.14.0

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

func NewHMACAuth added in v1.14.0

func NewHMACAuth(param_url *url.URL, logger *clog.CondLogger) (*HMACAuth, error)

func (*HMACAuth) Stop added in v1.14.0

func (auth *HMACAuth) Stop()

func (*HMACAuth) Validate added in v1.14.0

func (auth *HMACAuth) Validate(_ context.Context, wr http.ResponseWriter, req *http.Request) (string, bool)

type HMACToken added in v1.14.0

type HMACToken struct {
	Expire    int64
	Signature [HMACSignatureSize]byte
}

type NoAuth

type NoAuth struct{}

func (NoAuth) Stop

func (_ NoAuth) Stop()

func (NoAuth) Validate

func (_ NoAuth) Validate(_ context.Context, _ http.ResponseWriter, _ *http.Request) (string, bool)

type RedisAuth added in v1.27.0

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

func NewRedisAuth added in v1.27.0

func NewRedisAuth(param_url *url.URL, cluster bool, logger *clog.CondLogger) (*RedisAuth, error)

func (*RedisAuth) Stop added in v1.27.0

func (auth *RedisAuth) Stop()

func (*RedisAuth) Validate added in v1.27.0

func (auth *RedisAuth) Validate(ctx context.Context, wr http.ResponseWriter, req *http.Request) (string, bool)

Jump to

Keyboard shortcuts

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