mirror of
https://github.com/openziti/zrok.git
synced 2025-08-09 00:04:43 +02:00
implement the new password hashing approach (#156)
This commit is contained in:
@ -1,9 +1,7 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"crypto/sha512"
|
||||
"crypto/x509"
|
||||
"encoding/hex"
|
||||
errors2 "github.com/go-openapi/errors"
|
||||
"github.com/jaevor/go-nanoid"
|
||||
"github.com/openziti/edge/rest_management_api_client"
|
||||
@ -83,12 +81,6 @@ func createToken() (string, error) {
|
||||
return gen(), nil
|
||||
}
|
||||
|
||||
func hashPassword(raw string) string {
|
||||
hash := sha512.New()
|
||||
hash.Write([]byte(raw))
|
||||
return hex.EncodeToString(hash.Sum(nil))
|
||||
}
|
||||
|
||||
func realRemoteAddress(req *http.Request) string {
|
||||
ip := strings.Split(req.RemoteAddr, ":")[0]
|
||||
fwdAddress := req.Header.Get("X-Forwarded-For")
|
||||
|
Reference in New Issue
Block a user