public abstract class SocialProxyFilter
extends org.mitre.dsmiley.httpproxy.ProxyServlet
implements javax.servlet.Filter
| Modifier and Type | Field and Description |
|---|---|
protected ProfileClient |
client |
protected String |
cookieTicketName |
static String |
CRAFTER_PROFILE_AUTH |
protected String |
proxyFilterPrefix |
| Constructor and Description |
|---|
SocialProxyFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkIfUserIsAuth(ProxyHttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse) |
protected Map<String,Object> |
doCrafterProfileAuth(Map<String,Object> userInformation,
ProxyHttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
protected boolean |
doResponseRedirectOrNotModifiedLogic(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse,
org.apache.http.HttpResponse proxyResponse,
int statusCode) |
protected String |
getConfigParam(String key)
Reads a configuration parameter.
|
protected String |
getCookieNamePrefix()
The string prefixing rewritten cookies.
|
javax.servlet.ServletContext |
getServletContext() |
abstract Map<String,Object> |
getUserProfile(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
init(javax.servlet.FilterConfig filterConfig) |
protected void |
initTarget() |
protected String |
rewriteUrlFromRequest(javax.servlet.http.HttpServletRequest servletRequest)
Reads the request URI from
servletRequest and rewrites it, considering targetUri. |
void |
setClient(ProfileClient client) |
void |
setCookieTicketName(String cookieTicketName) |
void |
setProxyFilterPrefix(String proxyFilterPrefix) |
void |
setSocialUrl(String socialUrl) |
protected String |
ticketCookieExist(ProxyHttpServletRequest httpServletRequest) |
protected void |
validateAuthCookie(String authCookieValue,
ProxyHttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse) |
closeQuietly, consumeQuietly, copyProxyCookie, copyRequestHeaders, copyResponseEntity, copyResponseHeaders, createHttpClient, destroy, encodeUriQuery, getProxyClient, getRealCookie, getServletInfo, getTargetUri, getTargetUri, init, readConfigParam, rewriteQueryStringFromRequest, rewriteUrlFromResponse, servicedoDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, servicegetInitParameter, getInitParameterNames, getServletConfig, getServletName, init, log, logpublic static final String CRAFTER_PROFILE_AUTH
protected String proxyFilterPrefix
protected ProfileClient client
protected String cookieTicketName
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterjavax.servlet.ServletExceptionpublic abstract Map<String,Object> getUserProfile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.FilterIOExceptionjavax.servlet.ServletExceptionprotected void checkIfUserIsAuth(ProxyHttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws Exception
Exceptionprotected void validateAuthCookie(String authCookieValue, ProxyHttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws Exception
Exceptionprotected String ticketCookieExist(ProxyHttpServletRequest httpServletRequest)
protected Map<String,Object> doCrafterProfileAuth(Map<String,Object> userInformation, ProxyHttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
Exceptionprotected boolean doResponseRedirectOrNotModifiedLogic(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse,
org.apache.http.HttpResponse proxyResponse,
int statusCode)
throws javax.servlet.ServletException,
IOException
doResponseRedirectOrNotModifiedLogic in class org.mitre.dsmiley.httpproxy.ProxyServletjavax.servlet.ServletExceptionIOExceptionpublic void setSocialUrl(String socialUrl)
protected String rewriteUrlFromRequest(javax.servlet.http.HttpServletRequest servletRequest)
servletRequest and rewrites it, considering targetUri.
It's used to make the new request.rewriteUrlFromRequest in class org.mitre.dsmiley.httpproxy.ProxyServletprotected void initTarget()
initTarget in class org.mitre.dsmiley.httpproxy.ProxyServletpublic javax.servlet.ServletContext getServletContext()
getServletContext in interface javax.servlet.ServletConfiggetServletContext in class javax.servlet.GenericServletprotected String getCookieNamePrefix()
getCookieNamePrefix in class org.mitre.dsmiley.httpproxy.ProxyServletprotected String getConfigParam(String key)
getConfigParam in class org.mitre.dsmiley.httpproxy.ProxyServletpublic void setProxyFilterPrefix(String proxyFilterPrefix)
public void setClient(ProfileClient client)
public void setCookieTicketName(String cookieTicketName)
Copyright © 2017. All Rights Reserved.