auth
This commit is contained in:
@@ -23,7 +23,7 @@ On Windows, `gradlew.bat` is equivalent (it is git-ignored but present locally).
|
||||
|
||||
## Conventions and gotchas
|
||||
|
||||
- **Spring Boot 4 starter names**: `spring-boot-starter-webmvc`, `spring-boot-starter-security-oauth2-resource-server`, and matching `*-test` starters. Do not "fix" them to Boot 3 names (`spring-boot-starter-web`, `spring-boot-starter-oauth2-resource-server`) — those do not exist in Boot 4. Auth is resource-server only (JWT from Keycloak, client `gorodar`); there is no oauth2-client.
|
||||
- **Spring Boot 4 starter names**: `spring-boot-starter-webmvc`, `spring-boot-starter-security-oauth2-resource-server`, and matching `*-test` starters. Do not "fix" them to Boot 3 names (`spring-boot-starter-web`, `spring-boot-starter-oauth2-resource-server`) — those do not exist in Boot 4. Auth is self-issued (email-code flow in `ru.gorodar.auth`, OIDC-shaped endpoints); the service validates its own JWTs (RS256, local JWKS) as a resource server; there is no Keycloak and no oauth2-client.
|
||||
- **Lombok**: declared as `compileOnly` + `annotationProcessor` (plus test variants). Keep this pattern when adding modules; plain `implementation` breaks annotation processing.
|
||||
- **MapStruct** (entity↔DTO mappers in `ru.gorodar.mapper`, `componentModel = "spring"`, `unmappedTargetPolicy = ERROR`): `mapstruct` is an `implementation` dep, `mapstruct-processor` and `lombok-mapstruct-binding` are `annotationProcessor` entries — keep all three together, order matters for Lombok interop.
|
||||
- **Criteria queries use the generated JPA metamodel**: `hibernate-jpamodelgen` runs as an annotation processor and generates `X_` classes next to entities; Specifications (`ru.gorodar.dao.spec`) must reference attributes via `Entity_.field`, never string paths like `root.get("name")`.
|
||||
|
||||
Reference in New Issue
Block a user