const classafSleepSafe::SleepSafeMiddleware

sys::Obj
  afSleepSafe::SleepSafeMiddleware : afBedSheet::Middleware

BedSheet middleware that invokes the Guards.

SleepSafeMiddleware is contributed with the following:

@Contribute { serviceType=MiddlewarePipeline# }
Void contributeMiddleware(Configuration config, SleepSafeMiddleware middleware) {
    config.set("afSleepSafe.guards", middleware).after("afBedSheet.assets").before("afBedSheet.routes")
}

Assets are not purposely not protected to prevent HTTP sessions being loaded (potentially from a database) on every request. Override Middleware ordering to change this behaviour.

guards

Source

const Guard[] guards

The Guards used to protect / reject each HTTP request.

rejectSuspectedAttack

Source

virtual Void rejectSuspectedAttack(Str msg)

Hook to respond to failed Guard checks. Defaults to logging the msg (at warn level) and processes a 403 status.