Page MenuHomeDevCentral

Add RequestBody guard for Rocket
ClosedPublic

Authored by dereckson on Apr 11 2023, 00:17.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 28, 17:21
Unknown Object (File)
Fri, Sep 13, 03:11
Unknown Object (File)
Fri, Sep 13, 03:11
Unknown Object (File)
Wed, Sep 11, 04:28
Unknown Object (File)
Sun, Sep 8, 15:14
Unknown Object (File)
Fri, Sep 6, 18:18
Unknown Object (File)
Fri, Sep 6, 10:21
Unknown Object (File)
Tue, Sep 3, 19:19
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 Passed
Unit
No Test Coverage
Branch
guards
Build Status
Buildable 4733
Build 5014: arc lint + arc unit

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.