Merge pull request #1004 from vwbusguy/bugfix/no-auto-capitalization-support

Fix no Auto-Capitalization for secrets get/set. Fixes #1003
This commit is contained in:
Maidul Islam
2023-09-22 13:28:15 -07:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
module github.com/Infisical/infisical-merge
go 1.19
go 1.21
require (
github.com/charmbracelet/lipgloss v0.5.0

View File

@@ -198,7 +198,7 @@ var secretsSetCmd = &cobra.Command{
}
// Key and value from argument
key := strings.ToUpper(splitKeyValueFromArg[0])
key := splitKeyValueFromArg[0]
value := splitKeyValueFromArg[1]
hashedKey := fmt.Sprintf("%x", sha256.Sum256([]byte(key)))
@@ -417,7 +417,7 @@ func getSecretsByNames(cmd *cobra.Command, args []string) {
secretsMap := getSecretsByKeys(secrets)
for _, secretKeyFromArg := range args {
if value, ok := secretsMap[strings.ToUpper(secretKeyFromArg)]; ok {
if value, ok := secretsMap[secretKeyFromArg]; ok {
requestedSecrets = append(requestedSecrets, value)
} else {
requestedSecrets = append(requestedSecrets, models.SingleEnvironmentVariable{
@@ -625,7 +625,7 @@ func generateExampleEnv(cmd *cobra.Command, args []string) {
func CenterString(s string, numStars int) string {
stars := strings.Repeat("*", numStars)
padding := (numStars - len(s)) / 2
cenetredTextWithStar := stars[:padding] + " " + strings.ToUpper(s) + " " + stars[padding:]
cenetredTextWithStar := stars[:padding] + " " + s + " " + stars[padding:]
hashes := strings.Repeat("#", len(cenetredTextWithStar)+2)
return fmt.Sprintf("%s \n# %s \n%s", hashes, cenetredTextWithStar, hashes)