class Athena::Security::Firewall
inherits Reference
#
Calls the listeners of the firewall each request belongs to, as determined by an ASEC::FirewallMapInterface, e.g. to authenticate its user and check its access.
The listeners are called until one sets a response. The exception listener of the firewall then handles the security exceptions raised while handling the request, e.g. denying its access.
firewall_map = ASEC::FirewallMap.new
firewall_map.add(
AHTTP::RequestMatcher::Path.new(%r(^/api)),
[
ASEC::Firewall::AuthenticatorManagerListener.new(authenticator_manager),
ASEC::Firewall::AccessListener.new(token_storage, access_decision_manager, access_map),
] of ASEC::Firewall::ListenerInterface,
ASEC::Firewall::ExceptionListener.new(token_storage, ASEC::Authentication::TrustResolver.new, "api"),
)
event_dispatcher.listener ASEC::Firewall.new firewall_map
Constructors#
Methods#
#on_exception(event : AHK::Events::Exception) : Nil#
Runs before AHK::Listeners::Error, so that security exceptions are handled before being rendered as errors.