Leosac  0.8.0
Open Source Access Control
AuditFwd.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2016 Leosac
3 
4  This file is part of Leosac.
5 
6  Leosac is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Affero General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Leosac is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include <cstddef>
23 #include <flagset.hpp>
24 #include <memory>
25 #include <odb/lazy-ptr.hxx>
26 
27 namespace Leosac
28 {
29 namespace Audit
30 {
31 using AuditEntryId = unsigned long;
32 
33 class Factory;
34 
39 class IAuditEntry;
40 using IAuditEntryPtr = std::shared_ptr<IAuditEntry>;
41 
42 class IAuditTracker;
43 using IAuditTrackerPtr = std::shared_ptr<IAuditTracker>;
44 
45 class IUserEvent;
46 using IUserEventPtr = std::shared_ptr<IUserEvent>;
47 
48 class IGroupEvent;
49 using IGroupEventPtr = std::shared_ptr<IGroupEvent>;
50 
51 class IWSAPICall;
52 using IWSAPICallPtr = std::shared_ptr<IWSAPICall>;
53 
55 using IUserGroupMembershipEventPtr = std::shared_ptr<IUserGroupMembershipEvent>;
56 
57 class ICredentialEvent;
58 using ICredentialEventPtr = std::shared_ptr<ICredentialEvent>;
59 
60 class IScheduleEvent;
61 using IScheduleEventPtr = std::shared_ptr<IScheduleEvent>;
62 
63 class IDoorEvent;
64 using IDoorEventPtr = std::shared_ptr<IDoorEvent>;
65 
66 class IAccessPointEvent;
67 using IAccessPointEventPtr = std::shared_ptr<IAccessPointEvent>;
68 
69 class IUpdateEvent;
70 using IUpdateEventPtr = std::shared_ptr<IUpdateEvent>;
71 
72 class IZoneEvent;
73 using IZoneEventPtr = std::shared_ptr<IZoneEvent>;
74 
79 class AuditEntry;
80 using AuditEntryLPtr = odb::lazy_shared_ptr<AuditEntry>;
81 using AuditEntryPtr = std::shared_ptr<AuditEntry>;
82 using AuditEntryWPtr = std::weak_ptr<AuditEntry>;
83 
84 class AuditTracker;
85 using AuditTrackerPtr = std::shared_ptr<AuditTracker>;
86 using AuditTrackerWPtr = std::weak_ptr<AuditTracker>;
87 
88 class WSAPICall;
89 using WSAPICallUPtr = std::unique_ptr<WSAPICall>;
90 using WSAPICallPtr = std::shared_ptr<WSAPICall>;
91 
92 class UserEvent;
93 using UserEventPtr = std::shared_ptr<UserEvent>;
94 
95 class GroupEvent;
96 using GroupEventPtr = std::shared_ptr<GroupEvent>;
97 
99 using UserGroupMembershipEventPtr = std::shared_ptr<UserGroupMembershipEvent>;
100 
101 class CredentialEvent;
102 using CredentialEventPtr = std::shared_ptr<CredentialEvent>;
103 
104 class ScheduleEvent;
105 using ScheduleEventPtr = std::shared_ptr<ScheduleEvent>;
106 
107 class DoorEvent;
108 using DoorEventPtr = std::shared_ptr<DoorEvent>;
109 
110 class AccessPointEvent;
111 using AccessPointEventPtr = std::shared_ptr<AccessPointEvent>;
112 
113 class UpdateEvent;
114 using UpdateEventPtr = std::shared_ptr<UpdateEvent>;
115 
116 class ZoneEvent;
117 using ZoneEventPtr = std::shared_ptr<ZoneEvent>;
118 
119 enum class EventType
120 {
121  WSAPI_CALL,
122  USER_CREATED,
123  USER_DELETED,
124  USER_EDITED,
130 
142 
146 
150 
151  DOOR_CREATED,
152  DOOR_UPDATED,
153  DOOR_DELETED,
163 
167 
169  UPDATE_ACKED,
171 
172  ZONE_CREATED,
173  ZONE_UPDATED,
174  ZONE_DELETED,
175 
176  LAST__
177 };
178 
179 using EventMask = FlagSet<EventType>;
180 }
181 }
Leosac::Audit::EventType::ACCESS_POINT_CREATED
@ ACCESS_POINT_CREATED
Leosac::Audit::EventType::USER_CREATED
@ USER_CREATED
Leosac::Audit::EventType::GROUP_CREATED
@ GROUP_CREATED
Leosac::Audit::UserEventPtr
std::shared_ptr< UserEvent > UserEventPtr
Definition: AuditFwd.hpp:93
Leosac::Audit::EventType::UPDATE_CANCELLED
@ UPDATE_CANCELLED
Leosac::Audit::IAuditTracker
The AuditTracker class provides the ability to "track" the audit log and acknowledge its entries.
Definition: IAuditTracker.hpp:35
Leosac::Audit::IAuditTrackerPtr
std::shared_ptr< IAuditTracker > IAuditTrackerPtr
Definition: AuditFwd.hpp:43
Leosac::Audit::DoorEvent
Provides an implementation of IDoorEvent.
Definition: DoorEvent.hpp:33
Leosac::Audit::AuditEntryPtr
std::shared_ptr< AuditEntry > AuditEntryPtr
Definition: AuditFwd.hpp:81
Leosac::Audit::EventType::DOOR_UPDATED
@ DOOR_UPDATED
Leosac::Audit::IGroupEvent
Interface that describes an Audit object for group related event.
Definition: IGroupEvent.hpp:36
Leosac::Audit::EventType::CREDENTIAL_CREATED
@ CREDENTIAL_CREATED
Leosac::Audit::IDoorEvent
Interface that describes an Audit object for door related event.
Definition: IDoorEvent.hpp:32
Leosac::Audit::EventType::CREDENTIAL_UPDATED
@ CREDENTIAL_UPDATED
Leosac::Audit::ICredentialEvent
Audit interface to Credential related events.
Definition: ICredentialEvent.hpp:32
Leosac::Audit::IAccessPointEventPtr
std::shared_ptr< IAccessPointEvent > IAccessPointEventPtr
Definition: AuditFwd.hpp:67
Leosac::Audit::EventType::GROUP_MEMBERSHIP_JOINED
@ GROUP_MEMBERSHIP_JOINED
Someone joined the group.
Leosac::Audit::WSAPICallUPtr
std::unique_ptr< WSAPICall > WSAPICallUPtr
Definition: AuditFwd.hpp:89
Leosac::Audit::AuditEntryId
unsigned long AuditEntryId
Definition: AuditFwd.hpp:31
Leosac::Audit::AuditEntryLPtr
odb::lazy_shared_ptr< AuditEntry > AuditEntryLPtr
Definition: AuditFwd.hpp:80
Leosac::Audit::EventType::ZONE_CREATED
@ ZONE_CREATED
Leosac::Audit::EventType::SCHEDULE_UPDATED
@ SCHEDULE_UPDATED
Leosac::Audit::IZoneEventPtr
std::shared_ptr< IZoneEvent > IZoneEventPtr
Definition: AuditFwd.hpp:73
Leosac::Audit::AccessPointEvent
Provides an implementation of IAccessPointEvent.
Definition: AccessPointEvent.hpp:33
Leosac::Audit::IUserEvent
Interface that describes an Audit object when a user-related event happens.
Definition: IUserEvent.hpp:37
Leosac::Audit::ZoneEvent
Provides an implementation of IZoneEvent.
Definition: ZoneEvent.hpp:33
Leosac::Audit::IAuditEntryPtr
std::shared_ptr< IAuditEntry > IAuditEntryPtr
Definition: AuditFwd.hpp:40
Leosac::Audit::EventType::ZONE_DELETED
@ ZONE_DELETED
Leosac::Audit::EventType::MAPPING_MAY_HAVE_CHANGED
@ MAPPING_MAY_HAVE_CHANGED
This event is linked to door.
Leosac::Audit::GroupEventPtr
std::shared_ptr< GroupEvent > GroupEventPtr
Definition: AuditFwd.hpp:96
Leosac::Audit::AuditEntryWPtr
std::weak_ptr< AuditEntry > AuditEntryWPtr
Definition: AuditFwd.hpp:82
Leosac::Audit::EventType::LAST__
@ LAST__
Leosac::Audit::UserEvent
Provides an implementation of IUserEvent.
Definition: UserEvent.hpp:33
Leosac::Audit::IAccessPointEvent
Interface that describes an Audit object for AccessPoint related event.
Definition: IAccessPointEvent.hpp:33
Leosac::Audit::UpdateEventPtr
std::shared_ptr< UpdateEvent > UpdateEventPtr
Definition: AuditFwd.hpp:114
Leosac::Audit::UserGroupMembershipEvent
Provides an implementation of IUserGroupMembershipEvent.
Definition: UserGroupMembershipEvent.hpp:33
Leosac::Audit::EventType::ACCESS_POINT_DELETED
@ ACCESS_POINT_DELETED
Leosac::Audit::AuditTracker
Implementation of IAuditTracker, backed by ODB.
Definition: AuditTracker.hpp:38
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::Audit::CredentialEvent
Provides an implementation of ICredentialEvent.
Definition: CredentialEvent.hpp:35
Leosac::Audit::UpdateEvent
Provides an implementation of IUpdateEvent.
Definition: UpdateEvent.hpp:33
Leosac::Audit::EventType::GROUP_DELETED
@ GROUP_DELETED
Leosac::Audit::EventType::ACCESS_POINT_UPDATED
@ ACCESS_POINT_UPDATED
Leosac::Audit::EventType
EventType
Definition: AuditFwd.hpp:119
Leosac::Audit::IUserEventPtr
std::shared_ptr< IUserEvent > IUserEventPtr
Definition: AuditFwd.hpp:46
Leosac::Audit::EventType::CREDENTIAL_DELETED
@ CREDENTIAL_DELETED
Leosac::Audit::Factory
Provide static methods to instanciate various Audit objects.
Definition: AuditFactory.hpp:46
Leosac::Audit::EventType::USER_PASSWORD_CHANGE_FAILURE
@ USER_PASSWORD_CHANGE_FAILURE
An attempt to change the password failed.
Leosac::Audit::EventType::USER_DELETED
@ USER_DELETED
Leosac::Audit::EventType::SCHEDULE_DELETED
@ SCHEDULE_DELETED
Leosac::Audit::EventMask
FlagSet< EventType > EventMask
Definition: AuditFwd.hpp:179
Leosac::Audit::ScheduleEventPtr
std::shared_ptr< ScheduleEvent > ScheduleEventPtr
Definition: AuditFwd.hpp:105
Leosac::Audit::IDoorEventPtr
std::shared_ptr< IDoorEvent > IDoorEventPtr
Definition: AuditFwd.hpp:64
Leosac::Audit::EventType::USER_PASSWORD_CHANGED
@ USER_PASSWORD_CHANGED
Leosac::Audit::GroupEvent
Provides an implementation of IGroupEvent.
Definition: GroupEvent.hpp:33
Leosac::Audit::IWSAPICallPtr
std::shared_ptr< IWSAPICall > IWSAPICallPtr
Definition: AuditFwd.hpp:52
Leosac::Audit::EventType::WSAPI_CALL
@ WSAPI_CALL
Leosac::Audit::IScheduleEventPtr
std::shared_ptr< IScheduleEvent > IScheduleEventPtr
Definition: AuditFwd.hpp:61
Leosac::Audit::IScheduleEvent
Audit interface to Schedule related events.
Definition: IScheduleEvent.hpp:32
Leosac::Audit::AuditTrackerWPtr
std::weak_ptr< AuditTracker > AuditTrackerWPtr
Definition: AuditFwd.hpp:86
Leosac::Audit::EventType::SCHEDULE_CREATED
@ SCHEDULE_CREATED
Leosac::Audit::EventType::DOOR_DELETED
@ DOOR_DELETED
Leosac::Audit::EventType::GROUP_MEMBERSHIP_LEFT
@ GROUP_MEMBERSHIP_LEFT
Someone left the group.
Leosac::Audit::AuditTrackerPtr
std::shared_ptr< AuditTracker > AuditTrackerPtr
Definition: AuditFwd.hpp:85
Leosac::Audit::IAuditEntry
Base interface to Audit object.
Definition: IAuditEntry.hpp:47
Leosac::Audit::ICredentialEventPtr
std::shared_ptr< ICredentialEvent > ICredentialEventPtr
Definition: AuditFwd.hpp:58
Leosac::Audit::EventType::UPDATE_ACKED
@ UPDATE_ACKED
Leosac::Audit::CredentialEventPtr
std::shared_ptr< CredentialEvent > CredentialEventPtr
Definition: AuditFwd.hpp:102
Leosac::Audit::EventType::GROUP_UPDATED
@ GROUP_UPDATED
Leosac::Audit::EventType::USER_EDITED
@ USER_EDITED
Leosac::Audit::ZoneEventPtr
std::shared_ptr< ZoneEvent > ZoneEventPtr
Definition: AuditFwd.hpp:117
Leosac::Audit::IZoneEvent
Interface that describes an Audit object for zone related event.
Definition: IZoneEvent.hpp:32
Leosac::Audit::EventType::DOOR_CREATED
@ DOOR_CREATED
Leosac::Audit::IUpdateEvent
Interface for update-related event.
Definition: IUpdateEvent.hpp:32
Leosac::Audit::AccessPointEventPtr
std::shared_ptr< AccessPointEvent > AccessPointEventPtr
Definition: AuditFwd.hpp:111
Leosac::Audit::EventType::UPDATE_CREATED
@ UPDATE_CREATED
Leosac::Audit::AuditEntry
Implementation of IAuditEntry, backed by ODB.
Definition: AuditEntry.hpp:45
Leosac::Audit::IUserGroupMembershipEventPtr
std::shared_ptr< IUserGroupMembershipEvent > IUserGroupMembershipEventPtr
Definition: AuditFwd.hpp:55
Leosac::Audit::UserGroupMembershipEventPtr
std::shared_ptr< UserGroupMembershipEvent > UserGroupMembershipEventPtr
Definition: AuditFwd.hpp:99
Leosac::Audit::WSAPICallPtr
std::shared_ptr< WSAPICall > WSAPICallPtr
Definition: AuditFwd.hpp:90
Leosac::Audit::IUserGroupMembershipEvent
Interface to audit object that take care of tracking user/group membership change.
Definition: IUserGroupMembershipEvent.hpp:33
Leosac::Audit::IGroupEventPtr
std::shared_ptr< IGroupEvent > IGroupEventPtr
Definition: AuditFwd.hpp:49
Leosac::Audit::WSAPICall
Provides the implementation of IWSAPICall.
Definition: WSAPICall.hpp:33
Leosac::Audit::DoorEventPtr
std::shared_ptr< DoorEvent > DoorEventPtr
Definition: AuditFwd.hpp:108
Leosac::Audit::ScheduleEvent
Provides an implementation of IScheduleEvent.
Definition: ScheduleEvent.hpp:34
Leosac::Audit::IUpdateEventPtr
std::shared_ptr< IUpdateEvent > IUpdateEventPtr
Definition: AuditFwd.hpp:70
Leosac::Audit::IWSAPICall
An audit entry dedicated to tracing API call.
Definition: IWSAPICall.hpp:39
Leosac::Audit::EventType::ZONE_UPDATED
@ ZONE_UPDATED