Downgrading OrientDB to 3.0.42
This commit is contained in:
parent
d7af96d8a7
commit
10985f00f8
2
pom.xml
2
pom.xml
|
@ -64,7 +64,7 @@
|
|||
implementation we use a lighter dependency
|
||||
-->
|
||||
<artifactId>orientdb-client</artifactId>
|
||||
<version>3.2.6</version>
|
||||
<version>3.0.42</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.graalvm.tools</groupId>
|
||||
|
|
|
@ -320,6 +320,8 @@ public class DatabaseEnvironment {
|
|||
OUser newAdminUser = oSecurity.createUser(CHANGED_ADMIN_USERNAME, CHANGED_ADMIN_PASSWORD, adminRole);
|
||||
newAdminUser.save();
|
||||
|
||||
DatabaseEnvironment.changeDefaultAdminPassword(oSecurity);
|
||||
|
||||
setRecordLevelSecurity(oMetadata);
|
||||
|
||||
oDatabaseSession.commit();
|
||||
|
@ -339,5 +341,28 @@ public class DatabaseEnvironment {
|
|||
public static Key getDatabaseKey() {
|
||||
return KEY;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
// This code must be removed for OrientDB versions higher than 3.2.X
|
||||
public static void changeDefaultAdminPassword(OSecurity oSecurity) {
|
||||
for(PermissionMode permissionMode : DEFAULT_PASSWORDS.keySet()) {
|
||||
try {
|
||||
logger.trace("Going to update password for user {}", permissionMode.toString());
|
||||
OUser oUser = oSecurity.getUser(permissionMode.toString());
|
||||
oUser.setPassword(DEFAULT_PASSWORDS.get(permissionMode));
|
||||
oUser.save();
|
||||
logger.trace("Updated password for user {}", permissionMode.toString());
|
||||
}catch (Exception e) {
|
||||
logger.trace("Unable to update password for user {}. {}", permissionMode.toString(), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
logger.trace("Removing 'admin' user");
|
||||
oSecurity.dropUser("admin");
|
||||
}catch (Exception e) {
|
||||
logger.info("Unable to delete admin user. {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue