samlbindinclude_HEADERS = \
binding/ArtifactMap.h \
- binding/GenericRequest.h \
- binding/GenericResponse.h \
- binding/HTTPRequest.h \
- binding/HTTPResponse.h \
binding/MessageDecoder.h \
binding/MessageEncoder.h \
binding/SAMLArtifact.h \
}
DECL_XMLTOOLING_EXCEPTION_FACTORY(ArtifactException,opensaml);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(SecurityPolicyException,opensaml);
DECL_XMLTOOLING_EXCEPTION_FACTORY(MetadataException,opensaml::saml2md);
DECL_XMLTOOLING_EXCEPTION_FACTORY(MetadataFilterException,opensaml::saml2md);
DECL_XMLTOOLING_EXCEPTION_FACTORY(BindingException,opensaml);
}
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ArtifactException,opensaml);
+ REGISTER_XMLTOOLING_EXCEPTION_FACTORY(SecurityPolicyException,opensaml);
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(MetadataException,opensaml::saml2md);
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(MetadataFilterException,opensaml::saml2md);
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(BindingException,opensaml);
+++ /dev/null
-/*
- * Copyright 2001-2007 Internet2
- *
- * Licensed 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.
- */
-
-/**
- * @file saml/binding/GenericRequest.h
- *
- * Interface to generic protocol requests that transport SAML messages.
- */
-
-#ifndef __saml_genreq_h__
-#define __saml_genreq_h__
-
-#include <saml/base.h>
-#include <string>
-#include <vector>
-#include <xsec/enc/XSECCryptoX509.hpp>
-
-namespace opensaml {
-
- /**
- * Interface to caller-supplied shim for accessing generic transport
- * request context.
- *
- * <p>This interface need not be threadsafe.
- */
- class SAML_API GenericRequest {
- MAKE_NONCOPYABLE(GenericRequest);
- protected:
- GenericRequest() {}
- public:
- virtual ~GenericRequest() {}
-
- /**
- * Returns the URL scheme of the request (http, https, ftp, ldap, etc.)
- *
- * @return the URL scheme
- */
- virtual const char* getScheme() const=0;
-
- /**
- * Returns true iff the request is over a confidential channel.
- *
- * @return confidential channel indicator
- */
- virtual bool isSecure() const=0;
-
- /**
- * Returns hostname of service that received request.
- *
- * @return hostname of service
- */
- virtual const char* getHostname() const=0;
-
- /**
- * Returns incoming port.
- *
- * @return incoming port
- */
- virtual int getPort() const=0;
-
- /**
- * Returns the MIME type of the request, if known.
- *
- * @return the MIME type, or an empty string
- */
- virtual std::string getContentType() const=0;
-
- /**
- * Returns the length of the request body, if known.
- *
- * @return the content length, or -1 if unknown
- */
- virtual long getContentLength() const=0;
-
- /**
- * Returns the raw request body.
- *
- * @return the request body, or NULL
- */
- virtual const char* getRequestBody() const=0;
-
- /**
- * Returns a decoded named parameter value from the request.
- * If a parameter has multiple values, only one will be returned.
- *
- * @param name the name of the parameter to return
- * @return a single parameter value or NULL
- */
- virtual const char* getParameter(const char* name) const=0;
-
- /**
- * Returns all of the decoded values of a named parameter from the request.
- * All values found will be returned.
- *
- * @param name the name of the parameter to return
- * @param values a vector in which to return pointers to the decoded values
- * @return the number of values returned
- */
- virtual std::vector<const char*>::size_type getParameters(
- const char* name, std::vector<const char*>& values
- ) const=0;
-
- /**
- * Returns the transport-authenticated identity associated with the request,
- * if authentication is solely handled by the transport.
- *
- * @return the authenticated username or an empty string
- */
- virtual std::string getRemoteUser() const=0;
-
- /**
- * Returns the IP address of the client.
- *
- * @return the client's IP address
- */
- virtual std::string getRemoteAddr() const=0;
-
- /**
- * Returns the chain of certificates sent by the client.
- * They are not guaranteed to be valid according to any particular definition.
- *
- * @return the client's certificate chain
- */
- virtual const std::vector<XSECCryptoX509*>& getClientCertificates() const=0;
- };
-};
-
-#endif /* __saml_genreq_h__ */
+++ /dev/null
-/*
- * Copyright 2001-2007 Internet2
- *
- * Licensed 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.
- */
-
-/**
- * @file saml/binding/GenericResponse.h
- *
- * Interface to generic protocol responses that transport SAML messages.
- */
-
-#ifndef __saml_genres_h__
-#define __saml_genres_h__
-
-#include <saml/base.h>
-#include <iostream>
-
-namespace opensaml {
-
- /**
- * Interface to caller-supplied shim for accessing generic transport
- * request context.
- *
- * <p>This interface need not be threadsafe.
- */
- class SAML_API GenericResponse {
- MAKE_NONCOPYABLE(GenericResponse);
- protected:
- GenericResponse() {}
- public:
- virtual ~GenericResponse() {}
-
- /**
- * Sets or clears the MIME type of the response.
- *
- * @param type the MIME type, or NULL to clear
- */
- virtual void setContentType(const char* type=NULL)=0;
-
- /**
- * Sends a completed response to the client along with a
- * transport-specific "OK" indication. Used for "normal" responses.
- *
- * @param inputStream reference to source of response data
- * @return a result code to return from the calling MessageEncoder
- */
- virtual long sendResponse(std::istream& inputStream)=0;
-
- /**
- * Sends an "error" response to the client along with a
- * transport-specific error indication.
- *
- * @param inputStream reference to source of response data
- * @return a result code to return from the calling MessageEncoder
- */
- virtual long sendError(std::istream& inputStream)=0;
-
- /**
- * Sends a completed response to the client.
- *
- * @param inputStream reference to source of response data
- * @param status transport-specific status to return
- * @return a result code to return from the calling MessageEncoder
- */
- virtual long sendResponse(std::istream& inputStream, long status)=0;
- };
-};
-
-#endif /* __saml_genres_h__ */
+++ /dev/null
-/*
- * Copyright 2001-2007 Internet2
- *
- * Licensed 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.
- */
-
-/**
- * @file saml/binding/HTTPRequest.h
- *
- * Interface to HTTP requests
- */
-
-#ifndef __saml_httpreq_h__
-#define __saml_httpreq_h__
-
-#include <saml/binding/GenericRequest.h>
-
-namespace opensaml {
-
- /**
- * Interface to caller-supplied shim for accessing HTTP request context.
- *
- * <p>To supply information from the surrounding web server environment,
- * a shim must be supplied in the form of this interface to adapt the
- * library to different proprietary server APIs.
- *
- * <p>This interface need not be threadsafe.
- */
- class SAML_API HTTPRequest : public GenericRequest {
- MAKE_NONCOPYABLE(HTTPRequest);
- protected:
- HTTPRequest() {}
- public:
- virtual ~HTTPRequest() {}
-
- bool isSecure() const {
- return strcmp(getScheme(),"https")==0;
- }
-
- /**
- * Returns the HTTP method of the request (GET, POST, etc.)
- *
- * @return the HTTP method
- */
- virtual const char* getMethod() const=0;
-
- /**
- * Returns the request URI.
- *
- * @return the request URI
- */
- virtual const char* getRequestURI() const=0;
-
- /**
- * Returns the complete request URL, including scheme, host, port, and URI.
- *
- * @return the request URL
- */
- virtual const char* getRequestURL() const=0;
-
- /**
- * Returns the HTTP query string appened to the request. The query
- * string is returned without any decoding applied, everything found
- * after the ? delimiter.
- *
- * @return the query string
- */
- virtual const char* getQueryString() const=0;
-
- /**
- * Returns a request header value.
- *
- * @param name the name of the header to return
- * @return the header's value, or an empty string
- */
- virtual std::string getHeader(const char* name) const=0;
- };
-};
-
-#endif /* __saml_httpreq_h__ */
+++ /dev/null
-/*
- * Copyright 2001-2007 Internet2
- *
- * Licensed 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.
- */
-
-/**
- * @file saml/binding/HTTPResponse.h
- *
- * Interface to HTTP requests
- */
-
-#ifndef __saml_httpres_h__
-#define __saml_httpres_h__
-
-#include <saml/binding/GenericResponse.h>
-
-namespace opensaml {
-
- /**
- * Interface to caller-supplied shim for issuing an HTTP response.
- *
- * <p>To supply information to the surrounding web server environment,
- * a shim must be supplied in the form of this interface to adapt the
- * library to different proprietary server APIs.
- *
- * <p>This interface need not be threadsafe.
- */
- class SAML_API HTTPResponse : public GenericResponse {
- MAKE_NONCOPYABLE(HTTPResponse);
- protected:
- HTTPResponse() {}
- public:
- virtual ~HTTPResponse() {}
-
- void setContentType(const char* type) {
- setResponseHeader("Content-Type", type);
- }
-
- /**
- * Sets or clears a response header.
- *
- * @param name header name
- * @param value value to set, or NULL to clear
- */
- virtual void setResponseHeader(const char* name, const char* value)=0;
-
- /**
- * Sets a client cookie.
- *
- * @param name cookie name
- * @param value value to set, or NULL to clear
- */
- virtual void setCookie(const char* name, const char* value) {
- std::string cookie(name);
- cookie = cookie + '=' + value;
- setResponseHeader("Set-Cookie", cookie.c_str());
- }
-
- /**
- * Redirect the client to the specified URL and complete the response.
- * Any headers previously set will be sent ahead of the redirect.
- *
- * @param url location to redirect client
- * @return a result code to return from the calling MessageEncoder
- */
- virtual long sendRedirect(const char* url)=0;
-
- /** Some common HTTP status codes. */
- enum status_t {
- SAML_HTTP_STATUS_OK = 200,
- SAML_HTTP_STATUS_MOVED = 302,
- SAML_HTTP_STATUS_FORBIDDEN = 403,
- SAML_HTTP_STATUS_NOTFOUND = 404,
- SAML_HTTP_STATUS_ERROR = 500
- };
-
- using GenericResponse::sendResponse;
-
- long sendError(std::istream& inputStream) {
- return sendResponse(inputStream, SAML_HTTP_STATUS_ERROR);
- }
-
- long sendResponse(std::istream& inputStream) {
- return sendResponse(inputStream, SAML_HTTP_STATUS_OK);
- }
- };
-};
-
-#endif /* __saml_httpres_h__ */
#ifndef __saml_decoder_h__
#define __saml_decoder_h__
-#include <saml/binding/GenericRequest.h>
#include <saml/binding/SecurityPolicy.h>
#include <xmltooling/XMLObject.h>
+#include <xmltooling/io/GenericRequest.h>
namespace opensaml {
*/
virtual xmltooling::XMLObject* decode(
std::string& relayState,
- const GenericRequest& genericRequest,
+ const xmltooling::GenericRequest& genericRequest,
SecurityPolicy& policy
) const=0;
#ifndef __saml_encoder_h__
#define __saml_encoder_h__
-#include <saml/binding/GenericResponse.h>
+#include <saml/base.h>
#include <istream>
#include <xmltooling/XMLObject.h>
+#include <xmltooling/io/GenericResponse.h>
#include <xmltooling/security/Credential.h>
namespace opensaml {
* @param digestAlg optional reference digest algorithm identifier
*/
virtual long encode(
- GenericResponse& genericResponse,
+ xmltooling::GenericResponse& genericResponse,
xmltooling::XMLObject* xmlObject,
const char* destination,
const char* recipientID=NULL,
#ifndef __saml_secpol_h__
#define __saml_secpol_h__
-#include <saml/binding/GenericRequest.h>
+#include <saml/base.h>
#include <ctime>
#include <vector>
#include <xmltooling/XMLObject.h>
+#include <xmltooling/io/GenericRequest.h>
#include <xmltooling/security/TrustEngine.h>
#if defined (_MSC_VER)
*
* @throws BindingException raised if the message/request is invalid according to the supplied rules
*/
- void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request=NULL);
+ void evaluate(const xmltooling::XMLObject& message, const xmltooling::GenericRequest* request=NULL);
/**
* Resets the policy object and clears any per-message state.
* @throws BindingException raised if the message/request is not acceptable to the policy rule
*/
virtual void evaluate(
- const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy
+ const xmltooling::XMLObject& message, const xmltooling::GenericRequest* request, SecurityPolicy& policy
) const=0;
};
#include "internal.h"
#include "exceptions.h"
-#include "binding/HTTPRequest.h"
#include "binding/SecurityPolicyRule.h"
#include "saml2/core/Assertions.h"
#include "saml2/metadata/Metadata.h"
#include <log4cpp/Category.hh>
#include <xercesc/util/Base64.hpp>
+#include <xmltooling/io/HTTPRequest.h>
using namespace opensaml::saml2md;
using namespace opensaml;
>\r
</File>\r
<File\r
- RelativePath=".\binding\GenericRequest.h"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\binding\GenericResponse.h"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\binding\HTTPRequest.h"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\binding\HTTPResponse.h"\r
- >\r
- </File>\r
- <File\r
RelativePath=".\binding\MessageDecoder.h"\r
>\r
</File>\r
#include "internal.h"
#include "exceptions.h"
-#include "binding/HTTPRequest.h"
#include "binding/MessageDecoder.h"
#include "binding/SAMLArtifact.h"
#include "saml1/core/Protocols.h"
#include "saml2/metadata/MetadataProvider.h"
#include <log4cpp/Category.hh>
+#include <xmltooling/io/HTTPRequest.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/util/ReplayCache.h>
#include "internal.h"
#include "exceptions.h"
#include "binding/ArtifactMap.h"
-#include "binding/HTTPResponse.h"
#include "binding/MessageEncoder.h"
#include "binding/SAMLArtifact.h"
#include "saml1/core/Assertions.h"
#include <log4cpp/Category.hh>
#include <xmltooling/XMLToolingConfig.h>
+#include <xmltooling/io/HTTPResponse.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/util/URLEncoder.h>
#include "internal.h"
#include "exceptions.h"
-#include "binding/HTTPRequest.h"
#include "binding/MessageDecoder.h"
#include "saml1/core/Assertions.h"
#include "saml1/core/Protocols.h"
#include <log4cpp/Category.hh>
#include <xercesc/util/Base64.hpp>
+#include <xmltooling/io/HTTPRequest.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/validation/ValidatorSuite.h>
#include "internal.h"
#include "exceptions.h"
-#include "binding/HTTPResponse.h"
#include "binding/MessageEncoder.h"
#include "signature/ContentReference.h"
#include "saml1/core/Protocols.h"
#include <sstream>
#include <log4cpp/Category.hh>
+#include <xmltooling/io/HTTPResponse.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/soap/SOAP.h>
#include "internal.h"
#include "exceptions.h"
-#include "binding/HTTPRequest.h"
#include "binding/MessageDecoder.h"
#include "saml2/binding/SAML2Artifact.h"
#include "saml2/core/Protocols.h"
#include "saml2/metadata/MetadataProvider.h"
#include <log4cpp/Category.hh>
+#include <xmltooling/io/HTTPRequest.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/util/ReplayCache.h>
#include "internal.h"
#include "exceptions.h"
#include "binding/ArtifactMap.h"
-#include "binding/HTTPResponse.h"
#include "binding/MessageEncoder.h"
#include "saml2/binding/SAML2Artifact.h"
#include "saml2/core/Protocols.h"
#include <fstream>
#include <sstream>
#include <log4cpp/Category.hh>
+#include <xmltooling/io/HTTPResponse.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/util/TemplateEngine.h>
#include <xmltooling/util/URLEncoder.h>
#include "internal.h"
#include "exceptions.h"
-#include "binding/HTTPRequest.h"
#include "binding/MessageDecoder.h"
#include "saml2/core/Protocols.h"
#include "saml2/metadata/Metadata.h"
#include <log4cpp/Category.hh>
#include <xercesc/util/Base64.hpp>
+#include <xmltooling/io/HTTPRequest.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/validation/ValidatorSuite.h>
#include "internal.h"
#include "exceptions.h"
-#include "binding/HTTPRequest.h"
#include "binding/MessageDecoder.h"
#include "saml2/binding/SAML2Redirect.h"
#include "saml2/core/Protocols.h"
#include <log4cpp/Category.hh>
#include <xercesc/util/Base64.hpp>
+#include <xmltooling/io/HTTPRequest.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/validation/ValidatorSuite.h>
#include "internal.h"
#include "exceptions.h"
-#include "binding/HTTPResponse.h"
#include "binding/MessageEncoder.h"
#include "saml2/binding/SAML2Redirect.h"
#include "saml2/core/Protocols.h"
#include <sstream>
#include <log4cpp/Category.hh>
#include <xercesc/util/Base64.hpp>
+#include <xmltooling/io/HTTPResponse.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/util/URLEncoder.h>
#include "internal.h"
#include "exceptions.h"
-#include "binding/HTTPResponse.h"
#include "binding/MessageEncoder.h"
#include "signature/ContentReference.h"
#include "saml2/core/Protocols.h"
#include <sstream>
#include <log4cpp/Category.hh>
+#include <xmltooling/io/HTTPResponse.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/soap/SOAP.h>
#ifndef __saml_cgi_h__
#define __saml_cgi_h__
-#include <saml/binding/HTTPRequest.h>
+#include <saml/base.h>
+#include <xmltooling/io/HTTPRequest.h>
namespace opensaml {
*
* @param request HTTP request interface
*/
- CGIParser(const HTTPRequest& request);
+ CGIParser(const xmltooling::HTTPRequest& request);
~CGIParser();
#include "internal.h"\r
\r
#include <saml/SAMLConfig.h>\r
-#include <saml/binding/HTTPRequest.h>\r
-#include <saml/binding/HTTPResponse.h>\r
#include <saml/binding/MessageDecoder.h>\r
#include <saml/binding/MessageEncoder.h>\r
#include <saml/binding/SecurityPolicyRule.h>\r
#include <saml/saml2/metadata/Metadata.h>\r
#include <saml/saml2/metadata/MetadataProvider.h>\r
+#include <xmltooling/io/HTTPRequest.h>\r
+#include <xmltooling/io/HTTPResponse.h>\r
#include <xmltooling/security/TrustEngine.h>\r
#include <xmltooling/util/URLEncoder.h>\r
\r