Skip to content

Implement RFC-0027: Add configurable route options size limit#4934

Merged
philippthun merged 2 commits into
cloudfoundry:mainfrom
rkoster:rfc-0027-route-options-size-limit
Jun 25, 2026
Merged

Implement RFC-0027: Add configurable route options size limit#4934
philippthun merged 2 commits into
cloudfoundry:mainfrom
rkoster:rfc-0027-route-options-size-limit

Conversation

@rkoster

@rkoster rkoster commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the route options size limit from RFC-0027 amendment. Adds a configurable max_route_options_size setting (default: 1024 bytes) that rejects route create/update requests with HTTP 422 when the serialized route options JSON exceeds the limit.

Changes

  • Validators (app/messages/validators.rb): Added size check in OptionsValidator to validate raw input size against Config.config.get(:max_route_options_size)
  • Route model (app/models/runtime/route.rb): Added validate_route_options_size as a defense-in-depth database layer validation
  • Actions (app/actions/route_create.rb, app/actions/route_update.rb): Handle the new options_size_exceeded error from the model and return appropriate API error responses
  • Config schemas (api_schema.rb, worker_schema.rb): Added max_route_options_size with default of 1024
  • Tests: Full coverage for validators, model, and actions (create + update)

Error format

Options must be smaller than 1024 bytes (actual size is 1200 bytes)

Related

Adds configurable size limit for route options JSON payload.
Requests exceeding the limit are rejected with HTTP 422.

- Add max_route_options_size config key to api_schema and worker_schema
- Add default value of 1024 bytes to cloud_controller.yml
- Add size validation in OptionsValidator (message layer)
- Add validate_route_options_size in Route model (DB layer)
- Handle options_size_exceeded errors in RouteCreate and RouteUpdate actions
- Add unit tests for all new validation paths
@philippthun
philippthun merged commit 1082814 into cloudfoundry:main Jun 25, 2026
11 checks passed
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Jun 25, 2026
Changes in cloud_controller_ng:

- Implement RFC-0027: Add configurable route options size limit
    PR: cloudfoundry/cloud_controller_ng#4934
    Author: Ruben Koster <hi@rkoster.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants