Skip to content

BolMiddleware overview

Documentation context: Pipeline-packed library, NuGet package

BolMiddleware is a net8.0 ASP.NET Core Razor class library that supplies the Business Online (BOL) page chrome and context handling to SAIF Razor Pages applications. It sits between the consuming application and the remote BOL Context, BOL Menu, Policy Header, and Policy Core APIs, and it has no database access of its own.

Purpose

  • Give consumer applications a shared BOL look and behavior: layouts, menu, policy header, and page header.
  • Carry the user's BOL web context (application, policy, claim) across applications through a short-lived cookie, the session, and the BOL Context API.
  • Consumed by BOL Razor Pages applications that inherit BolRazorLayoutStartup and derive their pages from BolContextModel, BolMenuModel, or BolPolicyModel.

Responsibilities

Key components

  • BolRazorLayoutStartup: startup base class that enables legacy BOL authentication and binds BasicAppMap.
  • BolContextModel, BolMenuModel, BolPolicyModel: chained abstract page models for context, menu, and policy header behavior.
  • WebContextService, MenuService, PolicyHeaderService, SecurityService: facades over the remote API clients.
  • BolPolicyHeaderViewComponent, BolSideMenuViewComponent, BolTopMenuViewComponent: page chrome view components.
  • _PolicyLayout, _PolicyOnlyLayout, _ContextOnlyLayout, _MenuOnlyLayout: shared Razor layouts.
  • MenuNavigation.js: browser script for menu navigation.

Behavior and notable findings

The library enforces 21 business rules (Business rules) across 17 catalogued operations (Operations and processes). Notable findings are the disabled anti-forgery validation on derived pages, cookies without Secure and SameSite attributes, a fully commented-out BolLayoutStartup, and a duplicate IBolContextApiClient registration; see Security and authorization.

Sources

  • src/BolMiddleware/BolMiddleware.csproj
  • src/BolMiddleware/BolRazorLayoutStartup.cs
  • src/BolMiddleware/BolLayoutStartup.cs
  • src/BolMiddleware/Extensions/BolMiddlewareExtensions.cs
  • src/BolMiddleware/Models/BolContextModel.cs
  • src/BolMiddleware/Models/BolMenuModel.cs
  • src/BolMiddleware/Models/BolPolicyModel.cs
  • src/BolMiddleware/wwwroot/js/MenuNavigation.js