diff --git a/guard/all.html b/guard/all.html index eba4767f..c8a5c6da 100644 --- a/guard/all.html +++ b/guard/all.html @@ -3,5 +3,5 @@

List of all items[] -

Structs

Enums

Functions

Typedefs

Statics

Constants

+

Structs

Enums

Functions

Typedefs

Statics

Constants

\ No newline at end of file diff --git a/guard/api/v1/fn.services.html b/guard/api/v1/fn.services.html index 051fbae1..4f99b3f2 100644 --- a/guard/api/v1/fn.services.html +++ b/guard/api/v1/fn.services.html @@ -1,5 +1,5 @@ guard::api::v1::services - Rust

Function guard::api::v1::services[][src]

pub fn services(cfg: &mut ServiceConfig)
+ Change settings

Function guard::api::v1::services[][src]

pub fn services(cfg: &mut ServiceConfig)
\ No newline at end of file diff --git a/guard/api/v1/index.html b/guard/api/v1/index.html index ea57655d..6395e602 100644 --- a/guard/api/v1/index.html +++ b/guard/api/v1/index.html @@ -1,7 +1,7 @@ guard::api::v1 - Rust

Module guard::api::v1[][src]

Modules

+ Change settings

Module guard::api::v1[][src]

Modules

auth
mcaptcha
meta

Functions

services
\ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/fn.init_mcaptcha.html b/guard/api/v1/mcaptcha/pow/fn.init_mcaptcha.html deleted file mode 100644 index 9eb0496c..00000000 --- a/guard/api/v1/mcaptcha/pow/fn.init_mcaptcha.html +++ /dev/null @@ -1,5 +0,0 @@ -guard::api::v1::mcaptcha::pow::init_mcaptcha - Rust - -

Function guard::api::v1::mcaptcha::pow::init_mcaptcha[][src]

async fn init_mcaptcha(data: &Data, key: &str) -> Result<(), ServiceError>
- \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/get_config/fn.init_mcaptcha.html b/guard/api/v1/mcaptcha/pow/get_config/fn.init_mcaptcha.html new file mode 100644 index 00000000..1e348f98 --- /dev/null +++ b/guard/api/v1/mcaptcha/pow/get_config/fn.init_mcaptcha.html @@ -0,0 +1,5 @@ +guard::api::v1::mcaptcha::pow::get_config::init_mcaptcha - Rust + +

Function guard::api::v1::mcaptcha::pow::get_config::init_mcaptcha[][src]

async fn init_mcaptcha(data: &Data, key: &str) -> Result<(), ServiceError>
+ \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/get_config/index.html b/guard/api/v1/mcaptcha/pow/get_config/index.html new file mode 100644 index 00000000..1d097a26 --- /dev/null +++ b/guard/api/v1/mcaptcha/pow/get_config/index.html @@ -0,0 +1,7 @@ +guard::api::v1::mcaptcha::pow::get_config - Rust + +

Module guard::api::v1::mcaptcha::pow::get_config[][src]

Structs

+
GetConfigPayload
PoWConfig
get_config

Functions

+
init_mcaptcha
+ \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/get_config/sidebar-items.js b/guard/api/v1/mcaptcha/pow/get_config/sidebar-items.js new file mode 100644 index 00000000..b367ea3e --- /dev/null +++ b/guard/api/v1/mcaptcha/pow/get_config/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["init_mcaptcha",""]],"struct":[["GetConfigPayload",""],["PoWConfig",""],["get_config",""]]}); \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/struct.GetConfigPayload.html b/guard/api/v1/mcaptcha/pow/get_config/struct.GetConfigPayload.html similarity index 83% rename from guard/api/v1/mcaptcha/pow/struct.GetConfigPayload.html rename to guard/api/v1/mcaptcha/pow/get_config/struct.GetConfigPayload.html index 65153da2..8af31277 100644 --- a/guard/api/v1/mcaptcha/pow/struct.GetConfigPayload.html +++ b/guard/api/v1/mcaptcha/pow/get_config/struct.GetConfigPayload.html @@ -1,15 +1,15 @@ -guard::api::v1::mcaptcha::pow::GetConfigPayload - Rust - -

Struct guard::api::v1::mcaptcha::pow::GetConfigPayload[][src]

pub struct GetConfigPayload {
+guard::api::v1::mcaptcha::pow::get_config::GetConfigPayload - Rust
+
+

Struct guard::api::v1::mcaptcha::pow::get_config::GetConfigPayload[][src]

pub struct GetConfigPayload {
     pub key: String,
 }

- Fields

key: String

Trait Implementations

impl Clone for GetConfigPayload[src]

- \ No newline at end of file +

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

+ \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/struct.PoWConfig.html b/guard/api/v1/mcaptcha/pow/get_config/struct.PoWConfig.html similarity index 83% rename from guard/api/v1/mcaptcha/pow/struct.PoWConfig.html rename to guard/api/v1/mcaptcha/pow/get_config/struct.PoWConfig.html index 1d2fa8de..26314993 100644 --- a/guard/api/v1/mcaptcha/pow/struct.PoWConfig.html +++ b/guard/api/v1/mcaptcha/pow/get_config/struct.PoWConfig.html @@ -1,16 +1,16 @@ -guard::api::v1::mcaptcha::pow::PoWConfig - Rust - -

Struct guard::api::v1::mcaptcha::pow::PoWConfig[][src]

pub struct PoWConfig {
+guard::api::v1::mcaptcha::pow::get_config::PoWConfig - Rust
+
+

Struct guard::api::v1::mcaptcha::pow::get_config::PoWConfig[][src]

pub struct PoWConfig {
     pub name: String,
     pub domain: String,
 }

- Fields

name: Stringdomain: String

Trait Implementations

impl Clone for PoWConfig[src]

- \ No newline at end of file +

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

+ \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/struct.get_config.html b/guard/api/v1/mcaptcha/pow/get_config/struct.get_config.html similarity index 86% rename from guard/api/v1/mcaptcha/pow/struct.get_config.html rename to guard/api/v1/mcaptcha/pow/get_config/struct.get_config.html index 8c9baff3..5fe072e2 100644 --- a/guard/api/v1/mcaptcha/pow/struct.get_config.html +++ b/guard/api/v1/mcaptcha/pow/get_config/struct.get_config.html @@ -1,7 +1,7 @@ -guard::api::v1::mcaptcha::pow::get_config - Rust - -

Struct guard::api::v1::mcaptcha::pow::get_config[][src]

pub struct get_config;

Trait Implementations

impl HttpServiceFactory for get_config[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

+ \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/index.html b/guard/api/v1/mcaptcha/pow/index.html index afe29b3d..102b983d 100644 --- a/guard/api/v1/mcaptcha/pow/index.html +++ b/guard/api/v1/mcaptcha/pow/index.html @@ -1,7 +1,7 @@ guard::api::v1::mcaptcha::pow - Rust -

Module guard::api::v1::mcaptcha::pow[][src]

Structs

-
GetConfigPayload
PoWConfig
get_config

Functions

-
init_mcaptcha
+

Module guard::api::v1::mcaptcha::pow[][src]

Re-exports

+
pub use super::duration::GetDurationResp;
pub use super::is_authenticated;
pub use super::levels::I32Levels;

Modules

+
get_config
verify_pow
\ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/sidebar-items.js b/guard/api/v1/mcaptcha/pow/sidebar-items.js index b367ea3e..0110ed47 100644 --- a/guard/api/v1/mcaptcha/pow/sidebar-items.js +++ b/guard/api/v1/mcaptcha/pow/sidebar-items.js @@ -1 +1 @@ -initSidebarItems({"fn":[["init_mcaptcha",""]],"struct":[["GetConfigPayload",""],["PoWConfig",""],["get_config",""]]}); \ No newline at end of file +initSidebarItems({"mod":[["get_config",""],["verify_pow",""]]}); \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/verify_pow/index.html b/guard/api/v1/mcaptcha/pow/verify_pow/index.html new file mode 100644 index 00000000..8b542191 --- /dev/null +++ b/guard/api/v1/mcaptcha/pow/verify_pow/index.html @@ -0,0 +1,6 @@ +guard::api::v1::mcaptcha::pow::verify_pow - Rust + +

Module guard::api::v1::mcaptcha::pow::verify_pow[][src]

Structs

+
PoWConfig
ValidationToken
verify_pow
+ \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/verify_pow/sidebar-items.js b/guard/api/v1/mcaptcha/pow/verify_pow/sidebar-items.js new file mode 100644 index 00000000..84eba331 --- /dev/null +++ b/guard/api/v1/mcaptcha/pow/verify_pow/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["PoWConfig",""],["ValidationToken",""],["verify_pow",""]]}); \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/verify_pow/struct.PoWConfig.html b/guard/api/v1/mcaptcha/pow/verify_pow/struct.PoWConfig.html new file mode 100644 index 00000000..f91e06bb --- /dev/null +++ b/guard/api/v1/mcaptcha/pow/verify_pow/struct.PoWConfig.html @@ -0,0 +1,125 @@ +guard::api::v1::mcaptcha::pow::verify_pow::PoWConfig - Rust + +

Struct guard::api::v1::mcaptcha::pow::verify_pow::PoWConfig[][src]

pub struct PoWConfig {
+    pub name: String,
+    pub domain: String,
+}

+ Fields

name: Stringdomain: String

Trait Implementations

impl Clone for PoWConfig[src]

impl Debug for PoWConfig[src]

impl<'de> Deserialize<'de> for PoWConfig[src]

impl Serialize for PoWConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

+

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

+ \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/verify_pow/struct.ValidationToken.html b/guard/api/v1/mcaptcha/pow/verify_pow/struct.ValidationToken.html new file mode 100644 index 00000000..2382acee --- /dev/null +++ b/guard/api/v1/mcaptcha/pow/verify_pow/struct.ValidationToken.html @@ -0,0 +1,124 @@ +guard::api::v1::mcaptcha::pow::verify_pow::ValidationToken - Rust + +

Struct guard::api::v1::mcaptcha::pow::verify_pow::ValidationToken[][src]

pub struct ValidationToken {
+    pub token: String,
+}

+ Fields

token: String

Trait Implementations

impl Clone for ValidationToken[src]

impl Debug for ValidationToken[src]

impl<'de> Deserialize<'de> for ValidationToken[src]

impl Serialize for ValidationToken[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

+

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

+ \ No newline at end of file diff --git a/guard/api/v1/mcaptcha/pow/verify_pow/struct.verify_pow.html b/guard/api/v1/mcaptcha/pow/verify_pow/struct.verify_pow.html new file mode 100644 index 00000000..1e40bf88 --- /dev/null +++ b/guard/api/v1/mcaptcha/pow/verify_pow/struct.verify_pow.html @@ -0,0 +1,112 @@ +guard::api::v1::mcaptcha::pow::verify_pow::verify_pow - Rust + +

Struct guard::api::v1::mcaptcha::pow::verify_pow::verify_pow[][src]

pub struct verify_pow;

Trait Implementations

impl HttpServiceFactory for verify_pow[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

+

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

+ \ No newline at end of file diff --git a/guard/errors/enum.ServiceError.html b/guard/errors/enum.ServiceError.html index 72253f1b..885bca5d 100644 --- a/guard/errors/enum.ServiceError.html +++ b/guard/errors/enum.ServiceError.html @@ -1,7 +1,7 @@ guard::errors::ServiceError - Rust -

Enum guard::errors::ServiceError[][src]

pub enum ServiceError {
+

Enum guard::errors::ServiceError[][src]

pub enum ServiceError {
     InternalServerError,
     NotAnEmail,
     NotAUrl,
@@ -15,12 +15,9 @@
     PasswordTooLong,
     UsernameTaken,
     TokenNameTaken,
-    HostnameTaken,
     TokenNotFound,
     CaptchaError(CaptchaError),
     ClientServerUnreachable,
-    ChallengeCourruption,
-    ChallengeVerificationFailure,
 }

Variants

InternalServerError
NotAnEmail
NotAUrl
WrongPassword
UsernameNotFound
AuthorizationRequired
ProfainityError

when the value passed contains profainity

@@ -31,9 +28,8 @@ in UsernameCaseMapped profile

PasswordTooShort
PasswordTooLong
UsernameTaken

when the a username is already taken

TokenNameTaken

when the a token name is already taken

-
HostnameTaken

when the a host name is already taken

TokenNotFound

token not found

-
CaptchaError(CaptchaError)
ClientServerUnreachable
ChallengeCourruption
ChallengeVerificationFailure

Trait Implementations

impl Clone for ServiceError[src]

CaptchaError(CaptchaError)
ClientServerUnreachable

Trait Implementations

impl Clone for ServiceError[src]

impl Debug for ServiceError[src]

impl Display for ServiceError[src]

impl From<CaptchaError> for ServiceError[src]

impl From<CredsError> for ServiceError[src]

impl From<Error> for ServiceError[src]

impl From<ParseError> for ServiceError[src]

impl From<SendRequestError> for ServiceError[src]

impl From<ValidationErrors> for ServiceError[src]

impl From<CaptchaError> for ServiceError[src]

impl From<CredsError> for ServiceError[src]

impl From<Error> for ServiceError[src]

impl From<ParseError> for ServiceError[src]

impl From<SendRequestError> for ServiceError[src]

impl From<ValidationErrors> for ServiceError[src]

impl PartialEq<ServiceError> for ServiceError[src]

impl ResponseError for ServiceError[src]

impl ResponseError for ServiceError[src]

impl StructuralPartialEq for ServiceError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

Function guard::errors::dup_error[][src]

pub fn dup_error(e: Error, dup_error: ServiceError) -> ServiceError
\ No newline at end of file diff --git a/guard/errors/index.html b/guard/errors/index.html index ff2fa492..6df6af8e 100644 --- a/guard/errors/index.html +++ b/guard/errors/index.html @@ -1,7 +1,7 @@ guard::errors - Rust

Module guard::errors[][src]

Structs

+ Change settings

Module guard::errors[][src]

Structs

ErrorToResponse

Enums

ServiceError

Functions

dup_error

Type Definitions

diff --git a/guard/errors/struct.ErrorToResponse.html b/guard/errors/struct.ErrorToResponse.html index 46360804..f41b95a5 100644 --- a/guard/errors/struct.ErrorToResponse.html +++ b/guard/errors/struct.ErrorToResponse.html @@ -1,11 +1,11 @@ guard::errors::ErrorToResponse - Rust

Struct guard::errors::ErrorToResponse[][src]

pub struct ErrorToResponse {
+                Change settings

Struct guard::errors::ErrorToResponse[][src]

pub struct ErrorToResponse {
     pub error: String,
 }

- Fields

error: String

Trait Implementations

impl<'de> Deserialize<'de> for ErrorToResponse[src]

impl Serialize for ErrorToResponse[src]

 /*
 * Copyright (C) 2021  Aravinth Manivannan <realaravinth@batsense.net>
@@ -113,7 +114,8 @@
     cfg.service(mcaptcha::duration::get_duration);
 
     // pow
-    cfg.service(mcaptcha::pow::get_config);
+    cfg.service(mcaptcha::pow::get_config::get_config);
+    cfg.service(mcaptcha::pow::verify_pow::verify_pow);
 }
 
 #[cfg(test)]
diff --git a/src/guard/errors.rs.html b/src/guard/errors.rs.html
index ab07e848..007e9139 100644
--- a/src/guard/errors.rs.html
+++ b/src/guard/errors.rs.html
@@ -220,16 +220,6 @@
 217
 218
 219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
 
 /*
 * Copyright (C) 2021  Aravinth Manivannan <realaravinth@batsense.net>
@@ -309,9 +299,6 @@
     /// when the a token name is already taken
     #[display(fmt = "token name not available")]
     TokenNameTaken,
-    /// when the a host name is already taken
-    #[display(fmt = "host name not available")]
-    HostnameTaken,
     /// token not found
     #[display(fmt = "Token not found. Is token registered?")]
     TokenNotFound,
@@ -321,10 +308,6 @@
 
     #[display(fmt = "Couldn't reach your server. If Problem presists, contact support")]
     ClientServerUnreachable,
-    #[display(fmt = "Couldn't parse challenge from your server. Check for courruption")]
-    ChallengeCourruption,
-    #[display(fmt = "Verification failure, vaules didn't match")]
-    ChallengeVerificationFailure,
 }
 
 #[derive(Serialize, Deserialize)]
@@ -365,10 +348,7 @@
 
             ServiceError::TokenNameTaken => StatusCode::BAD_REQUEST,
             ServiceError::TokenNotFound => StatusCode::NOT_FOUND,
-            ServiceError::HostnameTaken => StatusCode::BAD_REQUEST,
             ServiceError::ClientServerUnreachable => StatusCode::SERVICE_UNAVAILABLE,
-            ServiceError::ChallengeCourruption => StatusCode::BAD_REQUEST,
-            ServiceError::ChallengeVerificationFailure => StatusCode::UNAUTHORIZED,
             ServiceError::CaptchaError(e) => match e {
                 CaptchaError::MailboxError => StatusCode::INTERNAL_SERVER_ERROR,
                 _ => StatusCode::BAD_REQUEST,