spring-projects / spring-projects/spring-boot
Independent management max-in-memory-size property
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
Enhancement
Related: https://github.com/spring-projects/spring-boot/issues/9560
Implemented out of Spring Boot: https://github.com/ilozano2/sc-management-codec-max-size
Motivation
By default, the maximum size of any request payload a Spring boot application can read is 262144 bytes.
This value can be changed using the Spring property spring.codec.max-in-memory-size.
However, increasing the value of this property could expose the production controllers to some risks like DDOS attacks.
Spring Actuator endpoints or the port they listen are not usually exposed to the outside, so it could be safe to increase this value only for the Management Server in a controlled network.
Solution
As implemented in this project I've created, the developer can configure different max-in-memory-size for the management server (aka Spring Actuator endpoints).
management:
codec:
max-in-memory-size: 1MB
It is also possible to configure different sizes for management and server.
# Management Server Codec configurations
management:
codec:
max-in-memory-size: 1MB
# (original) Server Codec configurations
spring:
codec:
max-in-memory-size: 1KB
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the related Spring Boot issue #9560 and the linked sc-management-codec-max-size implementation. Compare the proposed management.codec.max-in-memory-size and spring.codec.max-in-memory-size settings, then verify that management and application server payload limits can be configured independently without weakening the default server limit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100