5.1 Service Scaffold and Schema¶
Sprint: Sprint 05 - Security and Identity
Feature ID: 5.1
Subtasks: 5.1.1, 5.1.2
Objective¶
Deliver "Service Scaffold and Schema" within Sprint 05 - Security and Identity.
Dependencies¶
Aggregated from the subtasks below (prerequisite task IDs and enablers):
- 3.4.1
- 4.1.1
- 4.2.1
- 5.1.1
Subtasks¶
5.1.1 Scaffold identity-service from template¶
- ID: 5.1.1
- Title: Create identity-service from the service template
- Description: Instantiate
microservices/identity-service(port 9001, base packagecom.telco.identity) from the template; depend on starter-api, starter-security, starter-mediator, starter-observability, starter-outbox; point at theidentitydatabase; declare CQRS+Mediator mode and the Infrastructure Profile (PostgreSQL, ADR-006) in CLAUDE.md. Authentication is delegated to Keycloak (ADR-011); starter-security validates Keycloak JWTs - identity-service does not issue them. - Business Purpose: Standardized, platform-integrated identity service skeleton.
- Inputs: ADR-017, Sprint 03/04 outputs.
- Outputs: identity-service skeleton that builds and registers with discovery.
- Acceptance Criteria:
- Service starts, registers in Eureka, exposes Swagger UI, and serves config from config-server.
- Dependencies: 3.4.1, 4.1.1, 4.2.1
- Complexity: S
5.1.2 Identity schema migration¶
- ID: 5.1.2
- Title: Create Flyway migration for users, roles, permissions, audit
- Description:
V1__identity.sqlcreatingusers(id, keycloak_id, username, email, status, created_at) as a domain projection - credentials live in Keycloak, so nopassword_hash- plusroles(id, name),permissions(id, code),user_roles,role_permissions, andaudit_log(id, actor_id, action, entity, entity_id, details jsonb, created_at). Norefresh_tokenstable: Keycloak owns tokens (ADR-011). - Business Purpose: Persistent RBAC projection and audit storage (credentials are Keycloak's).
- Inputs: analysis Section 13, service-catalog identity-service.
- Outputs: Flyway migration.
- Acceptance Criteria:
- Migration applies cleanly on Testcontainers Postgres; all tables and join tables exist with FKs.
- Dependencies: 5.1.1
- Complexity: M
Acceptance Criteria¶
Each subtask above carries its own objective, testable acceptance criteria. This feature is complete when every subtask's acceptance criteria are met.
Deliverables¶
- identity-service skeleton that builds and registers with discovery.
- Flyway migration.
Definition of Done¶
- All subtasks (5.1.1, 5.1.2) completed and their acceptance criteria verified.
- All listed dependencies satisfied.
- Build and tests green per the global conventions in ../README.md (Section 3).