diff Lib/IMPL/Web/Handler/SecureCookie.pm @ 357:ec58c47edb52

web security: code cleanup, refactoring
author cin
date Fri, 18 Oct 2013 15:10:10 +0400
parents c090d9102a38
children d5c8b955bf8d
line wrap: on
line diff
--- a/Lib/IMPL/Web/Handler/SecureCookie.pm	Thu Oct 17 17:48:50 2013 +0400
+++ b/Lib/IMPL/Web/Handler/SecureCookie.pm	Fri Oct 18 15:10:10 2013 +0400
@@ -21,7 +21,7 @@
     },
     props => [  
         salt => PROP_RO,
-        _manager => PROP_RO,
+        _security => PROP_RO,
         _cookies => PROP_RW
     ]
 };
@@ -57,7 +57,7 @@
     return unless $nextHandler;
     
     my $context;
-    $this->_manager($action->security);
+    $this->_security($action->security);
     
         
     my $sid = $action->cookie('sid',qr/(\w+)/); 
@@ -66,7 +66,7 @@
     
     if ( $this->ValidateCookie($sid,$cookie,$sign) ) {
         # TODO: add a DeferredProxy to deffer a request to a data source
-        if ( $context = $this->_manager->sessions->GetById($sid) ) {
+        if ( $context = $this->_security->sessions->GetById($sid) ) {
             if ( eval { $context->auth->isa(AuthSimple) } ) {
                 my ($result,$challenge) = $context->auth->DoAuth($cookie);
  
@@ -118,7 +118,7 @@
 	        sdata => $cookie
 	    });
 	    
-	    my $context = $this->_manager->sessions->Create({
+	    my $context = $this->_security->sessions->Create({
 	        sessionId => $sid,
 	        principal => $user,
 	        auth => AuthSimple->Create(password => $cookie),