Metadata-Version: 2.4
Name: klyrek-http
Version: 0.1.0
Summary: HTTP client abstraction and request management for the Klyrek ecosystem
Author: Klyrek Contributors
License: MIT
Keywords: appsec,http,pentesting,reconnaissance,security
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: klyrek-core
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# klyrek-http

The HTTP layer shared by every Klyrek package that talks to a target: `klyrek-crawler`,
`klyrek-api`, `klyrek-tech`, `klyrek-auth`, `klyrek-js`, `klyrek-assets`, and `klyrek-headers` all
issue requests through `KlyrekHTTPClient` rather than calling `httpx`/`requests` directly.

Every request goes through two checks before it leaves the process:

1. **Scope enforcement** — the URL's host must be declared in the scan's
   [`AuthorizationScope`](../klyrek-core/README.md#scope-enforcement), or the request raises
   `ScopeViolationError` instead of firing.
2. **Rate limiting** — a per-host minimum interval (`KlyrekConfig.rate_limit_per_host`) keeps a
   scan from hammering a target faster than was authorized.

```python
from klyrek_core.config import KlyrekConfig
from klyrek_core.scope import AuthorizationScope
from klyrek_http.client import KlyrekHTTPClient

scope = AuthorizationScope(authorized_hosts=["target.com", "*.target.com"])

with KlyrekHTTPClient(scope, config=KlyrekConfig(rate_limit_per_host=5)) as client:
    response = client.get("https://target.com/")
```
