Leosac  0.8.0
Open Source Access Control
Leosac::Auth::BaseAuthSource Class Reference

#include <BaseAuthSource.hpp>

+ Inheritance diagram for Leosac::Auth::BaseAuthSource:
+ Collaboration diagram for Leosac::Auth::BaseAuthSource:

Public Member Functions

 MAKE_VISITABLE ()
 
 BaseAuthSource (const std::string &id="")
 
virtual ~BaseAuthSource ()=default
 
virtual void addAuthSource (IAuthenticationSourcePtr source) override
 Adds a new authentication sources as a subsource of this one. More...
 
virtual void owner (UserPtr user) override
 Set the user that map to this source,. More...
 
virtual UserPtr owner () const override
 Retrieve the user that map to this source. More...
 
virtual IAccessProfilePtr profile () const override
 This implementation simply return the profile associated with the credential, or null if not available. More...
 
virtual void profile (IAccessProfilePtr p) override
 Set an access profile for this credentials. More...
 
virtual const std::string & name () const override
 Return the name of the source. More...
 
void name (const std::string &n)
 Set a name for this auth source. More...
 
virtual std::string to_string () const override
 Returns a string representation of the authentication source content. More...
 
virtual const std::string & id () const override
 Returns the ID of the credentials. More...
 
void id (const std::string &cred_id) override
 
virtual const ValidityInfovalidity () const override
 Get the object that store info about the credential's validity. More...
 
virtual void validity (const ValidityInfo &c) override
 Update the validity of the credential. More...
 
- Public Member Functions inherited from Leosac::Auth::IAuthenticationSource
virtual ~IAuthenticationSource ()=default
 
- Public Member Functions inherited from Leosac::Tools::IVisitable
virtual void accept (::Leosac::Tools::BaseVisitor &)=0
 Accept a visitor that may mutate this. More...
 
virtual void accept (::Leosac::Tools::BaseVisitor &) const =0
 Accept a visitor that will not mutate this. More...
 

Protected Attributes

UserPtr owner_
 Which user this auth source maps to. More...
 
std::vector< IAuthenticationSourcePtrsubsources_
 Underlying auth source. More...
 
std::string source_name_
 Name of the source (generally the module / device that sent it) More...
 
std::string id_
 Credentials ID. More...
 
ValidityInfo validity_
 
IAccessProfilePtr profile_
 

Additional Inherited Members

- Static Protected Member Functions inherited from Leosac::Tools::IVisitable
template<class T >
static bool visitor_dispatch (T &visited, BaseVisitor &visitor, bool abort_on_failure)
 

Detailed Description

Definition at line 34 of file BaseAuthSource.hpp.

Constructor & Destructor Documentation

◆ BaseAuthSource()

BaseAuthSource::BaseAuthSource ( const std::string &  id = "")

Definition at line 24 of file BaseAuthSource.cpp.

◆ ~BaseAuthSource()

virtual Leosac::Auth::BaseAuthSource::~BaseAuthSource ( )
virtualdefault

Member Function Documentation

◆ addAuthSource()

void BaseAuthSource::addAuthSource ( IAuthenticationSourcePtr  source)
overridevirtual

Adds a new authentication sources as a subsource of this one.

Implements Leosac::Auth::IAuthenticationSource.

Definition at line 29 of file BaseAuthSource.cpp.

◆ id() [1/2]

const std::string & BaseAuthSource::id ( ) const
overridevirtual

Returns the ID of the credentials.

It is possible that this ID be empty.

Implements Leosac::Auth::IAuthenticationSource.

Definition at line 64 of file BaseAuthSource.cpp.

◆ id() [2/2]

void BaseAuthSource::id ( const std::string &  cred_id)
overridevirtual

Implements Leosac::Auth::IAuthenticationSource.

Definition at line 69 of file BaseAuthSource.cpp.

◆ MAKE_VISITABLE()

Leosac::Auth::BaseAuthSource::MAKE_VISITABLE ( )

◆ name() [1/2]

const std::string & BaseAuthSource::name ( ) const
overridevirtual

Return the name of the source.

This could be the name of the name of the module or device that sent the message that lead to this object's creation.

Implements Leosac::Auth::IAuthenticationSource.

Definition at line 49 of file BaseAuthSource.cpp.

◆ name() [2/2]

void BaseAuthSource::name ( const std::string &  n)

Set a name for this auth source.

Definition at line 54 of file BaseAuthSource.cpp.

◆ owner() [1/2]

UserPtr BaseAuthSource::owner ( ) const
overridevirtual

Retrieve the user that map to this source.

Implements Leosac::Auth::IAuthenticationSource.

Definition at line 39 of file BaseAuthSource.cpp.

◆ owner() [2/2]

void BaseAuthSource::owner ( UserPtr  user)
overridevirtual

Set the user that map to this source,.

Implements Leosac::Auth::IAuthenticationSource.

Definition at line 34 of file BaseAuthSource.cpp.

◆ profile() [1/2]

IAccessProfilePtr BaseAuthSource::profile ( ) const
overridevirtual

This implementation simply return the profile associated with the credential, or null if not available.

Implements Leosac::Auth::IAuthenticationSource.

Definition at line 44 of file BaseAuthSource.cpp.

◆ profile() [2/2]

void BaseAuthSource::profile ( IAccessProfilePtr  p)
overridevirtual

Set an access profile for this credentials.

This profile will be added to the user's profile when granting/denying acccess.

Implements Leosac::Auth::IAuthenticationSource.

Definition at line 84 of file BaseAuthSource.cpp.

◆ to_string()

std::string BaseAuthSource::to_string ( ) const
overridevirtual

Returns a string representation of the authentication source content.

Implements Leosac::Auth::IAuthenticationSource.

Definition at line 59 of file BaseAuthSource.cpp.

◆ validity() [1/2]

const ValidityInfo & BaseAuthSource::validity ( ) const
overridevirtual

Get the object that store info about the credential's validity.

Implements Leosac::Auth::IAuthenticationSource.

Definition at line 74 of file BaseAuthSource.cpp.

◆ validity() [2/2]

void BaseAuthSource::validity ( const ValidityInfo c)
overridevirtual

Update the validity of the credential.

Implements Leosac::Auth::IAuthenticationSource.

Definition at line 79 of file BaseAuthSource.cpp.

Member Data Documentation

◆ id_

std::string Leosac::Auth::BaseAuthSource::id_
protected

Credentials ID.

Definition at line 91 of file BaseAuthSource.hpp.

◆ owner_

UserPtr Leosac::Auth::BaseAuthSource::owner_
protected

Which user this auth source maps to.

May be null

Definition at line 76 of file BaseAuthSource.hpp.

◆ profile_

IAccessProfilePtr Leosac::Auth::BaseAuthSource::profile_
protected

Definition at line 95 of file BaseAuthSource.hpp.

◆ source_name_

std::string Leosac::Auth::BaseAuthSource::source_name_
protected

Name of the source (generally the module / device that sent it)

Definition at line 86 of file BaseAuthSource.hpp.

◆ subsources_

std::vector<IAuthenticationSourcePtr> Leosac::Auth::BaseAuthSource::subsources_
protected

Underlying auth source.

Definition at line 81 of file BaseAuthSource.hpp.

◆ validity_

ValidityInfo Leosac::Auth::BaseAuthSource::validity_
protected

Definition at line 93 of file BaseAuthSource.hpp.


The documentation for this class was generated from the following files: