Skip to content

Commit 8cbf460

Browse files
committed
Merge pull request #297 from PowerShell/BugFixes
Take Bug fixes to Master
2 parents 1c579c3 + e75debd commit 8cbf460

3 files changed

+5
-3
lines changed

Rules/AvoidUsingPlainTextForPassword.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
3737
// Finds all ParamAsts.
3838
IEnumerable<Ast> paramAsts = ast.FindAll(testAst => testAst is ParameterAst, true);
3939

40-
List<String> passwords = new List<String>() {"Password", "Passphrase"};
40+
List<String> passwords = new List<String>() {"Password", "Passphrase", "Auth", "Cred", "Credential"};
4141

4242
// Iterrates all ParamAsts and check if their names are on the list.
4343
foreach (ParameterAst paramAst in paramAsts)

Tests/Rules/AvoidUsingPlainTextForPassword.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
[securestring[]]
2222
$passwords,
2323
$passphrases,
24-
$passwordparam
24+
$passwordparam,
25+
$credential,
26+
$auth
2527
)
2628

2729
Begin

Tests/Rules/AvoidUsingPlainTextForPassword.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $noViolations = Invoke-ScriptAnalyzer $directory\AvoidUsingPlainTextForPasswordN
99
Describe "AvoidUsingPlainTextForPassword" {
1010
Context "When there are violations" {
1111
It "has 3 avoid using plain text for password violations" {
12-
$violations.Count | Should Be 3
12+
$violations.Count | Should Be 5
1313
}
1414

1515
It "has the correct violation message" {

0 commit comments

Comments
 (0)