-
Notifications
You must be signed in to change notification settings - Fork 55
win_psDscAdapter and psDscAdapter PScredentials fix for passing username and password #1308
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
Open
mimachniak
wants to merge
11
commits into
PowerShell:main
Choose a base branch
from
mimachniak:win_psDscAdapter-PSCredentials-fix-ScriptDSC
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
61f4b85
Add to win_psDscAdapter function for extraxting string from PSCredent…
mimachniak cd5df41
Add to win_psDscAdapter for ScriptBase resources PSCredentails fix co…
mimachniak 98e7099
Merge branch 'PowerShell:main' into win_psDscAdapter-PSCredentials-fi…
mimachniak 0a7c6aa
Fix win_psDscAdapter for ScriptBase resources PSCredentails fix conve…
mimachniak 82aeec4
psDscAdapter for ClassBase resources PSCredentails fix convert to Sys…
mimachniak 506ba9f
Add for testClass testing yaml with secureObject - main file and para…
mimachniak 49c381c
Fix win_psDscAdapter for ClassBase resources PSCredentails fix conver…
mimachniak 403e6b5
Fix win_psDscAdapter for ClassBase resources PSCredentails fix conver…
mimachniak 352dd69
Ad unit test for credentaials in powershellgroup.config.tests.ps1 - v…
mimachniak 4af004e
Ad unit test for credentaials in win_powershellgroup.tests.ps1 - vali…
mimachniak dd7425e
Ad unit test for credentaials in win_powershellgroup.tests.ps1 - vali…
mimachniak 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
29 changes: 29 additions & 0 deletions
29
adapters/powershell/Tests/class_ps_resources_secret.dsc.yaml
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. | ||
| # Licensed under the MIT License. | ||
|
|
||
| $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json | ||
| parameters: | ||
| showSecrets: | ||
| type: bool | ||
| defaultValue: true | ||
| cred: | ||
| type: secureObject | ||
| metadata: | ||
| Microsoft.DSC: | ||
| requiredSecurityContext: elevated # this is the default and just used as an example indicating this config works for admins and non-admins | ||
| resources: | ||
| - name: Working with classic DSC resources | ||
| type: Microsoft.DSC/PowerShell | ||
| properties: | ||
| resources: | ||
| - name: Class-resource Info | ||
| type: TestClassResource/TestClassResource | ||
| properties: | ||
| Name: TestClassResource1 | ||
| Prop1: ValueForProp1 | ||
| Credential: "[parameters('cred')]" | ||
| - name: SecureObject | ||
| type: Microsoft.DSC.Debug/Echo | ||
| properties: | ||
| output: "[parameters('cred')]" | ||
| showSecrets: "[parameters('showSecrets')]" |
4 changes: 4 additions & 0 deletions
4
adapters/powershell/Tests/class_ps_resources_secret.parameters.yaml
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,4 @@ | ||
| parameters: | ||
| cred: | ||
| username: admin | ||
| password: {To be Ovveride} |
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a test for a test script based resource to make sure this works