8 #define SCARAB_API_EXPORTS 20 LOGGER( mtlog,
"authentication" );
24 f_auth_filename( a_auth_filename ),
27 load( a_auth_filename );
38 f_auth_filename = a_auth_file;
44 bool t_auth_file_present =
false;
45 if( ! t_auth_file_path.empty() )
47 LDEBUG( mtlog,
"Looking for authentication file: <" << t_auth_file_path <<
">" );
50 t_auth_file_present = exists( t_auth_file_path ) && is_regular_file( t_auth_file_path );
51 if( ! t_auth_file_present )
53 LERROR( mtlog,
"File either doesn't exist (" << exists( t_auth_file_path ) <<
") or isn't a regular file (" << is_regular_file( t_auth_file_path ) <<
")" );
57 catch( boost::filesystem::filesystem_error& e )
59 LERROR( mtlog,
"Unable to determine if the authentication file is a regular file: " << e.what() );
65 if( t_auth_file_present )
68 std::unique_ptr< param > t_read_file( t_translator.
read_file( t_auth_file_path.string() ) );
69 if( t_read_file == NULL )
71 LERROR( mtlog,
"Unable to parse authentication file" );
74 else if( ! t_read_file->is_node() )
76 LERROR( mtlog,
"Authentication file must translate to a node" );
82 LDEBUG( mtlog,
"Authentications:\n" << *
this );
89 LWARN( mtlog,
"Authentications not loaded" );
path expand_path(const string &a_path)
Contains the logger class and macros, based on Kasper's KLogger class.
bool load(const std::string &a_auth_file)
param_node & operator=(const param_node &rhs)
param_ptr_t read_file(const std::string &a_filename, const param_node &a_options=param_node())
authentication(const std::string &a_auth_file)
LOGGER(mtlog,"authentication")