This commit is contained in:
Bryan Stitt 2022-08-06 06:17:49 +00:00
parent 2524168a0e
commit 46107eaa95
2 changed files with 3 additions and 1 deletions

View File

@ -7,7 +7,7 @@ use sea_orm::ActiveModelTrait;
use web3_proxy::users::new_api_key;
#[derive(FromArgs, PartialEq, Debug)]
/// First subcommand.
/// Create a new user and api key
#[argh(subcommand, name = "create_user")]
pub struct CreateUserSubCommand {
#[argh(option)]

View File

@ -41,6 +41,7 @@ pub async fn rate_limit_by_ip(app: &Web3ProxyApp, ip: &IpAddr) -> Result<(), imp
return Err(handle_anyhow_error(
Some(StatusCode::TOO_MANY_REQUESTS),
None,
// TODO: include the ip here
anyhow::anyhow!("too many requests from this ip"),
)
.await
@ -102,6 +103,7 @@ pub async fn rate_limit_by_key(
return Err(handle_anyhow_error(
Some(StatusCode::TOO_MANY_REQUESTS),
None,
// TODO: include the user id (NOT THE API KEY!) here
anyhow::anyhow!("too many requests from this key"),
)
.await