token-validator: display custom IP
This commit is contained in:
parent
8427a0adb8
commit
b6eb652929
3 changed files with 26 additions and 2 deletions
|
|
@ -103,6 +103,10 @@ type TunnelToken struct {
|
|||
Dump *WGDump
|
||||
}
|
||||
|
||||
func (tt *TunnelToken) GetStudentIP() string {
|
||||
return fmt.Sprintf("%s%x", StudentIP(tt.IdStudent).String(), tt.SuffixIP)
|
||||
}
|
||||
|
||||
func TokenFromText(token string) []byte {
|
||||
sha := sha512.Sum512([]byte(token))
|
||||
return sha[:]
|
||||
|
|
|
|||
Reference in a new issue