papplic-common is the shared core library for the Papplic microservices platform. It provides centralized security utilities, JWT token verification, global REST exception mapping, and OpenFeign inter-service error decoding.
-
Global Exception Mappings (
@RestControllerAdvice):-
ResultNotFoundException$\rightarrow$ HTTP 404 (Not Found) -
ResultConflictException$\rightarrow$ HTTP 409 (Conflict) -
ResultForbiddenException$\rightarrow$ HTTP 403 (Forbidden) -
IllegalArgumentException$\rightarrow$ HTTP 400 (Bad Request) - Generic
Exception$\rightarrow$ HTTP 500 (Internal Server Error)
-
-
Feign Inter-Service Resilience (
CustomFeignErrorDecoder):- Decodes downstream non-2xx HTTP status codes into domain exceptions, preventing raw
FeignExceptioncascades.
- Decodes downstream non-2xx HTTP status codes into domain exceptions, preventing raw
-
Pluggable Festival Authentication & SSO Infrastructure (
de.papplic.common.security.auth):-
FestivalAuthProvider: Interface for multi-service festival role providers (getOrder(),authenticate()). -
AuthResult: DTO carrying authentication state, claims, roles, and default redirect URLs. -
JwtCookieAuthenticationFilter: Reusable Spring Security filter resolving JWT from subdomain-widepapplic_tokencookies or Bearer headers. -
AuthCookieUtils: Helper for secure cookie creation, deletion, and subdomain resolution (.papplic.de/.localhost).
-
-
Transactional Outbox Infrastructure (
de.papplic.common.outbox):-
AbstractOutboxEvent,OutboxRepository,OutboxDispatcher, andOutboxPublisherfor resilient domain event dispatching.
-
-
Shared Security Infrastructure:
- JWT claim validation, AES encryption helpers, and security exception base.
# Build and install to local Maven repository
mvn clean installAdd the following dependency to any Papplic microservice pom.xml:
<dependency>
<groupId>de.papplic.common</groupId>
<artifactId>papplic-common</artifactId>
<version>1.0</version>
</dependency>- Java: 21
- Spring Boot: 4.1.0+