13 #include <ace/XML_Utils/XercesString.h> 21 using namespace XmlUtils;
27 topic_attrs.is_read_protected =
false;
28 topic_attrs.is_write_protected =
false;
29 topic_attrs.is_discovery_protected =
false;
30 topic_attrs.is_liveliness_protected =
false;
44 "\"%s\" value, \"%C\", in \"%C\" is not a valid boolean value\n",
56 const xercesc::DOMNodeList*
const nodes = parent->getElementsByTagName(XStr(name));
57 if (nodes->getLength() != 1) {
60 "expected 1 boolean value \"%s\" in parent element in \"%C\", found %B\n",
61 name, doc.
filename().c_str(), nodes->getLength()));
66 return get_bool_tag_value(doc, nodes->item(0),
name,
value);
73 const xercesc::DOMNodeList*
const nodes = parent->getElementsByTagName(XStr(name));
74 if (nodes->getLength() != 1) {
77 "expected 1 proctection kind value named \"%s\" in parent element in \"%C\", found %B\n",
78 name, doc.
filename().c_str(), nodes->getLength()));
83 const xercesc::DOMNode*
const node = nodes->item(0);
84 const std::string value =
to_string(node);
91 attributes |= enc_attr;
92 }
else if (
ACE_OS::strcasecmp(value.c_str(),
"SIGN_WITH_ORIGIN_AUTHENTICATION") == 0) {
94 attributes |= oa_attr;
95 }
else if (
ACE_OS::strcasecmp(value.c_str(),
"ENCRYPT_WITH_ORIGIN_AUTHENTICATION") == 0) {
97 attributes |= enc_attr;
98 attributes |= oa_attr;
102 "invalid %s, \"%C\", in \"%s\"\n",
103 name, value.c_str(), doc.
filename().c_str()));
114 const std::string& xml = doc.
content();
119 "get_parser failed\n"));
125 const xercesc::DOMNodeList*
const domainRules = parser->getDocument()->getDocumentElement()->
126 getElementsByTagName(XStr(
ACE_TEXT(
"domain_rule")));
127 for (XMLSize_t r = 0, dr_len = domainRules->getLength(); r < dr_len; ++r) {
130 const xercesc::DOMElement*
const domain_rule_el =
131 dynamic_cast<const xercesc::DOMElement*
>(domainRules->item(r));
132 if (!domain_rule_el) {
135 "domain_rule_el is null\n"));
141 const xercesc::DOMNodeList*
const ruleNodes = domain_rule_el->getChildNodes();
142 for (XMLSize_t rn = 0, rn_len = ruleNodes->getLength(); rn < rn_len; rn++) {
143 const xercesc::DOMNode*
const ruleNode = ruleNodes->item(rn);
144 const XStr dn_tag = ruleNode->getNodeName();
145 if (
ACE_TEXT(
"domains") == dn_tag) {
149 "failed to process domain ids in \"%C\"\n",
158 if (!get_bool_tag(doc, domain_rule_el,
ACE_TEXT(
"allow_unauthenticated_participants"),
164 if (!get_bool_tag(doc, domain_rule_el,
ACE_TEXT(
"enable_join_access_control"),
170 if (!get_protection_kind(doc, domain_rule_el,
ACE_TEXT(
"discovery_protection_kind"),
179 if (!get_protection_kind(doc, domain_rule_el,
ACE_TEXT(
"liveliness_protection_kind"),
188 if (!get_protection_kind(doc, domain_rule_el,
ACE_TEXT(
"rtps_protection_kind"),
200 const xercesc::DOMNodeList* topic_rules =
201 domain_rule_el->getElementsByTagName(XStr(
ACE_TEXT(
"topic_rule")));
202 for (XMLSize_t tr = 0, tr_len = topic_rules->getLength(); tr < tr_len; tr++) {
203 const xercesc::DOMNode* topic_rule = topic_rules->item(tr);
204 const xercesc::DOMNodeList* topic_rule_nodes = topic_rule->getChildNodes();
206 for (XMLSize_t trn = 0, trn_len = topic_rule_nodes->getLength(); trn < trn_len; trn++) {
207 const xercesc::DOMNode* topic_rule_node = topic_rule_nodes->item(trn);
208 const std::string
name =
to_string(topic_rule_node->getNodeName());
210 bool* bool_value = 0;
211 if (name ==
"topic_expression") {
213 }
else if (name ==
"enable_discovery_protection") {
215 }
else if (name ==
"enable_liveliness_protection") {
217 }
else if (name ==
"enable_read_access_control") {
219 }
else if (name ==
"enable_write_access_control") {
221 }
else if (name ==
"metadata_protection_kind") {
223 }
else if (name ==
"data_protection_kind") {
227 if (bool_value && !get_bool_tag_value(doc, topic_rule_node,
235 access_rules_.push_back(domain_rule);
bool parse_domain_id_set(const xercesc::DOMNode *node, Security::DomainIdSet &domain_id_set)
const LogLevel::Value value
const ParticipantSecurityAttributesMask PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_DISCOVERY_ORIGIN_AUTHENTICATED
boolean allow_unauthenticated_participants
const std::string & filename() const
boolean is_liveliness_protected
boolean is_discovery_protected
const ParticipantSecurityAttributesMask PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_VALID
DDS::Security::ParticipantSecurityAttributes domain_attrs
bool access_error
Permissions and Governance.
PluginParticipantSecurityAttributesMask plugin_participant_attributes
const ParticipantSecurityAttributesMask PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_LIVELINESS_ENCRYPTED
const ParticipantSecurityAttributesMask PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_BUILTIN_IS_DISCOVERY_ENCRYPTED
boolean is_discovery_protected
std::string topic_expression
boolean is_liveliness_protected
const std::string & content() const
std::string metadata_protection_kind
#define ACE_TEXT_CHAR_TO_TCHAR(STRING)
int strcasecmp(const char *s, const char *t)
const ParticipantSecurityAttributesMask PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_LIVELINESS_ORIGIN_AUTHENTICATED
bool parse_bool(const XMLCh *in, bool &value)
bool get_parser(ParserPtr &parser, const std::string &filename, const std::string &xml)
TopicAccessRules topic_rules
std::string data_protection_kind
int load(const SSL::SignedDocument &doc)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
boolean is_access_protected
boolean is_write_protected
boolean is_rtps_protected
std::string to_string(const xercesc::SAXParseException &ex)
const ParticipantSecurityAttributesMask PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_RTPS_ORIGIN_AUTHENTICATED
DDS::Security::TopicSecurityAttributes topic_attrs
const ParticipantSecurityAttributesMask PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_RTPS_ENCRYPTED
The Internal API and Implementation of OpenDDS.
boolean is_read_protected
OpenDDS_Dcps_Export SecurityDebug security_debug