Skip to main content

HTTP client abstraction and request management for the Klyrek ecosystem

Project description

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, 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.
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/")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

klyrek_http-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

klyrek_http-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file klyrek_http-0.1.0.tar.gz.

File metadata

  • Download URL: klyrek_http-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for klyrek_http-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b81b8c0edbf451e0b3aace493fc784e0ee3bc08a04b768ec3127c442ee93a723
MD5 ae66d4f927b5c83f36f5856275ef00b6
BLAKE2b-256 e28aafac03abbf8421eb4823ede116f6b9233de90b69367ba24890837e4e84bf

See more details on using hashes here.

File details

Details for the file klyrek_http-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: klyrek_http-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for klyrek_http-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 336fe2dd45e84f65ec673aea568c7c3e85d9259b04ee364a89307335c7e138d5
MD5 698f1b2bc4432314e21eb2c8aeb41904
BLAKE2b-256 8d42037a23f1856a03af2dc2d4a2488c69fbf95105273c304e8e3f0c0e057853

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page