Page MenuHomeDevCentral

Add RequestBody guard for Rocket
ClosedPublic

Authored by dereckson on Apr 11 2023, 00:17.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 12, 11:25
Unknown Object (File)
Mon, Dec 9, 01:47
Unknown Object (File)
Sun, Dec 8, 13:53
Unknown Object (File)
Wed, Dec 4, 00:05
Unknown Object (File)
Tue, Dec 3, 10:48
Unknown Object (File)
Wed, Nov 27, 23:32
Unknown Object (File)
Sat, Nov 23, 12:59
Unknown Object (File)
Nov 21 2024, 12:54
Subscribers
None
Tokens
"Y So Serious" token, awarded by dereckson.

Details

Summary

This commit adds a new data guard which allows reading the request body
as a string. The guard uses Rocket's simplified data guard and limits
the number of characters read to a million to prevent DoS attacks.

A use case for this guard is to pass arbitrary data to another part
of the application. Alkane API can uses this to expose the request
body to the build script using environment variable, where the 1M
limit is largely enough.

Ref T1826

Test Plan

Unit tests provided for RequestBody.

Feature tested in Alkane HTTP API with D2995.

Diff Detail

Repository
rLF Limiting Factor
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson created this revision.
dereckson edited the test plan for this revision. (Show Details)

Ok, but to chmod 644

This revision is now accepted and ready to land.Apr 11 2023, 00:38
This revision was automatically updated to reflect the committed changes.