mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-03-02 12:52:02 +00:00
feat: validate client name to avoid config errors
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/steveiliop56/tinyauth/internal/utils"
|
"github.com/steveiliop56/tinyauth/internal/utils"
|
||||||
@@ -25,6 +26,11 @@ func createOidcClientCmd() *cli.Command {
|
|||||||
|
|
||||||
clientName := args[0]
|
clientName := args[0]
|
||||||
|
|
||||||
|
// prevent client name from using periods or underscores in order to prevent breaking flags or env vars
|
||||||
|
if strings.Contains(clientName, "_") || strings.Contains(clientName, ".") {
|
||||||
|
tlog.App.Fatal().Msg("Client name cannot contain underscores or periods")
|
||||||
|
}
|
||||||
|
|
||||||
uuid := uuid.New()
|
uuid := uuid.New()
|
||||||
clientId := uuid.String()
|
clientId := uuid.String()
|
||||||
clientSecret := "ta-" + utils.GenerateString(61)
|
clientSecret := "ta-" + utils.GenerateString(61)
|
||||||
|
|||||||
Reference in New Issue
Block a user