2 * Copyright 2001-2005 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 /* internal.h - internally visible declarations
25 #ifndef __shibtarget_internal_h__
26 #define __shibtarget_internal_h__
29 # define _CRT_SECURE_NO_DEPRECATE 1
30 # define _CRT_NONSTDC_NO_DEPRECATE 1
34 # define SHIBTARGET_EXPORTS __declspec(dllexport)
37 // eventually we might be able to support autoconf via cygwin...
38 #if defined (_MSC_VER) || defined(__BORLANDC__)
39 # include "config_win32.h"
44 #include <shibsp/SPConstants.h>
46 #include "shib-target.h"
49 #include <log4cpp/Category.hh>
50 #include <log4cpp/FixedContextCategory.hh>
51 #include <shibsp/exceptions.h>
52 #include <xmltooling/util/Threads.h>
54 #define SHIBT_L(s) shibtarget::XML::Literals::s
55 #define SHIBT_L_QNAME(p,s) shibtarget::XML::Literals::p##_##s
56 #define SHIBT_LOGCAT "shibtarget"
57 #define SHIBTRAN_LOGCAT "Shibboleth-TRANSACTION"
59 namespace shibtarget {
60 // ST-aware class that maps SAML artifacts to appropriate binding information
61 class STArtifactMapper : public virtual saml::SAMLBrowserProfile::ArtifactMapper
64 STArtifactMapper(const IApplication* application) : m_app(application) {}
65 virtual ~STArtifactMapper() {}
66 saml::SAMLResponse* resolve(saml::SAMLRequest* request);
69 const IApplication* m_app;
72 class STConfig : public ShibTargetConfig
75 STConfig() : m_tranLog(NULL), m_tranLogLock(NULL) {}
78 bool init(const char* schemadir);
79 bool load(const char* config);
82 log4cpp::Category& getTransactionLog() { m_tranLogLock->lock(); return *m_tranLog; }
83 void releaseTransactionLog() { m_tranLogLock->unlock();}
85 log4cpp::FixedContextCategory* m_tranLog;
86 xmltooling::Mutex* m_tranLogLock;
87 static IConfig* ShibTargetConfigFactory(const DOMElement* e);