diff --git a/README.md b/README.md index c926bed..1222318 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,8 @@ coordinate is the reactor parent (a `pom`, no classes) — depend on one of the **À la carte:** import the BOM once, then declare `spring-services-core` plus only the feature modules you need (`spring-services-slack`, `spring-services-mcp`, `spring-services-email`, -`spring-services-search`, `spring-services-dbbackup`, `spring-services-scim`) without versions: +`spring-services-search`, `spring-services-dbbackup`, `spring-services-scim`, +`spring-services-tenant`) without versions: ```xml @@ -331,6 +332,7 @@ spring-services/ — reactor parent (packaging=pom) ├── spring-services-search — Meilisearch full-text search (RestClient, no extra dep) ├── spring-services-dbbackup — db-backup sidecar client (RestClient, no extra dep) ├── spring-services-scim — SCIM 2.0 Users provider (opt-in via openelements.scim.token) +├── spring-services-tenant — row-level multi-tenancy (self-activates on the classpath) ├── spring-services-all — everything bundle (depends on all modules; no config of its own) └── spring-services-bom — bill of materials for lockstep versioning ``` diff --git a/docs/releases/upgrade-to-1.4.md b/docs/releases/upgrade-to-1.4.md index 89acf7e..f86622e 100644 --- a/docs/releases/upgrade-to-1.4.md +++ b/docs/releases/upgrade-to-1.4.md @@ -1,4 +1,10 @@ -# Upgrade prompt: enabling the SCIM 2.0 Users provider (spec 015) +# Upgrade prompt: spring-services 1.4.0 optional-module changes + +`spring-services` 1.4.0 adds the optional **SCIM 2.0 Users provider** (spec 015) and moves +**multi-tenancy into its own module** (spec 016). Both sections below are independent — apply only +the ones you use. + +## SCIM 2.0 Users provider (spec 015) `spring-services` 1.4.0 adds an **optional** SCIM 2.0 Users service-provider module, `spring-services-scim`. It lets an external identity provider (Authentik, or any RFC 7644 client) @@ -83,3 +89,26 @@ credential. Rotation = change this property and the IdP token together; there is group write returns `501 Not Implemented`. Do not enable group provisioning in your IdP yet. - User `PATCH` is not implemented (`501`); Authentik updates via `PUT` full-replace. - Do not point your **application's own** entities at the reserved SCIM principal UUID. + +## Multi-tenancy moved to `spring-services-tenant` (spec 016) + +The multi-tenancy abstractions (`TenantService`, `AbstractMultitenantEntity`, +`AbstractMultitenantDbBackedDataService`, `RepositoryWithTenantSupport`, `EnableTenant`, +`TenantConfig`, …) previously lived in `spring-services-core`. In 1.4.0 they move, unchanged, into a +new optional feature module `spring-services-tenant`. No API, schema, or runtime-behaviour change to +the tenancy logic — this is a build-coordinate change only. + +- **`spring-services-all` consumers: nothing to do.** The everything-bundle now depends on + `spring-services-tenant`, so the feature is present exactly as before. +- **À-la-carte consumers who used tenant types via `spring-services-core`:** add the module + (version managed by the BOM): + + ```xml + + com.open-elements + spring-services-tenant + + ``` + +The feature self-activates on classpath presence (`TenantAutoConfiguration`); `@EnableTenant` and +`@Import(TenantConfig.class)` continue to work for explicit opt-in. There is no database migration. diff --git a/docs/specs/INDEX.md b/docs/specs/INDEX.md index 1b2a901..8559cfe 100644 --- a/docs/specs/INDEX.md +++ b/docs/specs/INDEX.md @@ -17,5 +17,5 @@ | 013 | 013-dedicated-schema-and-starter | Dedicated schema + starter | backend, database, architecture, build | Move all 7 library tables into a fixed `oe_spring_services` schema (single persistence unit) and ship a real Spring Boot starter that registers the library package additively via AutoConfigurationPackages — zero-config consumption. Migrations stay consumer-managed; the library ships ready-to-apply per-release SQL in the upgrade doc. Includes the app→lib cross-entity reference contract | #25 | done | | 014 | 014-multi-module-restructuring | Multi-module restructuring | build, architecture, infrastructure | Restructure the single artifact into a Maven reactor: `spring-services-core` (all 7 entities, single persistence unit) + optional feature modules (`slack`, `mcp`, `email`, `search`, `dbbackup`) + `spring-services-all` aggregator jar + `spring-services-bom`. Lockstep versioning; per-module `@AutoConfiguration` guarded by `@ConditionalOnClass`; builds on spec 013 (released first). Breaking change: `spring-services` coordinate becomes the reactor parent, consumers migrate to `spring-services-all` | #27 | done | | 015 | 015-scim-users-provider | SCIM Users provider | backend, security, api, database | SCIM 2.0 service-provider first slice: an isolated `/scim/v2/**` bearer-token filter chain (static `openelements.scim.token`), discovery endpoints (ServiceProviderConfig/ResourceTypes/Schemas), and the Users resource (list/filter, POST, GET, PUT full-replace, soft DELETE) mapped onto spec 012's `UserEntity`. `POST` collision → `409 uniqueness`; DELETE is soft (`deleted`/`deleted_at`); writes audited under a reserved SCIM service principal. Groups+membership and Group→Role mapping deferred to follow-up issues; grounded in real Authentik 2026.5.4 traffic (#21) with a pre-merge verification test plan. | #21 | done | -| 016 | 016-tenant-feature-module | Tenant feature module | build, architecture | Extract the `com.openelements.spring.base.tenant` package out of `spring-services-core` into a new optional feature module `spring-services-tenant` (depends on core), consistent with the spec-014 module pattern. Self-activates via `TenantAutoConfiguration`; `TenantConfig` drops its `@ComponentScan` in favour of an explicit `TenantService` `@Bean` to avoid double registration. Core loses its only two tenant references (`FullSpringServiceConfig` `@Import`, a `data/package-info.java` Javadoc link). Added to reactor + `spring-services-all` + BOM. Build-coordinate change only (no API/schema/behaviour change); breaking for à-la-carte core consumers of tenant types → documented in the 1.4.0 upgrade guide. | — | open | +| 016 | 016-tenant-feature-module | Tenant feature module | build, architecture | Extract the `com.openelements.spring.base.tenant` package out of `spring-services-core` into a new optional feature module `spring-services-tenant` (depends on core), consistent with the spec-014 module pattern. Self-activates via `TenantAutoConfiguration`; `TenantConfig` drops its `@ComponentScan` in favour of an explicit `TenantService` `@Bean` to avoid double registration. Core loses its only two tenant references (`FullSpringServiceConfig` `@Import`, a `data/package-info.java` Javadoc link). Added to reactor + `spring-services-all` + BOM. Build-coordinate change only (no API/schema/behaviour change); breaking for à-la-carte core consumers of tenant types → documented in the 1.4.0 upgrade guide. | #34 | done | diff --git a/pom.xml b/pom.xml index 67691cd..802ec0c 100644 --- a/pom.xml +++ b/pom.xml @@ -46,6 +46,7 @@ spring-services-email spring-services-mcp spring-services-scim + spring-services-tenant spring-services-all spring-services-bom diff --git a/spring-services-all/pom.xml b/spring-services-all/pom.xml index 97c8fd7..921399f 100644 --- a/spring-services-all/pom.xml +++ b/spring-services-all/pom.xml @@ -52,6 +52,11 @@ spring-services-scim ${project.version} + + com.open-elements + spring-services-tenant + ${project.version} + diff --git a/spring-services-bom/pom.xml b/spring-services-bom/pom.xml index f5c621a..5ee0b34 100644 --- a/spring-services-bom/pom.xml +++ b/spring-services-bom/pom.xml @@ -53,6 +53,11 @@ spring-services-scim ${project.version} + + com.open-elements + spring-services-tenant + ${project.version} + com.open-elements spring-services-all diff --git a/spring-services-core/src/main/java/com/openelements/spring/base/FullSpringServiceConfig.java b/spring-services-core/src/main/java/com/openelements/spring/base/FullSpringServiceConfig.java index d84461b..ac5af32 100644 --- a/spring-services-core/src/main/java/com/openelements/spring/base/FullSpringServiceConfig.java +++ b/spring-services-core/src/main/java/com/openelements/spring/base/FullSpringServiceConfig.java @@ -8,7 +8,6 @@ import com.openelements.spring.base.services.tag.TagConfig; import com.openelements.spring.base.services.translation.TranslationConfig; import com.openelements.spring.base.services.webhook.WebhookConfig; -import com.openelements.spring.base.tenant.TenantConfig; import org.springframework.context.annotation.Import; /** @@ -29,8 +28,6 @@ * *