* Signup -> Login -> JWT-Doot flow now works for users * Administrators cannot currently sign up for obvious reasons * Segmented the main.go methods into a core controller package
26 lines
306 B
Go
26 lines
306 B
Go
package util
|
|
|
|
import (
|
|
"crypto/rand"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
func GenerateHmac() []byte {
|
|
b := make([]byte, 64)
|
|
if _, err := rand.Read(b); err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
return b
|
|
}
|
|
|
|
type PrincipalInfo struct {
|
|
Uid uuid.UUID
|
|
Role string
|
|
}
|
|
|
|
type FailMsg struct {
|
|
Reason string `json:"reason"`
|
|
}
|