annotate Lib/IMPL/Web/Security.pm @ 79:2d1c3f713280

ORM concept in development
author wizard
date Mon, 05 Apr 2010 00:20:34 +0400
parents 2f31ecabe9ea
children 077357224bec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
52
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
1 package IMPL::Web::Security;
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
2
73
wizard
parents: 66
diff changeset
3 use base qw(IMPL::Object IMPL::Security IMPL::Object::Autofill);
wizard
parents: 66
diff changeset
4
wizard
parents: 66
diff changeset
5 use IMPL::Class::Property;
wizard
parents: 66
diff changeset
6
wizard
parents: 66
diff changeset
7 __PACKAGE__->PassThroughArgs;
wizard
parents: 66
diff changeset
8
wizard
parents: 66
diff changeset
9 BEGIN {
79
2d1c3f713280 ORM concept in development
wizard
parents: 73
diff changeset
10 public property source => prop_all;
73
wizard
parents: 66
diff changeset
11 }
wizard
parents: 66
diff changeset
12
wizard
parents: 66
diff changeset
13 sub CTOR {
wizard
parents: 66
diff changeset
14 my ($this) = @_;
wizard
parents: 66
diff changeset
15
wizard
parents: 66
diff changeset
16 $this->dataSource or die new IMPL::InvalidArgumentException("The argument is required",'dataSource');
wizard
parents: 66
diff changeset
17 }
wizard
parents: 66
diff changeset
18
79
2d1c3f713280 ORM concept in development
wizard
parents: 73
diff changeset
19 sub RetrSession {
2d1c3f713280 ORM concept in development
wizard
parents: 73
diff changeset
20 my ($this,$sid) = @_;
2d1c3f713280 ORM concept in development
wizard
parents: 73
diff changeset
21
2d1c3f713280 ORM concept in development
wizard
parents: 73
diff changeset
22 return $this->source->RetrSession(id => $sid);
73
wizard
parents: 66
diff changeset
23 }
wizard
parents: 66
diff changeset
24
79
2d1c3f713280 ORM concept in development
wizard
parents: 73
diff changeset
25 sub RetrSecData {
2d1c3f713280 ORM concept in development
wizard
parents: 73
diff changeset
26 my ($this,$user,$secPackage) = @_;
73
wizard
parents: 66
diff changeset
27
79
2d1c3f713280 ORM concept in development
wizard
parents: 73
diff changeset
28 $user = ref $user ? $user->name : $user;
2d1c3f713280 ORM concept in development
wizard
parents: 73
diff changeset
29
2d1c3f713280 ORM concept in development
wizard
parents: 73
diff changeset
30 return
2d1c3f713280 ORM concept in development
wizard
parents: 73
diff changeset
31 $this->source->RetrSecData(user => $user, package => $secPackage);
73
wizard
parents: 66
diff changeset
32 }
wizard
parents: 66
diff changeset
33
52
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
34 1;
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
35
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
36 __END__
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
37
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
38 =pod
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
39
73
wizard
parents: 66
diff changeset
40 =head1 NAME
wizard
parents: 66
diff changeset
41
wizard
parents: 66
diff changeset
42 C<IMPL::Web::Security> Модуль для аутентификации и авторизации веб запроса.
wizard
parents: 66
diff changeset
43
wizard
parents: 66
diff changeset
44 =head1 SINOPSYS
wizard
parents: 66
diff changeset
45
wizard
parents: 66
diff changeset
46 =begin code xml
wizard
parents: 66
diff changeset
47
wizard
parents: 66
diff changeset
48 <security type='IMPL::Config::Activator'>
wizard
parents: 66
diff changeset
49 <factory>IMPL::Web::Security</factory>
wizard
parents: 66
diff changeset
50 <parameters type='HASH'>
wizard
parents: 66
diff changeset
51 <sessionFactory type='IMPL::Object::Factory'>
wizard
parents: 66
diff changeset
52 <factory type='IMPL::Object::Factory'>App::Data::Session</factory>
wizard
parents: 66
diff changeset
53 <method>insert</method>
wizard
parents: 66
diff changeset
54 </sessionFactory>
wizard
parents: 66
diff changeset
55 </parameters>
wizard
parents: 66
diff changeset
56 </security>
wizard
parents: 66
diff changeset
57
wizard
parents: 66
diff changeset
58 =end code xml
wizard
parents: 66
diff changeset
59
52
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
60 =head1 DESCRIPTION
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
61
73
wizard
parents: 66
diff changeset
62 Отвечает за инфраструктуру аутентификации и авторизации запросов. Основная особенность
wizard
parents: 66
diff changeset
63 заключается в том, что запросы приходят через значительные интевалы времени, хотя и
wizard
parents: 66
diff changeset
64 относятся к одной логической транзакции. В промежутках между запросами сервер не
wizard
parents: 66
diff changeset
65 сохраняет свое состояние. Поэтому при каждом обращении сервер восстанавливает
wizard
parents: 66
diff changeset
66 контекст безопасности.
52
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
67
73
wizard
parents: 66
diff changeset
68 C<IMPL::Web::Session> Объект обеспечивающий сохранение состояния в рамках одной сессии
wizard
parents: 66
diff changeset
69 пользователя. Кроме контекста безопасности хранит дополнительние данные, которые необходимо
wizard
parents: 66
diff changeset
70 сохранить между обработкой запросов.
52
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
71
73
wizard
parents: 66
diff changeset
72 C<IMPL::Web::User> Объект, устанавливающий связь между идентификатором пользователя
wizard
parents: 66
diff changeset
73 C<IMPL::Security::Principal>, его ролями и данными безопасности для создания объектов
wizard
parents: 66
diff changeset
74 аутентификации C<IMPL::Security::Auth>.
52
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
75
73
wizard
parents: 66
diff changeset
76 =head1 MEMBERS
52
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
77
15d720913562 security in work
wizard@linux-odin.local
parents:
diff changeset
78 =cut