projects
/
shibboleth
/
cpp-sp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0915a3a
)
Support for NameIDFormats.
author
Scott Cantor
<cantor.2@osu.edu>
Mon, 25 Oct 2010 17:12:16 +0000
(17:12 +0000)
committer
Scott Cantor
<cantor.2@osu.edu>
Mon, 25 Oct 2010 17:12:16 +0000
(17:12 +0000)
shibsp/handler/impl/MetadataGenerator.cpp
patch
|
blob
|
history
diff --git
a/shibsp/handler/impl/MetadataGenerator.cpp
b/shibsp/handler/impl/MetadataGenerator.cpp
index
7ae1c9d
..
7cafe7d
100644
(file)
--- a/
shibsp/handler/impl/MetadataGenerator.cpp
+++ b/
shibsp/handler/impl/MetadataGenerator.cpp
@@
-89,6
+89,7
@@
namespace shibsp {
delete m_org;
delete m_entityAttrs;
for_each(m_contacts.begin(), m_contacts.end(), xmltooling::cleanup<ContactPerson>());
delete m_org;
delete m_entityAttrs;
for_each(m_contacts.begin(), m_contacts.end(), xmltooling::cleanup<ContactPerson>());
+ for_each(m_formats.begin(), m_formats.end(), xmltooling::cleanup<NameIDFormat>());
for_each(m_reqAttrs.begin(), m_reqAttrs.end(), xmltooling::cleanup<RequestedAttribute>());
for_each(m_attrConsumers.begin(), m_attrConsumers.end(), xmltooling::cleanup<AttributeConsumingService>());
#endif
for_each(m_reqAttrs.begin(), m_reqAttrs.end(), xmltooling::cleanup<RequestedAttribute>());
for_each(m_attrConsumers.begin(), m_attrConsumers.end(), xmltooling::cleanup<AttributeConsumingService>());
#endif
@@
-114,6
+115,7
@@
namespace shibsp {
Organization* m_org;
EntityAttributes* m_entityAttrs;
vector<ContactPerson*> m_contacts;
Organization* m_org;
EntityAttributes* m_entityAttrs;
vector<ContactPerson*> m_contacts;
+ vector<NameIDFormat*> m_formats;
vector<RequestedAttribute*> m_reqAttrs;
vector<AttributeConsumingService*> m_attrConsumers;
#endif
vector<RequestedAttribute*> m_reqAttrs;
vector<AttributeConsumingService*> m_attrConsumers;
#endif
@@
-184,48
+186,55
@@
MetadataGenerator::MetadataGenerator(const DOMElement* e, const char* appId)
m_contacts.push_back(cp);
}
else {
m_contacts.push_back(cp);
}
else {
-
RequestedAttribute* req = dynamic_cast<RequestedAttribute
*>(child.get());
- if (
req
) {
+
NameIDFormat* nif = dynamic_cast<NameIDFormat
*>(child.get());
+ if (
nif
) {
child.release();
child.release();
- m_
reqAttrs.push_back(req
);
+ m_
formats.push_back(nif
);
}
else {
}
else {
-
AttributeConsumingService* acs = dynamic_cast<AttributeConsumingServic
e*>(child.get());
- if (
acs
) {
+
RequestedAttribute* req = dynamic_cast<RequestedAttribut
e*>(child.get());
+ if (
req
) {
child.release();
child.release();
- m_
attrConsumers.push_back(acs
);
+ m_
reqAttrs.push_back(req
);
}
else {
}
else {
- UIInfo* info = dynamic_cast<UIInfo*>(child.get());
- if (info) {
- if (!m_uiinfo) {
- child.release();
- m_uiinfo = info;
- }
- else {
- m_log.warn("skipping duplicate UIInfo element");
- }
+ AttributeConsumingService* acs = dynamic_cast<AttributeConsumingService*>(child.get());
+ if (acs) {
+ child.release();
+ m_attrConsumers.push_back(acs);
}
else {
}
else {
-
Organization* org = dynamic_cast<Organization
*>(child.get());
- if (
org
) {
- if (!m_
org
) {
+
UIInfo* info = dynamic_cast<UIInfo
*>(child.get());
+ if (
info
) {
+ if (!m_
uiinfo
) {
child.release();
child.release();
- m_
org = org
;
+ m_
uiinfo = info
;
}
else {
}
else {
- m_log.warn("skipping duplicate
Organization
element");
+ m_log.warn("skipping duplicate
UIInfo
element");
}
}
else {
}
}
else {
-
EntityAttributes* ea = dynamic_cast<EntityAttributes
*>(child.get());
- if (
ea
) {
- if (!m_
entityAttrs
) {
+
Organization* org = dynamic_cast<Organization
*>(child.get());
+ if (
org
) {
+ if (!m_
org
) {
child.release();
child.release();
- m_
entityAttrs = ea
;
+ m_
org = org
;
}
else {
}
else {
- m_log.warn("skipping duplicate EntityAttributes element");
+ m_log.warn("skipping duplicate Organization element");
+ }
+ }
+ else {
+ EntityAttributes* ea = dynamic_cast<EntityAttributes*>(child.get());
+ if (ea) {
+ if (!m_entityAttrs) {
+ child.release();
+ m_entityAttrs = ea;
+ }
+ else {
+ m_log.warn("skipping duplicate EntityAttributes element");
+ }
}
}
}
}
}
}
@@
-363,7
+372,7
@@
pair<bool,long> MetadataGenerator::processMessage(
entity->setOrganization(m_org->cloneOrganization());
for (vector<ContactPerson*>::const_iterator cp = m_contacts.begin(); cp != m_contacts.end(); ++cp)
entity->setOrganization(m_org->cloneOrganization());
for (vector<ContactPerson*>::const_iterator cp = m_contacts.begin(); cp != m_contacts.end(); ++cp)
- entity->getContactPersons().push_back((*cp)->cloneContactPerson());
+ entity->getContactPersons().push_back((*cp)->cloneContactPerson());
if (m_entityAttrs) {
if (!entity->getExtensions())
if (m_entityAttrs) {
if (!entity->getExtensions())
@@
-380,6
+389,9
@@
pair<bool,long> MetadataGenerator::processMessage(
role = entity->getSPSSODescriptors().front();
}
role = entity->getSPSSODescriptors().front();
}
+ for (vector<NameIDFormat*>::const_iterator nif = m_formats.begin(); nif != m_formats.end(); ++nif)
+ role->getNameIDFormats().push_back((*nif)->cloneNameIDFormat());
+
if (m_uiinfo) {
if (!role->getExtensions())
role->setExtensions(ExtensionsBuilder::buildExtensions());
if (m_uiinfo) {
if (!role->getExtensions())
role->setExtensions(ExtensionsBuilder::buildExtensions());