Leosac
0.8.0
Open Source Access Control
|
Base class to perform abstracted mapping operation over various AuthSource object. More...
#include <IAuthSourceMapper.hpp>
Public Member Functions | |
virtual | ~IAuthSourceMapper ()=default |
virtual void | mapToUser (Cred::ICredentialPtr cred)=0 |
Must map the ICredential data to a User. More... | |
virtual IAccessProfilePtr | buildProfile (Cred::ICredentialPtr auth_source)=0 |
Build an AccessProfile object given a Credential. More... | |
virtual std::vector< Leosac::Auth::GroupPtr > | groups () const =0 |
Return the groups this mapper is aware of. More... | |
Public Member Functions inherited from Leosac::Tools::Visitor< WiegandCard > | |
virtual void | visit (const VisitableT &) |
virtual void | visit (VisitableT &visitable) |
Public Member Functions inherited from Leosac::Tools::BaseVisitor | |
virtual | ~BaseVisitor ()=default |
virtual void | cannot_visit (const IVisitable &) |
Invoked when the visitable cannot be visited by the visitor. More... | |
Public Member Functions inherited from Leosac::Tools::Visitor< PINCode > | |
virtual void | visit (const VisitableT &) |
virtual void | visit (VisitableT &visitable) |
Public Member Functions inherited from Leosac::Tools::Visitor< WiegandCardPin > | |
virtual void | visit (const VisitableT &) |
virtual void | visit (VisitableT &visitable) |
Additional Inherited Members | |
Public Types inherited from Leosac::Tools::Visitor< WiegandCard > | |
using | VisitableT = std::remove_reference_t< std::remove_const_t< WiegandCard > > |
Public Types inherited from Leosac::Tools::Visitor< PINCode > | |
using | VisitableT = std::remove_reference_t< std::remove_const_t< PINCode > > |
Public Types inherited from Leosac::Tools::Visitor< WiegandCardPin > | |
using | VisitableT = std::remove_reference_t< std::remove_const_t< WiegandCardPin > > |
Base class to perform abstracted mapping operation over various AuthSource object.
It uses the visitor pattern to provide a somewhat low-coupling. Each module are free to use their own implementation of IAuthSourceMapper with various backend (database, file, ...). Theses shall be able to operate on various AuthSource (card, pin code, fingerprint).
Definition at line 43 of file IAuthSourceMapper.hpp.
|
virtualdefault |
|
pure virtual |
Build an AccessProfile object given a Credential.
How the profile is built (ie, based only on user-id, based on auth source and user-id, group membership, etc) is implementation-defined.
The caller expect a valid profile object that will behave correctly or nullptr if no profile could be built.
Implemented in Leosac::Module::Auth::FileAuthSourceMapper.
|
pure virtual |
Return the groups this mapper is aware of.
Implemented in Leosac::Module::Auth::FileAuthSourceMapper.
|
pure virtual |
Must map the ICredential data to a User.
This is done by calling the owner()
method on the auth source object. In case it fails, the field shall be set to nullptr
.
new
ed. Implemented in Leosac::Module::Auth::FileAuthSourceMapper.