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_krb_object.cpp
Go to the documentation of this file.
1 #include "rcMisc.h"
2 
3 #include "irods_krb_object.hpp"
4 #include "irods_auth_manager.hpp"
5 #include "irods_auth_plugin.hpp"
6 
7 extern int ProcessType;
8 
9 namespace irods {
10 
12  rError_t* _r_error ) :
13  auth_object( _r_error ),
14  sock_( 0 ) {
15  creds_ = GSS_C_NO_CREDENTIAL;
16  }
17 
19  // TODO - stub
20  }
21 
23  const std::string& _interface,
24  plugin_ptr& _ptr ) {
25  error result = SUCCESS();
26  if ( ( result = ASSERT_ERROR( _interface == AUTH_INTERFACE, SYS_INVALID_INPUT_PARAM,
27  "krb_auth_object does not support a \"%s\" plugin interface.",
28  _interface.c_str() ) ).ok() ) {
29  auth_ptr ath;
30  error ret = auth_mgr.resolve( AUTH_KRB_SCHEME, ath );
31  if ( !( result = ASSERT_PASS( ret, "Failed to resolve the KRB auth plugin." ) ).ok() ) {
32 
33  // Attempt to load the plugin.
34  std::string empty_context( "" );
36  result = ASSERT_PASS( ret, "Failed to load the KRB auth plugin." );
37  }
38 
39  if ( result.ok() ) {
40  _ptr = boost::dynamic_pointer_cast<plugin_base>( ath );
41  }
42  }
43  return result;
44  }
45 
47  const krb_auth_object& _rhs ) const {
48  return creds_ == _rhs.creds_;
49  }
50 
51 // =-=-=-=-=-=-=-
52 // public - serialize object to kvp
54  rule_engine_vars_t& _kvp ) {
55  irods::error result = SUCCESS();
56 
57  // =-=-=-=-=-=-=-
58  // all we have in this object is the auth results
59  std::stringstream sock_msg;
60  sock_msg << sock_;
61  _kvp["socket"] = sock_msg.str().c_str();
62  _kvp["serviceName"] = service_name_.c_str();
63  _kvp["digest"] = digest_.c_str();
64 
65  return result;
66 
67  } // get_re_vars
68 
69 }; // namespace irods
irods::plugin_ptr
boost::shared_ptr< plugin_base > plugin_ptr
Definition: irods_first_class_object.hpp:18
irods::auth_object
Definition: irods_auth_object.hpp:16
irods::auth_manager::init_from_type
error init_from_type(const int &, const std::string &_type, const std::string &_key, const std::string &_inst, const std::string &_ctx, auth_ptr &_rtn_auth)
Definition: irods_auth_manager.cpp:65
irods::krb_auth_object
Definition: irods_krb_object.hpp:19
irods::krb_auth_object::~krb_auth_object
virtual ~krb_auth_object()
Definition: irods_krb_object.cpp:18
irods::krb_auth_object::sock_
int sock_
Definition: irods_krb_object.hpp:84
rcMisc.h
ProcessType
int ProcessType
Definition: rcGlobal.cpp:16
irods::AUTH_INTERFACE
const std::string AUTH_INTERFACE("irods_auth_interface")
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
irods::krb_auth_object::creds_
gss_cred_id_t creds_
Definition: irods_krb_object.hpp:83
ASSERT_ERROR
#define ASSERT_ERROR(expr_, code_, format_,...)
Definition: irods_error.hpp:123
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods::krb_auth_object::krb_auth_object
krb_auth_object(rError_t *_r_error)
Definition: irods_krb_object.cpp:11
rError_t
Definition: rodsError.h:24
irods
Definition: apiHandler.hpp:35
ASSERT_PASS
#define ASSERT_PASS(prev_error_, format_,...)
Definition: irods_error.hpp:124
irods_auth_manager.hpp
irods::krb_auth_object::resolve
error resolve(const std::string &_name, plugin_ptr &_plugin)
Definition: irods_krb_object.cpp:22
irods::krb_auth_object::get_re_vars
virtual error get_re_vars(rule_engine_vars_t &)
Definition: irods_krb_object.cpp:53
irods::auth_manager::resolve
error resolve(const std::string &_key, auth_ptr &_value)
Definition: irods_auth_manager.cpp:22
irods_krb_object.hpp
irods::error
Definition: irods_error.hpp:23
irods_auth_plugin.hpp
irods::krb_auth_object::service_name_
std::string service_name_
Definition: irods_krb_object.hpp:85
irods::krb_auth_object::operator==
bool operator==(const krb_auth_object &_rhs) const
Definition: irods_krb_object.cpp:46
irods::auth_mgr
auth_manager auth_mgr
Definition: irods_auth_manager.cpp:7
irods::AUTH_KRB_SCHEME
const std::string AUTH_KRB_SCHEME("krb")
irods::krb_auth_object::digest_
std::string digest_
Definition: irods_krb_object.hpp:86
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
irods::auth_ptr
boost::shared_ptr< auth > auth_ptr
Definition: irods_auth_types.hpp:19
irods::rule_engine_vars_t
std::map< std::string, std::string > rule_engine_vars_t
Definition: irods_first_class_object.hpp:20