implement the new password hashing approach (#156)

This commit is contained in:
Michael Quigley
2023-01-23 12:50:24 -05:00
parent 45d83d1521
commit b32ee6350e
6 changed files with 68 additions and 15 deletions

View File

@ -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")