Portal context consumption
Contract
v0.1.25 defines how reusable bus-ui runtime packages consume portal host
context. bus-portal owns creation, validation, routing, security headers,
module handoff, and asset delivery. bus-ui accepts the resulting context
through small Go interfaces and uses it to resolve paths, assets, runtime
config, session helpers, and logging callbacks.
type HostContext interface {
ModuleBase() string
AssetBase() string
APIBase() string
RuntimeConfig() PublicRuntimeConfig
Session() uisession.Session
Logger() uilog.Logger
}
Components should receive only the context fields they use. Runtime helpers can
depend on a small interface such as PathResolver, AssetResolver,
SessionProvider, or PublicConfigProvider instead of accepting the full host
object everywhere.
Requirements
-
bus-uiconsumes host context but does not create or validate portal module registrations. - Base paths and asset URLs are same-origin or host-approved.
- Public runtime config rejects sensitive-looking keys before rendering.
- Session helpers come from v0.1.24.
- Resource helpers come from v0.1.23.
- Logging callbacks accept redacted framework and provider-safe errors only.
Boundary
This patch does not move portal routing, module discovery, security headers,
tenant authorization, or product provider policy into bus-ui. It only gives
Bus UI packages a stable way to consume context supplied by the portal host.