mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 12:26:13 +00:00
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:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
module github.com/Infisical/infisical-merge
|
module github.com/Infisical/infisical-merge
|
||||||
|
|
||||||
go 1.19
|
go 1.21
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/charmbracelet/lipgloss v0.5.0
|
github.com/charmbracelet/lipgloss v0.5.0
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ var secretsSetCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Key and value from argument
|
// Key and value from argument
|
||||||
key := strings.ToUpper(splitKeyValueFromArg[0])
|
key := splitKeyValueFromArg[0]
|
||||||
value := splitKeyValueFromArg[1]
|
value := splitKeyValueFromArg[1]
|
||||||
|
|
||||||
hashedKey := fmt.Sprintf("%x", sha256.Sum256([]byte(key)))
|
hashedKey := fmt.Sprintf("%x", sha256.Sum256([]byte(key)))
|
||||||
@@ -417,7 +417,7 @@ func getSecretsByNames(cmd *cobra.Command, args []string) {
|
|||||||
secretsMap := getSecretsByKeys(secrets)
|
secretsMap := getSecretsByKeys(secrets)
|
||||||
|
|
||||||
for _, secretKeyFromArg := range args {
|
for _, secretKeyFromArg := range args {
|
||||||
if value, ok := secretsMap[strings.ToUpper(secretKeyFromArg)]; ok {
|
if value, ok := secretsMap[secretKeyFromArg]; ok {
|
||||||
requestedSecrets = append(requestedSecrets, value)
|
requestedSecrets = append(requestedSecrets, value)
|
||||||
} else {
|
} else {
|
||||||
requestedSecrets = append(requestedSecrets, models.SingleEnvironmentVariable{
|
requestedSecrets = append(requestedSecrets, models.SingleEnvironmentVariable{
|
||||||
@@ -625,7 +625,7 @@ func generateExampleEnv(cmd *cobra.Command, args []string) {
|
|||||||
func CenterString(s string, numStars int) string {
|
func CenterString(s string, numStars int) string {
|
||||||
stars := strings.Repeat("*", numStars)
|
stars := strings.Repeat("*", numStars)
|
||||||
padding := (numStars - len(s)) / 2
|
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)
|
hashes := strings.Repeat("#", len(cenetredTextWithStar)+2)
|
||||||
return fmt.Sprintf("%s \n# %s \n%s", hashes, cenetredTextWithStar, hashes)
|
return fmt.Sprintf("%s \n# %s \n%s", hashes, cenetredTextWithStar, hashes)
|
||||||
|
|||||||
Reference in New Issue
Block a user