How youabledev/spring-safe-http works
Project Type Analysis
This is a Spring Boot library project focused on providing HTTP body encryption/decryption functionality. It's designed to be integrated into other Spring Boot applications as a dependency.
Main Components
A. Core Components:
• Request Handling Layer
• Response Handling Layer
• Encryption/Decryption Service Layer
• Configuration Layer
B. Key Classes and Their Relationships:
• Annotation Components (@DecryptRequest, @EncryptResponse)
• Advice Components (DecryptRequestBodyAdvice)
• AOP Components (EncryptResponseAspect)
• Cipher Implementation (AESCipher, RSACipher)
• Auto-configuration (AutoConfig)
[Client Application] <---> [Spring Safe HTTP Library]
• v
[Request Processing Flow] [Response Processing Flow]
Integration Layer
• How the library integrates with the host application
• Annotation-based integration points
Processing Layer
• Request Decryption Flow
• Response Encryption Flow
Core Services Layer
• Encryption/Decryption Services
• Cipher Implementations
Specific Elements
• Blue: Spring Framework components
• Green: Encryption/Decryption services
• Yellow: Annotation processors
• Gray: Configuration components
c. Components:
• [Client Request] -> [@DecryptRequest] -> [DecryptRequestBodyAdvice] -> [HttpCipher] -> [Controller]
• [Controller] -> [@EncryptResponse] -> [EncryptResponseAspect] -> [HttpCipher] -> [Encrypted Response]
Important Details to Highlight
• Auto-configuration capability
• AES and RSA cipher implementations
• Spring AOP integration
• Request/Response interceptor pattern
Implementation Notes
• Use standardized UML notation where appropriate
• Notes for important configuration requirements
• Relationship with Spring Boot's auto-configuration mechanism