diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2019-04-26 14:27:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-26 14:27:03 +0000 |
commit | eddeefc3ae3a655cf57e3e259464cee464b6f96e (patch) | |
tree | ebb46cbcdde44f87e0d02791bb8e3b20baf8ec37 /src/errors.rs | |
parent | Use rstest test fixtures to cut down on code duplication in integration tests (diff) | |
parent | Use 'if let' (diff) | |
download | miniserve-eddeefc3ae3a655cf57e3e259464cee464b6f96e.tar.gz miniserve-eddeefc3ae3a655cf57e3e259464cee464b6f96e.zip |
Merge pull request #76 from KSXGitHub/pullrequest.hashed-password
Add support for hashed password (sha256 and sha512)
Diffstat (limited to 'src/errors.rs')
-rw-r--r-- | src/errors.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/errors.rs b/src/errors.rs index bd6dc66..833e9c4 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -27,9 +27,19 @@ pub enum ContextualErrorKind { InvalidPathError(String), /// This error might occur if the HTTP credential string does not respect the expected format - #[fail(display = "Invalid format for credentials string. Expected is username:format")] + #[fail( + display = "Invalid format for credentials string. Expected username:password, username:sha256:hash or username:sha512:hash" + )] InvalidAuthFormat, + /// This error might occure if the hash method is neither sha256 nor sha512 + #[fail(display = "{} is not a valid hashing method. Expected sha256 or sha512", _0)] + InvalidHashMethod(String), + + /// This error might occur if the HTTP auth hash password is not a valid hex code + #[fail(display = "Invalid format for password hash. Expected hex code")] + InvalidPasswordHash, + /// This error might occur if the HTTP auth password exceeds 255 characters #[fail(display = "HTTP password length exceeds 255 characters")] PasswordTooLongError, |