-
Notifications
You must be signed in to change notification settings - Fork 228
Open
Labels
enhancementThe issue is an enhancement request.The issue is an enhancement request.help wantedThe issue is up for grabs for anyone in the community.The issue is up for grabs for anyone in the community.
Description
Description
The integration test PostInstallationConfiguration.Integration.Tests.ps1 contains code that duplicates functionality from private functions in the DSC_SqlSecureConnection DSC resource. These private functions should be refactored into public commands to reduce code duplication and improve maintainability.
Private Functions to Refactor
The following private functions from source/DSCResources/DSC_SqlSecureConnection/DSC_SqlSecureConnection.psm1 should be converted to public commands:
Certificate Permission Management
Get-CertificateAcl- Gets the ACL of the certificate private keySet-CertificatePermission- Grants service account read permissions to certificate private keyTest-CertificatePermission- Tests if service account has read permissions to certificate private key
SQL Server Encryption Registry Configuration
Get-SqlEncryptionValue- Gets the SQL Server SuperSocketNetLib registry pathGet-EncryptedConnectionSetting- Gets certificate thumbprint and ForceEncryption settings from registrySet-EncryptedConnectionSetting- Sets certificate thumbprint and ForceEncryption in registry
Benefits
- Reduce code duplication - Integration tests can use public commands instead of duplicating logic
- Improve testability - Public commands can be unit tested independently
- Better reusability - Other scripts and modules can leverage these commands
- Simplified maintenance - Single source of truth for certificate and encryption configuration logic
Implementation Notes
- Follow DSC Community naming conventions for public commands (e.g.,
Get-SqlDscCertificateAcl,Set-SqlDscCertificatePermission, etc.) - Add appropriate comment-based help with examples
- Create unit tests for all new public commands
- Update integration tests to use the new public commands
- Update the DSC resource to use the new public commands
- Add localized strings for any user-facing messages
References
Metadata
Metadata
Assignees
Labels
enhancementThe issue is an enhancement request.The issue is an enhancement request.help wantedThe issue is up for grabs for anyone in the community.The issue is up for grabs for anyone in the community.