From b272b4e3b87a95e962d3a6743908ada40ef6e92a Mon Sep 17 00:00:00 2001 From: Jun Kurihara Date: Thu, 18 Apr 2024 16:08:41 +0900 Subject: [PATCH] add header doc --- httpsig-hyper/src/lib.rs | 6 ++++++ httpsig/src/lib.rs | 7 +++++++ httpsig/src/signature_base.rs | 1 + 3 files changed, 14 insertions(+) diff --git a/httpsig-hyper/src/lib.rs b/httpsig-hyper/src/lib.rs index 6fdb012..a3fb303 100644 --- a/httpsig-hyper/src/lib.rs +++ b/httpsig-hyper/src/lib.rs @@ -1,3 +1,9 @@ +//! # httpsig-hyper +//! +//! `httpsig-hyper` is a crate that provides a convenient API for `Hyper` users to handle HTTP signatures. +//! This crate extends hyper's https request and response messages with the ability to generate and verify HTTP signatures. +//! Additionally it also provides a way to set and verify content-digest header. + mod error; mod hyper_content_digest; mod hyper_http; diff --git a/httpsig/src/lib.rs b/httpsig/src/lib.rs index ddc9f36..e45b7ea 100644 --- a/httpsig/src/lib.rs +++ b/httpsig/src/lib.rs @@ -1,3 +1,10 @@ +//! # httpsig +//! +//! `httpsig` is a library for raw HTTP Signature. +//! It provides a simple API for signing and verifying HTTP messages, and does not depends on any HTTP framework. +//! It simply handles header keys and values in `String` or `&str` as HTTP message components, which means it can be used in any HTTP framework but requires complicated handling of HTTP headers. +//! We thus recommend to use [`httpsig-hyper`](https://crates.io/crates/httpsig-hyper) for `Hyper`` users, which provides a more convenient API. + mod crypto; mod error; mod message_component; diff --git a/httpsig/src/signature_base.rs b/httpsig/src/signature_base.rs index b32b0f4..04da34a 100644 --- a/httpsig/src/signature_base.rs +++ b/httpsig/src/signature_base.rs @@ -119,6 +119,7 @@ impl HttpSignatureHeaders { } #[derive(Debug, Clone)] +/// Wrapper struct of raw signature bytes pub struct HttpSignature(Vec); impl std::fmt::Display for HttpSignature { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {