Peter Kurfer
647f602c79
- added Core CRD to manage DB migrations & configuration, PostgREST and GoTrue (auth) - added APIGateway CRD to manage Envoy proxy - added Dashboard CRD to manage (so far) pg-meta and (soon) studio deployments - implemented basic Envoy control plane based on K8s watcher
19 lines
390 B
Go
19 lines
390 B
Go
package supabase
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"encoding/hex"
|
|
)
|
|
|
|
func RandomJWTSecret() ([]byte, error) {
|
|
jwtSecretBytes := make([]byte, ServiceConfig.JWT.Defaults.SecretLength)
|
|
|
|
if _, err := rand.Read(jwtSecretBytes); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
jwtSecretHex := make([]byte, hex.EncodedLen(len(jwtSecretBytes)))
|
|
hex.Encode(jwtSecretHex, jwtSecretBytes)
|
|
|
|
return jwtSecretHex, nil
|
|
}
|