-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '915-revise-msexo51-to-remove-note-about-exceptions' of h…
…ttps://github.com/cisagov/ScubaGear into 915-revise-msexo51-to-remove-note-about-exceptions
- Loading branch information
Showing
10 changed files
with
264 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Purpose: Run a secret scanner against the repo. | ||
|
||
name: Run Secret Scan | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
secret-scan: | ||
name: MegaLint Gitleaks | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
- name: Setup Config File | ||
run: cp Testing/Linting/MegaLinter/.mega-linter-secret.yml .mega-linter.yml | ||
- name: Check Repo | ||
uses: oxsecurity/megalinter/flavors/security@latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
PowerShell/ScubaGear/Testing/Unit/PowerShell/Orchestrator/Invoke-Connection.Tests.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
$OrchestratorPath = '../../../../Modules/Orchestrator.psm1' | ||
Import-Module (Join-Path -Path $PSScriptRoot -ChildPath $OrchestratorPath) -Function 'Invoke-Connection' -Force | ||
|
||
InModuleScope Orchestrator { | ||
Describe -Tag 'Orchestrator' -Name 'Invoke-Connection' { | ||
BeforeAll { | ||
function Connect-Tenant {throw 'this will be mocked'} | ||
Mock -ModuleName Orchestrator Connect-Tenant {@('aad')} | ||
} | ||
It 'Login is false'{ | ||
Invoke-Connection -Login $false -ProductNames 'aad' -BoundParameters @{} | Should -BeNullOrEmpty | ||
} | ||
It 'Login is true'{ | ||
Invoke-Connection -Login $true -ProductNames 'aad' -BoundParameters @{} | Should -Not -BeNullOrEmpty | ||
} | ||
It 'Has AppId'{ | ||
Mock -ModuleName Orchestrator Connect-Tenant {@('aad')} | ||
$BoundParameters = @{ | ||
AppID = "a" | ||
CertificateThumbprint = "b" | ||
Organization = "c" | ||
} | ||
Invoke-Connection -Login $true -ProductNames 'aad' -BoundParameters $BoundParameters | Should -Not -BeNullOrEmpty | ||
Should -Invoke -CommandName Connect-Tenant -Exactly -Times 1 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.