httpsig module #7
Labels
No labels
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
geomind_research/herolib_rust#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Module Overview
The httpsig module implements the HTTP Signature scheme for authenticating API requests and responses in . This module provides a secure, standards-compliant way to verify the authenticity and integrity of HTTP messages, ensuring that requests truly come from claimed senders and haven't been tampered with in transit.
Functionality
Module API
HTTP Signatures
HttpSigner::new(keypair: KeyPair, key_id: &str) -> Self- Create a new HTTP signer with the provided keypair and identifierHttpSigner::with_headers(mut self, headers: Vec<String>) -> Self- Configure which HTTP headers to include in the signature calculationHttpSigner::sign_request(&self, request: &mut Request) -> Result<(), SignError>- Sign an HTTP request by adding the Signature headerHttpSigner::sign_string(&self, string: &str) -> Result<String, SignError>- Sign a string directly using the HTTP signature formatHttpVerifier::new(public_key: &str) -> Self- Create a verifier with a known public key for signature validationHttpVerifier::with_key_getter(mut self, getter: KeyGetter) -> Self- Set up a key lookup function to fetch public keys dynamicallyHttpVerifier::verify_request(&self, request: &Request) -> Result<(), VerifyError>- Verify the signature on an incoming HTTP requestHttpVerifier::verify_signature(&self, signature: &str, message: &str, key_id: &str) -> Result<(), VerifyError>- Verify a signature string against a messageextract_key_id(request: &Request) -> Result<String, HttpSigError>- Extract the key ID from the Signature header for lookupwhat is the usecase for this?