2.8 KiB
2.8 KiB
KriCommon Platform Capabilities
Dependency and Configuration Boundary
- Include the matching Spring starter for any optional Web, Security, JPA, Redis, AOP, or Swagger integration the service enables; KriCommon intentionally declares many integrations as compile-only.
- KriCommon configuration uses only
kri.*. Established groups includekri.auth.jwt,kri.auth.apikey,kri.crypto,kri.security,kri.swagger,kri.web,kri.web.mdc,kri.http.bypass,kri.redis,kri.scheduling, andkri.error.expose. - Read the version-matched README and configuration-property classes before setting a property; do not infer a property name or default from an older service.
- Supply production JWT secrets, API keys, credentials, allowlists, and service URLs through the consumer's approved secret and configuration system. Never rely on library example or default secrets in production.
- Preserve consumer override points. KriCommon's default security chain is created only when the consumer does not provide one, and overridable beans should remain explicit.
- Adding a path to API-key allowed paths scopes where API-key authentication is attempted; it does not make the path public or grant authorization.
Optional Capabilities
- JWT and API-key authentication integrate with Spring Security. API-key JPA preload requires Spring Data JPA; a consumer-provided claims provider can be used without JPA.
- Common Web may register error handling, tracing/MDC, request-user resolution, enum conversion, and CORS behavior. Check for overlap before defining consumer-local equivalents.
- Swagger support requires springdoc and defines the shared Bearer/API-key schemes and grouped paths.
- Redis and scheduling are opt-in through their
kri.*.enabledsettings and matching runtime dependencies. - HTTP bypass targets are server-configured. Never accept an arbitrary full target URL from a frontend; retain allowed-path checks and do not forward hop-by-hop headers.
- The external API client returns response bodies as documented, while bypass responses preserve raw bytes and target
Content-Type. ExternalApiClientmultipart requests generate their own boundary and ignore a caller-suppliedContent-Type. Multipart headers andformFieldvalues use UTF-8, while file bodies preserve the supplied bytes.- Multipart filenames, including non-ASCII names, are sent unchanged in the quoted
filenameparameter as raw UTF-8. No ASCII fallback orfilename*parameter is added; CR/LF rejection and quote/backslash escaping still apply. JsonUtilrequires the consumer's explicitObjectMapper; shared date/time helpers define KST asAsia/Seouland also expose UTC semantics.