feat(tenants): personalise seeded user credentials for a brand-new tenant
Adds TenantInitialUserProvisioner: right after the very first Liquibase migration of a tenant that was never on Flyway, renames the three seeded users (ids 1-3, otherwise shipping as mifos/system/interopUser with the public default password) to <tenantIdentifier>_admin/_system/ _interop, with a password from fineract.tenant.initial-user-password or a built-in default. An existing (Flyway-era) tenant already has its real users and is left untouched. Wired through TenantDatabaseUpgradeService and its two test configurations. Also fixes the two pooled interest-posting services' system-user lookup, which read username = 'system' — now wrong since that username is personalised per tenant — to find the seeded system user by its fixed id (2) instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -159,7 +159,9 @@ public class TestConfiguration {
|
||||
FineractProperties fineractProperties, Environment environment,
|
||||
List<CustomTaskChange> customTaskChangesForDependencyInjection) {
|
||||
return new TenantDatabaseUpgradeService(tenantDetailsService, tenantDataSource, fineractProperties, tenantDatabaseStateVerifier,
|
||||
liquibaseFactory, tenantDataSourceFactory, environment, customTaskChangesForDependencyInjection);
|
||||
liquibaseFactory, tenantDataSourceFactory, environment,
|
||||
new org.apache.fineract.infrastructure.core.service.migration.TenantInitialUserProvisioner(environment),
|
||||
customTaskChangesForDependencyInjection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-1
@@ -189,6 +189,8 @@ public class LiquibaseStepDefinitions implements En {
|
||||
.willReturn(tenantLiquibase);
|
||||
|
||||
tenantDatabaseUpgradeService = new TenantDatabaseUpgradeService(tenantDetailsService, tenantStoreDataSource, fineractProperties,
|
||||
databaseStateVerifier, liquibaseFactory, tenantDataSourceFactory, environment, Arrays.asList(tenantPasswordEncryptor));
|
||||
databaseStateVerifier, liquibaseFactory, tenantDataSourceFactory, environment,
|
||||
new org.apache.fineract.infrastructure.core.service.migration.TenantInitialUserProvisioner(environment),
|
||||
Arrays.asList(tenantPasswordEncryptor));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user