-
Notifications
You must be signed in to change notification settings - Fork 55
Add sshdconfig match to export #1327
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR enhances the sshdconfig resource to properly support SSH Match directives and Include directives in both get and export commands, while also fixing a bug where the get command was not properly ignoring input filtering. The changes include cross-platform test support improvements, grammar enhancements for better comment handling, and appropriate warning messages for Include directives.
Key Changes
- Fixed
getcommand to properly ignore input filtering by clearing the input map when filters are provided - Added support for parsing and exporting SSH
Matchdirective blocks - Added warning messages when
Includedirectives are detected, explaining thatsshd -Tmerges included files - Enhanced tree-sitter grammar to handle inline comments and flexible whitespace in match blocks
- Enabled sshd_config tests on all platforms (when elevated and sshd is available)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/sshdconfig/src/util.rs | Added sshd_config.clear() to fix get command input filtering bug |
| resources/sshdconfig/src/get.rs | Added match directive insertion and include warning logic |
| resources/sshdconfig/locales/en-us.toml | Added includeWarning message explaining Include directive behavior |
| resources/sshdconfig/tests/sshdconfig.get.tests.ps1 | New comprehensive test file for get and export commands with Match and Include scenarios |
| resources/sshdconfig/tests/sshdconfig.set.tests.ps1 | Updated to support cross-platform elevation checks |
| dsc/tests/dsc_sshdconfig.tests.ps1 | Updated to support cross-platform elevation checks |
| grammars/tree-sitter-ssh-server-config/grammar.js | Enhanced to support inline comments and exclude # from unquoted strings |
| grammars/tree-sitter-ssh-server-config/test/corpus/valid_expressions.txt | Added test cases for comments in various contexts and match blocks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
PR Summary
getbug where the command was not ignoring any input filteringgetandexportregardingMatchdirectivesgetandexportregardingIncludedirectivesgetandexportscenariosPR Context
getwill be required to enable theset&clobber: falsescenario