Categorygithub.com/etkecc/go-echo-basic-auth
modulepackage
1.1.1
Repository: https://github.com/etkecc/go-echo-basic-auth.git
Documentation: pkg.go.dev

# README

echo basic auth

Basic Auth middleware with constant time equality checks and optional IP whitelisting for Echo framework

Usage

auth := &echobasicauth.Auth{Login: "test", Password: "test", IPs: []string{"127.0.0.1"}}
e.Use(echobasicauth.NewMiddleware(auth))
// or you can use echobasicauth.NewValidator(auth) if you want to define the middleware yourself

# Functions

Equals performs equality check in constant time.
NewMiddleware returns a new BasicAuth middleware instance.
NewValidator returns a new BasicAuthValidator.

# Constants

ContextLoginKey is the key used to store the login after successful auth in the context.

# Structs

Auth model.