irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_auth_factory.cpp
Go to the documentation of this file.
1 // =-=-=-=-=-=-=-
2 #include "irods_auth_factory.hpp"
6 #include "irods_gsi_object.hpp"
7 #include "irods_krb_object.hpp"
9 #include "rodsErrorTable.h"
10 #include <boost/algorithm/string.hpp>
11 
12 namespace irods {
17  const std::string& _scheme,
18  rError_t* _r_error,
19  auth_object_ptr& _ptr ) {
20  // ensure scheme is lower case for comparison
21  std::string scheme = boost::algorithm::to_lower_copy( _scheme );
22 
23  if ( scheme.empty() || AUTH_NATIVE_SCHEME == scheme ) {
24  _ptr.reset( new native_auth_object( _r_error ) );
25  }
26  else if ( AUTH_PAM_SCHEME == scheme ) {
27  _ptr.reset( new pam_auth_object( _r_error ) );
28  }
29  else if ( AUTH_OSAUTH_SCHEME == scheme ) {
30  _ptr.reset( new osauth_auth_object( _r_error ) );
31  }
32  else if ( AUTH_GSI_SCHEME == scheme ) {
33  _ptr.reset( new gsi_auth_object( _r_error ) );
34  }
35  else if ( AUTH_KRB_SCHEME == scheme ) {
36  _ptr.reset( new krb_auth_object( _r_error ) );
37  }
38  else {
39  _ptr.reset( new irods::generic_auth_object( scheme, _r_error ) );
40  }
41 
42  return SUCCESS();
43 
44  } // auth_factory
45 
46 }; // namespace irods
47 
48 
49 
irods::krb_auth_object
Definition: irods_krb_object.hpp:19
irods_native_auth_object.hpp
irods::native_auth_object
Definition: irods_native_auth_object.hpp:21
irods::auth_factory
irods::error auth_factory(const std::string &, rError_t *, irods::auth_object_ptr &)
Definition: irods_auth_factory.cpp:16
irods::auth_object_ptr
boost::shared_ptr< auth_object > auth_object_ptr
Definition: irods_auth_object.hpp:86
irods::AUTH_OSAUTH_SCHEME
const std::string AUTH_OSAUTH_SCHEME("osauth")
irods::AUTH_NATIVE_SCHEME
const std::string AUTH_NATIVE_SCHEME("native")
irods::generic_auth_object
Definition: irods_generic_auth_object.hpp:15
irods::AUTH_GSI_SCHEME
const std::string AUTH_GSI_SCHEME("gsi")
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods::pam_auth_object
Definition: irods_pam_auth_object.hpp:21
rError_t
Definition: rodsError.h:24
irods_auth_factory.hpp
irods::osauth_auth_object
Definition: irods_osauth_auth_object.hpp:21
irods
Definition: apiHandler.hpp:35
irods_generic_auth_object.hpp
irods_pam_auth_object.hpp
irods::AUTH_PAM_SCHEME
const std::string AUTH_PAM_SCHEME("pam")
irods_krb_object.hpp
irods::error
Definition: irods_error.hpp:23
irods_osauth_auth_object.hpp
rodsErrorTable.h
irods_gsi_object.hpp
irods::AUTH_KRB_SCHEME
const std::string AUTH_KRB_SCHEME("krb")
irods::gsi_auth_object
Definition: irods_gsi_object.hpp:18