Repository navigation
·
14 commits
to master
since this release
Immutable
release. Only release title and notes can be modified.
Security
demo/13_entra_msgraph(Entra ID / Microsoft Graph sign-in) hardened its
PKCE andstatehandling. The code verifier is now 32 bytes from
OpenSSL's random generator, 43 characters (the RFC 7636 minimum), instead
of 12 characters cut from a GUID string, andstateis 128 random bits.
The redirect handler now rejects a callback when no authorization request
is pending (previously a missingstateparameter matched the empty
session value), and removesstateand the code verifier from the
session once used. The authorize request's query values are URL-encoded,
and OpenSSL is loaded once at startup instead of on every request.
(#557)
Added
TdjServer.StrictStart(defaultFalse): an opt-in fail-fast startup
mode. Today, a broken context or a Web Component whoseInitraised is
logged and swallowed, soServer.Startreports success regardless. With
StrictStartenabled, a startup failure anywhere in the handler tree now
raises out ofServer.Startinstead. Must be set beforeStart; setting
it on an already-started server raises. (#432)TdjContextHandler.ErrorHandlernow actually works: when a Web Component
or Web Filter raises an unhandled exception, and anErrorHandleris set
on the context, it is invoked in place of the framework's default generic
500 response, with the failure detail (status code, exception class and
message) available via newTdjServerContextproperties
(LastErrorStatusCode/LastErrorExceptionClass/LastErrorExceptionMessage).
Previously the field was stored but never invoked. NoErrorHandler
configured, or the handler itself raising, falls back to exactly today's
generic response — no behavior change for contexts that don't opt in. See
demo/19_error_handlerfor a runnable example. (#528)
Fixed
TdjContextHandler.ContextMatchesnow matches a named context's bare path
with no trailing slash (e.g./appfor a context registered as"app") —
previously only/app/...matched and the bare path 404'd. This follows
the Servlet spec's request path matching rule (exact match, or prefix
followed by/), the same ruleTdjPathMapalready applies for/foo/*
patterns matching bare/foo. (#544)demo/13_entra_msgraph: the Free Pascal build read the access token
through an uninitialized variable instead of the parsed JSON, and both
builds leaked the parsed JSON object. (#557)
Documentation
- New
SECURITY.md: a hardening guide for running Daraja where untrusted
clients can reach it — resource limits through the connector's Indy
server, session growth, URL patterns vs. authorization, the
single-instance threading rule, error-page verbosity, and the caveats of
the optional units. - Added
COMMERCIAL-LICENSE.txt, the commercial license text (v1.0), next
to the AGPLLICENSE, so the dual licensing is visible in the
repository. - New illustrated page, How a web request reaches your Pascal
code,
that follows one request through the framework's building blocks, for
developers new to HTTP. Linked from the README and the API reference. - The Getting Started guide is updated for 3.4.0: Indy 10.6.3, Lazarus 4.x
/ FPC 3.2.2 named as a supported environment, and the
demo/commons→demo/commonpath typo fixed. demo/13_entra_msgraph/readme.mdnow covers configuring the Microsoft
Entra app registration and shows the consent dialog.
Internal
- New test coverage:
TdjWebFilterChain.DoFilter's zero-filter, short-circuit
(a filter that never callsNext.DoFilter) and mid-chain-exception paths,
andTdjWebFilterMapping.AppliesTo's URL-pattern matching. (#503) - New test coverage: connector/server lifecycle —
TdjHTTPConnector's
bind/activate onStart, deactivate onStop, socket release onDestroy,
double-start and stop-when-never-started as no-ops, and mutatingPort
while running leaving the live binding untouched;TdjServerBase.Handle's
guard on the wrapped handler's own started state. (#504) - New test coverage:
TdjHandlerWrapper.GetSession's three branches —
returning an existing session as-is, returningnilwhen absent and
CreateisFalse, and creating a new session via the HTTP server's
CreateSessionwhen absent andCreateisTrue. (#505) - New test coverage: the shared
TdjGenericHolder/TdjGenericWebComponent/
TdjGenericWebFilterbase classes reused by every web-component and
web-filter holder subclass — theInit(Config)/Configcontract, and
TdjGenericWebComponent's own (previously untested)GetSession. (#506) - New test coverage:
djGlobal.HTMLEncode's character escaping and
TdjInitParameters's case-sensitive key contract; audited
djPlatform/djHTTPConstantsand confirmed they're low-risk
constant/wrapper units with no code of their own left to test. (#507) - New test coverage:
TdjAbstractConfig's full contract — missing-key
lookup, case-sensitive parameter names, duplicate-key rejection,
GetInitParameterNames,SetContext's nil/same-context/different-context
rules, and theNameproperty;TdjContextConfig's inherited behavior and
IContextConfigconformance. This closes out the coverage audit from
#502. (#508) - 13 log calls in five units built their message by string concatenation
even when the level was disabled; they now useILogger's
(AFormat, AArgs)overloads.rsNoPathMapMatchFoundForgains a%s
placeholder. Five calls that also pass anExceptionare still
eager-built, becauseILoggerhas no overload for format arguments
plus an exception; that is tracked in #559. (#552) - The Delphi unit-test project (
Unittests.dproj) is built with range
checks enabled, and its unit references are fixed. - Removed the manual-only Linux Doxygen CI workflow.
- Version constant set to
3.4.0.