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
implementation of WFLY-2510 #89
Conversation
Can one of the admins verify this patch? |
this is ok to test |
@darranl @aloubyansky please approve |
* | ||
* @author Claudio Miranda | ||
*/ | ||
public class ConnectionInfoHandler implements CommandHandler { |
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.
It would be better to extend CommandHandlerWithHelp and write a simple txt file with the description of the command or implement --help/-h argument otherwise.
Hi, take a look, thanks. |
Build 201 outcome was FAILURE using a merge of 18e143f Build problems:Process exited with code 1
|
Ah, had some issues with git merge and commit, sorry. |
import java.security.cert.X509Certificate; | ||
import java.util.Date; | ||
|
||
public class ConnectionInfoBean { |
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 good. I meant to keep the class public but the constructor and the setters could have the default access modifier, so they are not visible outside the package.
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.
Actually, if you don't mind, let's introduce a ConnectionInfo interface (which will expose only the get-methods) and simply add a method to CommandContext, e.g. ConnectionInfo getConnectionInfo(). Thanks!
Hi, take a look now. Thanks. |
|
||
public ConnectionInfo getConnectionInfo() { | ||
return connInfoBean; | ||
} |
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.
Yes, this looks better now. The final thing though... :) Sorry, I missed it before. There is a method disconnectController() in this class. This method could be called by a user or if the cli receives a connection closed notification. Anyway, to keep the connection info consistent it has to be reset in this method too.
Thanks a lot!
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.
Done!
@@ -837,6 +843,8 @@ public void connectController(String controller) throws CommandLineException { | |||
do { | |||
try { | |||
CallbackHandler cbh = new AuthenticationCallbackHandler(username, password); | |||
connInfoBean = new ConnectionInfoBean(); | |||
connInfoBean.setDisableLocalAuth(disableLocalAuth); |
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.
What if the connection actually fails? I think in that case you should reset the just initialized connection info in the catches below.
@@ -0,0 +1,56 @@ | |||
/* | |||
* JBoss, Home of Professional Open Source. | |||
* Copyright 2011, Red Hat, Inc., and individual contributors |
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.
It is now 2014 - all new classes should reflect this in the copyright header.
use SimpleTable for output added simple test added help text
…dContext to isolate responsibility
…ction is sucessfull
Sorry if you wouldn't mind I would suggest instead of authenticated as it may be better to say 'granted role' and 'granted roles'. |
I also added the message when there is no role associated when using rbac [standalone@localhost:9993 /] connection-info |
Hi @darranl, I think all remaining issues are fixed. |
@darranl @aloubyansky since there's been a fair bit of back and forth on this one, please give it a final +1 so I know all issues are addressed and can merge it. |
Claudio, thanks so much! Before merging, I need to get an answer to a question: We require that all contributions be made under the terms of the MIT License, http://www.opensource.org/licenses/mit-license.php. Do you agree to the these terms? |
Yes and thanks a lot from me! |
On Thu, Aug 28, 2014 at 8:53 AM, Brian Stansberry notifications@github.com
Yes. Claudio Miranda |
implementation of WFLY-2510
Thanks! |
[JBEAP-2490][WFCORE-1240] Call the non-deprecated variant
Add CLI command to display information about current connection.