From 46107eaa9512d176fb58c1f376d63d4f39dac6a9 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Sat, 6 Aug 2022 06:17:49 +0000 Subject: [PATCH] todos --- web3_proxy/src/bin/web3_proxy_cli/create_user.rs | 2 +- web3_proxy/src/frontend/mod.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web3_proxy/src/bin/web3_proxy_cli/create_user.rs b/web3_proxy/src/bin/web3_proxy_cli/create_user.rs index 848cc687..bb8b60cd 100644 --- a/web3_proxy/src/bin/web3_proxy_cli/create_user.rs +++ b/web3_proxy/src/bin/web3_proxy_cli/create_user.rs @@ -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)] diff --git a/web3_proxy/src/frontend/mod.rs b/web3_proxy/src/frontend/mod.rs index 6847e85f..495514ef 100644 --- a/web3_proxy/src/frontend/mod.rs +++ b/web3_proxy/src/frontend/mod.rs @@ -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