Package net.shibboleth.sp.messaging
Class RemotedHttpServletRequest
java.lang.Object
net.shibboleth.sp.messaging.RemotedHttpServletRequest
- All Implemented Interfaces:
HttpServletRequest,ServletRequest
Wraps a
DDF object reflecting a remoted message encapsulating an HTTP request.
Potential TODOs are noted in various places. One outstanding issue is header case. The SP code never did case-folding of the header names, so we may need to adjust that on the C++ side to force-lower them in transit and then lower them on access.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classHelper class cribbed from Spring. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringField holding body.static final StringField holding content length.static final StringField holding content type.Cookie array.private CharsetDecoderDecoder to apply to byte array data.private static final byte[]Empty byte array for empty bodies.static final StringField holding headers.static final StringField holding server hostname.static final StringField holding client address.static final StringField holding method.private final DDFUnderlying object containing remoted data.Parameter map.static final StringField holding port.static final StringField holding protocol.static final StringField holding query string.private StringCached, reconstructed URL from component parts.static final StringField holding client address.static final StringField holding REMOTE_USER.static final StringField holding request URI (path without query string).static final StringField holding scheme.static final StringField holding name ofDDFstructure containing request.private static final CharsetDecoderUTF-8 decoder.Fields inherited from interface jakarta.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for UTF-8 usage.RemotedHttpServletRequest(DDF ddf, CharsetDecoder dec) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticate(HttpServletResponse response) static StringdecodeUnsafeString(byte[] buffer, CharsetDecoder decoder, Character delim) Helper method to decode a byte array via a designated encoding.getAttribute(String name) intlongCookie[]longgetDateHeader(String name) getDDF()Gets the underlying object containing the remoted data.getHeaders(String name) intgetIntHeader(String name) intgetParameter(String name) String[]getParameterValues(String name) getParts()intgetRequestDispatcher(String path) intgetSession(boolean create) booleanbooleanbooleanbooleanbooleanbooleanisSecure()booleanisUserInRole(String role) voidvoidlogout()voidremoveAttribute(String name) voidsetAttribute(String name, Object o) voidstartAsync(ServletRequest servletRequest, ServletResponse servletResponse) <T extends HttpUpgradeHandler>
TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.http.HttpServletRequest
getHttpServletMapping, getTrailerFields, isTrailerFieldsReady, newPushBuilderMethods inherited from interface jakarta.servlet.ServletRequest
setCharacterEncoding
-
Field Details
-
STRUCTURE_NAME
Field holding name ofDDFstructure containing request.- See Also:
-
REQUEST_URI
Field holding request URI (path without query string).- See Also:
-
SCHEME
Field holding scheme.- See Also:
-
PORT
Field holding port.- See Also:
-
METHOD
Field holding method.- See Also:
-
PROTOCOL
Field holding protocol.- See Also:
-
HOSTNAME
Field holding server hostname.- See Also:
-
REMOTE_ADDR
Field holding client address.- See Also:
-
REMOTE_USER
Field holding REMOTE_USER.- See Also:
-
LOCAL_ADDR
Field holding client address.- See Also:
-
QUERY_STRING
Field holding query string.- See Also:
-
BODY
Field holding body.- See Also:
-
CONTENT_TYPE
Field holding content type.- See Also:
-
CONTENT_LENGTH
Field holding content length.- See Also:
-
HEADERS
Field holding headers.- See Also:
-
EMPTY_BODY
@Nonnull private static final byte[] EMPTY_BODYEmpty byte array for empty bodies. -
UTF_8
UTF-8 decoder. -
obj
Underlying object containing remoted data. -
reconstructedURL
Cached, reconstructed URL from component parts. -
decoder
Decoder to apply to byte array data. -
cookies
Cookie array. -
parameters
Parameter map.
-
-
Constructor Details
-
RemotedHttpServletRequest
Constructor for UTF-8 usage.- Parameters:
ddf- remoted request information
-
RemotedHttpServletRequest
Constructor.- Parameters:
ddf- remoted request informationdec- a backup decoder if UTF-8 fails
-
-
Method Details
-
getDDF
Gets the underlying object containing the remoted data.- Returns:
- remoted data object
-
getAttribute
- Specified by:
getAttributein interfaceServletRequest
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceServletRequest
-
getCharacterEncoding
- Specified by:
getCharacterEncodingin interfaceServletRequest
-
setCharacterEncoding
- Specified by:
setCharacterEncodingin interfaceServletRequest- Throws:
UnsupportedEncodingException
-
getContentLength
public int getContentLength()- Specified by:
getContentLengthin interfaceServletRequest
-
getContentLengthLong
public long getContentLengthLong()- Specified by:
getContentLengthLongin interfaceServletRequest
-
getContentType
- Specified by:
getContentTypein interfaceServletRequest
-
getInputStream
- Specified by:
getInputStreamin interfaceServletRequest- Throws:
IOException
-
getParameter
- Specified by:
getParameterin interfaceServletRequest
-
getParameterNames
- Specified by:
getParameterNamesin interfaceServletRequest
-
getParameterValues
- Specified by:
getParameterValuesin interfaceServletRequest
-
getParameterMap
- Specified by:
getParameterMapin interfaceServletRequest
-
getRequestId
- Specified by:
getRequestIdin interfaceServletRequest
-
getProtocolRequestId
- Specified by:
getProtocolRequestIdin interfaceServletRequest
-
getServletConnection
- Specified by:
getServletConnectionin interfaceServletRequest
-
getProtocol
- Specified by:
getProtocolin interfaceServletRequest
-
getScheme
- Specified by:
getSchemein interfaceServletRequest
-
getServerName
- Specified by:
getServerNamein interfaceServletRequest
-
getServerPort
public int getServerPort()- Specified by:
getServerPortin interfaceServletRequest
-
getReader
- Specified by:
getReaderin interfaceServletRequest- Throws:
IOException
-
getRemoteAddr
- Specified by:
getRemoteAddrin interfaceServletRequest
-
getRemoteHost
- Specified by:
getRemoteHostin interfaceServletRequest
-
setAttribute
- Specified by:
setAttributein interfaceServletRequest
-
removeAttribute
- Specified by:
removeAttributein interfaceServletRequest
-
getLocale
- Specified by:
getLocalein interfaceServletRequest
-
getLocales
- Specified by:
getLocalesin interfaceServletRequest
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfaceServletRequest
-
getRequestDispatcher
- Specified by:
getRequestDispatcherin interfaceServletRequest
-
getRemotePort
public int getRemotePort()- Specified by:
getRemotePortin interfaceServletRequest
-
getLocalName
- Specified by:
getLocalNamein interfaceServletRequest
-
getLocalAddr
- Specified by:
getLocalAddrin interfaceServletRequest
-
getLocalPort
public int getLocalPort()- Specified by:
getLocalPortin interfaceServletRequest
-
getServletContext
- Specified by:
getServletContextin interfaceServletRequest
-
startAsync
- Specified by:
startAsyncin interfaceServletRequest- Throws:
IllegalStateException
-
startAsync
public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException - Specified by:
startAsyncin interfaceServletRequest- Throws:
IllegalStateException
-
isAsyncStarted
public boolean isAsyncStarted()- Specified by:
isAsyncStartedin interfaceServletRequest
-
isAsyncSupported
public boolean isAsyncSupported()- Specified by:
isAsyncSupportedin interfaceServletRequest
-
getAsyncContext
- Specified by:
getAsyncContextin interfaceServletRequest
-
getDispatcherType
- Specified by:
getDispatcherTypein interfaceServletRequest
-
getAuthType
- Specified by:
getAuthTypein interfaceHttpServletRequest
-
getCookies
- Specified by:
getCookiesin interfaceHttpServletRequest
-
getDateHeader
- Specified by:
getDateHeaderin interfaceHttpServletRequest
-
getHeader
- Specified by:
getHeaderin interfaceHttpServletRequest
-
getHeaders
- Specified by:
getHeadersin interfaceHttpServletRequest
-
getHeaderNames
- Specified by:
getHeaderNamesin interfaceHttpServletRequest
-
getIntHeader
- Specified by:
getIntHeaderin interfaceHttpServletRequest
-
getMethod
- Specified by:
getMethodin interfaceHttpServletRequest
-
getPathInfo
- Specified by:
getPathInfoin interfaceHttpServletRequest
-
getPathTranslated
- Specified by:
getPathTranslatedin interfaceHttpServletRequest
-
getContextPath
- Specified by:
getContextPathin interfaceHttpServletRequest
-
getQueryString
- Specified by:
getQueryStringin interfaceHttpServletRequest
-
getRemoteUser
- Specified by:
getRemoteUserin interfaceHttpServletRequest
-
isUserInRole
- Specified by:
isUserInRolein interfaceHttpServletRequest
-
getUserPrincipal
- Specified by:
getUserPrincipalin interfaceHttpServletRequest
-
getRequestedSessionId
- Specified by:
getRequestedSessionIdin interfaceHttpServletRequest
-
getRequestURI
- Specified by:
getRequestURIin interfaceHttpServletRequest
-
getRequestURL
- Specified by:
getRequestURLin interfaceHttpServletRequest
-
getServletPath
- Specified by:
getServletPathin interfaceHttpServletRequest
-
getSession
- Specified by:
getSessionin interfaceHttpServletRequest
-
getSession
- Specified by:
getSessionin interfaceHttpServletRequest
-
changeSessionId
- Specified by:
changeSessionIdin interfaceHttpServletRequest
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()- Specified by:
isRequestedSessionIdValidin interfaceHttpServletRequest
-
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()- Specified by:
isRequestedSessionIdFromCookiein interfaceHttpServletRequest
-
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()- Specified by:
isRequestedSessionIdFromURLin interfaceHttpServletRequest
-
authenticate
- Specified by:
authenticatein interfaceHttpServletRequest- Throws:
IOExceptionServletException
-
login
- Specified by:
loginin interfaceHttpServletRequest- Throws:
ServletException
-
logout
- Specified by:
logoutin interfaceHttpServletRequest- Throws:
ServletException
-
getParts
- Specified by:
getPartsin interfaceHttpServletRequest- Throws:
IOExceptionServletException
-
getPart
- Specified by:
getPartin interfaceHttpServletRequest- Throws:
IOExceptionServletException
-
upgrade
public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, ServletException - Specified by:
upgradein interfaceHttpServletRequest- Throws:
IOExceptionServletException
-
decodeUnsafeString
@Nullable public static String decodeUnsafeString(byte[] buffer, @Nonnull CharsetDecoder decoder, @Nullable Character delim) Helper method to decode a byte array via a designated encoding.- Parameters:
buffer- input bufferdecoder- decoder to applydelim- optional delimter to truncate at- Returns:
- decoded String form of the data or null if a decoding exception was caught
-