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
- type Adapter
- func (a *Adapter) Capabilities() []adapter.Capability
- func (a *Adapter) Check(ctx context.Context, n *adapter.Node) error
- func (a *Adapter) Location(*manifest.Implementation) adapter.Location
- func (a *Adapter) Name() string
- func (a *Adapter) Run(ctx context.Context, n *adapter.Node, nio *adapter.IO) error
- func (a *Adapter) Supports(impl *manifest.Implementation) bool
Constants ¶
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 (*Adapter) Capabilities ¶
func (a *Adapter) Capabilities() []adapter.Capability
Capabilities implements adapter.Adapter.
func (*Adapter) Check ¶
Check validates the node without contacting the server: the URL, the transport-security rule, the grants and the port shapes.
func (*Adapter) Location ¶
func (a *Adapter) Location(*manifest.Implementation) adapter.Location
Location implements adapter.Adapter.