JWT token based auth
This commit is contained in:
@@ -9,6 +9,7 @@ const (
|
||||
NodePrefix = "ND_"
|
||||
ParticipantPrefix = "PA_"
|
||||
TrackPrefix = "TR_"
|
||||
APIKeyPrefix = "API"
|
||||
)
|
||||
|
||||
func NewGuid(prefix string) string {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/lytics/base62"
|
||||
)
|
||||
|
||||
func RandomSecret() string {
|
||||
// cannot error
|
||||
bin, _ := uuid.New().MarshalBinary()
|
||||
return base62.StdEncoding.EncodeToString(bin)
|
||||
}
|
||||
Reference in New Issue
Block a user