[cpp-sp] branch main updated: Purge more material from plugins project.
Scott Cantor
cantor.2 at osu.edu
Tue Oct 29 15:16:45 UTC 2024
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository cpp-sp.
View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=516966988778859bb93a463c587faf14fdaaac68
The following commit(s) were added to refs/heads/main by this push:
new 51696698 Purge more material from plugins project.
51696698 is described below
commit 516966988778859bb93a463c587faf14fdaaac68
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Oct 29 11:16:39 2024 -0400
Purge more material from plugins project.
---
plugins/CaseFoldingAttributeResolver.cpp | 207 ---------------
plugins/GSSAPIAttributeExtractor.cpp | 421 -------------------------------
plugins/Makefile.am | 66 -----
plugins/TemplateAttributeResolver.cpp | 220 ----------------
plugins/TransformAttributeResolver.cpp | 250 ------------------
plugins/internal.h | 47 ----
plugins/plugins.cpp | 82 ------
plugins/plugins.rc | 109 --------
plugins/resource.h | 35 ---
9 files changed, 1437 deletions(-)
diff --git a/plugins/CaseFoldingAttributeResolver.cpp b/plugins/CaseFoldingAttributeResolver.cpp
deleted file mode 100644
index 4a882fef..00000000
--- a/plugins/CaseFoldingAttributeResolver.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
- *
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- */
-
-/**
- * CaseFoldingAttributeResolver.cpp
- *
- * Attribute Resolver plugins for upcasing and downcasing.
- */
-
-#include "internal.h"
-
-#include <algorithm>
-#include <shibsp/exceptions.h>
-#include <shibsp/SessionCache.h>
-#include <shibsp/attribute/SimpleAttribute.h>
-#include <shibsp/attribute/resolver/AttributeResolver.h>
-#include <shibsp/attribute/resolver/ResolutionContext.h>
-#include <xmltooling/XMLToolingConfig.h>
-#include <xmltooling/util/XMLHelper.h>
-#include <xercesc/util/XMLUniDefs.hpp>
-
-using namespace shibsp;
-using namespace xmltooling;
-using namespace xercesc;
-using namespace std;
-
-namespace shibsp {
-
- class SHIBSP_DLLLOCAL FoldingContext : public ResolutionContext
- {
- public:
- FoldingContext(const vector<Attribute*>* attributes) : m_inputAttributes(attributes) {
- }
-
- ~FoldingContext() {
- for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<Attribute>());
- }
-
- const vector<Attribute*>* getInputAttributes() const {
- return m_inputAttributes;
- }
- vector<Attribute*>& getResolvedAttributes() {
- return m_attributes;
- }
- vector<opensaml::Assertion*>& getResolvedAssertions() {
- return m_assertions;
- }
-
- private:
- const vector<Attribute*>* m_inputAttributes;
- vector<Attribute*> m_attributes;
- static vector<opensaml::Assertion*> m_assertions; // empty dummy
- };
-
-
- class SHIBSP_DLLLOCAL CaseFoldingAttributeResolver : public AttributeResolver
- {
- public:
- enum case_t {
- _up,
- _down
- };
-
- CaseFoldingAttributeResolver(const DOMElement* e, case_t direction);
- virtual ~CaseFoldingAttributeResolver() {}
-
- Lockable* lock() {
- return this;
- }
- void unlock() {
- }
-
- ResolutionContext* createResolutionContext(
- const Application& application,
- const GenericRequest* request,
- const opensaml::saml2md::EntityDescriptor* issuer,
- const XMLCh* protocol,
- const opensaml::saml2::NameID* nameid=nullptr,
- const XMLCh* authncontext_class=nullptr,
- const XMLCh* authncontext_decl=nullptr,
- const vector<const opensaml::Assertion*>* tokens=nullptr,
- const vector<Attribute*>* attributes=nullptr
- ) const {
- return new FoldingContext(attributes);
- }
-
- ResolutionContext* createResolutionContext(const Application& application, const Session& session) const {
- return new FoldingContext(&session.getAttributes());
- }
-
- void resolveAttributes(ResolutionContext& ctx) const;
-
- void getAttributeIds(vector<string>& attributes) const {
- if (!m_dest.empty() && !m_dest.front().empty())
- attributes.push_back(m_dest.front());
- }
-
- private:
- Category& m_log;
- case_t m_direction;
- string m_source;
- vector<string> m_dest;
- };
-
- static const XMLCh dest[] = UNICODE_LITERAL_4(d,e,s,t);
- static const XMLCh source[] = UNICODE_LITERAL_6(s,o,u,r,c,e);
-
- AttributeResolver* SHIBSP_DLLLOCAL UpperCaseAttributeResolverFactory(const DOMElement* const & e, bool)
- {
- return new CaseFoldingAttributeResolver(e, CaseFoldingAttributeResolver::_up);
- }
-
- AttributeResolver* SHIBSP_DLLLOCAL LowerCaseAttributeResolverFactory(const DOMElement* const & e, bool)
- {
- return new CaseFoldingAttributeResolver(e, CaseFoldingAttributeResolver::_down);
- }
-};
-
-vector<opensaml::Assertion*> FoldingContext::m_assertions;
-
-CaseFoldingAttributeResolver::CaseFoldingAttributeResolver(const DOMElement* e, case_t direction)
- : m_log(Category::getInstance(SHIBSP_LOGCAT ".AttributeResolver.CaseFolding")),
- m_direction(direction),
- m_source(XMLHelper::getAttrString(e, nullptr, source)),
- m_dest(1, XMLHelper::getAttrString(e, nullptr, dest))
-{
- if (m_source.empty())
- throw ConfigurationException("CaseFolding AttributeResolver requires source attribute.");
-}
-
-
-void CaseFoldingAttributeResolver::resolveAttributes(ResolutionContext& ctx) const
-{
- FoldingContext& fctx = dynamic_cast<FoldingContext&>(ctx);
- if (!fctx.getInputAttributes())
- return;
-
- auto_ptr<SimpleAttribute> destwrapper;
-
- for (vector<Attribute*>::const_iterator a = fctx.getInputAttributes()->begin(); a != fctx.getInputAttributes()->end(); ++a) {
- if (m_source != (*a)->getId() || (*a)->valueCount() == 0) {
- continue;
- }
-
- SimpleAttribute* dest = nullptr;
- if (m_dest.empty() || m_dest.front().empty()) {
- // Can we transform in-place?
- dest = dynamic_cast<SimpleAttribute*>(*a);
- if (!dest) {
- m_log.warn("can't %scase non-simple attribute (%s) 'in place'", (m_direction==_up ? "up" : "down"), m_source.c_str());
- continue;
- }
- m_log.debug("applying in-place transform to source attribute (%s)", m_source.c_str());
- }
- else if (!destwrapper.get()) {
- // Create a destination attribute.
- destwrapper.reset(new SimpleAttribute(m_dest));
- m_log.debug("applying transform from source attribute (%s) to dest attribute (%s)", m_source.c_str(), m_dest.front().c_str());
- }
-
- for (size_t i = 0; i < (*a)->valueCount(); ++i) {
- try {
- XMLCh* srcval = fromUTF8((*a)->getSerializedValues()[i].c_str());
- if (srcval) {
- auto_arrayptr<XMLCh> valjanitor(srcval);
- (m_direction == _up) ? XMLString::upperCase(srcval) : XMLString::lowerCase(srcval);
- auto_arrayptr<char> narrow(toUTF8(srcval));
- if (dest) {
- // Modify in place.
- dest->getValues()[i] = narrow.get();
- }
- else {
- // Add to new object.
- destwrapper->getValues().push_back(narrow.get());
- }
- }
- }
- catch (XMLException& ex) {
- auto_ptr_char msg(ex.getMessage());
- m_log.error("caught error performing conversion: %s", msg.get());
- }
- }
- }
-
- // Save off new object.
- if (destwrapper.get()) {
- ctx.getResolvedAttributes().push_back(destwrapper.get());
- destwrapper.release();
- }
-}
diff --git a/plugins/GSSAPIAttributeExtractor.cpp b/plugins/GSSAPIAttributeExtractor.cpp
deleted file mode 100644
index 09261811..00000000
--- a/plugins/GSSAPIAttributeExtractor.cpp
+++ /dev/null
@@ -1,421 +0,0 @@
-/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
- *
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- */
-
-/**
- * GSSAPIAttributeExtractor.cpp
- *
- * AttributeExtractor for a base64-encoded GSS-API context or name.
- */
-
-#include "internal.h"
-
-#include <shibsp/exceptions.h>
-#include <shibsp/Application.h>
-#include <shibsp/SPConfig.h>
-#include <shibsp/attribute/BinaryAttribute.h>
-#include <shibsp/attribute/ScopedAttribute.h>
-#include <shibsp/attribute/SimpleAttribute.h>
-#include <shibsp/attribute/resolver/AttributeExtractor.h>
-#include <shibsp/remoting/ddf.h>
-#include <shibsp/util/SPConstants.h>
-#include <saml/saml1/core/Assertions.h>
-#include <saml/saml2/metadata/Metadata.h>
-#include <xmltooling/unicode.h>
-#include <xmltooling/XMLToolingConfig.h>
-#include <xmltooling/util/NDC.h>
-#include <xmltooling/util/ReloadableXMLFile.h>
-#include <xmltooling/util/Threads.h>
-#include <xmltooling/util/XMLHelper.h>
-#include <xercesc/util/Base64.hpp>
-#include <xercesc/util/XMLUniDefs.hpp>
-#include <boost/algorithm/string.hpp>
-
-#ifdef SHIBSP_HAVE_GSSGNU
-# include <gss.h>
-#elif defined SHIBSP_HAVE_GSSMIT
-# include <gssapi/gssapi_ext.h>
-#else
-# include <gssapi.h>
-#endif
-
-
-using namespace shibsp;
-using namespace opensaml::saml2md;
-using namespace opensaml;
-using namespace xmltooling;
-using namespace xercesc;
-using namespace boost;
-using namespace std;
-
-namespace shibsp {
-
-#if defined (_MSC_VER)
- #pragma warning( push )
- #pragma warning( disable : 4250 )
-#endif
-
- class GSSAPIExtractorImpl
- {
- public:
- GSSAPIExtractorImpl(const DOMElement* e, Category& log);
- ~GSSAPIExtractorImpl() {
- if (m_document)
- m_document->release();
- }
-
- void setDocument(DOMDocument* doc) {
- m_document = doc;
- }
-
- void extractAttributes(gss_name_t initiatorName, vector<Attribute*>& attributes) const;
- void extractAttributes(gss_name_t initiatorName, gss_buffer_t namingAttribute, vector<Attribute*>& attributes) const;
-
- void getAttributeIds(vector<string>& attributes) const {
- attributes.insert(attributes.end(), m_attributeIds.begin(), m_attributeIds.end());
- }
-
- private:
- struct Rule {
- Rule() : authenticated(true), binary(false), scopeDelimiter(0) {}
- vector<string> ids;
- bool authenticated,binary;
- char scopeDelimiter;
- };
-
- Category& m_log;
- DOMDocument* m_document;
- map<string,Rule> m_attrMap;
- vector<string> m_attributeIds;
- };
-
- class GSSAPIExtractor : public AttributeExtractor, public ReloadableXMLFile
- {
- public:
- GSSAPIExtractor(const DOMElement* e)
- : ReloadableXMLFile(e, Category::getInstance(SHIBSP_LOGCAT ".AttributeExtractor.GSSAPI")) {
- SPConfig::getConfig().deprecation().warn("GSSAPI AttributeExtractor");
- background_load();
- }
- ~GSSAPIExtractor() {
- shutdown();
- }
-
- void extractAttributes(
- const Application& application,
- const GenericRequest* request,
- const RoleDescriptor* issuer,
- const XMLObject& xmlObject,
- vector<Attribute*>& attributes
- ) const;
-
- void getAttributeIds(std::vector<std::string>& attributes) const {
- if (m_impl)
- m_impl->getAttributeIds(attributes);
- }
-
- protected:
- pair<bool,DOMElement*> background_load();
-
- private:
- scoped_ptr<GSSAPIExtractorImpl> m_impl;
- };
-
-#if defined (_MSC_VER)
- #pragma warning( pop )
-#endif
-
- AttributeExtractor* GSSAPIExtractorFactory(const DOMElement* const & e, bool)
- {
- return new GSSAPIExtractor(e);
- }
-
- static const XMLCh _aliases[] = UNICODE_LITERAL_7(a,l,i,a,s,e,s);
- static const XMLCh Attributes[] = UNICODE_LITERAL_10(A,t,t,r,i,b,u,t,e,s);
- static const XMLCh _authenticated[] = UNICODE_LITERAL_13(a,u,t,h,e,n,t,i,c,a,t,e,d);
- static const XMLCh _binary[] = UNICODE_LITERAL_6(b,i,n,a,r,y);
- static const XMLCh GSSAPIAttribute[] = UNICODE_LITERAL_15(G,S,S,A,P,I,A,t,t,r,i,b,u,t,e);
- static const XMLCh _id[] = UNICODE_LITERAL_2(i,d);
- static const XMLCh _name[] = UNICODE_LITERAL_4(n,a,m,e);
- static const XMLCh _scopeDelimiter[] = UNICODE_LITERAL_14(s,c,o,p,e,D,e,l,i,m,i,t,e,r);
-};
-
-GSSAPIExtractorImpl::GSSAPIExtractorImpl(const DOMElement* e, Category& log)
- : m_log(log), m_document(nullptr)
-{
-#ifdef _DEBUG
- xmltooling::NDC ndc("GSSAPIExtractorImpl");
-#endif
-
- if (!XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEMAP_NS, Attributes))
- throw ConfigurationException("GSSAPI AttributeExtractor requires am:Attributes at root of configuration.");
-
- DOMElement* child = XMLHelper::getFirstChildElement(e, shibspconstants::SHIB2ATTRIBUTEMAP_NS, GSSAPIAttribute);
- while (child) {
- // Check for missing name or id.
- const XMLCh* name = child->getAttributeNS(nullptr, _name);
- if (!name || !*name) {
- m_log.warn("skipping GSSAPIAttribute with no name");
- child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, GSSAPIAttribute);
- continue;
- }
-
- auto_ptr_char id(child->getAttributeNS(nullptr, _id));
- if (!id.get() || !*id.get()) {
- m_log.warn("skipping GSSAPIAttribute with no id");
- child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, GSSAPIAttribute);
- continue;
- }
- else if (!strcmp(id.get(), "REMOTE_USER")) {
- m_log.warn("skipping GSSAPIAttribute, id of REMOTE_USER is a reserved name");
- child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, GSSAPIAttribute);
- continue;
- }
-
- // Fetch/create the map entry and see if it's a duplicate rule.
- auto_ptr_char attrname(name);
- Rule& decl = m_attrMap[attrname.get()];
- if (!decl.ids.empty()) {
- m_log.warn("skipping duplicate GSS-API Attribute mapping (same name)");
- child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, GSSAPIAttribute);
- continue;
- }
-
- m_log.info("creating mapping for GSS-API Attribute %s", attrname.get());
-
- decl.ids.push_back(id.get());
- m_attributeIds.push_back(id.get());
-
- name = child->getAttributeNS(nullptr, _aliases);
- if (name && *name) {
- auto_ptr_char aliases(name);
- string dup(aliases.get());
- trim(dup);
- set<string> new_aliases;
- split(new_aliases, dup, is_space(), algorithm::token_compress_on);
- set<string>::iterator ru = new_aliases.find("REMOTE_USER");
- if (ru != new_aliases.end()) {
- m_log.warn("skipping alias, REMOTE_USER is a reserved name");
- new_aliases.erase(ru);
- }
- m_attributeIds.insert(m_attributeIds.end(), new_aliases.begin(), new_aliases.end());
- }
-
- decl.authenticated = XMLHelper::getAttrBool(child, true, _authenticated);
- decl.binary = XMLHelper::getAttrBool(child, false, _binary);
- string delim = XMLHelper::getAttrString(child, "", _scopeDelimiter);
- if (!delim.empty())
- decl.scopeDelimiter = delim[0];
-
- child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, GSSAPIAttribute);
- }
-}
-
-void GSSAPIExtractorImpl::extractAttributes(gss_name_t initiatorName, vector<Attribute*>& attributes) const
-{
- OM_uint32 minor;
- gss_buffer_set_t attrnames = GSS_C_NO_BUFFER_SET;
- OM_uint32 major = gss_inquire_name(&minor, initiatorName, nullptr, nullptr, &attrnames);
- if (major == GSS_S_COMPLETE) {
- for (size_t i = 0; i < attrnames->count; ++i) {
- extractAttributes(initiatorName, &attrnames->elements[i], attributes);
- }
- gss_release_buffer_set(&minor, &attrnames);
- }
- else {
- m_log.warn("unable to extract attributes, GSS name attribute inquiry failed (%u:%u)", major, minor);
- }
-}
-
-void GSSAPIExtractorImpl::extractAttributes(
- gss_name_t initiatorName, gss_buffer_t namingAttribute, vector<Attribute*>& attributes
- ) const
-{
- // First we have to determine if this GSS attribute is something we recognize.
- string attrname(reinterpret_cast<char*>(namingAttribute->value), namingAttribute->length);
- map<string,Rule>::const_iterator rule = m_attrMap.find(attrname);
- if (rule == m_attrMap.end()) {
- m_log.info("skipping GSS-API attribute: %s", attrname.c_str());
- return;
- }
-
- vector<string> values;
-
- OM_uint32 major,minor;
- int authenticated=-1,more=-1;
- do {
- gss_buffer_desc buf = GSS_C_EMPTY_BUFFER;
- major = gss_get_name_attribute(
- &minor, initiatorName, namingAttribute, &authenticated, nullptr, &buf, nullptr, &more
- );
- if (major == GSS_S_COMPLETE) {
- if (rule->second.authenticated && !authenticated) {
- m_log.warn("skipping unauthenticated GSS-API attribute: %s", attrname.c_str());
- gss_release_buffer(&minor, &buf);
- return;
- }
- if (buf.length) {
- values.push_back(string(reinterpret_cast<char*>(buf.value), buf.length));
- }
- gss_release_buffer(&minor, &buf);
- }
- else {
- m_log.warn("error obtaining values for GSS-API attribute (%s): %u:%u", attrname.c_str(), major, minor);
- }
- } while (major == GSS_S_COMPLETE && more);
-
- if (values.empty())
- return;
-
- if (rule->second.scopeDelimiter && !rule->second.binary) {
- auto_ptr<ScopedAttribute> scoped(new ScopedAttribute(rule->second.ids, rule->second.scopeDelimiter));
- vector< pair<string,string> >& dest = scoped->getValues();
- for (vector<string>::const_iterator v = values.begin(); v != values.end(); ++v) {
- const char* value = v->c_str();
- const char* scope = strchr(value, rule->second.scopeDelimiter);
- if (scope) {
- if (*(scope+1))
- dest.push_back(pair<string,string>(v->substr(0, scope-value), scope + 1));
- else
- m_log.warn("ignoring unscoped value");
- }
- else {
- m_log.warn("ignoring unscoped value");
- }
- }
- if (!scoped->getValues().empty()) {
- attributes.push_back(scoped.get());
- scoped.release();
- }
- }
- else if (rule->second.binary) {
- auto_ptr<BinaryAttribute> binary(new BinaryAttribute(rule->second.ids));
- binary->getValues() = values;
- attributes.push_back(binary.get());
- binary.release();
- }
- else {
- auto_ptr<SimpleAttribute> simple(new SimpleAttribute(rule->second.ids));
- simple->getValues() = values;
- attributes.push_back(simple.get());
- simple.release();
- }
-}
-
-void GSSAPIExtractor::extractAttributes(
- const Application& application, const GenericRequest* request, const RoleDescriptor* issuer, const XMLObject& xmlObject, vector<Attribute*>& attributes
- ) const
-{
- if (!m_impl)
- return;
-
- static const XMLCh _GSSAPIContext[] = UNICODE_LITERAL_13(G,S,S,A,P,I,C,o,n,t,e,x,t);
- static const XMLCh _GSSAPIName[] = UNICODE_LITERAL_10(G,S,S,A,P,I,N,a,m,e);
-
- if (!XMLString::equals(xmlObject.getElementQName().getLocalPart(), _GSSAPIContext)
- && !XMLString::equals(xmlObject.getElementQName().getLocalPart(), _GSSAPIName)
- ) {
- m_log.debug("unable to extract attributes, unknown XML object type: %s", xmlObject.getElementQName().toString().c_str());
- return;
- }
-
- const XMLCh* encodedWide = xmlObject.getTextContent();
- if (!encodedWide || !*encodedWide) {
- m_log.warn("unable to extract attributes, GSSAPI element had no text content");
- return;
- }
-
- XMLSize_t x;
- OM_uint32 major,minor;
- auto_ptr_char encoded(encodedWide);
-
- gss_name_t srcname;
- gss_ctx_id_t gss = GSS_C_NO_CONTEXT;
-
- XMLByte* decoded=Base64::decode(reinterpret_cast<const XMLByte*>(encoded.get()), &x);
- if (decoded) {
- gss_buffer_desc importbuf;
- importbuf.length = x;
- importbuf.value = decoded;
- if (XMLString::equals(xmlObject.getElementQName().getLocalPart(), _GSSAPIName)) {
-#if HAVE_DECL_GSS_C_NT_EXPORT_NAME_COMPOSITE
- major = gss_import_name(&minor, &importbuf, GSS_C_NT_EXPORT_NAME_COMPOSITE, &srcname);
-#else
- major = gss_import_name(&minor, &importbuf, GSS_C_NT_EXPORT_NAME, &srcname);
-#endif
- if (major == GSS_S_COMPLETE) {
- m_impl->extractAttributes(srcname, attributes);
- gss_release_name(&minor, &srcname);
- }
- else {
- m_log.warn("unable to extract attributes, GSS name import failed (%u:%u)", major, minor);
- }
- // We fall through here down to the GSS context check, which will exit us.
- }
- else {
- major = gss_import_sec_context(&minor, &importbuf, &gss);
- if (major != GSS_S_COMPLETE) {
- m_log.warn("unable to extract attributes, GSS context import failed (%u:%u)", major, minor);
- gss = GSS_C_NO_CONTEXT;
- }
- }
- XMLString::release((char**)&decoded);
- }
- else {
- m_log.warn("unable to extract attributes, base64 decode of GSSAPI context or name failed");
- }
-
- if (gss == GSS_C_NO_CONTEXT) {
- return;
- }
-
- // Extract the initiator name from the context.
- major = gss_inquire_context(&minor, gss, &srcname, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
- if (major == GSS_S_COMPLETE) {
- m_impl->extractAttributes(srcname, attributes);
- gss_release_name(&minor, &srcname);
- }
- else {
- m_log.warn("unable to extract attributes, GSS initiator name extraction failed (%u:%u)", major, minor);
- }
-
- gss_delete_sec_context(&minor, &gss, GSS_C_NO_BUFFER);
-}
-
-pair<bool,DOMElement*> GSSAPIExtractor::background_load()
-{
- // Load from source using base class.
- pair<bool,DOMElement*> raw = ReloadableXMLFile::load();
-
- // If we own it, wrap it.
- XercesJanitor<DOMDocument> docjanitor(raw.first ? raw.second->getOwnerDocument() : nullptr);
-
- scoped_ptr<GSSAPIExtractorImpl> impl(new GSSAPIExtractorImpl(raw.second, m_log));
-
- // If we held the document, transfer it to the impl. If we didn't, it's a no-op.
- impl->setDocument(docjanitor.release());
-
- // Perform the swap inside a lock.
- if (m_lock)
- m_lock->wrlock();
- SharedLock locker(m_lock, false);
- m_impl.swap(impl);
-
- return make_pair(false,(DOMElement*)nullptr);
-}
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
deleted file mode 100644
index 0e8d048a..00000000
--- a/plugins/Makefile.am
+++ /dev/null
@@ -1,66 +0,0 @@
-AUTOMAKE_OPTIONS = foreign
-
-plugindir = $(libdir)/@PACKAGE_NAME@
-plugin_LTLIBRARIES = plugins.la plugins-lite.la
-
-noinst_HEADERS = \
- internal.h
-
-common_sources = \
- plugins.cpp \
- AttributeResolverHandler.cpp \
- TimeAccessControl.cpp
-
-plugins_la_SOURCES = \
- ${common_sources} \
- CaseFoldingAttributeResolver.cpp \
- TemplateAttributeResolver.cpp \
- TransformAttributeResolver.cpp
-
-plugins_lite_la_SOURCES = \
- ${common_sources}
-
-plugins_la_CXXFLAGS = \
- $(AM_CXXFLAGS) \
- $(BOOST_CPPFLAGS) \
- $(PTHREAD_CFLAGS) \
- $(log4cpp_CFLAGS) \
- $(log4shib_CFLAGS) \
- $(opensaml_CFLAGS) \
- $(xerces_CFLAGS) \
- $(xmltooling_CFLAGS)
-plugins_la_LIBADD = \
- $(top_builddir)/shibsp/libshibsp.la \
- $(PTHREAD_LIBS) \
- $(log4cpp_LIBS) \
- $(log4shib_LIBS) \
- $(opensaml_LIBS) \
- $(xerces_LIBS) \
- $(xmltooling_LIBS)
-
-if GSSAPI_NAMINGEXTS
-plugins_la_SOURCES += GSSAPIAttributeExtractor.cpp
-plugins_la_CXXFLAGS += $(gss_CFLAGS) $(gnu_gss_CFLAGS)
-plugins_la_LIBADD += $(gss_LIBS) $(gnu_gss_LIBS)
-endif
-
-plugins_lite_la_LIBADD = \
- $(top_builddir)/shibsp/libshibsp-lite.la \
- $(PTHREAD_LIBS) \
- $(log4cpp_LIBS) \
- $(log4shib_LIBS) \
- $(xerces_LIBS) \
- $(xmltooling_lite_LIBS)
-
-plugins_la_LDFLAGS = -module -avoid-version
-plugins_lite_la_LDFLAGS = -module -avoid-version
-plugins_lite_la_CXXFLAGS = -DSHIBSP_LITE \
- $(AM_CXXFLAGS) \
- $(BOOST_CPPFLAGS) \
- $(PTHREAD_CFLAGS) \
- $(log4cpp_CFLAGS) \
- $(log4shib_CFLAGS) \
- $(xerces_CFLAGS) \
- $(xmltooling_lite_CFLAGS)
-
-EXTRA_DIST = resource.h plugins.rc
diff --git a/plugins/TemplateAttributeResolver.cpp b/plugins/TemplateAttributeResolver.cpp
deleted file mode 100644
index cfa84a7f..00000000
--- a/plugins/TemplateAttributeResolver.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
- *
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- */
-
-/**
- * TemplateAttributeResolver.cpp
- *
- * AttributeResolver plugin for composing input values.
- */
-
-#include "internal.h"
-
-#include <boost/algorithm/string.hpp>
-#include <shibsp/exceptions.h>
-#include <shibsp/SessionCache.h>
-#include <shibsp/attribute/SimpleAttribute.h>
-#include <shibsp/attribute/resolver/AttributeResolver.h>
-#include <shibsp/attribute/resolver/ResolutionContext.h>
-#include <xmltooling/XMLToolingConfig.h>
-#include <xmltooling/util/Predicates.h>
-#include <xmltooling/util/XMLHelper.h>
-#include <xercesc/util/XMLUniDefs.hpp>
-
-using namespace shibsp;
-using namespace xmltooling;
-using namespace xercesc;
-using namespace boost;
-using namespace std;
-
-namespace shibsp {
-
- class SHIBSP_DLLLOCAL TemplateContext : public ResolutionContext
- {
- public:
- TemplateContext(const vector<Attribute*>* attributes) : m_inputAttributes(attributes) {
- }
-
- ~TemplateContext() {
- for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<Attribute>());
- }
-
- const vector<Attribute*>* getInputAttributes() const {
- return m_inputAttributes;
- }
- vector<Attribute*>& getResolvedAttributes() {
- return m_attributes;
- }
- vector<opensaml::Assertion*>& getResolvedAssertions() {
- return m_assertions;
- }
-
- private:
- const vector<Attribute*>* m_inputAttributes;
- vector<Attribute*> m_attributes;
- static vector<opensaml::Assertion*> m_assertions; // empty dummy
- };
-
-
- class SHIBSP_DLLLOCAL TemplateAttributeResolver : public AttributeResolver
- {
- public:
- TemplateAttributeResolver(const DOMElement* e);
- virtual ~TemplateAttributeResolver() {}
-
- Lockable* lock() {
- return this;
- }
- void unlock() {
- }
-
- ResolutionContext* createResolutionContext(
- const Application& application,
- const GenericRequest* request,
- const opensaml::saml2md::EntityDescriptor* issuer,
- const XMLCh* protocol,
- const opensaml::saml2::NameID* nameid=nullptr,
- const XMLCh* authncontext_class=nullptr,
- const XMLCh* authncontext_decl=nullptr,
- const vector<const opensaml::Assertion*>* tokens=nullptr,
- const vector<Attribute*>* attributes=nullptr
- ) const {
- return new TemplateContext(attributes);
- }
-
- ResolutionContext* createResolutionContext(const Application& application, const Session& session) const {
- return new TemplateContext(&session.getAttributes());
- }
-
- void resolveAttributes(ResolutionContext& ctx) const;
-
- void getAttributeIds(vector<string>& attributes) const {
- attributes.push_back(m_dest.front());
- }
-
- private:
- Category& m_log;
- string m_template;
- vector<string> m_sources,m_dest;
- };
-
- static const XMLCh dest[] = UNICODE_LITERAL_4(d,e,s,t);
- static const XMLCh _sources[] = UNICODE_LITERAL_7(s,o,u,r,c,e,s);
- static const XMLCh Template[] = UNICODE_LITERAL_8(T,e,m,p,l,a,t,e);
-
- AttributeResolver* SHIBSP_DLLLOCAL TemplateAttributeResolverFactory(const DOMElement* const & e, bool)
- {
- return new TemplateAttributeResolver(e);
- }
-
-};
-
-vector<opensaml::Assertion*> TemplateContext::m_assertions;
-
-TemplateAttributeResolver::TemplateAttributeResolver(const DOMElement* e)
- : m_log(Category::getInstance(SHIBSP_LOGCAT ".AttributeResolver.Template")),
- m_dest(1, XMLHelper::getAttrString(e, nullptr, dest))
-{
- if (m_dest.front().empty())
- throw ConfigurationException("Template AttributeResolver requires dest attribute.");
-
- string s(XMLHelper::getAttrString(e, nullptr, _sources));
- trim(s);
- split(m_sources, s, is_space(), algorithm::token_compress_on);
- if (m_sources.empty())
- throw ConfigurationException("Template AttributeResolver requires sources attribute.");
-
- e = e ? XMLHelper::getFirstChildElement(e, Template) : nullptr;
- char* t = toUTF8(XMLHelper::getTextContent(e));
- if (t) {
- m_template = t;
- delete[] t;
- trim(m_template);
- }
- if (m_template.empty())
- throw ConfigurationException("Template AttributeResolver requires non-empty <Template> child element.");
-}
-
-
-void TemplateAttributeResolver::resolveAttributes(ResolutionContext& ctx) const
-{
- TemplateContext& tctx = dynamic_cast<TemplateContext&>(ctx);
- if (!tctx.getInputAttributes())
- return;
-
- map<string,const Attribute*> attrmap;
-
- for (vector<string>::const_iterator a = m_sources.begin(); a != m_sources.end(); ++a) {
- const Attribute* attr = nullptr;
- for (vector<Attribute*>::const_iterator b = tctx.getInputAttributes()->begin(); b != tctx.getInputAttributes()->end(); ++b) {
- if (*a == (*b)->getId()) {
- attr = *b;
- break;
- }
- }
-
- if (!attr) {
- m_log.warn("source attribute (%s) missing, cannot resolve attribute (%s)", a->c_str(), m_dest.front().c_str());
- return;
- }
- else if (!attrmap.empty() && attr->valueCount() != attrmap.begin()->second->valueCount()) {
- m_log.warn("all source attributes must contain equal number of values, cannot resolve attribute (%s)", m_dest.front().c_str());
- return;
- }
- attrmap[*a] = attr;
- }
-
- auto_ptr<SimpleAttribute> dest(new SimpleAttribute(m_dest));
-
- for (size_t ix = 0; ix < attrmap.begin()->second->valueCount(); ++ix) {
- static const char* legal="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_-.[]";
-
- dest->getValues().push_back(string());
- string& processed = dest->getValues().back();
-
- string::size_type i=0, start=0;
- while (start != string::npos && start < m_template.length() && (i = m_template.find("$", start)) != string::npos) {
- if (i > start)
- processed += m_template.substr(start, i - start); // append everything in between
- start = i + 1; // move start to the beginning of the token name
- i = m_template.find_first_not_of(legal, start); // find token delimiter
- if (i == start) { // append a non legal character
- processed += m_template[start++];
- continue;
- }
-
- map<string,const Attribute*>::const_iterator iter = attrmap.find(m_template.substr(start, (i==string::npos) ? i : i - start));
- if (iter != attrmap.end())
- processed += iter->second->getSerializedValues()[ix];
- start = i;
- }
- if (start != string::npos && start < m_template.length())
- processed += m_template.substr(start, i); // append rest of string
-
- trim(processed);
- if (processed.empty())
- dest->getValues().pop_back();
- }
-
- // Save off new object.
- if (dest.get() && dest->valueCount()) {
- ctx.getResolvedAttributes().push_back(dest.get());
- dest.release();
- }
-}
diff --git a/plugins/TransformAttributeResolver.cpp b/plugins/TransformAttributeResolver.cpp
deleted file mode 100644
index 50a5aa7e..00000000
--- a/plugins/TransformAttributeResolver.cpp
+++ /dev/null
@@ -1,250 +0,0 @@
-/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
- *
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- */
-
-/**
- * TransformAttributeResolver.cpp
- *
- * Attribute Resolver plugin for transforming input values.
- */
-
-#include "internal.h"
-
-#include <algorithm>
-#include <boost/shared_ptr.hpp>
-#include <boost/algorithm/string/trim.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <shibsp/exceptions.h>
-#include <shibsp/SessionCache.h>
-#include <shibsp/attribute/SimpleAttribute.h>
-#include <shibsp/attribute/resolver/AttributeResolver.h>
-#include <shibsp/attribute/resolver/ResolutionContext.h>
-#include <xmltooling/XMLToolingConfig.h>
-#include <xmltooling/util/XMLHelper.h>
-#include <xercesc/util/XMLUniDefs.hpp>
-#include <xercesc/util/regx/RegularExpression.hpp>
-
-using namespace shibsp;
-using namespace xmltooling;
-using namespace xercesc;
-using namespace boost;
-using namespace std;
-
-namespace shibsp {
-
- class SHIBSP_DLLLOCAL TransformContext : public ResolutionContext
- {
- public:
- TransformContext(const vector<Attribute*>* attributes) : m_inputAttributes(attributes) {
- }
-
- ~TransformContext() {
- for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<Attribute>());
- }
-
- const vector<Attribute*>* getInputAttributes() const {
- return m_inputAttributes;
- }
- vector<Attribute*>& getResolvedAttributes() {
- return m_attributes;
- }
- vector<opensaml::Assertion*>& getResolvedAssertions() {
- return m_assertions;
- }
-
- private:
- const vector<Attribute*>* m_inputAttributes;
- vector<Attribute*> m_attributes;
- static vector<opensaml::Assertion*> m_assertions; // empty dummy
- };
-
-
- class SHIBSP_DLLLOCAL TransformAttributeResolver : public AttributeResolver
- {
- public:
- TransformAttributeResolver(const DOMElement* e);
- virtual ~TransformAttributeResolver() {}
-
- Lockable* lock() {
- return this;
- }
- void unlock() {
- }
-
- ResolutionContext* createResolutionContext(
- const Application& application,
- const GenericRequest* request,
- const opensaml::saml2md::EntityDescriptor* issuer,
- const XMLCh* protocol,
- const opensaml::saml2::NameID* nameid=nullptr,
- const XMLCh* authncontext_class=nullptr,
- const XMLCh* authncontext_decl=nullptr,
- const vector<const opensaml::Assertion*>* tokens=nullptr,
- const vector<Attribute*>* attributes=nullptr
- ) const {
- return new TransformContext(attributes);
- }
-
- ResolutionContext* createResolutionContext(const Application& application, const Session& session) const {
- return new TransformContext(&session.getAttributes());
- }
-
- void resolveAttributes(ResolutionContext& ctx) const;
-
- void getAttributeIds(vector<string>& attributes) const {
- for (vector<regex_t>::const_iterator r = m_regex.begin(); r != m_regex.end(); ++r) {
- if (!r->get<0>().empty())
- attributes.push_back(r->get<0>());
- }
- }
-
- private:
- Category& m_log;
- string m_source;
- // dest id, regex to apply, replacement string
- typedef boost::tuple<string,boost::shared_ptr<RegularExpression>,const XMLCh*> regex_t;
- vector<regex_t> m_regex;
- };
-
- static const XMLCh dest[] = UNICODE_LITERAL_4(d,e,s,t);
- static const XMLCh match[] = UNICODE_LITERAL_5(m,a,t,c,h);
- static const XMLCh caseSensitive[] = UNICODE_LITERAL_13(c,a,s,e,S,e,n,s,i,t,i,v,e);
- static const XMLCh source[] = UNICODE_LITERAL_6(s,o,u,r,c,e);
- static const XMLCh Regex[] = UNICODE_LITERAL_5(R,e,g,e,x);
-
- AttributeResolver* SHIBSP_DLLLOCAL TransformAttributeResolverFactory(const DOMElement* const & e, bool)
- {
- return new TransformAttributeResolver(e);
- }
-
-};
-
-vector<opensaml::Assertion*> TransformContext::m_assertions;
-
-TransformAttributeResolver::TransformAttributeResolver(const DOMElement* e)
- : m_log(Category::getInstance(SHIBSP_LOGCAT ".AttributeResolver.Transform")),
- m_source(XMLHelper::getAttrString(e, nullptr, source))
-{
- if (m_source.empty())
- throw ConfigurationException("Transform AttributeResolver requires source attribute.");
-
- e = XMLHelper::getFirstChildElement(e, Regex);
- while (e) {
- if (e->hasChildNodes() && e->hasAttributeNS(nullptr, match)) {
- const XMLCh* repl(XMLHelper::getTextContent(e));
- string destId(XMLHelper::getAttrString(e, nullptr, dest));
- bool caseflag(XMLHelper::getAttrBool(e, true, caseSensitive));
- if (repl && *repl) {
- try {
- static XMLCh options[] = { chLatin_i, chNull };
- boost::shared_ptr<RegularExpression> re(new RegularExpression(e->getAttributeNS(nullptr, match), (caseflag ? &chNull : options)));
- m_regex.push_back(boost::make_tuple(destId, re, repl));
- }
- catch (XMLException& ex) {
- auto_ptr_char msg(ex.getMessage());
- auto_ptr_char m(e->getAttributeNS(nullptr, match));
- m_log.error("exception parsing regular expression (%s): %s", m.get(), msg.get());
- }
- }
- }
- e = XMLHelper::getNextSiblingElement(e, Regex);
- }
-
- if (m_regex.empty())
- throw ConfigurationException("Transform AttributeResolver requires at least one non-empty Regex element.");
-}
-
-
-void TransformAttributeResolver::resolveAttributes(ResolutionContext& ctx) const
-{
- TransformContext& tctx = dynamic_cast<TransformContext&>(ctx);
- if (!tctx.getInputAttributes())
- return;
-
- for (vector<Attribute*>::const_iterator a = tctx.getInputAttributes()->begin(); a != tctx.getInputAttributes()->end(); ++a) {
- if (m_source != (*a)->getId() || (*a)->valueCount() == 0) {
- continue;
- }
-
- // We run each transform expression against each value of the input. Each transform either generates
- // a new attribute from its dest property, or overwrites a SimpleAttribute's values in place.
-
- for (vector<regex_t>::const_iterator r = m_regex.begin(); r != m_regex.end(); ++r) {
- SimpleAttribute* dest = nullptr;
- auto_ptr<SimpleAttribute> destwrapper;
-
- // First tuple element is the destination attribute ID, if any.
- if (r->get<0>().empty()) {
- // Can we transform in-place?
- dest = dynamic_cast<SimpleAttribute*>(*a);
- if (!dest) {
- m_log.warn("can't transform non-simple attribute (%s) 'in place'", m_source.c_str());
- continue;
- }
- }
- else {
- // Create a destination attribute.
- vector<string> ids(1, r->get<0>());
- destwrapper.reset(new SimpleAttribute(ids));
- }
-
- if (dest)
- m_log.debug("applying in-place transform to source attribute (%s)", m_source.c_str());
- else
- m_log.debug("applying transform from source attribute (%s) to dest attribute (%s)", m_source.c_str(), r->get<0>().c_str());
-
- for (size_t i = 0; i < (*a)->valueCount(); ++i) {
- try {
- auto_arrayptr<XMLCh> srcval(fromUTF8((*a)->getSerializedValues()[i].c_str()));
- XMLCh* destval = r->get<1>()->replace(srcval.get(), r->get<2>());
- if (!destval)
- continue;
- // For some reason, it returns the source string if the match doesn't succeed.
- if (!XMLString::equals(destval, srcval.get())) {
- auto_arrayptr<char> narrow(toUTF8(destval));
- XMLString::release(&destval);
- if (dest) {
- // Modify in place.
- dest->getValues()[i] = narrow.get();
- trim(dest->getValues()[i]);
- }
- else {
- // Add to new object.
- destwrapper->getValues().push_back(narrow.get());
- trim(destwrapper->getValues().back());
- }
- }
- else {
- XMLString::release(&destval);
- }
- }
- catch (XMLException& ex) {
- auto_ptr_char msg(ex.getMessage());
- m_log.error("caught error applying regular expression: %s", msg.get());
- }
- }
-
- // Save off new object.
- if (destwrapper.get()) {
- ctx.getResolvedAttributes().push_back(destwrapper.get());
- destwrapper.release();
- }
- }
- }
-}
diff --git a/plugins/internal.h b/plugins/internal.h
deleted file mode 100644
index c979c757..00000000
--- a/plugins/internal.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
- *
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- */
-
-/*
- * internal.h - internally visible declarations
- */
-
-#ifndef __plugins_internal_h__
-#define __plugins_internal_h__
-
-#ifdef WIN32
-# define _CRT_SECURE_NO_DEPRECATE 1
-# define _CRT_NONSTDC_NO_DEPRECATE 1
-#endif
-
-// eventually we might be able to support autoconf via cygwin...
-#if defined (_MSC_VER) || defined(__BORLANDC__)
-# include "config_win32.h"
-#else
-# include "config.h"
-#endif
-
-#include <shibsp/base.h>
-
-#include <memory>
-#include <xmltooling/logging.h>
-
-using namespace xmltooling::logging;
-
-#endif /* __plugins_internal_h__ */
diff --git a/plugins/plugins.cpp b/plugins/plugins.cpp
deleted file mode 100644
index 5235e4b0..00000000
--- a/plugins/plugins.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
- *
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- */
-
-/**
- * plugins.cpp
- *
- * Extension plugins for Shibboleth SP.
- */
-
-#include "internal.h"
-#include <shibsp/SPConfig.h>
-#include <shibsp/util/SPConstants.h>
-#include <xmltooling/impl/AnyElement.h>
-
-using namespace shibsp;
-using namespace xmltooling;
-using namespace xercesc;
-using namespace std;
-
-#ifdef WIN32
-# define PLUGINS_EXPORTS __declspec(dllexport)
-#else
-# define PLUGINS_EXPORTS
-#endif
-
-namespace shibsp {
- PluginManager<AccessControl,string,const DOMElement*>::Factory TimeAccessControlFactory;
- PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory AttributeResolverHandlerFactory;
-
-#ifndef SHIBSP_LITE
-# if HAVE_DECL_GSS_GET_NAME_ATTRIBUTE
- PluginManager<AttributeExtractor,string,const DOMElement*>::Factory GSSAPIExtractorFactory;
-# endif
- PluginManager<AttributeResolver,string,const DOMElement*>::Factory TemplateAttributeResolverFactory;
- PluginManager<AttributeResolver,string,const DOMElement*>::Factory TransformAttributeResolverFactory;
- PluginManager<AttributeResolver,string,const DOMElement*>::Factory UpperCaseAttributeResolverFactory;
- PluginManager<AttributeResolver,string,const DOMElement*>::Factory LowerCaseAttributeResolverFactory;
-#endif
-};
-
-extern "C" int PLUGINS_EXPORTS xmltooling_extension_init(void*)
-{
- SPConfig& conf = SPConfig::getConfig();
- conf.AccessControlManager.registerFactory("Time", TimeAccessControlFactory);
- conf.HandlerManager.registerFactory("AttributeResolver", AttributeResolverHandlerFactory);
-#ifndef SHIBSP_LITE
-# if HAVE_DECL_GSS_GET_NAME_ATTRIBUTE
- conf.AttributeExtractorManager.registerFactory("GSSAPI", GSSAPIExtractorFactory);
- static const XMLCh _GSSAPIName[] = UNICODE_LITERAL_10(G,S,S,A,P,I,N,a,m,e);
- static const XMLCh _GSSAPIContext[] = UNICODE_LITERAL_13(G,S,S,A,P,I,C,o,n,t,e,x,t);
- XMLObjectBuilder::registerBuilder(xmltooling::QName(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _GSSAPIName), new AnyElementBuilder());
- XMLObjectBuilder::registerBuilder(xmltooling::QName(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _GSSAPIContext), new AnyElementBuilder());
-# endif
- conf.AttributeResolverManager.registerFactory("Template", TemplateAttributeResolverFactory);
- conf.AttributeResolverManager.registerFactory("Transform", TransformAttributeResolverFactory);
- conf.AttributeResolverManager.registerFactory("UpperCase", UpperCaseAttributeResolverFactory);
- conf.AttributeResolverManager.registerFactory("LowerCase", LowerCaseAttributeResolverFactory);
-#endif
- return 0; // signal success
-}
-
-extern "C" void PLUGINS_EXPORTS xmltooling_extension_term()
-{
- // Factories normally get unregistered during library shutdown, so no work usually required here.
-}
diff --git a/plugins/plugins.rc b/plugins/plugins.rc
deleted file mode 100644
index 2e579b80..00000000
--- a/plugins/plugins.rc
+++ /dev/null
@@ -1,109 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION RC_FILE_VERSION ,0
- PRODUCTVERSION RC_PRODUCT_VERSION ,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
-#include "..\util\resourceCommon.rci"
- VALUE "FileDescription", "Shibboleth SP Plugins\0"
-#ifdef SHIBSP_LITE
- VALUE "InternalName", "plugins-lite\0"
-#else
- VALUE "InternalName", "plugins\0"
-#endif
-#ifdef SHIBSP_LITE
- VALUE "OriginalFilename", "plugins-lite.so\0"
-#else
- VALUE "OriginalFilename", "plugins.so\0"
-#endif
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-#endif // !_MAC
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/plugins/resource.h b/plugins/resource.h
deleted file mode 100644
index ec6c6512..00000000
--- a/plugins/resource.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
- *
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- */
-
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by plugins.rc
-//
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 101
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list