Search in sources :

Example 1 with CxUser

use of com.checkmarx.sdk.dto.sast.CxUser in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class CxLegacyService method mapUser.

private CxUser mapUser(UserData u) {
    CxUser user = new CxUser();
    user.setId(u.getID());
    user.setActive(u.isIsActive());
    user.setLastLoginDate(u.getLastLoginDate().toString());
    user.setUserName(u.getUserName());
    user.setFirstName(u.getFirstName());
    user.setLastName(u.getLastName());
    user.setEmail(u.getEmail());
    user.setPhoneNumber(u.getPhone());
    user.setCellPhoneNumber(u.getCellPhone());
    user.setJobTitle(u.getJobTitle());
    user.setCountry(u.getCountry());
    // TODO expiration date?
    user.setAllowedIpList(u.getAllowedIPs().getString());
    // user.setType8x();
    user.setCompanyId8x(u.getCompanyID());
    user.setCompany8x(u.getCompanyName());
    user.setUpn(u.getUPN());
    Map<String, String> teams = new HashMap<>();
    for (Group g : u.getGroupList().getGroup()) {
        teams.put(g.getID(), g.getGroupName());
    }
    user.setTeams8x(teams);
    CxUser.Role8x role = ROLEMAP.get(Integer.parseInt(u.getRoleData().getID()));
    if (role != null) {
        // validate
        user.setRole8x(role);
    } else {
        log.warn("Uknown role id {}", u.getRoleData().getID());
    }
    user.setAuditor(u.isAuditUser());
    return user;
}
Also used : HashMap(java.util.HashMap) CxUser(com.checkmarx.sdk.dto.sast.CxUser)

Aggregations

CxUser (com.checkmarx.sdk.dto.sast.CxUser)1 HashMap (java.util.HashMap)1