Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApiFilter ¶
ApiFilter is the ONE authorization seam — ZAP middleware that authorizes every request against the static Casbin policy (authz.IsAllowed) on the resolved subject/object, denying with 403 or threading the request through to the handler via c.Next(). It runs after the tenant filter and before the record filter, exactly as the Beego BeforeRouter chain did.
func GetSessionUser ¶
GetSessionUser resolves the caller from the forwarded IAM Bearer JWT — the ONE stateless identity seam. There is no cookie or server-side session: an API/console caller presents a short-lived Bearer, verified and brand-bound in object.GetBearerUser.
func RecordMessage ¶
RecordMessage is the audit-record middleware. Beego split this into a BeforeRouter hook (stash the acting user) and an AfterExec hook (build+persist the record from the response); ZAP composes both around one c.Next() — the before-work stashes the user id, the handler runs, then the after-work reads the response envelope the handler stashed and writes the audit record. Login, signup and get-assets are exempted from the user-id stash exactly as before.
func Route ¶ added in v1.108.15
Route mounts the whole visor HTTP surface on app: the ambient filter chain (recover, CORS, static, tenant, authz, record) followed by the /v1 API. The filter order is the Beego BeforeRouter chain preserved exactly — static short- circuits before the authz seam, so an asset is never gated; every /v1 route registered after the chain is tenant-scoped, authorized and audited.
func TenantContextFilter ¶
TenantContextFilter is the ZAP middleware seam: it threads the tenant scope onto the request, then continues the chain via c.Next(). The scope transform itself is applyTenantContext, kept separate from the plumbing so it is unit- testable without a routed context.
func TransparentStatic ¶
TransparentStatic is the FIRST request filter after recover/CORS. It replaces Beego's BeforeRouter static filter one-for-one: a /v1/ request threads through (c.Next()) to the tenant/authz/record chain and the API routes; anything else is served from the web build with an index.html SPA fallback (or from the swagger root), short-circuiting the chain so no static asset is ever authz-gated or audit-recorded.