added auth method
This commit is contained in:
parent
7715fcf373
commit
a735b9cc5e
8 changed files with 270 additions and 12 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
//"golang.org/x/crypto/bcrypt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
|
@ -15,10 +16,14 @@ func (nf *notFoundHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
func authHandler(h ctxHandler) ctxHandler {
|
||||
return func(ctx *Context) {
|
||||
// TODO
|
||||
// test:123456
|
||||
// test:$2b$10$zNfGTAQ94vifj2wtGsv1W.yZRe4/rDBzQixpB6FbrTed4BnHuNqBS
|
||||
//bcrypt.CompareHashAndPassword(hash, pw)
|
||||
h(ctx)
|
||||
}
|
||||
}
|
||||
|
||||
func healthzHandler(ctx *Context) {
|
||||
// TODO maybe report etcd/raft stats
|
||||
ctx.OK()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue