feat: oidc client create command (#672)

* feat: add oidc client create command

* refactor: use own utility for creating random strings (more flexible
than stdlib)

* feat: validate client name to avoid config errors

* refactor: limit to only alphanumeric characters and hyphens

* refactor: remove the need of the logger in the create oidc client cmd
This commit is contained in:
Stavros
2026-02-26 16:28:58 +01:00
committed by GitHub
parent 5acac0e016
commit 4a1889c20b
9 changed files with 77 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
package utils
import (
"crypto/rand"
"encoding/base64"
"errors"
"net"
@@ -105,3 +106,9 @@ func GenerateUUID(str string) string {
uuid := uuid.NewSHA1(uuid.NameSpaceURL, []byte(str))
return uuid.String()
}
func GenerateString(length int) string {
src := make([]byte, length)
rand.Read(src)
return base64.RawURLEncoding.EncodeToString(src)[:length]
}