haproxy-lb/pkg/api/v1/server/handler.go
2021-03-01 07:40:10 +01:00

23 lines
465 B
Go

package server
import (
//"golang.org/x/crypto/bcrypt"
"net/http"
"git.giftfish.de/ston1th/haproxy-lb/pkg/api/types"
)
func authHandler(h types.CtxHandler) types.CtxHandler {
return func(ctx *types.Context) {
// TODO
// test:123456
// test:$2b$10$zNfGTAQ94vifj2wtGsv1W.yZRe4/rDBzQixpB6FbrTed4BnHuNqBS
//bcrypt.CompareHashAndPassword(hash, pw)
h(ctx)
}
}
func healthzHandler(ctx *types.Context) {
// TODO maybe report etcd/raft stats
ctx.OK()
}