feat: full tenant cleanup on delete — Docker resources, PG schema, CH data (#55)
DockerTenantProvisioner.remove() now cleans up all tenant Docker resources: containers (by cameleer.tenant label), env networks, tenant network, JAR volume. TenantDataCleanupService drops the tenant's PostgreSQL schema and deletes all ClickHouse data for GDPR compliance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -47,7 +47,7 @@ class TenantPortalServiceTest {
|
||||
private TenantProvisioner tenantProvisioner;
|
||||
|
||||
private final ProvisioningProperties provisioningProps = new ProvisioningProperties(
|
||||
null, null, null, null, "test.example.com", "https", null, null, null, null);
|
||||
null, null, null, null, "test.example.com", "https", null, null, null, null, null);
|
||||
|
||||
private TenantPortalService tenantPortalService;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.siegeln.cameleer.saas.identity.LogtoConfig;
|
||||
import net.siegeln.cameleer.saas.identity.LogtoManagementClient;
|
||||
import net.siegeln.cameleer.saas.identity.ServerApiClient;
|
||||
import net.siegeln.cameleer.saas.provisioning.ProvisioningProperties;
|
||||
import net.siegeln.cameleer.saas.provisioning.TenantDataCleanupService;
|
||||
import net.siegeln.cameleer.saas.license.LicenseEntity;
|
||||
import net.siegeln.cameleer.saas.license.LicenseService;
|
||||
import net.siegeln.cameleer.saas.provisioning.ProvisionResult;
|
||||
@@ -61,18 +62,21 @@ class VendorTenantServiceTest {
|
||||
@Mock
|
||||
private AuditService auditService;
|
||||
|
||||
@Mock
|
||||
private TenantDataCleanupService dataCleanupService;
|
||||
|
||||
private VendorTenantService vendorTenantService;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
var provisioningProps = new ProvisioningProperties(
|
||||
"img", "uiimg", "net", "traefik", "localhost", "https",
|
||||
"jdbc:postgresql://pg:5432/db", "https://localhost/oidc",
|
||||
"http://logto:3001/oidc/jwks", "https://localhost");
|
||||
"jdbc:postgresql://pg:5432/db", "jdbc:clickhouse://ch:8123/cameleer",
|
||||
"https://localhost/oidc", "http://logto:3001/oidc/jwks", "https://localhost");
|
||||
vendorTenantService = new VendorTenantService(
|
||||
tenantService, tenantRepository, licenseService,
|
||||
tenantProvisioner, serverApiClient, logtoClient, logtoConfig,
|
||||
auditService, provisioningProps);
|
||||
auditService, provisioningProps, dataCleanupService);
|
||||
}
|
||||
|
||||
// --- Helpers ---
|
||||
|
||||
Reference in New Issue
Block a user