Skip to content

class Athena::Security::Bundle::FirewallMap
inherits Reference #

Maps requests to the firewalls configured via the ASEC::Bundle, only instantiating the firewall a request belongs to.

A request belongs to the firewall of the first request matcher matching it, while a nil request matcher matches every request.

Included modules

Athena::Security::FirewallMapInterface

Constructors#

.new(contexts : ADI::ServiceLocator(ASEC::Bundle::FirewallContext), map : Hash(String, AHTTP::RequestMatcher::Interface | Nil))#

Creates a map of the firewalls whose context the provided contexts provide by their name. The map holds the request matcher of each firewall, keyed by its name, in the order they are matched in.

View source

Methods#

#listeners(request : AHTTP::Request) : Tuple(Array(ASEC::Firewall::ListenerInterface), ASEC::Firewall::ExceptionListener | Nil)#

Returns the listeners and the exception listener of the firewall the provided request belongs to.

Returns no listeners and no exception listener if the request belongs to no firewall.

View source