Class BaseSAMLHttpServletRequestDecoder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.decoder.AbstractMessageDecoder
org.opensaml.messaging.decoder.servlet.AbstractHttpServletRequestMessageDecoder
org.opensaml.messaging.decoder.servlet.BaseHttpServletRequestXMLMessageDecoder
org.opensaml.saml.common.binding.impl.BaseSAMLHttpServletRequestDecoder
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,UnmodifiableComponent,MessageDecoder,HttpServletRequestMessageDecoder
- Direct Known Subclasses:
HTTPArtifactDecoder,HTTPArtifactDecoder,HTTPPostDecoder,HTTPPostDecoder,HTTPRedirectDeflateDecoder
public abstract class BaseSAMLHttpServletRequestDecoder
extends BaseHttpServletRequestXMLMessageDecoder
Abstract base decoder for SAML decoders.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerLogger.private MessageTypeCached message type.Fields inherited from class org.opensaml.messaging.decoder.AbstractMessageDecoder
BASE_PROTOCOL_MESSAGE_LOGGER_CATEGORY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidEnforce the configured message size limit, if enabled.protected IntegerGet the message size in bytes.protected IntegerGet the configured message size limit, in bytes.protected MessageTypeGet the type of message being processed by the decoder.protected booleanGet whether enforcement of message size limit is enabled.protected IntegerValidate message parameter values and return the message size in bytes.protected voidvalidateHttpRequest(HttpServletRequest request) Perform optional validation of the inboundHttpServletRequest.Methods inherited from class org.opensaml.messaging.decoder.servlet.BaseHttpServletRequestXMLMessageDecoder
decode, doInitialize, getParserPool, serializeMessageForLogging, setParserPool, unmarshallMessageMethods inherited from class org.opensaml.messaging.decoder.servlet.AbstractHttpServletRequestMessageDecoder
getHttpServletRequest, getHttpServletRequestSupplier, isCheckDuringInit, setCheckDuringInit, setHttpServletRequestSupplierMethods inherited from class org.opensaml.messaging.decoder.AbstractMessageDecoder
doDecode, getMessageContext, getMessageToLog, getProtocolMessageLogger, getProtocolMessageLoggerSubCategory, logDecodedMessage, setMessageContext, setProtocolMessageLoggerSubCategoryMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitializedMethods inherited from interface org.opensaml.messaging.decoder.MessageDecoder
getMessageContext
-
Field Details
-
log
private final org.slf4j.Logger logLogger. -
messageType
Cached message type.
-
-
Constructor Details
-
BaseSAMLHttpServletRequestDecoder
public BaseSAMLHttpServletRequestDecoder()Constructor.
-
-
Method Details
-
validateHttpRequest
protected void validateHttpRequest(@Nonnull HttpServletRequest request) throws MessageDecodingException Perform optional validation of the inboundHttpServletRequest.This method is called before the main
MessageDecoder.decode()logic}.The default behavior is a no-op. Subclasses may override with specific constraints.
- Overrides:
validateHttpRequestin classBaseHttpServletRequestXMLMessageDecoder- Parameters:
request- the HTTP request being validate- Throws:
MessageDecodingException- if request is not considered valid
-
evaluateMessageSizeLimit
Enforce the configured message size limit, if enabled.- Throws:
MessageDecodingException- if message size exceeds the enabled and configured limit, or if evaluation encounters a fatal error
-
getMessageType
Get the type of message being processed by the decoder.- Returns:
- the message type
- Throws:
MessageDecodingException- if the MessageType can not be determined
-
isEnforceMessageSizeLimit
Get whether enforcement of message size limit is enabled.- Returns:
- true if enabled, false if not
- Throws:
MessageDecodingException- if there is a fatal error during evaluation
-
getMessageSizeLimit
Get the configured message size limit, in bytes.- Returns:
- the message size limit in bytes, or null if not configured
- Throws:
MessageDecodingException- if there is a fatal error during evaluation
-
validateAndGetMessageSize
Validate message parameter values and return the message size in bytes.- Returns:
- the message size in bytes, or null if can not be determined
- Throws:
MessageDecodingException- if the HTTP request carries an invalid number of values for the specified message type
-
getMessageSize
Get the message size in bytes.The default implementation is to return null. Specific decoder implementation MUST implement this if message size limit enforcement is to be effectively enabled for that type of concrete decoder. Implementations may assume that the parameter set has already been validated and the request contains only 1 message parameter and 1 value for that parameter.
- Returns:
- the message size in bytes, or null if can not be determined
- Throws:
MessageDecodingException- if there is a fatal error determining message size
-