MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / load

Method load

dds/DCPS/security/AccessControl/Governance.cpp:112–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112int Governance::load(const SSL::SignedDocument& doc)
113{
114 const std::string& xml = doc.content();
115 ParserPtr parser;
116 if (!get_parser(parser, doc.filename(), xml)) {
117 if (security_debug.access_error) {
118 ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: {access_error} Governance::load: "
119 "get_parser failed\n"));
120 }
121 return -1;
122 }
123
124 // Find the domain rules
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) {
128 Governance::DomainRule domain_rule;
129 domain_rule.domain_attrs.plugin_participant_attributes = 0;
130 const xercesc::DOMElement* const domain_rule_el =
131 dynamic_cast<const xercesc::DOMElement*>(domainRules->item(r));
132 if (!domain_rule_el) {
133 if (security_debug.access_error) {
134 ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: {access_error} Governance::load: "
135 "domain_rule_el is null\n"));
136 }
137 return -1;
138 }
139
140 // Process domain ids this domain rule applies to
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) {
146 if (!parse_domain_id_set(ruleNode, domain_rule.domains)) {
147 if (security_debug.access_error) {
148 ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: {access_error} Governance::load: "
149 "failed to process domain ids in \"%C\"\n",
150 doc.filename().c_str()));
151 }
152 return -1;
153 }
154 }
155 }
156
157 // Process allow_unauthenticated_participants
158 if (!get_bool_tag(doc, domain_rule_el, ACE_TEXT("allow_unauthenticated_participants"),
159 domain_rule.domain_attrs.allow_unauthenticated_participants)) {
160 return -1;
161 }
162
163 // Process enable_join_access_control
164 if (!get_bool_tag(doc, domain_rule_el, ACE_TEXT("enable_join_access_control"),
165 domain_rule.domain_attrs.is_access_protected)) {
166 return -1;
167 }
168
169 // Process discovery_protection_kind

Callers

nothing calls this directly

Calls 9

get_parserFunction · 0.85
parse_domain_id_setFunction · 0.85
get_bool_tagFunction · 0.85
get_protection_kindFunction · 0.85
get_bool_tag_valueFunction · 0.85
getLengthMethod · 0.80
itemMethod · 0.80
to_stringFunction · 0.70
filenameMethod · 0.45

Tested by

no test coverage detected