httppipe

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httppipe is the HTTP Pipe Protocol client adapter (openflange.org/http/v0.1): it runs a node whose implementation is `type: http` — or whose pipe was referenced as `https://host/base/pipes/<id>` — on a remote server.

For one node execution the adapter discovers the remote definition and verifies that it satisfies the local contract, opens a session, attaches every enabled output (GET) and input (POST) concurrently — it never waits for the response to an input before reading outputs — and finally consults the session status, which is the authoritative outcome. A session that did not complete fails the node with the remote's structured error, and the session is DELETEd whenever the node fails or is cancelled.

Security. Record data leaves the machine: the node needs the `network` grant for the server's host:port and `remoteData` for its host, and the adapter refuses to run without them. Requests go through the bounded, SSRF-safe client of this module: HTTPS only (plain HTTP for loopback only, so a bearer token is never sent in clear text to another host), no connections to private address ranges for public names, and no redirects at all on requests that carry credentials or a stream. The bearer credential comes from a secret — the single secret the pipe declares, or Adapter.Credentials — never from a parameter, and is never logged.

Index

Constants

View Source
const (
	// MaxJSONBytes bounds every JSON response read from a server.
	MaxJSONBytes = 1 << 20
	// DefaultRequestTimeout bounds the non-streaming requests (definition,
	// session creation, status, DELETE).
	DefaultRequestTimeout = 30 * time.Second
)

Limits and timeouts.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// Credentials returns the bearer token for a server, identified by its
	// lower-case "host:port", for nodes whose pipe declares no secret (for
	// example pipes referenced by URL). It is consulted once per node
	// execution. May be nil.
	Credentials func(hostport string) (token string, ok bool)
	// RequestTimeout bounds non-streaming requests (default
	// DefaultRequestTimeout).
	RequestTimeout time.Duration
	// IdleTimeout, when positive, cancels the session if no stream makes any
	// progress for that long (E_TIMEOUT). Default: no idle timeout, because
	// a pipe may legitimately be quiet for a long time.
	IdleTimeout time.Duration
}

Adapter runs nodes on remote HTTP Pipe Protocol servers.

func New

func New() *Adapter

New returns the adapter with defaults.

func (*Adapter) Capabilities

func (a *Adapter) Capabilities() []adapter.Capability

Capabilities implements adapter.Adapter.

func (*Adapter) Check

func (a *Adapter) Check(ctx context.Context, n *adapter.Node) error

Check validates the node without contacting the server: the URL, the transport-security rule, the grants and the port shapes.

func (*Adapter) Location

Location implements adapter.Adapter.

func (*Adapter) Name

func (a *Adapter) Name() string

Name implements adapter.Adapter.

func (*Adapter) Run

func (a *Adapter) Run(ctx context.Context, n *adapter.Node, nio *adapter.IO) error

Run implements adapter.Adapter.

func (*Adapter) Supports

func (a *Adapter) Supports(impl *manifest.Implementation) bool

Supports implements adapter.Adapter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL