-
Notifications
You must be signed in to change notification settings - Fork 47
Add sshdconfig get #1004
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?
Add sshdconfig get #1004
Conversation
This reverts commit af54285.
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 adds comprehensive get
functionality to the sshdconfig
resource, enabling retrieval of SSH server configuration settings with flexible filtering options.
- Add
get
command support to retrieve SSH server settings fromsshd -T
output - Implement metadata-based filtering to exclude defaults and specify custom config files
- Add comprehensive Pester tests for the new
get
andexport
functionality
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
sshd_config.dsc.resource.json | Adds get/set command definitions and enables additional properties in schema |
src/util.rs | Adds command argument structures and utility functions for metadata extraction and default filtering |
src/main.rs | Updates get command to accept input parameter |
src/get.rs | Implements complete get functionality with filtering and metadata support |
src/export.rs | Refactors export to support reusable map generation |
src/error.rs | Adds IO and persist error types, removes unused NotImplemented error |
src/args.rs | Adds input parameter to get command |
locales/en-us.toml | Updates localization strings for new functionality |
Cargo.toml | Adds tempfile dependency |
dsc/tests/dsc_sshdconfig.tests.ps1 | Adds comprehensive Pester tests for get and export operations |
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.
LGTM
It's a bit late, since the implementation is already so far along, but I want to address a few things from the design perspective:
The differing behavior for input/no-input in the Similarly, here we seem to be defining write-only properties (behavior-modifying parameters) to be passed through |
@michaeltlombardi seems like we should have a meeting to discuss this before we commit this change |
I'll set it up! |
PR Summary
SSHD -T
including defaultsSSHD -T
included in the inputincludeDefaults: false
is passed in via_metadata
, get returns the subset of settings fromSSHD -T
that are not defaultsfilepath: <filepath>
is passed in via_metadata
, get runsSSHD -T -f <filepath>