Home /Modules/http-3.0/HTTP-COLORS.md

HTTP-COLORS.md

http-3.0/HTTP-COLORS.md · 88 line(s) · markdown

HTTP Colors — specifying HTTP behavior from SLeeLa source

A SLeeLa program specifies its HTTP behavior by naming a color. A color is a named bundle of protocol knobs — wire form, default flags, and the per-packet integrity profile (keyed-MAC DIGEST, INTACTX tamper gate, replay NONCE, and the goods & services BASKET) — so source code can say "use color green" instead of setting each switch by hand.

Colors are advisory selectors over behavior the protocol already supports. Naming a color never changes the on-the-wire envelope layout; it only chooses which optional protections a connection turns on. The mechanism is additive.

Where colors live

ArtifactRole
http3_colors.confAuthoritative palette (one color per line)
http3_profile.h / http3_profile.cC: http3_profile_t, resolver, loader, pipeline apply
http3_flow.pyPython parity: Profile, PALETTE, profile_by_color, profile_load
http3_service.example.confExample per-service → color mapping
http_colors.example.sleelaExample of naming colors from SLeeLa source

The shipped palette

ColorWireFlagsMACINTACTXReplayBasketUse
greentext—✗✗✗✗Lightest, most interoperable; core only
ambertext—✓✗✓✗Balanced: authenticity + replay guard
redbinaryBINARY✓✓✓✓Strict: full per-packet integrity
blackbinaryBINARY+COMPRESSED✓✓✓✓Strict, with compressed payloads

The palette is identical across http3_colors.conf, http3_profile.c, and http3_flow.py.

Specifying colors from SLeeLa source

A Wrapper (.sleela source file) declares its HTTP colors declaratively:

http {
    default color green;

    service "orders"    color red;     // binary + full integrity + basket
    service "billing"   color black;   // red, plus compressed payloads
    service "catalog"   color green;   // textual, core only (lightest)
    service "telemetry" color amber;   // textual, MAC + replay guard
}

Under the hood the connector resolves and applies the color:

http3_profile_t p;
http3_profile_by_color("red", &p);   /* or http3_profile_load(path,"red",&p) */
http3_profile_apply(&p, &pipe);      /* sets the pipeline's INTACTX threshold */
/* then send/verify per p.wire, p.mac_required, p.replay_guard, ... */
from http3_flow import profile_by_color, profile_load
p = profile_by_color("red")          # or profile_load("http3_colors.conf", "red")

Config-file format (http3_colors.conf)

One color per line; # comments and blank lines ignored:

# name    wire    flags  mac  intactx  threshold  replay  basket
green     text    0      0    0        0          0       0
amber     text    0      1    0        0          1       0
red       binary  1      1    1        0          1       1
black     binary  3      1    1        0          1       1

HTTP 2.1 note

The HTTP 2.1 sketch (../http-2.0/) has no per-packet integrity substrate, so its colors reduce to wire form + flags only (the MAC / INTACTX / replay / basket columns do not apply). The same "name a color from source" surface is intended there; when the 2.1 core is fleshed out, a trimmed palette (green/amber as text/binary + flags) would mirror this document.