-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
feat: Enhance RemoteServer
and Console
create-user to assign group
#1405
Conversation
@@ -467,16 +467,25 @@ private void executeCreateUser(final String params) { | |||
checkHasSpaces("User name", userName); | |||
|
|||
final String password; | |||
final List<String> databases; | |||
HashMap<String,String> databases = new HashMap<String,String>(); |
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.
my suggestion:
final Map<String,String>...
@@ -74,7 +74,7 @@ public String toString() { | |||
return protocol + "://" + currentServer + ":" + currentPort; | |||
} | |||
|
|||
public void createUser(final String userName, final String password, final List<String> databases) { | |||
public void createUser(final String userName, final String password, final HashMap<String,String> databases) { |
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.
again, prefer interface:
final Map<String,String
@@ -101,6 +101,16 @@ public void createUser(final String userName, final String password, final List< | |||
} | |||
} | |||
|
|||
public void createUser(final String userName, final String password, final List<String> databases) { | |||
|
|||
HashMap<String,String> databasesWithGroups = new HashMap<String, String>(); |
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.
again:
Map<String,String> databasesWithGroups = new HashMap<String, String>();
Good for me ;-) |
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
What does this PR do?
RemoteServe
class methodcreateUser
is overloaded with a variant with the signatureAs for the HTTP API server command the
databases
HashMap should have keys being database names and values being a group name.The former function with a
List<String>
databases
argument is still available, but its body changed so that the new method is called by it.Console
class methodexecuteCreateUser
is updated so the newRemoteServer
createUser
method is used. However not too robustly, and error handling is defered to theRemoteServer
or eventually to theServerSecurityUser
class.So now in console the following can be done:
Motivation
Missing capability to assign group during user creation in console, even though possibl via HTTP API.
Additional Notes
It is possible to pass an empty group, but AFAIK this is also allowed in the HTTP server command.
Checklist
mvn clean package
command