-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Support data-ciphers and data-ciphers-fallback options #444
base: master
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.
Some minor data types issues. I added in-line comments to address them.
I would suggest to stick to String in this PR to match the rest of the module for now, and if you are up to it work on improving the module so that OpenVPN use the default values (i.e. no parameter is output) when no explicit value is provided instead of when a ''
is passed in another PR that will go in a new major release.
manifests/client.pp
Outdated
@@ -61,6 +63,8 @@ | |||
Boolean $pam = false, | |||
String $cipher = 'AES-256-GCM', | |||
String $tls_cipher = 'TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-128-CBC-SHA256', | |||
Optional[String] $data_ciphers = 'AES-256-GCM:AES-128-GCM', |
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.
Optional
with a default value cannot be forced to undef. Since we test the value against ''
, it make sense to only allow String
:
Optional[String] $data_ciphers = 'AES-256-GCM:AES-128-GCM', | |
String $data_ciphers = 'AES-256-GCM:AES-128-GCM', |
manifests/client.pp
Outdated
@@ -61,6 +63,8 @@ | |||
Boolean $pam = false, | |||
String $cipher = 'AES-256-GCM', | |||
String $tls_cipher = 'TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-128-CBC-SHA256', | |||
Optional[String] $data_ciphers = 'AES-256-GCM:AES-128-GCM', | |||
Optional[String] $data_ciphers_fallback = undef, |
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.
Since we test the value against ''
bellow, it make sense to only allow String
:
Optional[String] $data_ciphers_fallback = undef, | |
String $data_ciphers_fallback = '', |
Admitedly this is inelegant, but it is the may this module currently duplicate all config.
Just a quick question: if the vars are not Optional, how would that work with OpenVPN versions that don't support these yet? I added them as optional so as not to break config for OpenVPN 2.4 and before. |
An optional parameter with a default value cannot be forced to "back" to undef: it will take the default value: class foo (
Optional[String] $x = 'foo',
) {
warning("x=${x}")
}
class { 'foo':
x => undef, # This will print "x=foo"
} If the parameters are new, indeed adding them to the config may cause trouble with older versions. My recommendation then would be make sure these parameters are only output when the user provided a value for them. This would mean defaulting to class foo (
Optional[String[1]] $x = undef,
String $y = '',
) {
# ...
} and the corresponding template:
|
These are new in OpenVPN 2.5. Since they are not supported in OpenVPN 2.4, they aren't produced in the output unless they are changed from the default.
Pull Request (PR) description
Support
data-ciphers
anddata-ciphers-fallback
options for OpenVPN 2.5.This Pull Request (PR) fixes the following issues: n/a