Your ROOT_URL in app.ini is https://git.ondrovo.com/ but you are visiting http://159.69.29.240:49153/JamesMc86/digest_auth_rs/commit/c10d96bf834b80f15a70c558e51a289395a15fbd?style=split&whitespace=ignore-change
You should set ROOT_URL correctly, otherwise the web may not work correctly.
3 changed files with
9 additions and
5 deletions
Cargo.toml
src/digest.rs
src/lib.rs
@ -1,6 +1,6 @@
[ package ]
[ package ]
name = "digest_auth"
name = "digest_auth"
version = "0.1.3 "
version = "0.2.0 "
authors = [ "Ondřej Hruška <ondra@ondrovo.com>" ]
authors = [ "Ondřej Hruška <ondra@ondrovo.com>" ]
edition = "2018"
edition = "2018"
description = "Implementation of the Digest Auth algorithm as defined in IETF RFC 2069, 2617, and 7616, intended for HTTP clients"
description = "Implementation of the Digest Auth algorithm as defined in IETF RFC 2069, 2617, and 7616, intended for HTTP clients"
@ -461,7 +461,7 @@ impl AuthorizationHeader {
nc : prompt . nc ,
nc : prompt . nc ,
} ;
} ;
hdr . build_hash ( context ) ;
hdr . digest ( context ) ;
Ok ( hdr )
Ok ( hdr )
}
}
@ -479,7 +479,7 @@ impl AuthorizationHeader {
/// - cnonce (if it was None before)
/// - cnonce (if it was None before)
/// - username copied from context
/// - username copied from context
/// - response
/// - response
pub fn build_hash ( & mut self , context : & AuthContext )
pub fn digest ( & mut self , context : & AuthContext )
{
{
// figure out which QOP option to use
// figure out which QOP option to use
let qop_algo = match self . qop {
let qop_algo = match self . qop {
@ -2,8 +2,12 @@
//! It can be used in conjunction with libraries like reqwest to access e.g. IP cameras
//! It can be used in conjunction with libraries like reqwest to access e.g. IP cameras
//! that use this authentication scheme.
//! that use this authentication scheme.
//!
//!
//! This library is intended for the http client. The algorithm is symmetrical,
//! This library was written for the http client, but since the algorithm is symmetrical,
//! it's just not optimized for / tested on the server side yet.
//! it can be used by the server side as well. Server-side nonce management (generation, timed
//! expiry) and authorization checking is left to user's implementation.
//!
//! The `AuthorizationHeader::digest()` method can be used server-side to replicate the
//! password/body hash; then just check if the computed digest matches what the user sent.
//!
//!
//! # Examples
//! # Examples
//!
//!