public class TopologyRequestValidator extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HASH_HEADER |
static String |
SIG_HEADER |
Constructor and Description |
---|
TopologyRequestValidator(BaseConfig config)
Create a TopologyRequestValidator.
|
Modifier and Type | Method and Description |
---|---|
String |
decodeMessage(javax.servlet.http.HttpServletRequest request)
Decode a message sent from the client.
|
String |
decodeMessage(String uri,
org.apache.http.HttpResponse response)
Decode a response from the server.
|
String |
encodeMessage(String body)
Encodes a request returning the encoded body
|
boolean |
isTrusted(org.apache.http.HttpResponse response)
Is the response from the server to be trusted by the client.
|
boolean |
isTrusted(javax.servlet.http.HttpServletRequest request)
Is the request from the client trusted, based on the signature headers.
|
void |
trustMessage(javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request,
String body)
Trust a response message sent from the server to the client.
|
void |
trustMessage(org.apache.http.client.methods.HttpUriRequest method,
String body)
Trust a message on the client before sending, only if trust is enabled.
|
public static final String SIG_HEADER
public static final String HASH_HEADER
public TopologyRequestValidator(BaseConfig config)
config
- the configuation objectpublic String encodeMessage(String body) throws IOException
body
- IOException
public String decodeMessage(javax.servlet.http.HttpServletRequest request) throws IOException
request
- the request object for the message.IOException
- if there is a problem decoding the message or the
message is invalid.public String decodeMessage(String uri, org.apache.http.HttpResponse response) throws IOException
response
- the response.IOException
- if there was a problem decoding the message.public boolean isTrusted(javax.servlet.http.HttpServletRequest request)
request
- the request.public boolean isTrusted(org.apache.http.HttpResponse response)
response
- the responsepublic void trustMessage(org.apache.http.client.methods.HttpUriRequest method, String body)
method
- the method which will have headers set after the call.body
- the body.public void trustMessage(javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request, String body)
response
- the response.request
- the request,body
- body of the response.Copyright © 2017 The Apache Software Foundation. All rights reserved.