-
Notifications
You must be signed in to change notification settings - Fork 214
Making updates to WAM implementation #2100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a78ad8e
Making updates to WAM implementation
FehintolaObafemi 724b718
Update src/Authentication/Authentication/Cmdlets/GetMgGraphOption.cs
FehintolaObafemi 2cdfba3
Implementing Peter's suggestions v1
FehintolaObafemi 7efe218
Adding documentation for WAM
FehintolaObafemi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
36 changes: 36 additions & 0 deletions
36
src/Authentication/Authentication/Cmdlets/GetMgGraphOption.cs
This file contains hidden or 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,36 @@ | ||
| // ------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. | ||
| // ------------------------------------------------------------------------------ | ||
|
|
||
| using Newtonsoft.Json.Linq; | ||
| using System.IO; | ||
| using System.Management.Automation; | ||
|
|
||
| namespace Microsoft.Graph.PowerShell.Authentication.Cmdlets | ||
| { | ||
| [Cmdlet(VerbsCommon.Get, "MgGraphOption", HelpUri = "")] | ||
| [OutputType(typeof(IGraphOption))] | ||
| public class GetMgGraphOption : PSCmdlet | ||
| { | ||
| protected override void BeginProcessing() | ||
| { | ||
| base.BeginProcessing(); | ||
| } | ||
|
|
||
| protected override void ProcessRecord() | ||
| { | ||
| base.ProcessRecord(); | ||
| WriteObject(GraphSession.Instance.GraphOption); | ||
| } | ||
|
|
||
| protected override void EndProcessing() | ||
| { | ||
| base.EndProcessing(); | ||
| } | ||
|
|
||
| protected override void StopProcessing() | ||
| { | ||
| base.StopProcessing(); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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
24 changes: 24 additions & 0 deletions
24
src/Authentication/Authentication/test/Get-MgGraphOption.Tests.ps1
This file contains hidden or 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 @@ | ||
| # ------------------------------------------------------------------------------ | ||
| # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. | ||
| # ------------------------------------------------------------------------------ | ||
|
|
||
| Describe "Get-MgGraphOption Command" { | ||
| BeforeAll { | ||
| $ModuleName = "Microsoft.Graph.Authentication" | ||
| $ModulePath = Join-Path $PSScriptRoot "..\artifacts\$ModuleName.psd1" | ||
| Import-Module $ModulePath -Force | ||
| } | ||
| Context "When executing the command" { | ||
| it 'Should have one ParameterSets' { | ||
| $GetMgGraphOptionCommand = Get-Command Set-MgGraphOption | ||
| $GetMgGraphOptionCommand | Should -Not -BeNullOrEmpty | ||
| $GetMgGraphOptionCommand.ParameterSets | Should -HaveCount 1 | ||
| $GetMgGraphOptionCommand.ParameterSets.Parameters | Should -HaveCount 12 # PS common parameters. | ||
| } | ||
|
|
||
| It 'Executes successfully' { | ||
| { Get-MgGraphOption -Debug | Out-Null } | Should -Not -Be $null | ||
| { Get-MgGraphOption -ErrorAction SilentlyContinue } | Should -Not -Throw | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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
29 changes: 29 additions & 0 deletions
29
src/Authentication/Authentication/test/Set-MgGraphOption.Tests.ps1
This file contains hidden or 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,29 @@ | ||
| # ------------------------------------------------------------------------------ | ||
| # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. | ||
| # ------------------------------------------------------------------------------ | ||
|
|
||
| Describe "Set-MgGraphOption" { | ||
| BeforeAll { | ||
| $ModuleName = "Microsoft.Graph.Authentication" | ||
| $ModulePath = Join-Path $PSScriptRoot "..\artifacts\$ModuleName.psd1" | ||
| Import-Module $ModulePath -Force -ErrorAction SilentlyContinue | ||
| } | ||
| Context "When executing the command" { | ||
| it 'Should have one ParameterSets' { | ||
| $SetMgGraphOptionCommand = Get-Command Set-MgGraphOption | ||
| $SetMgGraphOptionCommand | Should -Not -BeNullOrEmpty | ||
| $SetMgGraphOptionCommand.ParameterSets | Should -HaveCount 1 | ||
| $SetMgGraphOptionCommand.ParameterSets.Parameters | Should -HaveCount 12 # PS common parameters. | ||
| } | ||
|
|
||
| It 'Executes successfully whren toggling WAM on' { | ||
| { Set-MgGraphOption -EnableLoginByWAM $true -Debug | Out-Null } | Should -Not -Be $null | ||
| { Set-MgGraphOption -EnableLoginByWAM $true -ErrorAction SilentlyContinue } | Should -Not -Throw | ||
| } | ||
|
|
||
| It 'Executes successfully when toggling WAM off' { | ||
| { Set-MgGraphOption -EnableLoginByWAM $false -Debug | Out-Null } | Should -Not -Be $null | ||
| { Set-MgGraphOption -EnableLoginByWAM $false -ErrorAction SilentlyContinue } | Should -Not -Throw | ||
| } | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.