From 6fe1743238d39ad4867a927e09a128a3ff0c3cb0 Mon Sep 17 00:00:00 2001 From: Stavros Date: Thu, 26 Feb 2026 16:49:23 +0200 Subject: [PATCH] feat: validate client name to avoid config errors --- cmd/tinyauth/create_oidc_client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/tinyauth/create_oidc_client.go b/cmd/tinyauth/create_oidc_client.go index 9efb154..989d41b 100644 --- a/cmd/tinyauth/create_oidc_client.go +++ b/cmd/tinyauth/create_oidc_client.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "strings" "github.com/google/uuid" "github.com/steveiliop56/tinyauth/internal/utils" @@ -25,6 +26,11 @@ func createOidcClientCmd() *cli.Command { 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() clientId := uuid.String() clientSecret := "ta-" + utils.GenerateString(61)