1 /** 2 * Licensed to the University Corporation for Advanced Internet 3 * Development, Inc. (UCAID) under one or more contributor license 4 * agreements. See the NOTICE file distributed with this work for 5 * additional information regarding copyright ownership. 6 * 7 * UCAID licenses this file to you under the Apache License, 8 * Version 2.0 (the "License"); you may not use this file except 9 * in compliance with the License. You may obtain a copy of the 10 * License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 17 * either express or implied. See the License for the specific 18 * language governing permissions and limitations under the License. 19 */ 20 21 #include <shibsp/SPConfig.h> 22 #include <shibsp/Application.h> 23 #include <shibsp/util/DOMPropertySet.h> 24 #include <saml/saml2/metadata/MetadataProvider.h> 25 #include <saml/binding/SAMLArtifact.h> 26 #include <saml/saml2/binding/SAML2Artifact.h> 27 28 #if defined (_MSC_VER) 29 #pragma warning( push ) 30 #pragma warning( disable : 4250 ) 31 #endif 32 33 namespace ta { 34 35 using namespace std; 36 using namespace shibsp; 37 using namespace opensaml::saml2md; 38 using namespace opensaml; 39 40 class TestApplication : public Application { 41 public: 42 TestApplication(const ServiceProvider *sp, MetadataProvider* provider); 43 44 // Application 45 virtual const char* getHash() const; 46 virtual MetadataProvider* getMetadataProvider(bool required=true) const; 47 virtual xmltooling::TrustEngine* getTrustEngine(bool required=true) const; 48 virtual AttributeExtractor* getAttributeExtractor() const; 49 virtual AttributeFilter* getAttributeFilter() const; 50 virtual AttributeResolver* getAttributeResolver() const; 51 virtual xmltooling::CredentialResolver* getCredentialResolver() const; 52 virtual const PropertySet* getRelyingParty(const EntityDescriptor* provider) const; 53 virtual const PropertySet* getRelyingParty(const XMLCh* entityID) const; 54 virtual const vector<const XMLCh*>* getAudiences() const; 55 virtual string getNotificationURL(const char* request, bool front, unsigned int index) const; 56 virtual const vector<string>& getRemoteUserAttributeIds() const; 57 virtual const SessionInitiator* getDefaultSessionInitiator() const; 58 virtual const SessionInitiator* getSessionInitiatorById(const char* id) const; 59 virtual const Handler* getDefaultAssertionConsumerService() const; 60 virtual const Handler* getAssertionConsumerServiceByIndex(unsigned short index) const; 61 virtual const Handler* getAssertionConsumerServiceByProtocol(const XMLCh* protocol, const char* binding=nullptr) const; 62 virtual const Handler* getHandler(const char* path) const; 63 virtual void getHandlers(vector<const Handler*>& handlers) const; 64 virtual SAMLArtifact* generateSAML1Artifact(const EntityDescriptor* relyingParty) const; 65 virtual saml2p::SAML2Artifact* generateSAML2Artifact(const EntityDescriptor* relyingParty) const; 66 67 // PropertySet 68 virtual const PropertySet* getParent() const; 69 virtual void setParent(const PropertySet* parent); 70 virtual pair<bool, bool> getBool(const char* name, const char* ns=nullptr) const; 71 virtual pair<bool, const char*> getString(const char* name, const char* ns=nullptr) const; 72 virtual pair<bool, const XMLCh*> getXMLString(const char* name, const char* ns=nullptr) const; 73 virtual pair<bool, unsigned int> getUnsignedInt(const char* name, const char* ns=nullptr) const; 74 virtual pair<bool, int> getInt(const char* name, const char* ns=nullptr) const; 75 virtual void getAll(std::map<std::string, const char*>& properties) const; 76 virtual const PropertySet* getPropertySet(const char* name, const char* ns=shibspconstants::ASCII_SHIBSPCONFIG_NS) const; 77 virtual const xercesc::DOMElement* getElement() const; 78 79 private: 80 MetadataProvider* m_provider; 81 }; 82 83 } 84 85 #if defined (_MSC_VER) 86 #pragma warning( pop ) 87 #endif 88