develop herolib httpsig #32

Closed
sameh-farouk wants to merge 30 commits from develop-herolib-httpsig into develop
Member

PR Description: Add herolib-httpsig Module

Summary

Implements RFC 9421 (HTTP Message Signatures) and RFC 9530 (Content-Digest) with Ed25519 cryptography for secure HTTP request/response authentication.

Features

  • RFC Compliant: Full RFC 9421 & RFC 9530 implementation
  • Universal HTTP Support: Works with any library using http crate (reqwest, hyper, axum, etc.)
  • Ed25519 Signatures: Fast, secure cryptography via herolib-keys
  • Replay Protection: Configurable timestamp tolerance (default: 60s)
  • Mandatory Security: Always signs @method, @path, @authority, content-digest
  • Rhai Integration: Optional scripting support with 7 tests + 2 examples

API

// Sign requests
let signer = HttpSigner::new(keypair, "key-id");
signer.sign_request(&mut request, body)?;

// Verify requests
let verifier = HttpVerifier::new().with_key(public_key);
verifier.verify_request(&request, body)?;

Testing

  • 31 unit tests + 11 doc tests (Rust)
  • 7 integration tests + 2 examples (Rhai)
  • Zero warnings, no unsafe code

Security

  • Tight 60s default tolerance (balances security & clock skew)
  • Mandatory body digest (prevents tampering)
  • Canonical component normalization (prevents manipulation)
  • Comprehensive input validation
# PR Description: Add `herolib-httpsig` Module ## Summary Implements RFC 9421 (HTTP Message Signatures) and RFC 9530 (Content-Digest) with Ed25519 cryptography for secure HTTP request/response authentication. ## Features - ✅ **RFC Compliant**: Full RFC 9421 & RFC 9530 implementation - ✅ **Universal HTTP Support**: Works with any library using `http` crate (reqwest, hyper, axum, etc.) - ✅ **Ed25519 Signatures**: Fast, secure cryptography via `herolib-keys` - ✅ **Replay Protection**: Configurable timestamp tolerance (default: 60s) - ✅ **Mandatory Security**: Always signs `@method`, `@path`, `@authority`, `content-digest` - ✅ **Rhai Integration**: Optional scripting support with 7 tests + 2 examples ## API ```rust // Sign requests let signer = HttpSigner::new(keypair, "key-id"); signer.sign_request(&mut request, body)?; // Verify requests let verifier = HttpVerifier::new().with_key(public_key); verifier.verify_request(&request, body)?; ``` ## Testing - 31 unit tests + 11 doc tests (Rust) - 7 integration tests + 2 examples (Rhai) - Zero warnings, no unsafe code ## Security - Tight 60s default tolerance (balances security & clock skew) - Mandatory body digest (prevents tampering) - Canonical component normalization (prevents manipulation) - Comprehensive input validation
sameh-farouk closed this pull request 2025-12-31 17:21:21 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_research/herolib_rust!32
No description provided.