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
- Host: GitHub
- URL: https://github.com/etkecc/go-echo-basic-auth
- Owner: etkecc
- License: lgpl-3.0
- Created: 2024-08-08T18:55:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-14T20:19:15.000Z (9 months ago)
- Last Synced: 2025-03-14T21:29:02.009Z (9 months ago)
- Topics: auth, echo-framework, library
- Language: Go
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
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
```