From c10d96bf834b80f15a70c558e51a289395a15fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Mon, 7 Oct 2019 01:10:12 +0200 Subject: [PATCH] version bump, updated readme --- Cargo.toml | 2 +- src/digest.rs | 4 ++-- src/lib.rs | 8 ++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fb9f170..d221a49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "digest_auth" -version = "0.1.3" +version = "0.2.0" authors = ["Ondřej Hruška "] edition = "2018" description = "Implementation of the Digest Auth algorithm as defined in IETF RFC 2069, 2617, and 7616, intended for HTTP clients" diff --git a/src/digest.rs b/src/digest.rs index cf4d544..5ae2362 100644 --- a/src/digest.rs +++ b/src/digest.rs @@ -461,7 +461,7 @@ impl AuthorizationHeader { nc: prompt.nc, }; - hdr.build_hash(context); + hdr.digest(context); Ok(hdr) } @@ -479,7 +479,7 @@ impl AuthorizationHeader { /// - cnonce (if it was None before) /// - username copied from context /// - response - pub fn build_hash(&mut self, context : &AuthContext) + pub fn digest(&mut self, context : &AuthContext) { // figure out which QOP option to use let qop_algo = match self.qop { diff --git a/src/lib.rs b/src/lib.rs index 960087b..33ff39f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,8 +2,12 @@ //! It can be used in conjunction with libraries like reqwest to access e.g. IP cameras //! that use this authentication scheme. //! -//! This library is intended for the http client. The algorithm is symmetrical, -//! it's just not optimized for / tested on the server side yet. +//! This library was written for the http client, but since the algorithm is symmetrical, +//! 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 //!