Skip to content

Add config support for overriding endpoint max request size - #50823

Open
hmacr wants to merge 3 commits into
fleetdm:mainfrom
hmacr:40829-configurable-endpoint-max-req-size
Open

Add config support for overriding endpoint max request size#50823
hmacr wants to merge 3 commits into
fleetdm:mainfrom
hmacr:40829-configurable-endpoint-max-req-size

Conversation

@hmacr

@hmacr hmacr commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Related issue: Resolves #40829

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added configurable maximum request body sizes for individual endpoints.
    • Endpoint overrides work alongside global and route-specific limits, using the larger applicable value.
    • Supports configuration through YAML and environment variables.
  • Documentation

    • Documented endpoint request-size overrides.
    • Marked existing osquery request-size settings as deprecated.
  • Bug Fixes

    • Applied endpoint-specific limits consistently across supported request paths.

@hmacr
hmacr requested review from a team and rachaelshaw as code owners August 8, 2026 01:40
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 715670cb-58ed-4cc0-9857-5a8796c70fcc

📥 Commits

Reviewing files that changed from the base of the PR and between bc537a3 and 7b81206.

⛔ Files ignored due to path filters (1)
  • docs/Configuration/fleet-server-configuration.md is excluded by !**/*.md
📒 Files selected for processing (8)
  • changes/40829-endpoint-request-size-overrides
  • cmd/fleet/serve.go
  • server/config/config.go
  • server/config/config_test.go
  • server/platform/endpointer/endpoint_utils.go
  • server/platform/endpointer/endpoint_utils_test.go
  • server/platform/http/request.go
  • server/service/integration_core_test.go
🚧 Files skipped from review as they are similar to previous changes (7)
  • changes/40829-endpoint-request-size-overrides
  • server/platform/http/request.go
  • server/config/config_test.go
  • server/platform/endpointer/endpoint_utils_test.go
  • server/platform/endpointer/endpoint_utils.go
  • server/config/config.go
  • server/service/integration_core_test.go

Walkthrough

Added server.endpoint_request_size_overrides configuration with YAML and environment or CLI JSON parsing and validation. Wired the parsed endpoint limits into HTTP request handling. Endpoint decoding now uses the largest applicable value among the endpoint limit, global default, and configured override. Deprecated osquery limits remain supported. Added unit and integration tests for precedence, validation, route matching, and authentication behavior.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The integration test includes unrelated reformatting and replaces ptr.String with new without a stated requirement. Revert unrelated formatting and ptr.String changes, and retain only changes required to implement or test endpoint request-size overrides.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: configurable endpoint request-size overrides.
Description check ✅ Passed The description links issue #40829 and documents the changes file, automated tests, and manual QA, but omits the applicable configuration-setting checklist.
Linked Issues check ✅ Passed The changes implement YAML and environment configuration, preserve defaults, apply the highest request-size limit, support uploads, and test deprecated settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@server/service/integration_core_test.go`:
- Line 17140: Update both subtests configuring deprecatedLimit near the existing
cfg.Osquery.MaxLogWriteBodySize assignments to also set
cfg.Osquery.MaxDistributedWriteBodySize = deprecatedLimit, ensuring the
distributed-write requests use the same overridden limit and retain the expected
successful response.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 01fd956d-986a-4963-ad64-0a548cac1cce

📥 Commits

Reviewing files that changed from the base of the PR and between bc537a3 and d4dc1be.

⛔ Files ignored due to path filters (1)
  • docs/Configuration/fleet-server-configuration.md is excluded by !**/*.md
📒 Files selected for processing (8)
  • changes/40829-endpoint-request-size-overrides
  • cmd/fleet/serve.go
  • server/config/config.go
  • server/config/config_test.go
  • server/platform/endpointer/endpoint_utils.go
  • server/platform/endpointer/endpoint_utils_test.go
  • server/platform/http/request.go
  • server/service/integration_core_test.go

Comment thread server/service/integration_core_test.go
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.59184% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.43%. Comparing base (bc537a3) to head (7b81206).

Files with missing lines Patch % Lines
server/config/config.go 72.22% 7 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #50823      +/-   ##
==========================================
- Coverage   68.53%   68.43%   -0.10%     
==========================================
  Files        3977     3972       -5     
  Lines      256142   255802     -340     
  Branches    13818    13637     -181     
==========================================
- Hits       175535   175069     -466     
- Misses      64985    65113     +128     
+ Partials    15622    15620       -2     
Flag Coverage Δ
backend 69.63% <79.59%> (+<0.01%) ⬆️
backend-activity 83.69% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@hmacr

hmacr commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@JordanMontgomery This is my second contribution to the project, would love to get feedback on this 😄

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.

Make endpoint max request size more granularly configurable

1 participant