Add projects and shell for metadata query tool.
authorScott Cantor <cantor.2@osu.edu>
Wed, 5 Sep 2007 17:42:37 +0000 (17:42 +0000)
committerScott Cantor <cantor.2@osu.edu>
Wed, 5 Sep 2007 17:42:37 +0000 (17:42 +0000)
Shibboleth.sln
shibboleth.spec.in
util/Makefile.am
util/mdquery.cpp [new file with mode: 0644]
util/mdquery.vcproj [new file with mode: 0644]

index 9d5ca0a..ae22d3b 100644 (file)
@@ -123,6 +123,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "adfs-lite", "adfs\adfs-lite
                {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}
        EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mdquery", "util\mdquery.vcproj", "{F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}"
+       ProjectSection(WebsiteProperties) = preProject
+               Debug.AspNetCompiler.Debug = "True"
+               Release.AspNetCompiler.Debug = "False"
+       EndProjectSection
+       ProjectSection(ProjectDependencies) = postProject
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
+       EndProjectSection
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -181,6 +190,10 @@ Global
                {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Debug|Win32.Build.0 = Debug|Win32
                {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Release|Win32.ActiveCfg = Release|Win32
                {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Release|Win32.Build.0 = Release|Win32
+               {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Debug|Win32.ActiveCfg = Debug|Win32
+               {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Debug|Win32.Build.0 = Debug|Win32
+               {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Release|Win32.ActiveCfg = Release|Win32
+               {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Release|Win32.Build.0 = Release|Win32
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
@@ -196,5 +209,6 @@ Global
                {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B} = {96AE4FC9-45EF-4C18-9F3B-EDA439E26E4C}
                {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59} = {FED80230-119E-4B2F-9F53-D2660A5F022B}
                {4D02F36E-D2CD-4FD1-AC50-2941E27BB3FB} = {FED80230-119E-4B2F-9F53-D2660A5F022B}
+               {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A} = {FED80230-119E-4B2F-9F53-D2660A5F022B}
        EndGlobalSection
 EndGlobal
index 4a54159..82d9c25 100644 (file)
@@ -149,6 +149,7 @@ fi
 %{_sbindir}/shibd
 %{_sbindir}/siterefresh
 %{_bindir}/samlquery
+%{_bindir}/mdquery
 %{_libdir}/libshibsp.so.*
 %{_libdir}/libshibsp-lite.so.*
 %dir %{_localstatedir}/log/%{name}
index c6abaa4..334b508 100644 (file)
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-bin_PROGRAMS = samlquery
+bin_PROGRAMS = samlquery mdquery
 sbin_PROGRAMS = siterefresh
 
 samlquery_SOURCES = samlquery.cpp
@@ -12,8 +12,15 @@ samlquery_LDADD = \
 
 samlquery_LDFLAGS = $(XMLSEC_LIBS)
 
+mdquery_SOURCES = mdquery.cpp
+
+mdquery_LDADD = \
+       $(top_builddir)/shibsp/libshibsp.la
+
+mdquery_LDFLAGS = $(XMLSEC_LIBS)
+
 siterefresh_SOURCES = siterefresh.cpp
 
 siterefresh_LDFLAGS = $(XMLSEC_LIBS)
 
-EXTRA_DIST = samlquery.vcproj siterefresh.vcproj
+EXTRA_DIST = mdquery.vcproj samlquery.vcproj siterefresh.vcproj
diff --git a/util/mdquery.cpp b/util/mdquery.cpp
new file mode 100644 (file)
index 0000000..f0f918c
--- /dev/null
@@ -0,0 +1,111 @@
+/*\r
+ *  Copyright 2001-2007 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/**\r
+ * mdquery.cpp\r
+ * \r
+ * SAML Metadata Query tool layered on SP configuration\r
+ */\r
+\r
+#if defined (_MSC_VER) || defined(__BORLANDC__)\r
+# include "config_win32.h"\r
+#else\r
+# include "config.h"\r
+#endif\r
+\r
+#ifdef WIN32\r
+# define _CRT_NONSTDC_NO_DEPRECATE 1\r
+# define _CRT_SECURE_NO_DEPRECATE 1\r
+#endif\r
+\r
+#include <shibsp/Application.h>\r
+#include <shibsp/exceptions.h>\r
+#include <shibsp/SPConfig.h>\r
+#include <shibsp/ServiceProvider.h>\r
+#include <shibsp/util/SPConstants.h>\r
+#include <saml/saml2/metadata/Metadata.h>\r
+\r
+using namespace shibsp;\r
+using namespace opensaml::saml2md;\r
+using namespace opensaml;\r
+using namespace xmltooling;\r
+using namespace std;\r
+\r
+int main(int argc,char* argv[])\r
+{\r
+    /*\r
+    char* n_param=NULL;\r
+    char* q_param=NULL;\r
+    char* f_param=NULL;\r
+    char* a_param=NULL;\r
+\r
+    for (int i=1; i<argc; i++) {\r
+        if (!strcmp(argv[i],"-n") && i+1<argc)\r
+            n_param=argv[++i];\r
+        else if (!strcmp(argv[i],"-q") && i+1<argc)\r
+            q_param=argv[++i];\r
+        else if (!strcmp(argv[i],"-f") && i+1<argc)\r
+            f_param=argv[++i];\r
+        else if (!strcmp(argv[i],"-a") && i+1<argc)\r
+            a_param=argv[++i];\r
+    }\r
+\r
+    if (!n_param || !q_param) {\r
+        cerr << "usage: samlquery -n <name> -q <IdP> [-f <format URI> -a <application id>]" << endl;\r
+        exit(0);\r
+    }\r
+    if (!a_param)\r
+        a_param="default";\r
+    */\r
+\r
+    char* path=getenv("SHIBSP_SCHEMAS");\r
+    if (!path)\r
+        path=SHIBSP_SCHEMAS;\r
+    char* config=getenv("SHIBSP_CONFIG");\r
+    if (!config)\r
+        config=SHIBSP_CONFIG;\r
+\r
+    XMLToolingConfig::getConfig().log_config(getenv("SHIBSP_LOGGING") ? getenv("SHIBSP_LOGGING") : SHIBSP_LOGGING);\r
+\r
+    SPConfig& conf=SPConfig::getConfig();\r
+    conf.setFeatures(SPConfig::Metadata | SPConfig::OutOfProcess);\r
+    if (!conf.init(path))\r
+        return -10;\r
+\r
+    try {\r
+        static const XMLCh _path[] = UNICODE_LITERAL_4(p,a,t,h);\r
+        static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);\r
+        xercesc::DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();\r
+        XercesJanitor<xercesc::DOMDocument> docjanitor(dummydoc);\r
+        xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,_path);\r
+        auto_ptr_XMLCh src(config);\r
+        dummy->setAttributeNS(NULL,_path,src.get());\r
+        dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE);\r
+        conf.setServiceProvider(conf.ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy));\r
+        conf.getServiceProvider()->init();\r
+    }\r
+    catch (exception&) {\r
+        conf.term();\r
+        return -20;\r
+    }\r
+\r
+    ServiceProvider* sp=conf.getServiceProvider();\r
+    sp->lock();\r
+\r
+    sp->unlock();\r
+    conf.term();\r
+    return 0;\r
+}\r
diff --git a/util/mdquery.vcproj b/util/mdquery.vcproj
new file mode 100644 (file)
index 0000000..5992811
--- /dev/null
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="mdquery"\r
+       ProjectGUID="{F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}"\r
+       RootNamespace="mdquery"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               HeaderFileName=""\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               InlineFunctionExpansion="1"\r
+                               AdditionalIncludeDirectories=".;..;&quot;..\..\cpp-opensaml2&quot;;&quot;..\..\cpp-xmltooling&quot;"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+                               StringPooling="true"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               RuntimeTypeInfo="true"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               CompileAs="0"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               Culture="1033"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="log4shib1.lib saml2.lib xmltooling1.lib xerces-c_2.lib"\r
+                               LinkIncremental="1"\r
+                               SuppressStartupBanner="true"\r
+                               AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(ConfigurationName);..\..\cpp-xmltooling\$(ConfigurationName)"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               HeaderFileName=""\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories=".;..;&quot;..\..\cpp-opensaml2&quot;;&quot;..\..\cpp-xmltooling&quot;"\r
+                               PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               RuntimeTypeInfo="true"\r
+                               BrowseInformation="1"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="4"\r
+                               CompileAs="0"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               Culture="1033"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="log4shib1D.lib saml2D.lib xmltooling1D.lib xerces-c_2D.lib"\r
+                               LinkIncremental="2"\r
+                               SuppressStartupBanner="true"\r
+                               AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(ConfigurationName);..\..\cpp-xmltooling\$(ConfigurationName)"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <File\r
+                       RelativePath=".\mdquery.cpp"\r
+                       >\r
+               </File>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r