version bump, updated readme

pull/4/head
Ondřej Hruška 5 years ago
parent 1947affd75
commit c10d96bf83
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 2
      Cargo.toml
  2. 4
      src/digest.rs
  3. 8
      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
//! //!

Loading…
Cancel
Save