corvix.pipeline.base

Shared request primitives for hydration and enrichment pipelines.

Classes

JsonFetchClient

Client capability required by data-enrichment pipelines.

RequestContext

Per-cycle request budget and URL cache, scoped per account.

Module Contents

class corvix.pipeline.base.JsonFetchClient[source][source]

Bases: Protocol

Client capability required by data-enrichment pipelines.

api_base_url: str[source][source]

Trusted base URL of the upstream API (e.g. https://api.github.com).

Providers use this to construct upstream API URLs from trusted config rather than from data received in API responses, which prevents SSRF taint flows.

account_id: str[source][source]

Identifies which account’s credentials this client authenticates requests with.

Used to scope the per-cycle URL cache (see RequestContext) so a payload fetched with one account’s token is never served to another account’s notification.

fetch_json_url(url: str, timeout_seconds: float = 30.0) corvix.types.JsonValue[source][source]

Fetch JSON from a fully-qualified API URL.

class corvix.pipeline.base.RequestContext[source][source]

Per-cycle request budget and URL cache, scoped per account.

max_requests_per_cycle: int[source][source]
url_cache: dict[tuple[str, str], corvix.types.JsonValue][source][source]
request_count: int = 0[source][source]
get_json(client: JsonFetchClient, url: str, timeout_seconds: float) corvix.types.JsonValue[source][source]

Fetch and cache a JSON payload for this cycle.

The cache is keyed by (client.account_id, url) rather than by URL alone, so a payload fetched under one account’s token is never handed back to a request made on behalf of a different account, even when two accounts share the same URL (e.g. both watching the same repo).