Skip to content

Commit

Permalink
Merge pull request #432 from ghoneycutt/fix_ssh_host_data_type
Browse files Browse the repository at this point in the history
Fix data type for 'host' to allow for wildcards
  • Loading branch information
ghoneycutt authored Dec 30, 2024
2 parents b0eaa74 + 59378ea commit 2b143c7
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# devcontainer


For format details, see https://aka.ms/devcontainer.json.
For format details, see https://aka.ms/devcontainer.json.

For config options, see the README at:
https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet

``` json
{
"name": "Puppet Development Kit (Community)",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
env:
BUNDLE_WITHOUT: development:release
BEAKER_debug: true
name:
name:
steps:
- name: Enable IPv6 on docker
run: |
Expand Down
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2671,7 +2671,7 @@ Alias of

```puppet
Struct[{
Optional['Host'] => Stdlib::Host,
Optional['Host'] => String[1],
Optional['Match'] => String[1],
Optional['AddKeysToAgent'] => Enum['yes', 'no', 'ask', 'confirm'],
Optional['AddressFamily'] => Enum['any', 'inet', 'inet6'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/config_file_client.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @summary Create config files to be used
# @summary Create config files to be used
#
# Manage an entry in ~/.ssh/config for a particular user. Lines model the
# lines in each Host block.
Expand Down
2 changes: 1 addition & 1 deletion manifests/config_file_server.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @summary Create config files to be used
# @summary Create config files to be used
#
# Manage an entry in ~/.ssh/config for a particular user. Lines model the
# lines in each Host block.
Expand Down
38 changes: 12 additions & 26 deletions spec/type_aliases/ssh_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,18 @@

context 'String[1]' do
[
'Match', 'BindAddress', 'BindInterface', 'CanonicalDomains', 'CanonicalizePermittedCNAMEs', 'CASignatureAlgorithms',
'CertificateFile', 'Ciphers', 'ControlPath', 'ControlPersist', 'DynamicForward', 'EscapeChar', 'GlobalKnownHostsFile',
'HostbasedAcceptedAlgorithms', 'HostKeyAlgorithms', 'HostKeyAlias', 'Hostname', 'IdentityAgent', 'IdentityFile',
'IgnoreUnknown', 'Include', 'IPQoS', 'KbdInteractiveDevices', 'KexAlgorithms', 'KnownHostsCommand', 'LocalCommand',
'LocalForward', 'LogVerbose', 'MACs', 'PermitRemoteOpen', 'PKCS11Provider', 'PreferredAuthentications', 'ProxyCommand',
'ProxyJump', 'PubkeyAcceptedAlgorithms', 'RekeyLimit', 'RemoteCommand', 'RemoteForward', 'RevokedHostKeys',
'SecurityKeyProvider', 'SendEnv', 'SetEnv', 'TunnelDevice', 'User', 'UserKnownHostsFile', 'XAuthLocation'
'Match', 'BindAddress', 'BindInterface', 'CanonicalDomains',
'CanonicalizePermittedCNAMEs', 'CASignatureAlgorithms',
'CertificateFile', 'Ciphers', 'ControlPath', 'ControlPersist',
'DynamicForward', 'EscapeChar', 'GlobalKnownHostsFile', 'Host',
'HostbasedAcceptedAlgorithms', 'HostKeyAlgorithms', 'HostKeyAlias',
'Hostname', 'IdentityAgent', 'IdentityFile', 'IgnoreUnknown', 'Include',
'IPQoS', 'KbdInteractiveDevices', 'KexAlgorithms', 'KnownHostsCommand',
'LocalCommand', 'LocalForward', 'LogVerbose', 'MACs', 'PermitRemoteOpen',
'PKCS11Provider', 'PreferredAuthentications', 'ProxyCommand',
'ProxyJump', 'PubkeyAcceptedAlgorithms', 'RekeyLimit', 'RemoteCommand',
'RemoteForward', 'RevokedHostKeys', 'SecurityKeyProvider', 'SendEnv',
'SetEnv', 'TunnelDevice', 'User', 'UserKnownHostsFile', 'XAuthLocation'
].each do |directive|
describe directive.inspect do
[
Expand Down Expand Up @@ -337,25 +342,6 @@
end
end

context 'Stdlib::Host' do
[
'Host',
].each do |directive|
describe directive.inspect do
[
'string', 'host.domain.tld', '242.242.242.242', '242', nil, :keyword # FIXME: unsure why nil and :keyword are actually supported
].each do |valid|
it { is_expected.to allow_value(directive => valid) }
end
[
'_invalid.domain.tld', 'ネット', ['array'], { 'ha' => 'sh' }, [], '', 242, 0x242, true, false, [nil], [nil, nil]
].each do |invalid|
it { is_expected.not_to allow_value(directive => invalid) }
end
end
end
end

context 'Stdlib::Port' do
[
'Port',
Expand Down
2 changes: 1 addition & 1 deletion types/ssh_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
type Ssh::Ssh_Config = Struct[
{
Optional['Host'] => Stdlib::Host,
Optional['Host'] => String[1],
Optional['Match'] => String[1],
Optional['AddKeysToAgent'] => Enum['yes', 'no', 'ask', 'confirm'],
Optional['AddressFamily'] => Enum['any', 'inet', 'inet6'],
Expand Down

0 comments on commit 2b143c7

Please sign in to comment.