Added servlet request back to the checksums

This commit is contained in:
Paul Trudel 2024-04-23 11:44:57 -04:00
parent de83c75716
commit 7d156e8828
3 changed files with 15 additions and 4 deletions

View File

@ -16,9 +16,12 @@ public abstract class Checksum {
protected String queryStringWithoutChecksum;
public Checksum(String apiCall, String checksum) {
protected HttpServletRequest request;
public Checksum(String apiCall, String checksum, HttpServletRequest request) {
this.apiCall = ParamsUtil.sanitizeString(apiCall);
this.checksum = ParamsUtil.sanitizeString(checksum);
this.request = request;
}
public String getApiCall() {
@ -44,4 +47,12 @@ public abstract class Checksum {
public void setQueryStringWithoutChecksum(String queryStringWithoutChecksum) {
this.queryStringWithoutChecksum = queryStringWithoutChecksum;
}
public void setRequest(HttpServletRequest request) {
this.request = request;
}
public HttpServletRequest getRequest() {
return request;
}
}

View File

@ -12,8 +12,8 @@ public class GetChecksum extends Checksum {
@NotEmpty(message = "You must provide the query string")
private String queryString;
public GetChecksum(String apiCall, String checksum, String queryString) {
super(apiCall, checksum);
public GetChecksum(String apiCall, String checksum, String queryString, HttpServletRequest request) {
super(apiCall, checksum, request);
this.queryString = ParamsUtil.sanitizeString(queryString);
removeChecksumFromQueryString();
}

View File

@ -119,7 +119,7 @@ public class ValidationService {
switch(apiCall.requestType) {
case GET:
checksum = new GetChecksum(apiCall.getName(), checksumValue, queryString);
checksum = new GetChecksum(apiCall.getName(), checksumValue, queryString, servletRequest);
switch(apiCall) {
case CREATE:
request = new CreateMeeting(checksum, servletRequest);