Skip to content

Commit f1cc955

Browse files
authored
BREAKING: SChannelProtocol Class-Based (#72)
* Merge main * Delete protocol tests * Add Reason * Add protocolbase class * Add protocol server and client resources * Add strings files * Update changelog * Update examples * Update changelog * Fix tests * Remove use of Where-Object * Fix reasons assertions * Protocol Client integration tests * Update tests * Config * Formatting * Update * Make deploy depend on all tests * Update * Update * Update * Add import * Update * Update * Update * Update * Test * Test * Add dir per config * Use flags on enum * Add helper method to convert a enum to the individual flag values * Use enum with flags * Int tests * Fix * Remove Type * Fix HQRM * Fix type * Disable tests * No need to convert * Fix text * Testing * Only assign if there are values * test for empty * fix * Set values * fix * Int tests * assign var * fix * Revert "Use flags on enum" This reverts commit 9843e2e. * Reapply "Use flags on enum" This reverts commit 13bde73. * Use string array as enum array or enum with flags does not produce valid MOF. * Add protocol server integration tests * Add property assertion * Add clear * Fix assert * Remove clear flag * Set Next version * Remove old codecov config * Remove commented config * Fill in missing issue descriptions * Update synopsis' * Use unique GUIDs * CodeRabbit fixes * Coderabbit fixes * Update Description * Fix message * Only run Integration Test files. * Add space * Fix tests * Revert "Set Next version" This reverts commit 4a5fd64. * Fix formatting * Use real GUIDs * Add comment based help * Update exmaple formatting * CodeRabbit suggestions * ModuleFast fixes current issues with PSResourceGet * Use latest GitHubTasks * Fix convergence issue * Modify update * Fixes * Fix logic * Debug * Fix default protocols * Fix * Remove debug * Add test coverage
1 parent cecce02 commit f1cc955

64 files changed

Lines changed: 2957 additions & 703 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codecov.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- Test-TlsProtocol
2020
- Enum
2121
- SChannelSslProtocols
22+
- BREAKING: Converted Protocol to class-based resource [issue #50](https://github.com/dsccommunity/SChannelDsc/issues/50).
23+
- This now consists of two resources
24+
- SChannelProtocolClient
25+
- SChannelProtocolServer
26+
- Add DTLS support [issue #37](https://github.com/dsccommunity/SChannelDsc/issues/37).
2227

2328
### Changed
2429

@@ -44,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4449
- Convert-SCDscCIMInstanceToString
4550
- Convert-SCDscHashtableToString
4651
- Test-SCDscObjectHasProperty
52+
- Protocol Resource - Replaced by class resources
4753

4854
## [1.5.0] - 2026-01-27
4955

GitVersion.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,3 @@ branches:
2525
ignore:
2626
sha: []
2727
merge-message-formats: {}
28-
29-
30-
# feature:
31-
# tag: useBranchName
32-
# increment: Minor
33-
# regex: f(eature(s)?)?[/-]
34-
# source-branches: ['master']
35-
# hotfix:
36-
# tag: fix
37-
# increment: Patch
38-
# regex: (hot)?fix(es)?[/-]
39-
# source-branches: ['master']

RequiredModules.psd1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@
1414
ModuleBuilder = 'latest'
1515
ChangelogManagement = 'latest'
1616
Sampler = 'latest'
17-
'Sampler.GitHubTasks' = 'latest'
17+
'Sampler.GitHubTasks' = @{
18+
Version = 'latest'
19+
Parameters = @{
20+
AllowPrerelease = $true
21+
}
22+
}
1823
MarkdownLinkCheck = 'latest'
1924
'DscResource.Test' = 'latest'
2025
xDscResourceDesigner = 'latest'
2126

2227
# Build dependencies needed for using the module
2328
'DscResource.Common' = 'latest'
29+
'DscResource.Base' = 'latest'
2430

2531
# Analyzer rules
2632
'DscResource.AnalyzerRules' = 'latest'

Resolve-Dependency.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
set to $false then PowerShellGet will be used to resolve dependencies.
6868
#>
6969
UsePSResourceGet = $true
70-
#PSResourceGetVersion = '1.0.1'
70+
# PSResourceGetVersion = '1.0.1'
7171

7272
# PowerShellGet compatibility module only works when using PSResourceGet or ModuleFast.
7373
UsePowerShellGetCompatibilityModule = $true

azure-pipelines.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,57 @@ stages:
167167
bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml"
168168
displayName: 'Publish Code Coverage to Codecov.io'
169169
170+
- stage: Integration_Test
171+
displayName: 'Integration Test'
172+
dependsOn: Build
173+
jobs:
174+
- job: Test_Integration
175+
displayName: 'Integration'
176+
strategy:
177+
matrix:
178+
Windows Server 2022:
179+
vmImage: 'windows-2022'
180+
Windows Server 2025:
181+
vmImage: 'windows-2025'
182+
pool:
183+
vmImage: $(vmImage)
184+
timeoutInMinutes: '0'
185+
steps:
186+
- task: DownloadPipelineArtifact@2
187+
displayName: 'Download Pipeline Artifact'
188+
inputs:
189+
buildType: 'current'
190+
artifactName: $(buildArtifactName)
191+
targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)'
192+
193+
- task: PowerShell@2
194+
name: configureWinRM
195+
displayName: 'Configure WinRM'
196+
inputs:
197+
targetType: 'inline'
198+
script: 'winrm quickconfig -quiet'
199+
pwsh: false
200+
201+
- task: PowerShell@2
202+
name: test
203+
displayName: 'Run Integration Test'
204+
inputs:
205+
filePath: './build.ps1'
206+
arguments: "-Tasks test -PesterScript 'tests/Integration/Resources/DSC_*.Integration.Tests.ps1' -CodeCoverageThreshold 0"
207+
pwsh: false
208+
209+
- task: PublishTestResults@2
210+
displayName: 'Publish Test Results'
211+
inputs:
212+
testResultsFormat: 'NUnit'
213+
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
214+
testRunTitle: 'Integration $(vmImage)'
215+
condition: succeededOrFailed()
216+
170217
- stage: Deploy
171218
dependsOn:
172219
- Quality_Test_and_Unit_Test
220+
- Integration_Test
173221
condition: |
174222
and(
175223
succeeded(),

build.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ NestedModule:
8787
Path: ./output/RequiredModules/DscResource.Common
8888
AddToManifest: false
8989
Exclude: PSGetModuleInfo.xml
90+
DscResource.Base:
91+
CopyOnly: true
92+
Path: ./output/RequiredModules/DscResource.Base
93+
AddToManifest: false
94+
Exclude: PSGetModuleInfo.xml
9095
SChannelDsc.Common:
9196
Prefix: prefix.ps1
9297
VersionedOutputDirectory: false
@@ -115,6 +120,7 @@ Pester:
115120
OutputEncoding: ascii
116121
ExcludeFromCodeCoverage:
117122
- Modules/DscResource.Common
123+
- Modules/DscResource.Base
118124

119125
####################################################
120126
# Code Coverage Configuration #
@@ -148,6 +154,7 @@ DscTest:
148154
- output
149155
ExcludeModuleFile:
150156
- Modules/DscResource.Common
157+
- Modules/DscResource.Base
151158
# Must exclude built module file because it should not be tested like MOF-based resources
152159
- SChannelDsc.psm1
153160
MainGitBranch: main
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<#
2+
.SYNOPSIS
3+
The reason a property of a DSC resource is not in desired state.
4+
5+
.DESCRIPTION
6+
A DSC resource can have a read-only property `Reasons` that the compliance
7+
part (audit via Azure Policy) of Azure AutoManage Machine Configuration
8+
uses. The property Reasons holds an array of SChannelReason. Each SChannelReason
9+
explains why a property of a DSC resource is not in desired state.
10+
#>
11+
12+
class SChannelReason
13+
{
14+
[DscProperty()]
15+
[System.String]
16+
$Code
17+
18+
[DscProperty()]
19+
[System.String]
20+
$Phrase
21+
}

0 commit comments

Comments
 (0)