Mercurial > pub > Impl
comparison Lib/IMPL/Web/Handler/SecureCookie.pm @ 340:c090d9102a38
web application security refactoring
author | cin |
---|---|
date | Fri, 21 Jun 2013 02:43:56 +0400 |
parents | 97628101b765 |
children | ec58c47edb52 |
comparison
equal
deleted
inserted
replaced
339:97628101b765 | 340:c090d9102a38 |
---|---|
55 my ($this,$action,$nextHandler) = @_; | 55 my ($this,$action,$nextHandler) = @_; |
56 | 56 |
57 return unless $nextHandler; | 57 return unless $nextHandler; |
58 | 58 |
59 my $context; | 59 my $context; |
60 $this->_manager($action->application->security->new()); | 60 $this->_manager($action->security); |
61 | 61 |
62 | 62 |
63 my $sid = $action->cookie('sid',qr/(\w+)/); | 63 my $sid = $action->cookie('sid',qr/(\w+)/); |
64 my $cookie = $action->cookie('sdata',qr/(\w+)/); | 64 my $cookie = $action->cookie('sdata',qr/(\w+)/); |
65 my $sign = $action->cookie('sign',qw/(\w+)/); | 65 my $sign = $action->cookie('sign',qw/(\w+)/); |
84 | 84 |
85 $context ||= SecurityContext->new(principal => User->nobody, authority => $this); | 85 $context ||= SecurityContext->new(principal => User->nobody, authority => $this); |
86 | 86 |
87 my $httpResponse = eval { $context->Impersonate($nextHandler,$action); }; | 87 my $httpResponse = eval { $context->Impersonate($nextHandler,$action); }; |
88 my $e = $@; | 88 my $e = $@; |
89 | |
90 $this->_manager->Dispose(); | |
91 | 89 |
92 die $e if $e; | 90 die $e if $e; |
93 | 91 |
94 die OperationException->new("A HttpResponse instance is expected") | 92 die OperationException->new("A HttpResponse instance is expected") |
95 unless ref $httpResponse && eval { $httpResponse->isa(HttpResponse) }; | 93 unless ref $httpResponse && eval { $httpResponse->isa(HttpResponse) }; |