Skip to content

Commit

Permalink
MOSIP-26691 (#1170)
Browse files Browse the repository at this point in the history
Signed-off-by: ase-101 <[email protected]>
  • Loading branch information
ase-101 committed Jan 23, 2024
1 parent a733d21 commit f1c07d5
Showing 1 changed file with 5 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ private void audit(String username, Action action, ActionStatus status, AuditDTO
auditRequest.setApplicationName(ESIGNET);
auditRequest.setSessionUserId(StringUtils.isEmpty(username)?"no-user":username);
auditRequest.setSessionUserName(StringUtils.isEmpty(username)?"no-user":username);
auditRequest.setIdType(TRANSACTION);
auditRequest.setIdType(audit.getIdType());
auditRequest.setCreatedBy(this.getClass().getSimpleName());
auditRequest.setModuleName(getModuleByAction(action));
auditRequest.setModuleId(getModuleByAction(action));
auditRequest.setModuleName(action.getModule());
auditRequest.setModuleId(action.getModule());
auditRequest.setDescription(getAuditDescription(audit));
auditRequest.setId(audit.getTransactionId());

Expand Down Expand Up @@ -120,40 +120,9 @@ private String getAuditDescription(AuditDTO audit) throws JSONException {
json.put("state", audit.getState());
json.put("codeHash", audit.getCodeHash());
json.put("accessTokenHash", audit.getAccessTokenHash());
json.put("linkCodeHash", audit.getLinkedCodeHash());
json.put("linkTransactionId", audit.getLinkedTransactionId());
return json.toString();
}

private String getModuleByAction(Action action) {
switch (action) {
case OIDC_CLIENT_CREATE:
case OIDC_CLIENT_UPDATE:
return "ClientManagementController";
case GET_OAUTH_DETAILS:
case TRANSACTION_STARTED:
case SEND_OTP:
case AUTHENTICATE:
case GET_AUTH_CODE:
case DO_KYC_AUTH:
case DO_KYC_EXCHANGE:
return "AuthorizationController";
case GENERATE_TOKEN:
return "OAuthController";
case GET_USERINFO:
return "OpenIdConnectController";
case LINK_AUTH_CODE:
case LINK_AUTHENTICATE:
case LINK_CODE:
case LINK_SEND_OTP:
case LINK_STATUS:
case LINK_TRANSACTION:
case SAVE_CONSENT:
return "LinkedAuthorizationController";
case GET_CERTIFICATE:
case UPLOAD_CERTIFICATE:
return "SystemInfoController";
default:
return "EsignetService";
}
}

}

0 comments on commit f1c07d5

Please sign in to comment.