From Newsgroup: comp.lang.tcl
ANNOUNCE: Websh 3.7.7 released
==============================
Websh is a rapid development environment for building web applications
with Tcl, running as CGI or as an Apache 2.4 module (mod_websh).
Originally developed by Netcetera AG and contributed to the Apache
Software Foundation, the 3.7 series is a modernized continuation of
Apache Websh 3.6.
Highlight of this release: the build system is now fully TEA 3.13
compliant (Tcl Extension Architecture).
Download / Repository:
https://fossil.sowaswie.de/websh
Reference:
https://fossil.sowaswie.de/websh/uv/index.html
English
-------
New features since 3.7:
* JSON REST support: POST bodies with Content-Type application/json are
parsed (bundled cJSON) and can drive command dispatch via a cmd tag in
the JSON body. Dispatch order is now: 1. HTTP GET, 2. HTTP header (e.g. X-CMD), 3. HTTP POST JSON, 4. form variables.
* JSON Web Tokens: ::jwt::sign and ::jwt::verify (HS256, HS512, NaCl).
verify returns a boolean (signature only) or, with -json, a re-parsable
result document (verify/header/payload). Opt-in -claims validates RFC
7519 exp/nbf and adds a reason field
(ok|signature|notbefore|expired|payload); -leeway sec adds clock-skew tolerance.
* Server-Sent Events: web::sseStart and web::sseSend for real-time
streaming, backed by the new web::response -flush, which pushes pending
output through Apache's output filter chain (ap_rflush) under mod_websh. Complete server/client example in examples/sse/.
* Session helpers: web::configSetup, web::sessionSetup,
web::loggingSetup, web::sessionNew/Init/Close/Refresh/Get rCo file-based sessions with JWT-style claims (iss, sub, aud, exp, nbf, iat, jti, mlt), X-Session response header and AUTH_BEARER support. sessionInit accepts
an explicit session id that takes precedence over the bearer token.
* Response helpers: web::returnJson, web::returnText, web::returnBinary
(typed responses with correct headers) and web::getContent, which
decodes POST bodies with proper charset resolution (charset= parameter,
RFC 8259 UTF-8 default for JSON, CONTENT_ENCODING, UTF-8 fallback).
* Utilities: web::randombytes (CSPRNG with selectable sources),
web::uuidV4, web::ts (ISO-8601 timestamps), web::mimeType,
web::filerandom (UUID v4 id generator for file contexts), web::genPasswd (password generator backed by web::randombytes, rejection sampling, Fisher-Yates shuffle, configurable rules).
* Request data: Authorization Bearer tokens are captured as AUTH_BEARER.
* Logging: new format specifiers $U (microseconds) and $M (milliseconds)
for web::logdest -format.
Fixes:
* Fixed a segfault in the raw POST data path when no Content-Type header
was present.
* Fixed double UTF-8 encoding of multipart/form-data text fields (Tcl's -translation binary implicitly switched the channel encoding).
* CONTENT_ENCODING is now deterministic: derived from the charset=
parameter of the Content-Type header, with the HTTP/1.1 default
iso8859-1 as fallback (previously system-dependent).
* web::getContent decodes JSON bodies without a charset parameter as
UTF-8 per RFC 8259.
* Zero compiler warnings; replaced unsafe tempnam with mkstemp.
* C23 compatibility (clang defaults on recent macOS): reserved keyword collision and K&R declarations removed.
* macOS: libwebsh is linked with an absolute install_name so mod_websh
loads reliably under the Apache LaunchAgent (previously dyld failed to
resolve the bare library name when CWD=/).
Build and installation:
* Build system migrated to the standard TEA 3.13 (Tcl Extension
Architecture); ./configure --with-tcl=... just works.
* The Apache module is optional: auto-detected by default,
--enable-apache to require it, --disable-apache for a Tcl-package-only
build.
* APR/APR-util include paths and link flags are auto-detected via apr-1-config/apu-1-config, including Homebrew on macOS (Intel and Apple Silicon).
* make install follows the Tcl package layout (lib/websh<version>/ with pkgIndex.tcl and unversioned symlinks) and automates post-install steps: ldconfig and systemctl restart apache2/httpd on Linux, brew services
restart httpd on macOS (dropping privileges to the invoking user under
sudo).
* Platform-correct shared library naming (.dylib on macOS, .so
elsewhere); make clean removes artifacts of previous versions after a
version bump.
Documentation and tests:
* The DocBook reference (doc/quickref.xml) is maintained again and
covers all commands including JWT, SSE, sessions and the new utilities;
HTML is generated offline via the local XML catalog (docbook +
docbook-xsl) with make in doc/ and published at the URL above.
* The test suite has grown to 526 tests (521 passed, 5 skipped, 0
failed), adding coverage for JWT, SSE framing, encoding resolution,
multipart UTF-8, session lifecycle, JSON dispatch and the response helpers.
Next on the roadmap: Tcl 9 compatibility.
Deutsch
-------
Neue Features seit 3.7:
* JSON-REST-Unterst|+tzung: POST-Bodies mit Content-Type application/json werden geparst (mitgeliefertes cJSON) und k||nnen das Command-Dispatching |+ber einen cmd-Tag im JSON-Body steuern. Dispatch-Reihenfolge jetzt: 1.
HTTP GET, 2. HTTP-Header (z.B. X-CMD), 3. HTTP POST JSON, 4. Formularvariablen.
* JSON Web Tokens: ::jwt::sign und ::jwt::verify (HS256, HS512, NaCl).
verify liefert einen Boolean (nur Signaturpr|+fung) oder mit -json ein re-parsebares Ergebnisdokument (verify/header/payload). Optional pr|+ft -claims die RFC-7519-Zeitangaben exp/nbf und erg|nnzt ein reason-Feld (ok|signature|notbefore|expired|payload); -leeway sec erlaubt
Uhren-Toleranz.
* Server-Sent Events: web::sseStart und web::sseSend f|+r
Echtzeit-Streaming, basierend auf dem neuen web::response -flush, das
unter mod_websh die anstehende Ausgabe durch Apaches Output-Filter-Kette schiebt (ap_rflush). Vollst|nndiges Server/Client-Beispiel in examples/sse/.
* Session-Helfer: web::configSetup, web::sessionSetup,
web::loggingSetup, web::sessionNew/Init/Close/Refresh/Get rCo
dateibasierte Sessions mit JWT-artigen Claims (iss, sub, aud, exp, nbf,
iat, jti, mlt), X-Session-Response-Header und AUTH_BEARER-Unterst|+tzung. sessionInit akzeptiert eine explizite Session-Id, die Vorrang vor dem Bearer-Token hat.
* Response-Helfer: web::returnJson, web::returnText, web::returnBinary (typisierte Antworten mit korrekten Headern) sowie web::getContent, das POST-Bodies mit sauberer Charset-Aufl||sung dekodiert
(charset=-Parameter, RFC-8259-UTF-8-Default f|+r JSON, CONTENT_ENCODING, UTF-8-Fallback).
* Utilities: web::randombytes (CSPRNG mit w|nhlbaren Quellen),
web::uuidV4, web::ts (ISO-8601-Zeitstempel), web::mimeType,
web::filerandom (UUID-v4-Id-Generator f|+r File-Contexts), web::genPasswd (Passwortgenerator auf Basis von web::randombytes, Rejection-Sampling, Fisher-Yates-Shuffle, konfigurierbare Regeln).
* Request-Daten: Authorization-Bearer-Tokens stehen als AUTH_BEARER bereit.
* Logging: neue Formatangaben $U (Mikrosekunden) und $M (Millisekunden)
f|+r web::logdest -format.
Fehlerbehebungen:
* Segfault im Raw-POST-Pfad behoben, wenn kein Content-Type-Header
vorhanden war.
* Doppelte UTF-8-Kodierung von multipart/form-data-Textfeldern behoben
(Tcls -translation binary schaltete implizit das Channel-Encoding um).
* CONTENT_ENCODING ist jetzt deterministisch: abgeleitet aus dem charset=-Parameter des Content-Type-Headers, mit dem HTTP/1.1-Default iso8859-1 als Fallback (vorher systemabh|nngig).
* web::getContent dekodiert JSON-Bodies ohne charset-Parameter gem|n|f RFC 8259 als UTF-8.
* Null Compiler-Warnings; unsicheres tempnam durch mkstemp ersetzt.
* C23-Kompatibilit|nt (clang-Default auf aktuellem macOS): Kollision mit reserviertem Schl|+sselwort und K&R-Deklarationen entfernt.
* macOS: libwebsh wird mit absolutem install_name gelinkt, damit
mod_websh unter dem Apache-LaunchAgent zuverl|nssig l|ndt (vorher konnte
dyld den nackten Bibliotheksnamen bei CWD=/ nicht aufl||sen).
Build und Installation:
* Build-System auf das Standard-TEA 3.13 (Tcl Extension Architecture) migriert; ./configure --with-tcl=... funktioniert out of the box.
* Das Apache-Modul ist optional: Auto-Detection per Default,
--enable-apache erzwingt es, --disable-apache baut nur das Tcl-Package.
* APR/APR-util-Include-Pfade und Link-Flags werden |+ber apr-1-config/apu-1-config automatisch erkannt, inklusive Homebrew auf
macOS (Intel und Apple Silicon).
* make install folgt dem Tcl-Package-Layout (lib/websh<version>/ mit pkgIndex.tcl und unversionierten Symlinks) und automatisiert die Post-Install-Schritte: ldconfig und systemctl restart apache2/httpd auf
Linux, brew services restart httpd auf macOS (unter sudo mit
Rechte-R|+ckgabe an den aufrufenden Benutzer).
* Plattformkorrekte Bibliotheksnamen (.dylib auf macOS, .so sonst); make
clean r|numt nach einem Versionswechsel auch Artefakte der Vorversion weg.
Dokumentation und Tests:
* Die DocBook-Referenz (doc/quickref.xml) wird wieder gepflegt und deckt
alle Commands ab, inklusive JWT, SSE, Sessions und der neuen Utilities;
das HTML wird offline |+ber den lokalen XML-Katalog (docbook +
docbook-xsl) mit make in doc/ erzeugt und unter obiger URL ver||ffentlicht.
* Die Testsuite ist auf 526 Tests gewachsen (521 passed, 5 skipped, 0
failed) rCo neu abgedeckt: JWT, SSE-Framing, Encoding-Aufl||sung, Multipart-UTF-8, Session-Lifecycle, JSON-Dispatch und die Response-Helfer.
N|nchstes To-do auf der Roadmap: Tcl-9-Kompatibilit|nt.
--- Synchronet 3.22a-Linux NewsLink 1.2