public function register(Application $app)
 {
     //shared firewall service
     $app['firewall'] = $app->share(function ($app) {
         $f = new Firewall($app['dispatcher']);
         $f->addSubscriber($app['firewall.configurator']);
         return $f;
     });
     //configuration service - can be used by other extensions
     //in Application::boot to register other config handlers
     $app['firewall.configurator'] = $app->share(function ($c) {
         $s = new ConfigSubscriber($app->getParameter('firewall.rules', array()));
         $s->addConfigHandler(new IpBlacklistHandler());
         $s->addConfigHandler(new IpWhitelisttHandler());
     });
 }