Skip to content

v3.4.0

Latest

Choose a tag to compare

@michaelJustin michaelJustin released this 14 Oct 16:57
· 14 commits to master since this release
Immutable release. Only release title and notes can be modified.
d5c72fc

Security

  • demo/13_entra_msgraph (Entra ID / Microsoft Graph sign-in) hardened its
    PKCE and state handling. 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, and state is 128 random bits.
    The redirect handler now rejects a callback when no authorization request
    is pending (previously a missing state parameter matched the empty
    session value), and removes state and 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 (default False): an opt-in fail-fast startup
    mode. Today, a broken context or a Web Component whose Init raised is
    logged and swallowed, so Server.Start reports success regardless. With
    StrictStart enabled, a startup failure anywhere in the handler tree now
    raises out of Server.Start instead. Must be set before Start; setting
    it on an already-started server raises. (#432)
  • TdjContextHandler.ErrorHandler now actually works: when a Web Component
    or Web Filter raises an unhandled exception, and an ErrorHandler is 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 new TdjServerContext properties
    (LastErrorStatusCode/LastErrorExceptionClass/LastErrorExceptionMessage).
    Previously the field was stored but never invoked. No ErrorHandler
    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_handler for a runnable example. (#528)

Fixed

  • TdjContextHandler.ContextMatches now matches a named context's bare path
    with no trailing slash (e.g. /app for 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 rule TdjPathMap already 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 AGPL LICENSE, 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/common path typo fixed.
  • demo/13_entra_msgraph/readme.md now 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 calls Next.DoFilter) and mid-chain-exception paths,
    and TdjWebFilterMapping.AppliesTo's URL-pattern matching. (#503)
  • New test coverage: connector/server lifecycle — TdjHTTPConnector's
    bind/activate on Start, deactivate on Stop, socket release on Destroy,
    double-start and stop-when-never-started as no-ops, and mutating Port
    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, returning nil when absent and
    Create is False, and creating a new session via the HTTP server's
    CreateSession when absent and Create is True. (#505)
  • New test coverage: the shared TdjGenericHolder/TdjGenericWebComponent/
    TdjGenericWebFilter base classes reused by every web-component and
    web-filter holder subclass — the Init(Config)/Config contract, 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/djHTTPConstants and 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 the Name property; TdjContextConfig's inherited behavior and
    IContextConfig conformance. 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 use ILogger's
    (AFormat, AArgs) overloads. rsNoPathMapMatchFoundFor gains a %s
    placeholder. Five calls that also pass an Exception are still
    eager-built, because ILogger has 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.