Leosac  0.8.0
Open Source Access Control
AuthFile.cpp
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 
28 #include "core/auth/User.hpp"
34 #include <chrono>
36 #include <gtest/gtest.h>
37 
42 static std::string gl_data_path;
43 
44 using namespace Leosac::Auth;
45 using namespace Leosac::Module::Auth;
46 
47 namespace Leosac
48 {
49 namespace Test
50 {
56 class AuthFileMapperTest : public ::testing::Test
57 {
58  public:
60  : doorA_(new AuthTarget("doorA"))
61  , doorB_(new AuthTarget("doorB"))
62  , doorC_(new AuthTarget("doorC"))
63  , my_card_(new Cred::RFIDCard())
64  , my_card2_(new Cred::RFIDCard())
65  , unknown_card_(new Cred::RFIDCard())
66  , my_pin_(new Cred::PinCode())
67  {
68  my_card_->card_id("aa:bb:cc:dd");
69  my_card_->nb_bits(32);
70 
71  my_card2_->card_id("cc:dd:ee:ff");
72  my_card2_->nb_bits(32);
73 
74  unknown_card_->card_id("00:00:00:00");
75  unknown_card_->nb_bits(32);
76 
77  my_pin_->pin_code("1234");
78 
79  card_and_pin_ = std::make_shared<Cred::RFIDCardPin>();
80  card_and_pin_->card().card_id("cc:dd:ee:ff");
81  card_and_pin_->card().nb_bits(32);
82  card_and_pin_->pin().pin_code("1234");
83 
84  mapper_ = new FileAuthSourceMapper(gl_data_path + "AuthFile-1.xml");
85  mapper2_ = new FileAuthSourceMapper(gl_data_path + "AuthFile-3.xml");
86  mapper3_ = new FileAuthSourceMapper(gl_data_path + "AuthFile-4.xml");
87  mapper4_ = new FileAuthSourceMapper(gl_data_path + "AuthFile-5.xml");
88  mapper5_ = new FileAuthSourceMapper(gl_data_path + "AuthFile-6.xml");
89  mapper6_ = new FileAuthSourceMapper(gl_data_path + "AuthFile-7.xml");
90  mapper7_ = new FileAuthSourceMapper(gl_data_path + "AuthFile-8.xml");
91 
92  // initialize date object.
93  std::tm date = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
94  std::tm date2;
95  std::tm date3;
96  std::tm date4;
97  std::tm date5;
98  std::time_t time_temp;
99 
100  // Monday 12h
101  date.tm_year = 114;
102  date.tm_mon = 10;
103  date.tm_mday = 3;
104  date.tm_hour = 12;
105  date5 = date4 = date3 = date2 = date;
106 
107  time_temp = std::mktime(&date);
108  date_monday_12_00 = std::chrono::system_clock::from_time_t(time_temp);
109 
110  // monday 16h31
111  date2.tm_hour = 16;
112  date2.tm_min = 31;
113  time_temp = std::mktime(&date2);
114  date_monday_16_31 = std::chrono::system_clock::from_time_t(time_temp);
115 
116  // sunday 18h50
117  date3.tm_mday = 2;
118  date3.tm_hour = 18;
119  date3.tm_min = 50;
120  time_temp = std::mktime(&date3);
121  date_sunday_18_50 = std::chrono::system_clock::from_time_t(time_temp);
122 
123  // wednesday 23h42
124  date4.tm_mday = 5;
125  date4.tm_hour = 23;
126  date4.tm_min = 42;
127  time_temp = std::mktime(&date4);
128  date_wednesday_23_42 = std::chrono::system_clock::from_time_t(time_temp);
129 
130  // thursday 14h00
131  date4.tm_mday = 6;
132  date4.tm_hour = 14;
133  date4.tm_min = 00;
134  time_temp = std::mktime(&date4);
135  date_thursday_14_00 = std::chrono::system_clock::from_time_t(time_temp);
136  }
137 
139  {
140  delete mapper_;
141  delete mapper2_;
142  delete mapper3_;
143  delete mapper4_;
144  delete mapper5_;
145  delete mapper6_;
146  delete mapper7_;
147  }
148 
149  bool is_in_group(const std::string &user_name, const std::string &group_name,
150  IAuthSourceMapper *mapper)
151  {
152  auto search_lambda = [&](UserPtr u) -> bool {
153  return u->username() == boost::algorithm::to_lower_copy(user_name);
154  };
155 
156  for (const auto &group : mapper->groups())
157  {
158  if (group->name() == group_name)
159  {
160  return std::find_if(group->members().begin(), group->members().end(),
161  search_lambda) != group->members().end();
162  }
163  }
164  return false;
165  }
166 
167  std::chrono::system_clock::time_point date_monday_12_00;
168  std::chrono::system_clock::time_point date_monday_16_31;
169  std::chrono::system_clock::time_point date_sunday_18_50;
170  std::chrono::system_clock::time_point date_wednesday_23_42;
171  std::chrono::system_clock::time_point date_thursday_14_00;
176  // for group related tests.
179  // groupe + single user permissions
181  // wiegand card + pin
183  // cred validity
185  // per-credentials schedules.
192 };
193 
197 TEST_F(AuthFileMapperTest, SimpleMapping)
198 {
199  ASSERT_FALSE(my_card_->owner().get());
200  mapper_->mapToUser(my_card_);
201  ASSERT_TRUE(my_card_->owner().get());
202  ASSERT_EQ("my_user", my_card_->owner()->username());
203 
204  // MY_USER with a PIN Code.
205  ASSERT_FALSE(my_pin_->owner().get());
206  mapper_->mapToUser(my_pin_);
207  ASSERT_TRUE(my_pin_->owner().get());
208  ASSERT_EQ("my_user", my_pin_->owner()->username());
209 
210  ASSERT_FALSE(my_card2_->owner().get());
211  mapper_->mapToUser(my_card2_);
212  ASSERT_TRUE(my_card2_->owner().get());
213  ASSERT_EQ("toto", my_card2_->owner()->username());
214 }
215 
220 TEST_F(AuthFileMapperTest, TimeFrameMapping)
221 {
222  mapper_->mapToUser(my_card_);
223  ASSERT_TRUE(my_card_->owner().get());
224  IAccessProfilePtr profile = mapper_->buildProfile(my_card_);
225  // with wiegand card
226  ASSERT_TRUE(profile.get());
227 
228  ASSERT_TRUE(profile->isAccessGranted(date_monday_12_00, doorA_));
229  ASSERT_TRUE(profile->isAccessGranted(date_monday_16_31, doorA_));
230  ASSERT_FALSE(profile->isAccessGranted(date_thursday_14_00, doorA_));
231 
232  ASSERT_TRUE(profile->isAccessGranted(date_monday_12_00, doorB_));
233  ASSERT_TRUE(profile->isAccessGranted(date_monday_16_31, doorB_));
234  ASSERT_FALSE(profile->isAccessGranted(date_thursday_14_00, doorB_));
235 
236  ASSERT_TRUE(profile->isAccessGranted(date_sunday_18_50, doorA_));
237  ASSERT_TRUE(profile->isAccessGranted(date_sunday_18_50, doorB_));
238 
239  // same profile. but using a PIN code instead.
240  mapper_->mapToUser(my_pin_);
241  ASSERT_TRUE(my_pin_->owner().get());
242  IAccessProfilePtr profile_from_pin = mapper_->buildProfile(my_pin_);
243  // with pin code.
244  ASSERT_TRUE(profile_from_pin.get());
245 
246  ASSERT_TRUE(profile_from_pin->isAccessGranted(date_monday_12_00, doorA_));
247  ASSERT_TRUE(profile_from_pin->isAccessGranted(date_monday_16_31, doorA_));
248  ASSERT_FALSE(profile_from_pin->isAccessGranted(date_thursday_14_00, doorA_));
249 
250  ASSERT_TRUE(profile_from_pin->isAccessGranted(date_monday_12_00, doorB_));
251  ASSERT_TRUE(profile_from_pin->isAccessGranted(date_monday_16_31, doorB_));
252  ASSERT_FALSE(profile_from_pin->isAccessGranted(date_thursday_14_00, doorB_));
253 
254  ASSERT_TRUE(profile_from_pin->isAccessGranted(date_sunday_18_50, doorA_));
255  ASSERT_TRUE(profile_from_pin->isAccessGranted(date_sunday_18_50, doorB_));
256 }
257 
261 TEST_F(AuthFileMapperTest, TimeFrameMapping2)
262 {
263  mapper_->mapToUser(my_card_);
264  mapper_->mapToUser(my_card2_);
265  ASSERT_TRUE(my_card_->owner().get());
266  ASSERT_TRUE(my_card2_->owner().get());
267  IAccessProfilePtr profile_myuser = mapper_->buildProfile(my_card_);
268  IAccessProfilePtr profile_toto = mapper_->buildProfile(my_card2_);
269  ASSERT_TRUE(profile_myuser.get());
270  ASSERT_TRUE(profile_toto.get());
271 
272 
273  ASSERT_TRUE(profile_myuser->isAccessGranted(date_sunday_18_50, doorC_));
274  ASSERT_TRUE(profile_myuser->isAccessGranted(date_monday_16_31, doorC_));
275 
276  ASSERT_TRUE(profile_toto->isAccessGranted(date_sunday_18_50, doorA_));
277  ASSERT_TRUE(profile_toto->isAccessGranted(date_sunday_18_50, doorB_));
278  ASSERT_TRUE(profile_toto->isAccessGranted(date_sunday_18_50, doorC_));
279  ASSERT_FALSE(profile_toto->isAccessGranted(date_monday_16_31, doorC_));
280 }
281 
285 TEST_F(AuthFileMapperTest, NotFoundMapping)
286 {
287  ASSERT_FALSE(unknown_card_->owner().get());
288  mapper_->mapToUser(unknown_card_);
289  ASSERT_FALSE(unknown_card_->owner().get());
290 }
291 
296 {
297  ASSERT_THROW(std::unique_ptr<IAuthSourceMapper> faulty_mapper(
298  new FileAuthSourceMapper(gl_data_path + "no_file")),
300 }
301 
305 TEST_F(AuthFileMapperTest, InvalidFileContent)
306 {
307  ASSERT_THROW(
308  {
309  std::unique_ptr<IAuthSourceMapper> faulty_mapper(
310  new FileAuthSourceMapper(gl_data_path + "AuthFile-2.xml"));
311  faulty_mapper->mapToUser(my_card_);
312  },
314 }
315 
316 TEST_F(AuthFileMapperTest, TestGroupMapping)
317 {
318  ASSERT_TRUE(is_in_group("my_user", "Admins", mapper2_));
319  ASSERT_TRUE(is_in_group("toto", "Admins", mapper2_));
320 
321  ASSERT_FALSE(is_in_group("useless", "Admins", mapper2_));
322  ASSERT_TRUE(is_in_group("useless", "random_group", mapper2_));
323 }
324 
325 TEST_F(AuthFileMapperTest, TestMultiGroupMapping)
326 {
327  // MY_USER has 4 two group here.
328  ASSERT_TRUE(is_in_group("my_user", "Admins", mapper3_));
329  ASSERT_TRUE(is_in_group("my_user", "Operators", mapper3_));
330  ASSERT_TRUE(is_in_group("my_user", "Users", mapper3_));
331  ASSERT_TRUE(is_in_group("my_user", "YetAnotherGroup", mapper3_));
332  ASSERT_FALSE(is_in_group("my_user", "group_doesnt_exists", mapper3_));
333 
334  ASSERT_FALSE(is_in_group("toto", "Operators", mapper3_));
335  ASSERT_TRUE(is_in_group("toto", "Admins", mapper3_));
336  ASSERT_TRUE(is_in_group("toto", "Users", mapper3_));
337 }
338 
342 TEST_F(AuthFileMapperTest, TestGroupPermission)
343 {
344  mapper2_->mapToUser(my_card_);
345 
346  auto profile = mapper2_->buildProfile(my_card_);
347  ASSERT_TRUE(profile.get());
348  ASSERT_TRUE(is_in_group("my_user", "Admins", mapper2_));
349 
350  ASSERT_TRUE(profile->isAccessGranted(date_monday_12_00, doorA_));
351  ASSERT_FALSE(profile->isAccessGranted(date_monday_16_31, doorA_));
352 
353  ASSERT_FALSE(profile->isAccessGranted(date_monday_12_00, doorB_));
354  ASSERT_TRUE(profile->isAccessGranted(date_monday_16_31, doorB_));
355 
356  ASSERT_TRUE(profile->isAccessGranted(date_sunday_18_50, doorA_));
357  ASSERT_TRUE(profile->isAccessGranted(date_sunday_18_50, doorB_));
358 
359  ASSERT_TRUE(profile->isAccessGranted(date_sunday_18_50, doorC_));
360  ASSERT_FALSE(profile->isAccessGranted(date_monday_16_31, doorC_));
361 }
362 
367 TEST_F(AuthFileMapperTest, TestMultiGroupPermission)
368 {
369  mapper3_->mapToUser(my_card_);
370  mapper3_->mapToUser(my_card2_);
371 
372  auto profile = mapper3_->buildProfile(my_card_);
373  auto profile_toto = mapper3_->buildProfile(my_card2_);
374  ASSERT_TRUE(profile.get());
375  ASSERT_TRUE(profile_toto.get());
376 
377  ASSERT_TRUE(profile->isAccessGranted(date_monday_12_00, doorA_));
378  ASSERT_FALSE(profile->isAccessGranted(date_monday_16_31, doorA_));
379 
380  ASSERT_FALSE(profile->isAccessGranted(date_monday_12_00, doorB_));
381  ASSERT_TRUE(profile->isAccessGranted(date_monday_16_31, doorB_));
382 
383  ASSERT_TRUE(profile->isAccessGranted(date_sunday_18_50, doorA_));
384  ASSERT_TRUE(profile->isAccessGranted(date_sunday_18_50, doorB_));
385 
386  ASSERT_TRUE(profile->isAccessGranted(date_sunday_18_50, doorC_));
387  ASSERT_TRUE(profile->isAccessGranted(date_monday_16_31, doorC_));
388 
389  // full wednesday access because of group user
390  ASSERT_TRUE(profile->isAccessGranted(date_wednesday_23_42, doorA_));
391  ASSERT_TRUE(profile->isAccessGranted(date_wednesday_23_42, doorB_));
392  ASSERT_TRUE(profile->isAccessGranted(date_wednesday_23_42, doorC_));
393 
394  // doorA and B access thursday because of group YetAnotherGroup
395  ASSERT_TRUE(profile->isAccessGranted(date_thursday_14_00, doorA_));
396  ASSERT_TRUE(profile->isAccessGranted(date_thursday_14_00, doorB_));
397  ASSERT_FALSE(profile->isAccessGranted(date_thursday_14_00, doorC_));
398 
399  // Toto is in users, but not YetAnotherGroup. Should only have access to doorA
400  ASSERT_TRUE(profile_toto->isAccessGranted(date_thursday_14_00, doorA_));
401  ASSERT_FALSE(profile_toto->isAccessGranted(date_thursday_14_00, doorB_));
402  ASSERT_FALSE(profile_toto->isAccessGranted(date_thursday_14_00, doorC_));
403 }
404 
409 TEST_F(AuthFileMapperTest, TestGroupAndUserPermission)
410 {
411  mapper4_->mapToUser(my_card_);
412  mapper4_->mapToUser(my_card2_);
413 
414  auto profile = mapper4_->buildProfile(my_card_);
415  auto profile_toto = mapper4_->buildProfile(my_card2_);
416  ASSERT_TRUE(profile.get());
417  ASSERT_TRUE(profile_toto.get());
418 
419  ASSERT_TRUE(profile->isAccessGranted(date_sunday_18_50, doorB_));
420  ASSERT_TRUE(profile_toto->isAccessGranted(date_sunday_18_50, doorB_));
421 
422  ASSERT_TRUE(profile->isAccessGranted(date_thursday_14_00, doorA_));
423  ASSERT_TRUE(profile_toto->isAccessGranted(date_thursday_14_00, doorA_));
424 
425  ASSERT_TRUE(profile->isAccessGranted(date_sunday_18_50, doorA_));
426  ASSERT_FALSE(profile_toto->isAccessGranted(date_sunday_18_50, doorA_));
427 }
428 
430 {
431  mapper4_->mapToUser(unknown_card_);
432  auto profile = mapper4_->buildProfile(unknown_card_);
433  ASSERT_FALSE(profile.get());
434 }
435 
436 TEST_F(AuthFileMapperTest, TestWiegandCardAndPin)
437 {
438  mapper5_->mapToUser(card_and_pin_);
439  auto profile_toto = mapper5_->buildProfile(card_and_pin_);
440  ASSERT_TRUE(profile_toto.get());
441 
442  ASSERT_TRUE(profile_toto->isAccessGranted(date_sunday_18_50, doorA_));
443  ASSERT_TRUE(profile_toto->isAccessGranted(date_sunday_18_50, doorB_));
444  ASSERT_TRUE(profile_toto->isAccessGranted(date_sunday_18_50, doorC_));
445  ASSERT_FALSE(profile_toto->isAccessGranted(date_monday_16_31, doorC_));
446 }
447 
448 TEST_F(AuthFileMapperTest, TestUserValidityLimit)
449 {
450  mapper5_->mapToUser(my_card_);
451  mapper5_->mapToUser(my_card2_);
452  mapper5_->mapToUser(my_pin_);
453  // this user is disabled. should have a NULL profile.
454  auto profile_llamasticot = mapper5_->buildProfile(my_card_);
455  ASSERT_FALSE(profile_llamasticot.get());
456 
457  auto profile_llama1 = mapper5_->buildProfile(my_card2_);
458  ASSERT_TRUE(profile_llama1.get());
459 
460  auto profile_llama2 = mapper5_->buildProfile(my_pin_);
461  ASSERT_FALSE(profile_llama2.get());
462 }
463 
464 TEST_F(AuthFileMapperTest, TestCredentialsValidityLimit)
465 {
466  mapper6_->mapToUser(my_card_);
467  mapper6_->mapToUser(my_card2_);
468  mapper6_->mapToUser(my_pin_);
469  // this user is disabled. shouldn't have a profile.
470  auto profile_llamasticot = mapper6_->buildProfile(my_card_);
471  ASSERT_FALSE(profile_llamasticot.get());
472 
473  auto profile_llama1 = mapper6_->buildProfile(my_card2_);
474  ASSERT_TRUE(profile_llama1.get());
475 
476  auto profile_llama2 = mapper6_->buildProfile(my_pin_);
477  ASSERT_FALSE(profile_llama2.get());
478 }
479 
480 TEST_F(AuthFileMapperTest, TestCredentialSchedule)
481 {
482  mapper7_->mapToUser(my_card_);
483  mapper7_->mapToUser(my_pin_);
484  auto profile = mapper7_->buildProfile(my_card_);
485 
486  // this maps to the same user, but use a credential
487  // with additional schedules.
488  auto profile_magic_cred = mapper7_->buildProfile(my_pin_);
489 
490  ASSERT_TRUE(profile.get());
491  ASSERT_TRUE(profile_magic_cred.get());
492 
493  // User permissions.
494  ASSERT_TRUE(profile->isAccessGranted(date_monday_12_00, nullptr));
495  ASSERT_TRUE(profile->isAccessGranted(date_monday_16_31, nullptr));
496 
497  ASSERT_TRUE(profile_magic_cred->isAccessGranted(date_monday_12_00, nullptr));
498  ASSERT_TRUE(profile_magic_cred->isAccessGranted(date_monday_16_31, nullptr));
499  // Not allowed
500  ASSERT_FALSE(profile->isAccessGranted(date_sunday_18_50, nullptr));
501  ASSERT_FALSE(profile->isAccessGranted(date_wednesday_23_42, doorB_));
502  ASSERT_FALSE(profile->isAccessGranted(date_wednesday_23_42, doorC_));
503  ASSERT_FALSE(profile->isAccessGranted(date_wednesday_23_42, nullptr));
504 
505  ASSERT_FALSE(profile_magic_cred->isAccessGranted(date_sunday_18_50, nullptr));
506  ASSERT_FALSE(profile_magic_cred->isAccessGranted(date_wednesday_23_42, doorB_));
507  ASSERT_FALSE(profile_magic_cred->isAccessGranted(date_wednesday_23_42, doorC_));
508  ASSERT_FALSE(profile_magic_cred->isAccessGranted(date_wednesday_23_42, nullptr));
509 
510  // Per credentials schedule
511  ASSERT_TRUE(profile_magic_cred->isAccessGranted(date_wednesday_23_42, doorA_));
512  ASSERT_TRUE(profile_magic_cred->isAccessGranted(date_thursday_14_00, nullptr));
513  // if we used the "normal" those default permission shall fail
514  ASSERT_FALSE(profile->isAccessGranted(date_wednesday_23_42, doorA_));
515  ASSERT_FALSE(profile->isAccessGranted(date_thursday_14_00, nullptr));
516 }
517 
522 TEST_F(AuthFileMapperTest, TestReservedUserID)
523 {
524  ASSERT_THROW(
525  {
526  std::unique_ptr<IAuthSourceMapper> faulty_mapper(
527  new FileAuthSourceMapper(gl_data_path + "AuthFile-9.xml"));
528  },
530  // Nested exception. The original type is a ConfigException.
531 }
532 }
533 }
534 
535 int main(int argc, char **argv)
536 {
537  ::testing::InitGoogleTest(&argc, argv);
538 
539  // gtest shall leave us with our arguments.
540  // argv[1] shall be the path to test data file
541  assert(argc == 2);
542  gl_data_path = std::string(argv[1]) + '/';
543  return RUN_ALL_TESTS();
544 }
Leosac::Auth
Holds classes relevant to the Authentication and Authorization subsystem.
Definition: AccessPoint.hpp:27
Leosac::Test::AuthFileMapperTest::date_monday_16_31
std::chrono::system_clock::time_point date_monday_16_31
Definition: AuthFile.cpp:168
Leosac::Auth::AuthTarget
Represent an object that we are authorizing against (a door).
Definition: AuthTarget.hpp:37
Leosac::Test::AuthFileMapperTest::doorA_
AuthTargetPtr doorA_
Definition: AuthFile.cpp:172
unixshellscript.hpp
UnixShellScript class declaration.
Leosac::Test::AuthFileMapperTest::mapper_
IAuthSourceMapper * mapper_
Definition: AuthFile.cpp:175
Leosac::Auth::IAuthSourceMapper::groups
virtual std::vector< Leosac::Auth::GroupPtr > groups() const =0
Return the groups this mapper is aware of.
Leosac::Cred::RFIDCardPtr
std::shared_ptr< RFIDCard > RFIDCardPtr
Definition: CredentialFwd.hpp:43
Leosac::Auth::IAuthSourceMapper::mapToUser
virtual void mapToUser(Cred::ICredentialPtr cred)=0
Must map the ICredential data to a User.
Leosac::Auth::UserPtr
std::shared_ptr< User > UserPtr
Definition: AuthFwd.hpp:31
moduleexception.hpp
Exception class for modules.
Leosac::Test::AuthFileMapperTest
Test the mapping of wiegand-card to user from a file.
Definition: AuthFile.cpp:56
RFIDCard.hpp
User.hpp
Leosac::Test::AuthFileMapperTest::mapper5_
IAuthSourceMapper * mapper5_
Definition: AuthFile.cpp:182
Leosac::Test::TEST_F
TEST_F(AuthFileMapperTest, TestReservedUserID)
UserID UNKNOWN_USER is reserved to prevent confusion in the log file.
Definition: AuthFile.cpp:522
Leosac::Test::AuthFileMapperTest::AuthFileMapperTest
AuthFileMapperTest()
Definition: AuthFile.cpp:59
Leosac::Auth::IAccessProfilePtr
std::shared_ptr< IAccessProfile > IAccessProfilePtr
Definition: AuthFwd.hpp:88
Leosac::Test::AuthFileMapperTest::is_in_group
bool is_in_group(const std::string &user_name, const std::string &group_name, IAuthSourceMapper *mapper)
Definition: AuthFile.cpp:149
Leosac::Test::AuthFileMapperTest::mapper6_
IAuthSourceMapper * mapper6_
Definition: AuthFile.cpp:184
ModuleException
Definition: moduleexception.hpp:33
Leosac::Test::AuthFileMapperTest::mapper7_
IAuthSourceMapper * mapper7_
Definition: AuthFile.cpp:186
Leosac::Auth::AuthTargetPtr
std::shared_ptr< AuthTarget > AuthTargetPtr
Definition: AuthFwd.hpp:93
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::Test::AuthFileMapperTest::date_wednesday_23_42
std::chrono::system_clock::time_point date_wednesday_23_42
Definition: AuthFile.cpp:170
RFIDCardPin.hpp
FileAuthSourceMapper.hpp
Leosac::Test::AuthFileMapperTest::mapper2_
IAuthSourceMapper * mapper2_
Definition: AuthFile.cpp:177
Leosac::Test::AuthFileMapperTest::my_card_
Cred::RFIDCardPtr my_card_
Definition: AuthFile.cpp:187
Leosac::Test::AuthFileMapperTest::date_monday_12_00
std::chrono::system_clock::time_point date_monday_12_00
Definition: AuthFile.cpp:167
Leosac::Cred::PinCodePtr
std::shared_ptr< PinCode > PinCodePtr
Definition: CredentialFwd.hpp:47
main
int main(int argc, char **argv)
Definition: AuthFile.cpp:535
Leosac::Test::AuthFileMapperTest::date_sunday_18_50
std::chrono::system_clock::time_point date_sunday_18_50
Definition: AuthFile.cpp:169
Leosac::Test::AuthFileMapperTest::my_pin_
Cred::PinCodePtr my_pin_
Definition: AuthFile.cpp:190
PinCode.hpp
Leosac::Test::AuthFileMapperTest::date_thursday_14_00
std::chrono::system_clock::time_point date_thursday_14_00
Definition: AuthFile.cpp:171
Leosac::Test::AuthFileMapperTest::doorC_
AuthTargetPtr doorC_
Definition: AuthFile.cpp:174
Leosac::Auth::IAuthSourceMapper
Base class to perform abstracted mapping operation over various AuthSource object.
Definition: IAuthSourceMapper.hpp:43
Leosac::Test::AuthFileMapperTest::card_and_pin_
Cred::RFIDCardPinPtr card_and_pin_
Definition: AuthFile.cpp:191
Leosac::Test::AuthFileMapperTest::~AuthFileMapperTest
~AuthFileMapperTest()
Definition: AuthFile.cpp:138
Leosac::Cred::RFIDCardPinPtr
std::shared_ptr< RFIDCardPin > RFIDCardPinPtr
Definition: CredentialFwd.hpp:50
Leosac::Test::AuthFileMapperTest::mapper4_
IAuthSourceMapper * mapper4_
Definition: AuthFile.cpp:180
Leosac::Test::AuthFileMapperTest::mapper3_
IAuthSourceMapper * mapper3_
Definition: AuthFile.cpp:178
IAuthSourceMapper.hpp
Leosac::Module::Auth
Authentication backend modules live here.
Leosac::Test::AuthFileMapperTest::my_card2_
Cred::RFIDCardPtr my_card2_
Definition: AuthFile.cpp:188
Leosac::Test::AuthFileMapperTest::unknown_card_
Cred::RFIDCardPtr unknown_card_
Definition: AuthFile.cpp:189
Leosac::Test::AuthFileMapperTest::doorB_
AuthTargetPtr doorB_
Definition: AuthFile.cpp:173
Leosac::Module::Auth::FileAuthSourceMapper
Use a file to map auth source (card, PIN, etc) to user.
Definition: FileAuthSourceMapper.hpp:47