From cc76ae8156ccbd7975709d8fe35e29826a0edc43 Mon Sep 17 00:00:00 2001 From: cantor Date: Fri, 2 Mar 2007 05:04:30 +0000 Subject: [PATCH] ArtifactMap support. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2182 cb58f699-b61c-0410-a6fe-9272a202ed29 --- configs/shibboleth.xml.in | 11 +++++++---- schemas/shibboleth-spconfig-2.0.xsd | 24 +++++++++++++++++------- shibsp/impl/XMLServiceProvider.cpp | 26 ++++++++++++++++++++++---- 3 files changed, 46 insertions(+), 15 deletions(-) diff --git a/configs/shibboleth.xml.in b/configs/shibboleth.xml.in index 0eac855..410552c 100644 --- a/configs/shibboleth.xml.in +++ b/configs/shibboleth.xml.in @@ -25,7 +25,11 @@ + + + + - - - - diff --git a/schemas/shibboleth-spconfig-2.0.xsd b/schemas/shibboleth-spconfig-2.0.xsd index 4040c10..ec7247a 100644 --- a/schemas/shibboleth-spconfig-2.0.xsd +++ b/schemas/shibboleth-spconfig-2.0.xsd @@ -90,7 +90,7 @@ - + @@ -108,6 +108,7 @@ + @@ -117,12 +118,20 @@ - Ties ReplayCache to custom StorageService + Ties ReplayCache to a custom StorageService - - - - + + + + + + + Customizes an ArtifactMap + + + + + @@ -149,7 +158,8 @@ - + + diff --git a/shibsp/impl/XMLServiceProvider.cpp b/shibsp/impl/XMLServiceProvider.cpp index dd00d12..33d540c 100644 --- a/shibsp/impl/XMLServiceProvider.cpp +++ b/shibsp/impl/XMLServiceProvider.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -216,6 +217,7 @@ namespace { delete m_listener; delete m_tranLog; XMLToolingConfig::getConfig().setReplayCache(NULL); + SAMLConfig::getConfig().setArtifactMap(NULL); for_each(m_storage.begin(), m_storage.end(), cleanup_pair()); } @@ -308,6 +310,7 @@ namespace { static const XMLCh _Application[] = UNICODE_LITERAL_11(A,p,p,l,i,c,a,t,i,o,n); static const XMLCh Applications[] = UNICODE_LITERAL_12(A,p,p,l,i,c,a,t,i,o,n,s); + static const XMLCh _ArtifactMap[] = UNICODE_LITERAL_11(A,r,t,i,f,a,c,t,M,a,p); static const XMLCh _AttributeResolver[] = UNICODE_LITERAL_17(A,t,t,r,i,b,u,t,e,R,e,s,o,l,v,e,r); static const XMLCh Credentials[] = UNICODE_LITERAL_11(C,r,e,d,e,n,t,i,a,l,s); static const XMLCh CredentialUse[] = UNICODE_LITERAL_13(C,r,e,d,e,n,t,i,a,l,U,s,e); @@ -320,6 +323,9 @@ namespace { static const XMLCh Listener[] = UNICODE_LITERAL_8(L,i,s,t,e,n,e,r); static const XMLCh logger[] = UNICODE_LITERAL_6(l,o,g,g,e,r); static const XMLCh MemoryListener[] = UNICODE_LITERAL_14(M,e,m,o,r,y,L,i,s,t,e,n,e,r); + static const XMLCh _MetadataProvider[] = UNICODE_LITERAL_16(M,e,t,a,d,a,t,a,P,r,o,v,i,d,e,r); + static const XMLCh OutOfProcess[] = UNICODE_LITERAL_12(O,u,t,O,f,P,r,o,c,e,s,s); + static const XMLCh _path[] = UNICODE_LITERAL_4(p,a,t,h); static const XMLCh Policy[] = UNICODE_LITERAL_6(P,o,l,i,c,y); static const XMLCh RelyingParty[] = UNICODE_LITERAL_12(R,e,l,y,i,n,g,P,a,r,t,y); static const XMLCh _ReplayCache[] = UNICODE_LITERAL_11(R,e,p,l,a,y,C,a,c,h,e); @@ -329,13 +335,10 @@ namespace { static const XMLCh _SessionCache[] = UNICODE_LITERAL_12(S,e,s,s,i,o,n,C,a,c,h,e); static const XMLCh SessionInitiator[] = UNICODE_LITERAL_16(S,e,s,s,i,o,n,I,n,i,t,i,a,t,o,r); static const XMLCh _StorageService[] = UNICODE_LITERAL_14(S,t,o,r,a,g,e,S,e,r,v,i,c,e); - static const XMLCh OutOfProcess[] = UNICODE_LITERAL_12(O,u,t,O,f,P,r,o,c,e,s,s); static const XMLCh TCPListener[] = UNICODE_LITERAL_11(T,C,P,L,i,s,t,e,n,e,r); static const XMLCh _TrustEngine[] = UNICODE_LITERAL_11(T,r,u,s,t,E,n,g,i,n,e); - static const XMLCh UnixListener[] = UNICODE_LITERAL_12(U,n,i,x,L,i,s,t,e,n,e,r); - static const XMLCh _MetadataProvider[] = UNICODE_LITERAL_16(M,e,t,a,d,a,t,a,P,r,o,v,i,d,e,r); - static const XMLCh _path[] = UNICODE_LITERAL_4(p,a,t,h); static const XMLCh _type[] = UNICODE_LITERAL_4(t,y,p,e); + static const XMLCh UnixListener[] = UNICODE_LITERAL_12(U,n,i,x,L,i,s,t,e,n,e,r); class SHIBSP_DLLLOCAL PolicyNodeFilter : public DOMNodeFilter { @@ -859,6 +862,7 @@ short XMLConfigImpl::acceptNode(const DOMNode* node) const return FILTER_ACCEPT; const XMLCh* name=node->getLocalName(); if (XMLString::equals(name,Applications) || + XMLString::equals(name,_ArtifactMap) || XMLString::equals(name,Credentials) || XMLString::equals(name,Extensions::LOCAL_NAME) || XMLString::equals(name,Implementation) || @@ -1054,6 +1058,20 @@ XMLConfigImpl::XMLConfigImpl(const DOMElement* e, bool first, const XMLConfig* o replaySS = m_outer->m_storage[inmemID]; } xmlConf.setReplayCache(new ReplayCache(replaySS)); + + // ArtifactMap + child=XMLHelper::getFirstChildElement(SHAR,_ArtifactMap); + if (child) { + auto_ptr_char ssid(child->getAttributeNS(NULL,_StorageService)); + if (ssid.get() && *ssid.get() && m_outer->m_storage.count(ssid.get())) { + log.info("building ArtifactMap on top of StorageService (%s)...", ssid.get()); + samlConf.setArtifactMap(new ArtifactMap(child, m_outer->m_storage[ssid.get()])); + } + } + if (samlConf.getArtifactMap()==NULL) { + log.info("building in-memory ArtifactMap..."); + samlConf.setArtifactMap(new ArtifactMap(child)); + } } else { log.info("building in-process SessionCache of type %s...",REMOTED_SESSION_CACHE); -- 2.1.4