-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add support for all proxy schemes, not just https:// #2289
Conversation
Looks like the tests fail on this. I also wonder if this should be a type alias. |
I would agree on this |
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.
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.
Small detail, but this looks good.
types/modproxy.pp
Outdated
@@ -0,0 +1,3 @@ | |||
# @summary Supported protocols / schemes by mod_proxy | |||
# @see https://httpd.apache.org/docs/2.4/mod/mod_proxy.html | |||
type Apache::ModProxyProtocol = Pattern[/(\A(ajp|fcgi|ftp|h2|h2c|http|https|scgi|uwsgi|ws|wss):\/\/.*\z)/, /(\Aunix:\/([^\n\/\0]+\/*)*\z)/] |
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.
Is it valid to not specify anything or should it be
type Apache::ModProxyProtocol = Pattern[/(\A(ajp|fcgi|ftp|h2|h2c|http|https|scgi|uwsgi|ws|wss):\/\/.*\z)/, /(\Aunix:\/([^\n\/\0]+\/*)*\z)/] | |
type Apache::ModProxyProtocol = Pattern[/(\A(ajp|fcgi|ftp|h2|h2c|http|https|scgi|uwsgi|ws|wss):\/\/.+\z)/, /(\Aunix:\/([^\n\/\0]+\/*)*\z)/] |
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.
Looks like the tests are failing.
Also, it's possible to add tests for a type alias: https://rspec-puppet.com/documentation/type_aliases/
I don't think that's correct, because I took my regex directly from Stdlib:HTTPSUrl https://github.com/puppetlabs/puppetlabs-stdlib/blob/main/types/httpsurl.pp Which is: type Stdlib::HTTPSUrl = Pattern[/(?i:\Ahttps://.*\z)/] |
Ok, I'll add the tests for this new type alias. |
Interesting. That implies it also accepts |
types/modproxy.pp
Outdated
@@ -0,0 +1,3 @@ | |||
# @summary Supported protocols / schemes by mod_proxy | |||
# @see https://httpd.apache.org/docs/2.4/mod/mod_proxy.html | |||
type Apache::ModProxyProtocol = Pattern[/(\A(ajp|fcgi|ftp|h2c?|https?|scgi|uwsgi|wss?):\/\/.*\z)/, /(\Aunix:\/([^\n\/\0]+\/*)*\z)/] |
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.
I don't think this is correct. The filename must match the type name.
Actually, you're correct. We shouldn't allow an empty value after :// I'll fix that with your suggestion. It looks like the Stdlib:HTTPSUrl allows that for some reason? |
Possibly an oversight and nobody ran into problems because of it. |
The spec tests are failing, but I can't figure out why? Resource type not found: Apache::ModProxyProtocol Not sure why it's giving me that error? |
Because of #2289 (comment). You must name it according to the conventions so the loader finds it, so |
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.
This looks good to me. @david22swan you requested changes, mind taking another look? Also, IMHO we should squash this on merge.
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
Everything look's good to me, only small comment is that the variables aren't aligned, but since there are only two of them it's not that big of a deal in my eyes.
Will go ahead with a squash merge.
This commit fixes #2285 by supporting all mod_proxy schemes according to the documentation here:
https://httpd.apache.org/docs/2.4/mod/mod_proxy.html