Skip to content

Commit

Permalink
Merge pull request #37 from sa-rrowcliffe/develop
Browse files Browse the repository at this point in the history
Patched the Millisecond header
  • Loading branch information
Ryan Rowcliffe committed Jul 5, 2018
2 parents 88ecfb2 + 443bce9 commit 7fcdae0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
currentVersion=1.0.3-SNAPSHOT
currentVersion=1.0.3.1-SNAPSHOT
4 changes: 2 additions & 2 deletions src/main/java/org/secureauth/sarestapi/SAAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public PushAcceptStatus queryPushAcceptStatus(String refId){
* @return {@link ResponseObject}
*/
public BaseResponse validateUser(String userid){

userid = encode(userid);
String ts = getServerTime();
RestApiHeader restApiHeader = new RestApiHeader();
AuthRequest authRequest = new AuthRequest();
Expand Down Expand Up @@ -1146,7 +1146,7 @@ private static boolean isUnsafe(char ch) {
String getServerTime() {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
SimpleDateFormat dateFormat = new SimpleDateFormat(
"EEE, dd MMM yyyy HH:mm:ss.SSS z", Locale.US);
"EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
return dateFormat.format(calendar.getTime());
}
Expand Down
58 changes: 29 additions & 29 deletions src/main/java/org/secureauth/sarestapi/resources/SAExecuter.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public <T> T executeGetRequest(String auth, String query,String ts, Class<T> va
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
get();
genericResponse = response.readEntity(valueType);
response.close();
Expand Down Expand Up @@ -161,7 +161,7 @@ public BaseResponse executeValidateUser(String header,String query, AuthRequest
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", header).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(authRequest),MediaType.APPLICATION_JSON));

responseObject = response.readEntity(BaseResponse.class);
Expand Down Expand Up @@ -191,7 +191,7 @@ public BaseResponse executeValidateUserPassword(String auth,String query, AuthRe
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(authRequest), MediaType.APPLICATION_JSON));
responseObject=response.readEntity(BaseResponse.class);
response.close();
Expand Down Expand Up @@ -220,7 +220,7 @@ public BaseResponse executeValidateUserPin(String auth,String query, AuthRequest
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(authRequest), MediaType.APPLICATION_JSON));
responseObject=response.readEntity(BaseResponse.class);
response.close();
Expand Down Expand Up @@ -249,7 +249,7 @@ public BaseResponse executeValidateKba(String auth,String query, AuthRequest aut
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(authRequest), MediaType.APPLICATION_JSON));

responseObject=response.readEntity(BaseResponse.class);
Expand Down Expand Up @@ -279,7 +279,7 @@ public BaseResponse executeValidateOath(String auth,String query, AuthRequest au
response = target.request()
.accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(authRequest), MediaType.APPLICATION_JSON));

responseObject=response.readEntity(BaseResponse.class);
Expand Down Expand Up @@ -310,7 +310,7 @@ public ResponseObject executeOTPByPhone(String auth,String query, AuthRequest au
accept(MediaType.APPLICATION_JSON).
//type(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(authRequest), MediaType.APPLICATION_JSON));

responseObject=response.readEntity(ResponseObject.class);
Expand Down Expand Up @@ -341,7 +341,7 @@ public ResponseObject executeOTPBySMS(String auth, String query, AuthRequest aut
response = target.request()
.accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(authRequest), MediaType.APPLICATION_JSON));

responseObject=response.readEntity(ResponseObject.class);
Expand Down Expand Up @@ -371,7 +371,7 @@ public ResponseObject executeOTPByEmail(String auth,String query, AuthRequest au
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(authRequest), MediaType.APPLICATION_JSON));

responseObject=response.readEntity(ResponseObject.class);
Expand Down Expand Up @@ -402,7 +402,7 @@ public <T> T executePostRequest(String auth,String query, AuthRequest authReques
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(authRequest),MediaType.APPLICATION_JSON));

responseObject=response.readEntity(valueType);
Expand Down Expand Up @@ -432,7 +432,7 @@ public ValidateOTPResponse executeValidateOTP(String auth, String query, Validat
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(validateOTPRequest),MediaType.APPLICATION_JSON));

validateOTPResponse = response.readEntity(ValidateOTPResponse.class);
Expand Down Expand Up @@ -463,7 +463,7 @@ public ResponseObject executeOTPByHelpDesk(String auth,String query, AuthRequest
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(authRequest),MediaType.APPLICATION_JSON));

responseObject=response.readEntity(ResponseObject.class);
Expand Down Expand Up @@ -498,7 +498,7 @@ public IPEval executeIPEval(String auth, String query, IPEvalRequest ipEvalReque
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(ipEvalRequest), MediaType.APPLICATION_JSON));

ipEval = response.readEntity(IPEval.class);
Expand Down Expand Up @@ -529,7 +529,7 @@ public ResponseObject executeAccessHistory(String auth, String query, AccessHist
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(accessHistoryRequest),MediaType.APPLICATION_JSON));

accessHistory = response.readEntity(ResponseObject.class);
Expand Down Expand Up @@ -559,7 +559,7 @@ public DFPValidateResponse executeDFPValidate(String auth, String query, DFPVali
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(dfpValidateRequest),MediaType.APPLICATION_JSON));

dfpValidateResponse = response.readEntity(DFPValidateResponse.class);
Expand Down Expand Up @@ -589,7 +589,7 @@ public DFPConfirmResponse executeDFPConfirm(String auth, String query, DFPConfir
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(dfpConfirmRequest),MediaType.APPLICATION_JSON));


Expand Down Expand Up @@ -620,7 +620,7 @@ public <T> T executeGetJSObject(String auth, String query,String ts, Class<T> v
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
get();
jsObjectResponse = response.readEntity(valueType);
response.close();
Expand Down Expand Up @@ -649,7 +649,7 @@ public BehaveBioResponse executeBehaveBioPost(String auth, String query, BehaveB
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(behaveBioRequest),MediaType.APPLICATION_JSON));

behaveBioResponse = response.readEntity(BehaveBioResponse.class);
Expand Down Expand Up @@ -680,7 +680,7 @@ public ResponseObject executeBehaveBioReset(String auth, String query, BehaveBio
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
put(Entity.entity(JSONUtil.convertObjectToJSON(behaveBioResetRequest),MediaType.APPLICATION_JSON));

behaveBioResponse = response.readEntity(ResponseObject.class);
Expand Down Expand Up @@ -711,7 +711,7 @@ public ResponseObject executeUserPasswordReset(String auth, String query, UserPa
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(userPasswordRequest),MediaType.APPLICATION_JSON));

passwordResetResponse = response.readEntity(ResponseObject.class);
Expand Down Expand Up @@ -742,7 +742,7 @@ public ResponseObject executeUserPasswordChange(String auth, String query, UserP
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(userPasswordRequest),MediaType.APPLICATION_JSON));

passwordChangeResponse = response.readEntity(ResponseObject.class);
Expand Down Expand Up @@ -773,7 +773,7 @@ public <T> T executeUserProfileUpdateRequest(String auth, String query,NewUserPr
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
put(Entity.entity(JSONUtil.convertObjectToJSON(userProfile), MediaType.APPLICATION_JSON));

responseObject=response.readEntity(valueType);
Expand Down Expand Up @@ -803,7 +803,7 @@ public <T> T executeUserProfileCreateRequest(String auth, String query, NewUserP
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(newUserProfile),MediaType.APPLICATION_JSON));

responseObject=response.readEntity(valueType);
Expand Down Expand Up @@ -832,7 +832,7 @@ public <T> T executeSingleUserToSingleGroup(String auth, String query,String ts,
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity("",MediaType.APPLICATION_JSON));
genericResponse = response.readEntity(valueType);
response.close();
Expand Down Expand Up @@ -861,7 +861,7 @@ public <T> T executeGroupToUsersRequest(String auth, String query, UsersToGroup
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(usersToGroup),MediaType.APPLICATION_JSON));

responseObject=response.readEntity(valueType);
Expand Down Expand Up @@ -890,7 +890,7 @@ public <T> T executeSingleGroupToSingleUser(String auth, String query,String ts,
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity("",MediaType.APPLICATION_JSON));
genericResponse = response.readEntity(valueType);
response.close();
Expand Down Expand Up @@ -919,7 +919,7 @@ public <T> T executeUserToGroupsRequest(String auth, String query, UserToGroups
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(userToGroups),MediaType.APPLICATION_JSON));

responseObject=response.readEntity(valueType);
Expand Down Expand Up @@ -949,7 +949,7 @@ public NumberProfileResponse executeNumberProfilePost(String auth, String query,
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
post(Entity.entity(JSONUtil.convertObjectToJSON(numberProfileRequest),MediaType.APPLICATION_JSON));

numberProfileResponse = response.readEntity(NumberProfileResponse.class);
Expand Down Expand Up @@ -980,7 +980,7 @@ public BaseResponse executeNumberProfileUpdate(String auth, String query, Number
response = target.request().
accept(MediaType.APPLICATION_JSON).
header("Authorization", auth).
header("X-SA-Ext-Date", ts).
header("X-SA-Date", ts).
put(Entity.entity(JSONUtil.convertObjectToJSON(numberProfileUpdateRequest),MediaType.APPLICATION_JSON));

numberProfileUpdateResponse = response.readEntity(BaseResponse.class);
Expand Down

0 comments on commit 7fcdae0

Please sign in to comment.