-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 convenient method to add user to Realm #1488
Conversation
Add a new base class UserStore Signed-off-by: olivier lamy <olamy@webtide.com>
…ation to use Signed-off-by: olivier lamy <olamy@webtide.com>
Signed-off-by: olivier lamy <olamy@webtide.com>
_propertyUserStore = null; | ||
if (_userStore != null) | ||
_userStore.stop(); | ||
_userStore = null; |
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 think we need to remember whether the _userStore was explicitly set or we autocreated it: only if we autocreated it should we null it out, otherwise a stop/restart of the context won't work.
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.
good point. fixed!
propertyUserStore.setHotReload(hotReload); | ||
propertyUserStore.setConfigPath(_configFile); | ||
propertyUserStore.start(); | ||
this._userStore = propertyUserStore; |
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.
Teeny quibble: you can get rid of the this., as the underscore on the field name is definitive.
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.
haha grhh usually checkstyle says "this is mandatory" :-)
Signed-off-by: olivier lamy <olamy@webtide.com>
81b2a6a forced changes in jenkinsci/jenkins-test-harness#63, which in turn do not work with Jetty 9.2.x; i.e., there is no apparent idiom which works in either version. Was there no way to retain backward compatibility here? Something like @Deprecated
public void update(String userName, Credential credential, String[] roleArray) {
if (_userStore == null) {
_userStore = new UserStore();
}
userStore.addUser(userName, credentials, roleArray);
}
@Deprecated
public void remove(String userName) {
_userStore.removeUser(userName);
} ? |
fix #1481