-
Notifications
You must be signed in to change notification settings - Fork 8
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
BREAKING: WSManListener
: Convert to a Class Resource
#106
base: main
Are you sure you want to change the base?
BREAKING: WSManListener
: Convert to a Class Resource
#106
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #106 +/- ##
===================================
Coverage 98% 98%
===================================
Files 3 7 +4
Lines 292 198 -94
===================================
- Hits 288 196 -92
+ Misses 4 2 -2
|
@PlagueHO, finally ready to go. |
@johlju, is this something you can also look at please? |
Will do, later in the week or weekend. 😊 |
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.
Reviewed 15 of 28 files at r1, 19 of 20 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @dan-hughes and @PlagueHO)
source/Classes/020.WSManListener.ps1
line 232 at r3 (raw file):
'Issuer' 'BaseDN' )
Shouldn't there also be SubjectFormat
and MatchAlternate
in this list, they should also not be used when thumbprint or hostname is specified?
Code quote:
MutuallyExclusiveList1 = @(
'Issuer'
'BaseDN'
)
source/Classes/020.WSManListener.ps1
line 249 at r3 (raw file):
Transport = $this.Transport Address = $this.Address }
In this method we need to validate all properties needed to create an instance actually has a value. We cannot do it in AssertProperties()
as that would prevent as enforcing only a specific property. 🤔
Code quote:
$selectorSet = @{
Transport = $this.Transport
Address = $this.Address
}
source/Classes/020.WSManListener.ps1
line 269 at r3 (raw file):
if ([System.String]::IsNullOrEmpty($this.Hostname)) { $valueSet.HostName = [System.Net.Dns]::GetHostByName($env:COMPUTERNAME).Hostname
Suggest to use Get-ComputerName
here instead (from DscResource.Common)
Code quote:
$env:COMPUTERNAME
source/Classes/020.WSManListener.ps1
line 288 at r3 (raw file):
} hidden [void] RemoveInstance()
Do we need to validate here as well, that the required properties to remove an instance is actually set? 🤔
Code quote:
RemoveInstance()
source/Private/Find-Certificate.ps1
line 24 at r3 (raw file):
The Thumbprint of the certificate to use for the HTTPS WS-Man Listener. #> function Find-Certificate
We also have a Find-Certificate
in CertificateDsc - it might be possible to concat these inte one public function in DscResource.Common. 🤔 But out of scope for this PR.
Code quote:
Find-Certificate
Justa few comments. Heads up, there might be some issues with PowerShell Gallery - i trying to release a version before merging this breaking change, but it fails with random errors (re-run 3 times, failing on different module name each time): https://dev.azure.com/dsccommunity/WsManDsc/_build/results?buildId=9921&view=logs&j=d7ffe41d-f206-59ed-99c3-e44ba5bb1f40&t=e2ebcab5-cb94-5995-9070-3fa60620c9c4 |
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.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @johlju and @PlagueHO)
source/Classes/020.WSManListener.ps1
line 232 at r3 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Shouldn't there also be
SubjectFormat
andMatchAlternate
in this list, they should also not be used when thumbprint or hostname is specified?
I believe you are correct.
source/Classes/020.WSManListener.ps1
line 249 at r3 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
In this method we need to validate all properties needed to create an instance actually has a value. We cannot do it in
AssertProperties()
as that would prevent as enforcing only a specific property. 🤔
I don't believe so, if the port is not supplied, then it is populated with Get-DefaultPort
in Get().GetCurrentState()
.
source/Classes/020.WSManListener.ps1
line 269 at r3 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Suggest to use
Get-ComputerName
here instead (from DscResource.Common)
Done.
source/Classes/020.WSManListener.ps1
line 288 at r3 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Do we need to validate here as well, that the required properties to remove an instance is actually set? 🤔
Same as the port above. Using DscResource.Base
calling Set()
calls Get()
which calls GetCurrentState()
which resolves those properties if not set or supplied.
I also specifically did not touch the integration tests to remove the moving parts.
source/Private/Find-Certificate.ps1
line 24 at r3 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
We also have a
Find-Certificate
in CertificateDsc - it might be possible to concat these inte one public function in DscResource.Common. 🤔 But out of scope for this PR.
I'll create issues in the three repos for these.
Pull Request (PR) description
Convert
WSManListener
to a class resourceRename parameter
DN
toBaseDN
This Pull Request (PR) fixes the following issues
Contributes to #98
Fixes #89
Task list
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
and comment-based help.
This change is