Skip to content

Commit 61743dd

Browse files
committed
Don't output secret value from user-secrets set
1 parent 8321d83 commit 61743dd

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Tools/dotnet-user-secrets/src/Internal/SetCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void Execute(CommandContext context)
9999
{
100100
context.SecretStore.Set(_keyName, _keyValue);
101101
context.SecretStore.Save();
102-
context.Reporter.Output(Resources.FormatMessage_Saved_Secret(_keyName, _keyValue));
102+
context.Reporter.Output(Resources.FormatMessage_Saved_Secret(_keyName));
103103
}
104104
}
105105
}

src/Tools/dotnet-user-secrets/src/Resources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Use the '--help' flag to see info.</value>
149149
<value>Project file path {project}.</value>
150150
</data>
151151
<data name="Message_Saved_Secret" xml:space="preserve">
152-
<value>Successfully saved {key} = {value} to the secret store.</value>
152+
<value>Successfully saved {key} to the secret store.</value>
153153
</data>
154154
<data name="Message_Saved_Secrets" xml:space="preserve">
155155
<value>Successfully saved {number} secrets to the secret store.</value>

src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void SetSecrets(bool fromCurrentDirectory)
112112
foreach (var keyValue in secrets)
113113
{
114114
Assert.Contains(
115-
string.Format(CultureInfo.InvariantCulture, "Successfully saved {0} = {1} to the secret store.", keyValue.Key, keyValue.Value),
115+
string.Format(CultureInfo.InvariantCulture, "Successfully saved {0} to the secret store.", keyValue.Key),
116116
_console.GetOutput());
117117
}
118118

@@ -154,9 +154,9 @@ public void SetSecret_Update_Existing_Secret()
154154
var secretManager = CreateProgram();
155155

156156
secretManager.RunInternal("set", "secret1", "value1", "-p", projectPath, "--verbose");
157-
Assert.Contains("Successfully saved secret1 = value1 to the secret store.", _console.GetOutput());
157+
Assert.Contains("Successfully saved secret1 to the secret store.", _console.GetOutput());
158158
secretManager.RunInternal("set", "secret1", "value2", "-p", projectPath, "--verbose");
159-
Assert.Contains("Successfully saved secret1 = value2 to the secret store.", _console.GetOutput());
159+
Assert.Contains("Successfully saved secret1 to the secret store.", _console.GetOutput());
160160

161161
_console.ClearOutput();
162162

@@ -174,7 +174,7 @@ public void SetSecret_With_Verbose_Flag()
174174
secretManager.RunInternal("-v", "set", "secret1", "value1", "-p", projectPath);
175175
Assert.Contains(string.Format(CultureInfo.InvariantCulture, "Project file path {0}.", Path.Combine(projectPath, "TestProject.csproj")), _console.GetOutput());
176176
Assert.Contains(string.Format(CultureInfo.InvariantCulture, "Secrets file path {0}.", PathHelper.GetSecretsPathFromSecretsId(secretId)), _console.GetOutput());
177-
Assert.Contains("Successfully saved secret1 = value1 to the secret store.", _console.GetOutput());
177+
Assert.Contains("Successfully saved secret1 to the secret store.", _console.GetOutput());
178178
_console.ClearOutput();
179179

180180
secretManager.RunInternal("-v", "list", "-p", projectPath);
@@ -299,7 +299,7 @@ public void Clear_Secrets(bool fromCurrentDirectory)
299299
foreach (var keyValue in secrets)
300300
{
301301
Assert.Contains(
302-
string.Format(CultureInfo.InvariantCulture, "Successfully saved {0} = {1} to the secret store.", keyValue.Key, keyValue.Value),
302+
string.Format(CultureInfo.InvariantCulture, "Successfully saved {0} to the secret store.", keyValue.Key, keyValue.Value),
303303
_console.GetOutput());
304304
}
305305

0 commit comments

Comments
 (0)