feat: add optional Web Bot Authentication support#49
Merged
Conversation
Implement draft-meunier-web-bot-auth-architecture behind the `bot-auth` Cargo feature. When enabled, outgoing HTTP requests are signed with Ed25519 per RFC 9421, adding Signature, Signature-Input, and optionally Signature-Agent headers so origins can cryptographically verify bot identity. Key additions: - bot_auth module with BotAuthConfig, signing logic, JWK thumbprint - Feature-gated integration into FetchOptions, ToolBuilder, DefaultFetcher - CLI flags: --bot-auth-key and --bot-auth-agent - Spec (specs/bot-auth.md), docs, and comprehensive tests
Add TM-AUTH category covering key material handling, signature replay, scope binding, weak seeds, and graceful failure. Update security controls matrix and caller responsibilities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add optional support for the Web Bot Authentication Architecture (draft-meunier-web-bot-auth-architecture). When enabled via the
bot-authCargo feature, outgoing HTTP requests are signed with Ed25519 per RFC 9421, addingSignature,Signature-Input, and optionallySignature-Agentheaders so origins can cryptographically verify bot identity.Why
User-Agent strings are trivially spoofable. The Web Bot Auth draft provides a cryptographic alternative where bots sign requests with asymmetric keys, letting origins verify identity without shared secrets. This is increasingly relevant as more websites adopt bot authentication policies.
How
bot_authmodule (crates/fetchkit/src/bot_auth.rs) withBotAuthConfig, Ed25519 signing, JWK thumbprint (RFC 7638), and nonce generationbot-authCargo feature to avoid pulling crypto deps (ed25519-dalek, base64, sha2, rand) by defaultFetchOptions,ToolBuilder,Tool, andDefaultFetchervia#[cfg(feature = "bot-auth")]--bot-auth-key(base64url Ed25519 seed) and--bot-auth-agent(FQDN for Signature-Agent)Risk
Checklist
docs/security.md)specs/bot-auth.md)specs/threat-model.md— new TM-AUTH category)