HomeDevCentral

Add RequestBody guard for Rocket

Description

Add RequestBody guard for Rocket

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.

Reviewers: dereckson

Reviewed By: dereckson

Maniphest Tasks: T1826

Differential Revision: https://devcentral.nasqueron.org/D2994

Details

Provenance
derecksonAuthored on Apr 11 2023, 00:38
derecksonPushed on Apr 11 2023, 00:39
Reviewer
dereckson
Differential Revision
D2994: Add RequestBody guard for Rocket
Parents
rLF3e87fb19b6e8: Upgrade dependencies
Branches
Unknown
Tags
Unknown
References
tag: v0.8.0
Tasks
T1826: Create Alkane utility