ipp

package
v0.2.40 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MPL-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package ipp is the chassis's `ipp` personality: a stack presented to a user's computer as a PRINTER. File → Print → "Research Pony" in any application is one run of the tenant's `_ipp` stack, with the document delivered by CAS reference.

ipps://ipp.<zone>:443/p/<printer>
ipps://ipp.<structured suffix>:443/p/<handle>/<printer>   (a tenant with no zone)

IPP is HTTP (POST application/ipp: a binary attribute block, then the document), so this head binds no listener of its own — the web head mounts Handler() for every request whose Host is `ipp.<something>`, and for no other. The tenant comes from the ZONE (`ipp.dripl.it` → whoever delegated dripl.it to this chassis); the printer is the path label and means whatever the tenant's `_ipp` stack says it means. The chassis implements the printer; the stack decides what printing is.

What happens to one print job:

authenticate → decode the IPP header → stream the document into the CAS
(hash known only at EOF) → record tenant ownership → commit a durable job
row → answer the client → a dispatcher hands the envelope to the bus.

The job's lifecycle ENDS when the bus accepts the envelope (`delivered`). The stack may then create a task, wait three days for a human, vectorize the document or throw it away; none of that is a print job, and nothing here waits for it or reports on it.

A printer is a ROW (`txco://ipp/printer`): its label, the principal it is granted to, and its display name. A client signs in with that principal's username and a password `txco://credential/create` issued to it, through the login resolver the IMAP and DAV heads share (chassis/authn); the credential's scopes must cover `ipp:<printer>:print`. The delivered run is pinned to the principal that printed (`@principal`). A label with no active row does not exist.

Index

Constants

View Source
const (
	// PathPrefix is where printers live on an ipp host: /p/<printer>.
	PathPrefix = "/p"

	// SubscriptionStack is the tenant-level stack that receives print jobs —
	// the `_imap` / `_dns` idiom. A tenant without an active one has no
	// printers.
	SubscriptionStack = "_ipp"
)

Variables

This section is empty.

Functions

func IsIPPHost

func IsIPPHost(host string) bool

IsIPPHost is the web head's mount predicate: the leftmost label is `ipp`. Marker only — no lookup — because it runs on EVERY web request. Whether the rest names a tenant is the handler's question.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller owns the head's shared state. It binds no listener — the web head mounts Handler() — but it does own one goroutine: the dispatcher.

func NewController

func NewController(ctx context.Context, pu *processor.Unit, store *chipp.Store, resolver HostResolver) *Controller

NewController constructs (but does not start) the head. A nil store (ipp personality off) yields an inert controller: Enabled() is false, Start is a no-op and the web head is never asked to mount it.

func (*Controller) Enabled

func (c *Controller) Enabled() bool

Enabled reports whether the head serves anything: the personality is on, the job store opened, and there is somewhere to put documents.

func (*Controller) Handler

func (c *Controller) Handler() http.Handler

Handler is the http.Handler the web head mounts for ipp hosts.

func (*Controller) ServeHTTP

func (c *Controller) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP answers one request on an `ipp.<x>` host.

Two layers of status, as in any IPP server: HTTP codes speak about the TRANSPORT (not found, not authenticated, wrong method, draining); once a request is a well-formed, authenticated IPP operation the answer is HTTP 200 carrying an IPP status.

func (*Controller) SetAuth

func (c *Controller) SetAuth(r *authn.Resolver)

SetAuth hands the head the login resolver. Without one every login answers 503: the node could not open the identity database.

func (*Controller) SetBlobIndex

func (c *Controller) SetBlobIndex(ix blob.Index)

SetBlobIndex hands the head the blob index that records which tenant owns a document's hash (so the stack can read it by sha, and nobody else can).

func (*Controller) SetFileCAS

func (c *Controller) SetFileCAS(s filecas.Store)

SetFileCAS hands the head the content-addressed store documents stream into.

func (*Controller) Start

func (c *Controller) Start()

Start launches the dispatcher. The head itself is served by the web head, so an `ipp` personality without `web` receives nothing — say so.

func (*Controller) Stop

func (c *Controller) Stop()

Stop ends the dispatcher. Committed jobs it had not handed over stay committed; the next node (or the next boot) delivers them.

type HostResolver

type HostResolver interface {
	ResolveErr(key ingress.RouteKey) (ingress.RouteTarget, bool, error)
}

HostResolver maps a hostname to its tenant — the routing every web request uses (ingress.DBResolver.ResolveErr). Used for the hostname-row fallback when `ipp.<X>`'s X is not a zone origin. Tests inject.

Directories

Path Synopsis
Package ui owns the embedded printer page: what a browser sees at a printer's own address (https://ipp.<zone>/p/<printer> — the https twin of its ipps:// URI, and where a configuration profile's description points).
Package ui owns the embedded printer page: what a browser sees at a printer's own address (https://ipp.<zone>/p/<printer> — the https twin of its ipps:// URI, and where a configuration profile's description points).

Jump to

Keyboard shortcuts

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