use of com.adeptj.runtime.server.ServerConstants.KEY_USER_CREDENTIAL_MAPPING in project adeptj-runtime by AdeptJ.
the class Server method populateCredentialsStore.
private void populateCredentialsStore(Config undertowConf) {
try (MVStore store = MVStore.open(MV_CREDENTIALS_STORE)) {
MVMap<String, String> credentials = store.openMap(H2_MAP_ADMIN_CREDENTIALS);
// put the default password only when it is not set from web console.
undertowConf.getObject(KEY_USER_CREDENTIAL_MAPPING).entrySet().stream().filter(entry -> StringUtils.isEmpty(credentials.get(entry.getKey()))).forEach(entry -> credentials.put(entry.getKey(), ((String) entry.getValue().unwrapped()).substring(PWD_START_INDEX)));
}
}
Aggregations