Skip to content

Commit

Permalink
Merge pull request #297 from PowerShell/BugFixes
Browse files Browse the repository at this point in the history
Take Bug fixes to Master
  • Loading branch information
raghushantha committed Aug 25, 2015
2 parents 1c579c3 + e75debd commit 8cbf460
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Rules/AvoidUsingPlainTextForPassword.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
// Finds all ParamAsts.
IEnumerable<Ast> paramAsts = ast.FindAll(testAst => testAst is ParameterAst, true);

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

// Iterrates all ParamAsts and check if their names are on the list.
foreach (ParameterAst paramAst in paramAsts)
Expand Down
4 changes: 3 additions & 1 deletion Tests/Rules/AvoidUsingPlainTextForPassword.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
[securestring[]]
$passwords,
$passphrases,
$passwordparam
$passwordparam,
$credential,
$auth
)

Begin
Expand Down
2 changes: 1 addition & 1 deletion Tests/Rules/AvoidUsingPlainTextForPassword.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $noViolations = Invoke-ScriptAnalyzer $directory\AvoidUsingPlainTextForPasswordN
Describe "AvoidUsingPlainTextForPassword" {
Context "When there are violations" {
It "has 3 avoid using plain text for password violations" {
$violations.Count | Should Be 3
$violations.Count | Should Be 5
}

It "has the correct violation message" {
Expand Down

0 comments on commit 8cbf460

Please sign in to comment.