Enable SecureStore configuration during init
Add new flag for the init program: * --secure-store-lib That enables configuration of SecureStore during init. It will automatically discover implementations of SecureStore interface inside jar file. If there is not exactly one implementation the init will fail. During init the SecureStore jar file will be added to Gerrit classpath. Then after init this file will be copied to $gerrit_site/lib directory. The discovered value of 'secureStoreImpl' will be saved in the gerrit.config file. This change also introduces a @SecureStoreClassName String binding early in the startup so that this can be injected anywhere without worrying about having the @GerritServerConfig bound (which itself requires an injection of the SecureStore). If an already initialized site with a custom secure store is init-ed again and the --secure-store-lib option is not specified then the gerrit.secureStoreClass is honored to ensure we use the same secure store implementation. If the --secure-store-lib option is specified then the gerrit.secureStoreClass is ignored during init and will be overwritten with the new secure store. Without this modification schema updates will fail because of wrong password when custom SecureStore is used. Change-Id: Iae22bbdace0d9c7e7db0690c4bf522176fc3308e Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This commit is contained in:

committed by
David Pursehouse

parent
f62a233cc4
commit
256ec34af2
@@ -37,7 +37,7 @@ class GerritServerConfigProvider implements Provider<Config> {
|
||||
private final SecureStore secureStore;
|
||||
|
||||
@Inject
|
||||
GerritServerConfigProvider(final SitePaths site, final SecureStore secureStore) {
|
||||
GerritServerConfigProvider(SitePaths site, SecureStore secureStore) {
|
||||
this.site = site;
|
||||
this.secureStore = secureStore;
|
||||
}
|
||||
|
Reference in New Issue
Block a user