Different pipes. One standard.

Type to search this site.

Search runs in your browser against a static index built with this site (Pagefind). Nothing you type is sent to a server.

ExtractExperimental

std:http-source #

Source: NDJSON fetched with one HTTP GET. Needs a network grant for the URL's host:port.

For example: fetch an NDJSON export over HTTPS.

A pipe is a data processing step with declared inputs and outputs; standard pipes are built into the runner.

Ports #

std:http-source takes no inputs and produces out.std:http-sourceoutrecords
std:http-source takes no inputs and produces out.std:http-sourceoutrecords
Named ports from the latest published contract. Dashed lines are optional ports.

A source: it has no inputs.

Ports of std:http-source
PortDirectionKindRequiredDescription
outoutputrecordsyes

Parameters #

Parameters of std:http-source
NameTypeDefaultRequiredDescription
urlstringnoneyes
timeoutMsinteger30000no Minimum 1.

When to use it #

  • A public data set or an internal export published as NDJSON at a URL: one GET, the response body becomes the stream.
  • Give up on a slow server after a set time with timeoutMs.

When to use something else

  • The node needs a network grant for the URL's host and port. No credentials are sent — authenticated sources are outside the standard library in v0.1 — and any status other than 200 fails the run.

A tested example #

Nothing here is invented: this is the test “fetching without a network grant is refused” from the pipe's own portable test file, which every conformant runner must pass.

Parameters
{
  "url": "https://data.example.org/events.ndjson"
}
Input: —

This test gives the pipe no input.

Expected output: —

Expected result: the run fails with E_PERMISSION. Nothing is written to the outputs.

The test grants the node no permissions.

The same step as a node of a pipeline.yaml:

pipeline.yaml
nodes:
  http-source:
    pipe: std:http-source
    parameters:
      url: "https://data.example.org/events.ndjson"

Written like this, the node is refused, exactly as in the test: it needs a grant.

Notes from the manifest #

The pipe's manifest, OPENFLANGE.md, carries these notes.

Part of the OpenFlange standard library (std, version 0.1).

A source that performs one HTTP GET on url and streams the response body as NDJSON (one JSON value per line), emitting items while the download is in progress. A response status other than 200 fails the run with E_RUNTIME; malformed lines are E_FORMAT. timeoutMs bounds the whole exchange including the body; exceeding it fails with E_TIMEOUT.

Permission and safety #

The permission depends on the url parameter (a dynamic permission requirement of the standard library): network for the URL's host:port (default ports 443/80). The consumer must grant it and the runner enforces it, refusing with E_PERMISSION otherwise:

  • HTTPS only; plain HTTP is accepted for loopback addresses only;
  • the address actually connected to is checked after DNS resolution: a public host name can never reach loopback, private or link-local addresses (SSRF protection);
  • redirects are limited, re-checked per hop against the grant (a redirect to another host needs that host granted too), and may not downgrade to HTTP;
  • no cookies, no proxy from the environment, no credentials. Authenticated sources are out of scope for the standard library in v0.1.
sh
openflange run pipeline.yaml --grant network=data.example.org:443

Reference #

Maturity
Experimental
Manifest version
0.1.0