An open API service indexing awesome lists of open source software.

https://github.com/etkecc/go-echo-basic-auth


https://github.com/etkecc/go-echo-basic-auth

auth echo-framework library

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

          

# echo basic auth

Basic Auth middleware with constant time equality checks and optional IP whitelisting for Echo framework.
CIDRs are supported for IP whitelisting as well

## Usage

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