-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
ZOOKEEPER-4259 - Allow AdminServer to force https #1652
Conversation
zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/JettyAdminServer.java
Outdated
Show resolved
Hide resolved
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
Although I haven't tested it locally yet, I assume you did it. I'll try to do it tomorrow if noone else does it.
Is this fine that I stayed with portunification, or should we have a seperate secure port?
I don't mind to stick to the same port. The user can decide now to make that single port to be http-only, https-only or http-and-https-unified. I think this is flexible enough. Usually in production people will stick to either http-only or https-only, and maybe using http-and-https-unified during upgrade / migration.
Do you thing we can add any unit test? Do we have unit tests for admin port unification? Maybe those could be reused / extended.
zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/JettyAdminServer.java
Outdated
Show resolved
Hide resolved
Thanks for the review @symat , yes, I was planning to add unit tests, this was just an initial commit to see what folks think about the implementation (mainly to sticking to one port only). I will do the unit tests shortly. |
b19a9b3
to
1e1273d
Compare
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
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.
great work, also thanks for the unit tests!
I tested the patch locally:
- portUnification is still working (if portUnification=true and forceHttps=false)
- https enforced if forceHttps=true (independently of the value of portUnification)
I left a minor comment for the test code, PTAL.
zookeeper-server/src/test/java/org/apache/zookeeper/server/admin/JettyAdminServerTest.java
Show resolved
Hide resolved
Also, looking at the code "forceHTTPS" seems funky, I will change it to "forceHttps". Taking a quick look, all caps is not used for HTTPS in configs. |
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.
great, thanks! LGTM
Initial commit to allow adminServer to only serve HTTPS requests Questions: -Is this fine that I stayed with portunification, or should we have a seperate secure port? Author: Norbert Kalmar <[email protected]> Reviewers: Mate Szalay-Beko <[email protected]>, Enrico Olivelli <[email protected]> Closes #1652 from nkalmar/ZOOKEEPER-2512 (cherry picked from commit 0b6862e) Signed-off-by: Damien Diederen <[email protected]>
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 (but not tested). This is now in master
and branch-3.7
. It is not in branch-3.7.0
, as we currently have an open RC, nor in branch-3.6
, as it did not cherry-pick cleanly. (Can you open another PR if you want it there?)
Cheers, -D
Initial commit to allow adminServer to only serve HTTPS requests Author: Norbert Kalmar <[email protected]> Reviewers: Mate Szalay-Beko <[email protected]>, Enrico Olivelli <[email protected]> Closes #1652 from nkalmar/ZOOKEEPER-2512
Thank you @ztzg , about 3.6... I did the cherry-pick and accidentally committed to apache 3.6 branch instead of mine, so, consider it done I guess. Sorry about that... I will see that the commit did not break anything. Edit: commit seems good, spotbugs fails but from a different commit (quorumpeertest has a whitespace after a function start "(". It is not caused by my commit. |
:)
Right; that has been fixed by @arshadmohammad while preparing 3.6.3. Thanks! |
Initial commit to allow adminServer to only serve HTTPS requests Questions: -Is this fine that I stayed with portunification, or should we have a seperate secure port? Author: Norbert Kalmar <[email protected]> Reviewers: Mate Szalay-Beko <[email protected]>, Enrico Olivelli <[email protected]> Closes apache#1652 from nkalmar/ZOOKEEPER-2512
Initial commit to allow adminServer to only serve HTTPS requests Questions: -Is this fine that I stayed with portunification, or should we have a seperate secure port? Author: Norbert Kalmar <[email protected]> Reviewers: Mate Szalay-Beko <[email protected]>, Enrico Olivelli <[email protected]> Closes apache#1652 from nkalmar/ZOOKEEPER-2512 Co-authored-by: Norbert Kalmar <[email protected]>
Initial commit to allow adminServer to only serve HTTPS requests Questions: -Is this fine that I stayed with portunification, or should we have a seperate secure port? Author: Norbert Kalmar <[email protected]> Reviewers: Mate Szalay-Beko <[email protected]>, Enrico Olivelli <[email protected]> Closes apache#1652 from nkalmar/ZOOKEEPER-2512 Change-Id: I4a4779faa3fc988fe7a3204470471ac5aaabf989 (cherry picked from commit c839789)
Initial commit to allow adminServer to only serve HTTPS requests
Questions:
-Is this fine that I stayed with portunification, or should we have a seperate secure port?