OpenDDS
Snapshot(2023/04/28-20:55)
|
#include <SecurityRegistry.h>
Classes | |
class | SecurityConfigEntry |
Public Member Functions | |
void | release () |
SecurityPluginInst_rch | get_plugin_inst (const OPENDDS_STRING &plugin_name, bool attempt_fix=true) |
void | register_plugin (const OPENDDS_STRING &plugin_name, SecurityPluginInst_rch plugin) |
SecurityConfig_rch | create_config (const OPENDDS_STRING &config_name) |
SecurityConfig_rch | create_config (const OPENDDS_STRING &config_name, SecurityPluginInst_rch plugin) |
bool | has_no_configs () const |
SecurityConfig_rch | get_config (const OPENDDS_STRING &config_name) const |
SecurityConfig_rch | default_config () const |
void | default_config (const SecurityConfig_rch &cfg) |
SecurityConfig_rch | builtin_config () const |
void | builtin_config (const SecurityConfig_rch &cfg) |
int | load_security_configuration (ACE_Configuration_Heap &cf) |
Static Public Member Functions | |
static SecurityRegistry * | instance () |
Return a singleton instance of this class. More... | |
static void | close () |
Close the singleton instance of this class. More... | |
Static Public Attributes | |
static const char * | DEFAULT_CONFIG_NAME = "_OPENDDS_DEFAULT_CONFIG" |
static const char * | BUILTIN_CONFIG_NAME = "_OPENDDS_BUILTIN_CONFIG" |
Private Types | |
typedef DCPS::RcHandle< SecurityConfigEntry > | SecurityConfigEntry_rch |
typedef ACE_SYNCH_MUTEX | LockType |
typedef ACE_Guard< LockType > | GuardType |
Private Member Functions | |
typedef | OPENDDS_MAP (OPENDDS_STRING, SecurityConfig_rch) ConfigMap |
typedef | OPENDDS_MAP (OPENDDS_STRING, SecurityPluginInst_rch) InstMap |
typedef | OPENDDS_MAP (OPENDDS_STRING, OPENDDS_STRING) LibDirectiveMap |
typedef | OPENDDS_MAP (OPENDDS_STRING, SecurityConfigEntry_rch) ConfigEntryMap |
SecurityRegistry () | |
~SecurityRegistry () | |
int | load_security_sections (ACE_Configuration_Heap &cf, ConfigEntryMap &entries) |
void | load_security_plugin_lib (const OPENDDS_STRING &security_plugin_type) |
bool | find_config (const OPENDDS_STRING &name, SecurityConfig_rch &config) |
bool | add_config (const OPENDDS_STRING &name, SecurityConfig_rch &config) |
Private Attributes | |
ConfigEntryMap | config_entries_ |
ConfigMap | config_map_ |
InstMap | registered_plugins_ |
LibDirectiveMap | lib_directive_map_ |
SecurityConfig_rch | default_config_ |
SecurityConfig_rch | builtin_config_ |
LockType | lock_ |
LockType | default_load_lock_ |
Static Private Attributes | |
static const char * | DEFAULT_INST_PREFIX = "_OPENDDS_" |
static const char * | DEFAULT_PLUGIN_NAME = "BuiltIn" |
static const char * | SECURITY_SECTION_NAME = "security" |
static const char * | ACCESS_CTRL_PLUGIN_NAME = "access_ctrl_plugin" |
static const char * | AUTHENTICATION_PLUGIN_NAME = "auth_plugin" |
static const char * | CRYPTO_PLUGIN_NAME = "crypto_plugin" |
Friends | |
class | ACE_Singleton< SecurityRegistry, ACE_Recursive_Thread_Mutex > |
The TheSecurityRegistry is a singleton object which provides a mechanism to the application code to configure OpenDDS's security plugins.
Definition at line 34 of file SecurityRegistry.h.
|
private |
Definition at line 142 of file SecurityRegistry.h.
|
private |
Definition at line 141 of file SecurityRegistry.h.
|
private |
Definition at line 123 of file SecurityRegistry.h.
|
private |
Definition at line 94 of file SecurityRegistry.cpp.
References DBG_ENTRY_LVL, DEFAULT_PLUGIN_NAME, and lib_directive_map_.
|
private |
|
private |
Definition at line 403 of file SecurityRegistry.cpp.
References config_map_, lock_, and name.
Referenced by create_config().
SecurityConfig_rch OpenDDS::Security::SecurityRegistry::builtin_config | ( | ) | const |
Definition at line 278 of file SecurityRegistry.cpp.
References ACE_TEXT_CHAR_TO_TCHAR, ACE_Guard< ACE_LOCK >::acquire(), builtin_config_, default_load_lock_, DEFAULT_PLUGIN_NAME, lib_directive_map_, lock_, OPENDDS_ASSERT, ACE_Service_Config::process_directive(), and ACE_Guard< ACE_LOCK >::release().
void OpenDDS::Security::SecurityRegistry::builtin_config | ( | const SecurityConfig_rch & | cfg | ) |
Definition at line 298 of file SecurityRegistry.cpp.
References builtin_config_, and lock_.
|
static |
Close the singleton instance of this class.
Definition at line 89 of file SecurityRegistry.cpp.
References ACE_Unmanaged_Singleton< TYPE, ACE_LOCK >::close().
Referenced by OpenDDS::DCPS::Service_Participant::shutdown().
SecurityConfig_rch OpenDDS::Security::SecurityRegistry::create_config | ( | const OPENDDS_STRING & | config_name | ) |
Definition at line 130 of file SecurityRegistry.cpp.
References ACE_ERROR, ACE_TEXT(), add_config(), config_entries_, find_config(), get_plugin_inst(), OpenDDS::DCPS::RcHandle< T >::is_nil(), and LM_ERROR.
SecurityConfig_rch OpenDDS::Security::SecurityRegistry::create_config | ( | const OPENDDS_STRING & | config_name, |
SecurityPluginInst_rch | plugin | ||
) |
Definition at line 208 of file SecurityRegistry.cpp.
References ACE_ERROR, ACE_TEXT(), add_config(), find_config(), and LM_ERROR.
SecurityConfig_rch OpenDDS::Security::SecurityRegistry::default_config | ( | ) | const |
Definition at line 252 of file SecurityRegistry.cpp.
References default_config_, lock_, and TheServiceParticipant.
void OpenDDS::Security::SecurityRegistry::default_config | ( | const SecurityConfig_rch & | cfg | ) |
Definition at line 271 of file SecurityRegistry.cpp.
References default_config_, and lock_.
|
private |
Definition at line 388 of file SecurityRegistry.cpp.
References config_map_, and lock_.
Referenced by create_config().
SecurityConfig_rch OpenDDS::Security::SecurityRegistry::get_config | ( | const OPENDDS_STRING & | config_name | ) | const |
Definition at line 244 of file SecurityRegistry.cpp.
References config_map_, and lock_.
SecurityPluginInst_rch OpenDDS::Security::SecurityRegistry::get_plugin_inst | ( | const OPENDDS_STRING & | plugin_name, |
bool | attempt_fix = true |
||
) |
If the plugin is registered then return it. If it's not and attempt_fix is true, then try to load and return the plugin, otherwise return a nil rch.
Definition at line 421 of file SecurityRegistry.cpp.
References ACE_Guard< ACE_LOCK >::acquire(), find(), load_security_plugin_lib(), lock_, registered_plugins_, and ACE_Guard< ACE_LOCK >::release().
Referenced by create_config().
bool OpenDDS::Security::SecurityRegistry::has_no_configs | ( | ) | const |
Definition at line 443 of file SecurityRegistry.cpp.
References config_map_, lock_, and OPENDDS_END_VERSIONED_NAMESPACE_DECL.
|
static |
Return a singleton instance of this class.
Definition at line 83 of file SecurityRegistry.cpp.
References ACE_Unmanaged_Singleton< TYPE, ACE_LOCK >::instance().
int OpenDDS::Security::SecurityRegistry::load_security_configuration | ( | ACE_Configuration_Heap & | cf | ) |
For internal use by OpenDDS DCPS layer: Transfer the configuration in ACE_Configuration_Heap object to the SecurityRegistry. This is called by the Service_Participant at initialization time. This function iterates each section in the configuration file, and creates SecurityConfigEntry objects and adds them to the registry.
Definition at line 305 of file SecurityRegistry.cpp.
References ACE_ERROR_RETURN, ACE_TEXT(), ACE_TEXT_CHAR_TO_TCHAR, ACE_String_Base< char >::c_str(), config_entries_, ACE_Configuration_Heap::enumerate_sections(), LM_ERROR, ACE_Configuration_Heap::open_section(), OPENDDS_STRING, OpenDDS::DCPS::processSections(), OpenDDS::DCPS::pullValues(), ACE_Configuration::root_section(), SECURITY_SECTION_NAME, and ACE_OS::strcmp().
|
private |
For internal use by OpenDDS DCPS layer: Dynamically load the library for the supplied security plugin type.
Definition at line 373 of file SecurityRegistry.cpp.
References ACE_TEXT_CHAR_TO_TCHAR, ACE_String_Base< char >::c_str(), lib_directive_map_, lock_, ACE_Service_Config::process_directive(), and ACE_Guard< ACE_LOCK >::release().
Referenced by get_plugin_inst().
|
private |
|
private |
|
private |
|
private |
|
private |
void OpenDDS::Security::SecurityRegistry::register_plugin | ( | const OPENDDS_STRING & | plugin_name, |
SecurityPluginInst_rch | plugin | ||
) |
Definition at line 114 of file SecurityRegistry.cpp.
References ACE_ERROR, ACE_TEXT(), LM_ERROR, lock_, and registered_plugins_.
void OpenDDS::Security::SecurityRegistry::release | ( | void | ) |
This will shutdown all Security plugin objects.
Client Application calls this method to tear down the security framework.
Definition at line 101 of file SecurityRegistry.cpp.
References config_map_, DBG_ENTRY_LVL, lock_, and registered_plugins_.
Referenced by ~SecurityRegistry().
|
friend |
Definition at line 88 of file SecurityRegistry.h.
|
staticprivate |
Definition at line 93 of file SecurityRegistry.h.
|
staticprivate |
Definition at line 94 of file SecurityRegistry.h.
|
mutableprivate |
Definition at line 149 of file SecurityRegistry.h.
Referenced by builtin_config().
|
static |
Definition at line 44 of file SecurityRegistry.h.
|
private |
Definition at line 144 of file SecurityRegistry.h.
Referenced by create_config(), and load_security_configuration().
|
private |
Definition at line 145 of file SecurityRegistry.h.
Referenced by add_config(), find_config(), get_config(), has_no_configs(), and release().
|
staticprivate |
Definition at line 95 of file SecurityRegistry.h.
|
mutableprivate |
Definition at line 148 of file SecurityRegistry.h.
Referenced by default_config().
|
static |
Definition at line 43 of file SecurityRegistry.h.
Referenced by OpenDDS::Security::BuiltInPluginLoader::init().
|
staticprivate |
Definition at line 90 of file SecurityRegistry.h.
|
mutableprivate |
Definition at line 152 of file SecurityRegistry.h.
Referenced by builtin_config().
|
staticprivate |
Definition at line 91 of file SecurityRegistry.h.
Referenced by builtin_config(), and SecurityRegistry().
|
private |
Definition at line 147 of file SecurityRegistry.h.
Referenced by builtin_config(), load_security_plugin_lib(), and SecurityRegistry().
|
mutableprivate |
Definition at line 151 of file SecurityRegistry.h.
Referenced by add_config(), builtin_config(), default_config(), find_config(), get_config(), get_plugin_inst(), has_no_configs(), load_security_plugin_lib(), register_plugin(), and release().
|
private |
Definition at line 146 of file SecurityRegistry.h.
Referenced by get_plugin_inst(), register_plugin(), and release().
|
staticprivate |
Definition at line 92 of file SecurityRegistry.h.
Referenced by load_security_configuration().