Changed Iterator arguments to const references
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Mon, 19 Aug 2002 07:18:16 +0000 (07:18 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Mon, 19 Aug 2002 07:18:16 +0000 (07:18 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@45 cb58f699-b61c-0410-a6fe-9272a202ed29

eduPerson/AffiliationAttribute.cpp
eduPerson/EntitlementAttribute.cpp
eduPerson/ScopedAttribute.cpp
include/eduPerson.h
include/shib.h
shib/ClubShibPOSTProfile.cpp
shib/ShibPOSTProfile.cpp
shib/ShibPOSTProfileFactory.cpp

index 774b868..ee70aa1 100644 (file)
@@ -68,7 +68,8 @@ using namespace eduPerson;
 using namespace std;
 
 AffiliationAttribute::AffiliationAttribute(const XMLCh* defaultScope, long lifetime,
-                                           Iterator<const XMLCh*>& scopes,Iterator<const XMLCh*>& values)
+                                           const Iterator<const XMLCh*>& scopes,
+                                           const Iterator<const XMLCh*>& values)
     : ScopedAttribute(eduPerson::Constants::EDUPERSON_AFFILIATION,
                      shibboleth::Constants::SHIB_ATTRIBUTE_NAMESPACE_URI,
                      defaultScope,NULL,lifetime,scopes,values)
index 5b35ecb..4b0aaf2 100644 (file)
@@ -69,7 +69,7 @@ using namespace std;
 
 static XMLCh anyURI[]={ chLatin_a, chLatin_n, chLatin_y, chLatin_U, chLatin_R, chLatin_I, chNull };
 
-EntitlementAttribute::EntitlementAttribute(long lifetime, Iterator<const XMLCh*>& values)
+EntitlementAttribute::EntitlementAttribute(long lifetime, const Iterator<const XMLCh*>& values)
     : SAMLAttribute(eduPerson::Constants::EDUPERSON_ENTITLEMENT,
                            shibboleth::Constants::SHIB_ATTRIBUTE_NAMESPACE_URI,NULL,lifetime,values)
 {
index ce5e6d9..3096017 100644 (file)
@@ -69,7 +69,8 @@ using namespace std;
 
 ScopedAttribute::ScopedAttribute(const XMLCh* name, const XMLCh* ns, const XMLCh* defaultScope,
                                  const saml::QName* type, long lifetime,
-                                 saml::Iterator<const XMLCh*>& scopes,saml::Iterator<const XMLCh*>& values)
+                                 const saml::Iterator<const XMLCh*>& scopes,
+                                 const saml::Iterator<const XMLCh*>& values)
     : SAMLAttribute(name,ns,type,lifetime,values)
 {
     if (scopes.size()!=values.size())
index 1cfbaef..f4f14e3 100644 (file)
@@ -75,8 +75,8 @@ namespace eduPerson
     {
     public:
         ScopedAttribute(const XMLCh* name, const XMLCh* ns, const XMLCh* defaultScope, const saml::QName* type=NULL,
-                        long lifetime=0, saml::Iterator<const XMLCh*>& scopes=saml::Iterator<const XMLCh*>(),
-                        saml::Iterator<const XMLCh*>& values=saml::Iterator<const XMLCh*>());
+                        long lifetime=0, const saml::Iterator<const XMLCh*>& scopes=saml::Iterator<const XMLCh*>(),
+                        const saml::Iterator<const XMLCh*>& values=saml::Iterator<const XMLCh*>());
         ScopedAttribute(IDOM_Element* e);
         virtual ~ScopedAttribute();
 
@@ -112,8 +112,8 @@ namespace eduPerson
     {
     public:
         AffiliationAttribute(const XMLCh* defaultScope, long lifetime=0,
-                             saml::Iterator<const XMLCh*>& scopes=saml::Iterator<const XMLCh*>(),
-                             saml::Iterator<const XMLCh*>& values=saml::Iterator<const XMLCh*>());
+                             const saml::Iterator<const XMLCh*>& scopes=saml::Iterator<const XMLCh*>(),
+                             const saml::Iterator<const XMLCh*>& values=saml::Iterator<const XMLCh*>());
         AffiliationAttribute(IDOM_Element* e);
         virtual ~AffiliationAttribute();
 
@@ -135,7 +135,7 @@ namespace eduPerson
     class EDUPERSON_EXPORTS EntitlementAttribute : public saml::SAMLAttribute
     {
     public:
-        EntitlementAttribute(long lifetime=0, saml::Iterator<const XMLCh*>& values=saml::Iterator<const XMLCh*>());
+        EntitlementAttribute(long lifetime=0, const saml::Iterator<const XMLCh*>& values=saml::Iterator<const XMLCh*>());
         EntitlementAttribute(IDOM_Element* e);
         virtual ~EntitlementAttribute();
 
index d0d5549..3746758 100644 (file)
@@ -76,10 +76,10 @@ namespace shibboleth
     public:
         explicit UnsupportedProtocolException(const char* msg) : saml::SAMLException(msg) {}
         explicit UnsupportedProtocolException(const std::string& msg) : saml::SAMLException(msg) {}
-        explicit UnsupportedProtocolException(saml::Iterator<saml::QName>& codes, const char* msg) : saml::SAMLException(codes,msg) {}
-        explicit UnsupportedProtocolException(saml::Iterator<saml::QName>& codes, const std::string& msg) : saml::SAMLException(codes, msg) {}
-        explicit UnsupportedProtocolException(saml::QName& code, const char* msg) : saml::SAMLException(code,msg) {}
-        explicit UnsupportedProtocolException(saml::QName& code, const std::string& msg) : saml::SAMLException(code, msg) {}
+        explicit UnsupportedProtocolException(const saml::Iterator<saml::QName>& codes, const char* msg) : saml::SAMLException(codes,msg) {}
+        explicit UnsupportedProtocolException(const saml::Iterator<saml::QName>& codes, const std::string& msg) : saml::SAMLException(codes, msg) {}
+        explicit UnsupportedProtocolException(const saml::QName& code, const char* msg) : saml::SAMLException(code,msg) {}
+        explicit UnsupportedProtocolException(const saml::QName& code, const std::string& msg) : saml::SAMLException(code, msg) {}
     };
 
     struct SHIB_EXPORTS IOriginSiteMapper
@@ -93,8 +93,8 @@ namespace shibboleth
     class SHIB_EXPORTS ShibPOSTProfile
     {
     public:
-        ShibPOSTProfile(saml::Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper, const XMLCh* receiver, int ttlSeconds);
-        ShibPOSTProfile(saml::Iterator<const XMLCh*>& policies, const XMLCh* issuer);
+        ShibPOSTProfile(const saml::Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper, const XMLCh* receiver, int ttlSeconds);
+        ShibPOSTProfile(const saml::Iterator<const XMLCh*>& policies, const XMLCh* issuer);
         virtual ~ShibPOSTProfile();
 
         virtual saml::SAMLAssertion* getSSOAssertion(const saml::SAMLResponse& r);
@@ -106,14 +106,14 @@ namespace shibboleth
                                             const XMLCh* subjectIP,
                                             const XMLCh* authMethod,
                                             time_t authInstant,
-                                            saml::Iterator<saml::SAMLAuthorityBinding*>& bindings,
+                                            const saml::Iterator<saml::SAMLAuthorityBinding*>& bindings,
                                             const saml::Key& responseKey, const saml::X509Certificate* responseCert,
                                             const saml::Key* assertionKey, const saml::X509Certificate* assertionCert);
         virtual bool checkReplayCache(const saml::SAMLAssertion& a);
 
     protected:
         virtual bool verifySignature(const saml::SAMLSignedObject& obj, const XMLCh* signerName,
-                                     saml::Iterator<saml::X509Certificate*>& roots, const saml::Key* knownKey);
+                                     const saml::Iterator<saml::X509Certificate*>& roots, const saml::Key* knownKey);
 
         saml::SAMLSignedObject::sigs_t m_algorithm;
         IOriginSiteMapper* m_mapper;
@@ -126,8 +126,8 @@ namespace shibboleth
     class SHIB_EXPORTS ClubShibPOSTProfile : public ShibPOSTProfile
     {
     public:
-        ClubShibPOSTProfile(saml::Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper, const XMLCh* receiver, int ttlSeconds);
-        ClubShibPOSTProfile(saml::Iterator<const XMLCh*>& policies, const XMLCh* issuer);
+        ClubShibPOSTProfile(const saml::Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper, const XMLCh* receiver, int ttlSeconds);
+        ClubShibPOSTProfile(const saml::Iterator<const XMLCh*>& policies, const XMLCh* issuer);
         virtual ~ClubShibPOSTProfile();
 
         virtual saml::SAMLResponse* prepare(const XMLCh* recipient,
@@ -136,21 +136,21 @@ namespace shibboleth
                                             const XMLCh* subjectIP,
                                             const XMLCh* authMethod,
                                             time_t authInstant,
-                                            saml::Iterator<saml::SAMLAuthorityBinding*>& bindings,
+                                            const saml::Iterator<saml::SAMLAuthorityBinding*>& bindings,
                                             const saml::Key& responseKey, const saml::X509Certificate* responseCert,
                                             const saml::Key* assertionKey, const saml::X509Certificate* assertionCert);
 
     protected:
         virtual bool verifySignature(const saml::SAMLSignedObject& obj, const XMLCh* signerName,
-                                     saml::Iterator<saml::X509Certificate*>& roots, const saml::Key* knownKey);
+                                     const saml::Iterator<saml::X509Certificate*>& roots, const saml::Key* knownKey);
     };
 
     class SHIB_EXPORTS ShibPOSTProfileFactory
     {
     public:
-        static ShibPOSTProfile* getInstance(saml::Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper,
+        static ShibPOSTProfile* getInstance(const saml::Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper,
                                             const XMLCh* receiver, int ttlSeconds);
-        static ShibPOSTProfile* getInstance(saml::Iterator<const XMLCh*>& policies, const XMLCh* issuer);
+        static ShibPOSTProfile* getInstance(const saml::Iterator<const XMLCh*>& policies, const XMLCh* issuer);
     };
 
     class SHIB_EXPORTS ShibConfig
index 7c2084b..e1ad2f1 100644 (file)
@@ -64,7 +64,7 @@ using namespace shibboleth;
 using namespace saml;
 using namespace std;
 
-ClubShibPOSTProfile::ClubShibPOSTProfile(Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper,
+ClubShibPOSTProfile::ClubShibPOSTProfile(const Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper,
                                          const XMLCh* receiver, int ttlSeconds)
     : ShibPOSTProfile(policies,mapper,receiver,ttlSeconds)
 {
@@ -76,7 +76,7 @@ ClubShibPOSTProfile::ClubShibPOSTProfile(Iterator<const XMLCh*>& policies, IOrig
         throw SAMLException(SAMLException::REQUESTER, "ClubShibPOSTProfile() policy array must include Club Shib");
 }
 
-ClubShibPOSTProfile::ClubShibPOSTProfile(Iterator<const XMLCh*>& policies, const XMLCh* issuer)
+ClubShibPOSTProfile::ClubShibPOSTProfile(const Iterator<const XMLCh*>& policies, const XMLCh* issuer)
     : ShibPOSTProfile(policies,issuer)
 {
     bool found=false;
@@ -97,7 +97,7 @@ SAMLResponse* ClubShibPOSTProfile::prepare(const XMLCh* recipient,
                                            const XMLCh* subjectIP,
                                            const XMLCh* authMethod,
                                            time_t authInstant,
-                                           Iterator<SAMLAuthorityBinding*>& bindings,
+                                           const Iterator<SAMLAuthorityBinding*>& bindings,
                                            const saml::Key& responseKey, const saml::X509Certificate* responseCert,
                                            const saml::Key* assertionKey, const saml::X509Certificate* assertionCert)
 {
@@ -111,7 +111,7 @@ SAMLResponse* ClubShibPOSTProfile::prepare(const XMLCh* recipient,
 }
 
 bool ClubShibPOSTProfile::verifySignature(const SAMLSignedObject& obj, const XMLCh* signerName,
-                                          saml::Iterator<saml::X509Certificate*>& roots,
+                                          const saml::Iterator<saml::X509Certificate*>& roots,
                                           const saml::Key* knownKey)
 {
     if (!ShibPOSTProfile::verifySignature(obj,signerName,roots,knownKey))
index 3ccac10..bdb7414 100644 (file)
@@ -64,7 +64,7 @@ using namespace shibboleth;
 using namespace saml;
 using namespace std;
 
-ShibPOSTProfile::ShibPOSTProfile(Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper, const XMLCh* receiver, int ttlSeconds)
+ShibPOSTProfile::ShibPOSTProfile(const Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper, const XMLCh* receiver, int ttlSeconds)
     : m_mapper(mapper), m_ttlSeconds(ttlSeconds), m_algorithm(SAMLSignedObject::RSA_SHA1), m_issuer(NULL)
 {
     if (!mapper || !receiver || !*receiver || ttlSeconds <= 0)
@@ -76,7 +76,7 @@ ShibPOSTProfile::ShibPOSTProfile(Iterator<const XMLCh*>& policies, IOriginSiteMa
         m_policies.push_back(XMLString::replicate(*policies.next()));
 }
 
-ShibPOSTProfile::ShibPOSTProfile(Iterator<const XMLCh*>& policies, const XMLCh* issuer)
+ShibPOSTProfile::ShibPOSTProfile(const Iterator<const XMLCh*>& policies, const XMLCh* issuer)
     : m_mapper(NULL), m_ttlSeconds(0), m_algorithm(SAMLSignedObject::RSA_SHA1), m_receiver(NULL)
 {
     if (!issuer || !*issuer)
@@ -161,7 +161,7 @@ SAMLResponse* ShibPOSTProfile::prepare(const XMLCh* recipient,
                                        const XMLCh* subjectIP,
                                        const XMLCh* authMethod,
                                        time_t authInstant,
-                                       Iterator<SAMLAuthorityBinding*>& bindings,
+                                       const Iterator<SAMLAuthorityBinding*>& bindings,
                                        const saml::Key& responseKey, const saml::X509Certificate* responseCert,
                                        const saml::Key* assertionKey, const saml::X509Certificate* assertionCert)
 {
@@ -193,7 +193,7 @@ bool ShibPOSTProfile::checkReplayCache(const SAMLAssertion& a)
 }
 
 bool ShibPOSTProfile::verifySignature(const SAMLSignedObject& obj, const XMLCh* signerName,
-                                      saml::Iterator<saml::X509Certificate*>& roots,
+                                      const saml::Iterator<saml::X509Certificate*>& roots,
                                       const saml::Key* knownKey)
 {
     return knownKey ? obj.verify(*knownKey) : obj.verify();
index db088d7..2a8451a 100644 (file)
@@ -64,7 +64,7 @@ using namespace shibboleth;
 using namespace saml;
 using namespace std;
 
-ShibPOSTProfile* ShibPOSTProfileFactory::getInstance(Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper,
+ShibPOSTProfile* ShibPOSTProfileFactory::getInstance(const Iterator<const XMLCh*>& policies, IOriginSiteMapper* mapper,
                                                      const XMLCh* receiver, int ttlSeconds)
 {
     if (policies.size()!=1 || XMLString::compareString(Constants::POLICY_CLUBSHIB,*policies.next()))
@@ -73,7 +73,7 @@ ShibPOSTProfile* ShibPOSTProfileFactory::getInstance(Iterator<const XMLCh*>& pol
     return new ClubShibPOSTProfile(policies,mapper,receiver,ttlSeconds);
 }
 
-ShibPOSTProfile* ShibPOSTProfileFactory::getInstance(Iterator<const XMLCh*>& policies, const XMLCh* issuer)
+ShibPOSTProfile* ShibPOSTProfileFactory::getInstance(const Iterator<const XMLCh*>& policies, const XMLCh* issuer)
 {
     if (policies.size()!=1 || XMLString::compareString(Constants::POLICY_CLUBSHIB,*policies.next()))
         return NULL;