X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=saml%2Fbinding%2FMessageDecoder.h;h=9f3905df64816105e84651034939d876452e5bdf;hp=9d1c8e50066817a63ff8891e4caaa3ae15d8db8e;hb=7748ee29f760b74bca03c744deacba466a333c43;hpb=932cfaae2176c2eba1a9938dc420591a9551a7f3 diff --git a/saml/binding/MessageDecoder.h b/saml/binding/MessageDecoder.h index 9d1c8e5..9f3905d 100644 --- a/saml/binding/MessageDecoder.h +++ b/saml/binding/MessageDecoder.h @@ -23,9 +23,9 @@ #ifndef __saml_decoder_h__ #define __saml_decoder_h__ -#include #include #include +#include namespace opensaml { @@ -54,6 +54,15 @@ namespace opensaml { virtual ~MessageDecoder() {} /** + * Indicates whether a web browser or similar user agent delivered the message. + * + * @return true iff the message was delivered by a user agent + */ + virtual bool isUserAgentPresent() const { + return true; + } + + /** * Interface to caller-supplied artifact resolution mechanism. * * Resolving artifacts requires internally performing a SOAP-based @@ -68,25 +77,11 @@ namespace opensaml { MAKE_NONCOPYABLE(ArtifactResolver); protected: ArtifactResolver() {} - - /** Flag controlling schema validation. */ - bool m_validate; public: virtual ~ArtifactResolver() {} /** - * Controls schema validation of incoming XML messages. - * This is separate from other forms of programmatic validation of objects, - * but can detect a much wider range of syntax errors. - * - * @param validate true iff the resolver should use a validating XML parser - */ - void setValidating(bool validate=true) { - m_validate = validate; - } - - /** * Resolves one or more SAML 1.x artifacts into a response containing a set of * resolved Assertions. The caller is responsible for the resulting Response. * The supplied SecurityPolicy is used to access caller-supplied infrastructure @@ -128,26 +123,11 @@ namespace opensaml { * * @param artifactResolver an ArtifactResolver implementation to use */ - void setArtifactResolver(ArtifactResolver* artifactResolver) { + void setArtifactResolver(const ArtifactResolver* artifactResolver) { m_artifactResolver = artifactResolver; - if (m_artifactResolver) - m_artifactResolver->setValidating(m_validate); } /** - * Controls schema validation of incoming XML messages. - * This is separate from other forms of programmatic validation of objects, - * but can detect a much wider range of syntax errors. - * - * @param validate true iff the decoder should use a validating XML parser - */ - void setValidating(bool validate=true) { - m_validate = validate; - if (m_artifactResolver) - m_artifactResolver->setValidating(m_validate); - } - - /** * Decodes a transport request into a SAML protocol message, and evaluates it * against a supplied SecurityPolicy. If the transport request does not contain * the information necessary to decode the request, NULL will be returned. @@ -163,18 +143,30 @@ namespace opensaml { */ virtual xmltooling::XMLObject* decode( std::string& relayState, - const GenericRequest& genericRequest, + const xmltooling::GenericRequest& genericRequest, SecurityPolicy& policy ) const=0; protected: - MessageDecoder() : m_artifactResolver(NULL), m_validate(false) {} + MessageDecoder() : m_artifactResolver(NULL) {} /** Pointer to an ArtifactResolver implementation. */ - ArtifactResolver* m_artifactResolver; - - /** Flag controlling schema validation. */ - bool m_validate; + const ArtifactResolver* m_artifactResolver; + + /** + * Extracts policy-relevant message details. + * + * @param message the incoming message + * @param request the protocol request + * @param protocol the protocol family in use + * @param policy SecurityPolicy to provide various components and track message data + */ + virtual void extractMessageDetails ( + const xmltooling::XMLObject& message, + const xmltooling::GenericRequest& request, + const XMLCh* protocol, + SecurityPolicy& policy + ) const=0; }; /**