This repository has been archived by the owner on Sep 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Increase allowed request body payload size
- Loading branch information
Showing
11 changed files
with
169 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use rand::{rngs::StdRng, Rng, SeedableRng}; | ||
use std::sync::Arc; | ||
use tokio::sync::Mutex; | ||
|
||
/// A helper to support consistent use of seeded randomness in tests. | ||
/// Its primary purpose is to retain and report the seed in use for a | ||
/// random number generator that can be shared across threads in tests. | ||
/// This is probably not suitable for use outside of tests. | ||
pub struct TestEntropy { | ||
seed: [u8; 32], | ||
rng: Arc<Mutex<StdRng>>, | ||
} | ||
|
||
impl Default for TestEntropy { | ||
fn default() -> Self { | ||
Self::from_seed(rand::thread_rng().gen::<[u8; 32]>()) | ||
} | ||
} | ||
|
||
impl TestEntropy { | ||
pub fn from_seed(seed: [u8; 32]) -> Self { | ||
tracing::info!(?seed, "Initializing test entropy..."); | ||
|
||
let rng = Arc::new(Mutex::new(SeedableRng::from_seed(seed.clone()))); | ||
Self { seed, rng } | ||
} | ||
|
||
pub fn to_rng(&self) -> Arc<Mutex<StdRng>> { | ||
self.rng.clone() | ||
} | ||
|
||
pub fn seed(&self) -> &[u8] { | ||
&self.seed | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters