mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
Fix typos
This commit is contained in:
@@ -51,7 +51,7 @@ pub async fn uname_email_exists_works(data: ArcData) {
|
||||
let cookies = get_cookie!(signin_resp);
|
||||
let app = get_app!(data).await;
|
||||
|
||||
// chech if get user secret works
|
||||
// check if get user secret works
|
||||
let resp = test::call_service(
|
||||
&app,
|
||||
test::TestRequest::get()
|
||||
@@ -62,7 +62,7 @@ pub async fn uname_email_exists_works(data: ArcData) {
|
||||
.await;
|
||||
assert_eq!(resp.status(), StatusCode::OK);
|
||||
|
||||
// chech if get user secret works
|
||||
// check if get user secret works
|
||||
let resp = test::call_service(
|
||||
&app,
|
||||
test::TestRequest::post()
|
||||
@@ -178,7 +178,7 @@ pub async fn email_udpate_password_validation_del_userworks(data: ArcData) {
|
||||
)
|
||||
.await;
|
||||
|
||||
// wrong password while deleteing account
|
||||
// wrong password while deleting account
|
||||
let mut payload = Password {
|
||||
password: NAME.into(),
|
||||
};
|
||||
|
||||
@@ -86,7 +86,7 @@ pub mod runners {
|
||||
pub password: String,
|
||||
}
|
||||
|
||||
/// returns Ok(()) when everything checks out and the user is authenticated. Erros otherwise
|
||||
/// returns Ok(()) when everything checks out and the user is authenticated. Errors otherwise
|
||||
pub async fn login_runner(payload: Login, data: &AppData) -> ServiceResult<String> {
|
||||
use argon2_creds::Config;
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ pub struct TrafficPatternRequest {
|
||||
pub avg_traffic: u32,
|
||||
/// the peak traffic that the user's website can handle
|
||||
pub peak_sustainable_traffic: u32,
|
||||
/// trafic that bought the user's website down; optional
|
||||
/// traffic that bought the user's website down; optional
|
||||
pub broke_my_site_traffic: Option<u32>,
|
||||
/// Captcha description
|
||||
pub description: String,
|
||||
|
||||
@@ -191,7 +191,7 @@ mod tests {
|
||||
let updated_token: MCaptchaDetails =
|
||||
test::read_body_json(update_token_resp).await;
|
||||
|
||||
// get levels with udpated key
|
||||
// get levels with updated key
|
||||
let get_token_resp = test::call_service(
|
||||
&app,
|
||||
post_request!(&updated_token, ROUTES.captcha.get)
|
||||
@@ -199,7 +199,7 @@ mod tests {
|
||||
.to_request(),
|
||||
)
|
||||
.await;
|
||||
// if updated key doesn't exist in databse, a non 200 result will bereturned
|
||||
// if updated key doesn't exist in database, a non 200 result will bereturned
|
||||
assert_eq!(get_token_resp.status(), StatusCode::OK);
|
||||
|
||||
// get stats
|
||||
@@ -211,7 +211,7 @@ mod tests {
|
||||
.to_request(),
|
||||
)
|
||||
.await;
|
||||
// if updated key doesn't exist in databse, a non 200 result will bereturned
|
||||
// if updated key doesn't exist in database, a non 200 result will bereturned
|
||||
assert_eq!(get_statis_resp.status(), StatusCode::OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ pub mod routes {
|
||||
}
|
||||
}
|
||||
|
||||
/// emmits build details of the bninary
|
||||
/// emits build details of the bninary
|
||||
#[my_codegen::get(path = "crate::V1_API_ROUTES.meta.build_details")]
|
||||
async fn build_details() -> impl Responder {
|
||||
let build = BuildDetails {
|
||||
|
||||
@@ -42,7 +42,7 @@ pub async fn add_notification(
|
||||
id: Identity,
|
||||
) -> ServiceResult<impl Responder> {
|
||||
let sender = id.identity().unwrap();
|
||||
// TODO handle error where payload.to doesnt exist
|
||||
// TODO handle error where payload.to doesn't exist
|
||||
|
||||
let p = AddNotification {
|
||||
from: &sender,
|
||||
@@ -98,7 +98,7 @@ pub mod tests {
|
||||
let msg = AddNotificationRequest {
|
||||
to: NAME2.into(),
|
||||
heading: "Test notification".into(),
|
||||
message: "Testeing notifications with a dummy message".into(),
|
||||
message: "Testing notifications with a dummy message".into(),
|
||||
};
|
||||
|
||||
let send_notification_resp = test::call_service(
|
||||
|
||||
@@ -68,7 +68,7 @@ pub async fn get_notification(
|
||||
id: Identity,
|
||||
) -> ServiceResult<impl Responder> {
|
||||
let receiver = id.identity().unwrap();
|
||||
// TODO handle error where payload.to doesnt exist
|
||||
// TODO handle error where payload.to doesn't exist
|
||||
|
||||
let notifications = data.db.get_all_unread_notifications(&receiver).await?;
|
||||
let notifications = NotificationResp::from_notifications(notifications);
|
||||
|
||||
@@ -38,7 +38,7 @@ pub async fn mark_read(
|
||||
id: Identity,
|
||||
) -> ServiceResult<impl Responder> {
|
||||
let receiver = id.identity().unwrap();
|
||||
// TODO handle error where payload.to doesnt exist
|
||||
// TODO handle error where payload.to doesn't exist
|
||||
|
||||
// TODO get payload from path /api/v1/notifications/{id}/read"
|
||||
data.db
|
||||
|
||||
@@ -135,7 +135,7 @@ pub mod tests {
|
||||
// .await;
|
||||
// assert_eq!(pow_config_resp.status(), StatusCode::OK);
|
||||
// I'm not checking for errors because changing work.result triggered
|
||||
// InssuficientDifficulty, which is possible becuase libmcaptcha calculates
|
||||
// InssuficientDifficulty, which is possible because libmcaptcha calculates
|
||||
// difficulty with the submitted result. Besides, this endpoint is merely
|
||||
// propagating errors from libmcaptcha and libmcaptcha has tests covering the
|
||||
// pow aspects ¯\_(ツ)_/¯
|
||||
|
||||
@@ -47,7 +47,7 @@ impl From<VerifyCaptchaResultPayload> for VerifyCaptchaResult {
|
||||
|
||||
// API keys are mcaptcha actor names
|
||||
|
||||
/// route hander that validates a PoW solution token
|
||||
/// route handler that validates a PoW solution token
|
||||
#[my_codegen::post(path = "V1_API_ROUTES.pow.validate_captcha_token()")]
|
||||
pub async fn validate_captcha_token(
|
||||
payload: web::Json<VerifyCaptchaResultPayload>,
|
||||
|
||||
@@ -69,7 +69,7 @@ macro_rules! enum_system_wrapper {
|
||||
|
||||
/// Represents mCaptcha cache and master system.
|
||||
/// When Redis is configured, [SystemGroup::Redis] is used and
|
||||
/// in its absense, [SystemGroup::Embedded] is used
|
||||
/// in its absence, [SystemGroup::Embedded] is used
|
||||
pub enum SystemGroup {
|
||||
Embedded(System<HashCache, EmbeddedMaster>),
|
||||
Redis(System<RedisCache, RedisMaster>),
|
||||
|
||||
@@ -71,7 +71,7 @@ const PAGE: &str = "Notifications";
|
||||
)]
|
||||
pub async fn notifications(data: AppData, id: Identity) -> PageResult<impl Responder> {
|
||||
let receiver = id.identity().unwrap();
|
||||
// TODO handle error where payload.to doesnt exist
|
||||
// TODO handle error where payload.to doesn't exist
|
||||
|
||||
// let mut notifications = runner::get_notification(&data, &receiver).await?;
|
||||
let mut notifications = data.db.get_all_unread_notifications(&receiver).await?;
|
||||
|
||||
@@ -78,7 +78,7 @@ impl Server {
|
||||
//impl DatabaseBuilder {
|
||||
// #[cfg(not(tarpaulin_include))]
|
||||
// fn extract_database_url(url: &Url) -> Self {
|
||||
// debug!("Databse name: {}", url.path());
|
||||
// debug!("Database name: {}", url.path());
|
||||
// let mut path = url.path().split('/');
|
||||
// path.next();
|
||||
// let name = path.next().expect("no database name").to_string();
|
||||
@@ -223,7 +223,7 @@ fn set_database_url(s: &mut Config) {
|
||||
.expect("Couldn't access database name")
|
||||
),
|
||||
)
|
||||
.expect("Couldn't set databse url");
|
||||
.expect("Couldn't set database url");
|
||||
}
|
||||
|
||||
//#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user