From a3f060350c2ff8a1450c81d57edb526a71072701 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sun, 11 Apr 2021 22:57:56 +0530 Subject: [PATCH] moved pow to independent module --- src/api/v1/mcaptcha/mod.rs | 1 - src/api/v1/mod.rs | 7 ++++--- src/api/v1/{mcaptcha => }/pow/get_config.rs | 0 src/api/v1/{mcaptcha => }/pow/mod.rs | 6 +++--- src/api/v1/{mcaptcha => }/pow/verify_pow.rs | 2 +- src/api/v1/{mcaptcha => }/pow/verify_token.rs | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) rename src/api/v1/{mcaptcha => }/pow/get_config.rs (100%) rename src/api/v1/{mcaptcha => }/pow/mod.rs (85%) rename src/api/v1/{mcaptcha => }/pow/verify_pow.rs (98%) rename src/api/v1/{mcaptcha => }/pow/verify_token.rs (97%) diff --git a/src/api/v1/mcaptcha/mod.rs b/src/api/v1/mcaptcha/mod.rs index 192ac035..a6c05a0c 100644 --- a/src/api/v1/mcaptcha/mod.rs +++ b/src/api/v1/mcaptcha/mod.rs @@ -18,7 +18,6 @@ pub mod duration; pub mod levels; pub mod mcaptcha; -pub mod pow; pub use super::auth::is_authenticated; diff --git a/src/api/v1/mod.rs b/src/api/v1/mod.rs index 402f0194..c35b6bf1 100644 --- a/src/api/v1/mod.rs +++ b/src/api/v1/mod.rs @@ -20,6 +20,7 @@ use actix_web::web::ServiceConfig; pub mod auth; pub mod mcaptcha; pub mod meta; +pub mod pow; pub fn services(cfg: &mut ServiceConfig) { // meta @@ -53,9 +54,9 @@ pub fn services(cfg: &mut ServiceConfig) { cfg.service(mcaptcha::duration::get_duration); // pow - cfg.service(mcaptcha::pow::get_config::get_config); - cfg.service(mcaptcha::pow::verify_pow::verify_pow); - cfg.service(mcaptcha::pow::verify_token::validate_captcha_token); + cfg.service(pow::get_config::get_config); + cfg.service(pow::verify_pow::verify_pow); + cfg.service(pow::verify_token::validate_captcha_token); } #[cfg(test)] diff --git a/src/api/v1/mcaptcha/pow/get_config.rs b/src/api/v1/pow/get_config.rs similarity index 100% rename from src/api/v1/mcaptcha/pow/get_config.rs rename to src/api/v1/pow/get_config.rs diff --git a/src/api/v1/mcaptcha/pow/mod.rs b/src/api/v1/pow/mod.rs similarity index 85% rename from src/api/v1/mcaptcha/pow/mod.rs rename to src/api/v1/pow/mod.rs index 3e240d4c..20cf2294 100644 --- a/src/api/v1/mcaptcha/pow/mod.rs +++ b/src/api/v1/pow/mod.rs @@ -19,6 +19,6 @@ pub mod get_config; pub mod verify_pow; pub mod verify_token; -pub use super::duration::GetDurationResp; -pub use super::is_authenticated; -pub use super::levels::I32Levels; +pub use super::mcaptcha::duration::GetDurationResp; +pub use super::mcaptcha::is_authenticated; +pub use super::mcaptcha::levels::I32Levels; diff --git a/src/api/v1/mcaptcha/pow/verify_pow.rs b/src/api/v1/pow/verify_pow.rs similarity index 98% rename from src/api/v1/mcaptcha/pow/verify_pow.rs rename to src/api/v1/pow/verify_pow.rs index 970d67a7..fba551bf 100644 --- a/src/api/v1/mcaptcha/pow/verify_pow.rs +++ b/src/api/v1/pow/verify_pow.rs @@ -46,7 +46,7 @@ mod tests { use m_captcha::pow::PoWConfig; use super::*; - use crate::api::v1::mcaptcha::pow::get_config::GetConfigPayload; + use crate::api::v1::pow::get_config::GetConfigPayload; use crate::api::v1::services as v1_services; use crate::tests::*; use crate::*; diff --git a/src/api/v1/mcaptcha/pow/verify_token.rs b/src/api/v1/pow/verify_token.rs similarity index 97% rename from src/api/v1/mcaptcha/pow/verify_token.rs rename to src/api/v1/pow/verify_token.rs index be81ff02..4ed27916 100644 --- a/src/api/v1/mcaptcha/pow/verify_token.rs +++ b/src/api/v1/pow/verify_token.rs @@ -51,8 +51,8 @@ mod tests { use m_captcha::pow::Work; use super::*; - use crate::api::v1::mcaptcha::pow::get_config::GetConfigPayload; - use crate::api::v1::mcaptcha::pow::verify_pow::ValidationToken; + use crate::api::v1::pow::get_config::GetConfigPayload; + use crate::api::v1::pow::verify_pow::ValidationToken; use crate::api::v1::services as v1_services; use crate::tests::*; use crate::*;