java.lang.Object
es.kukenan.smartfi.microservice.clients.controller.user.UserController

@RestController public class UserController extends Object
Rest service exposed for user management .
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    REST API user devices resources base path.
    static final String
    REST API base path.
    private static final String
    Password change API access authorities.
    private static final String
    General user API access authorities.
    private static final String
    General user API access authorities.
    static final String
    REST API user devices resources base path.
    static final String
    REST API user devices resources base path.
    private static final String
    General user API access authorities.
    static final String
    REST API user change password path.
    static final String
    REST API user resources base path.
    static final String
    REST API sso login with bolsa kukenbank url resources base path.
    static final String
    REST API users resources base path.
    static final String
    REST API sso login processes resources base path.
    private es.kukenan.smartfi.common.context.RequestContextManager
    Request context manager.
    User device service.
    private UserService
    Users service.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.UserDeviceBiometricResponseDto>
    activeBiometric(String userId, String deviceId, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Biometric device activation.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.UrlBolsaKukenanDto>
    getBolsaKukenbankSession(String userIp, String userAgent, String userId, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Getting bolsa kukenbank url access.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.language.UserLanguageResponseDto>
    getLanguages(es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Getting languages for users.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.SsoLoginDto>
    getSsoLogin(String userIp, String userAgent, String userId, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Getting sso login access.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.UserDto>
    getUser(String userId, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Getting Personal data for userId.
    org.springframework.http.ResponseEntity<Void>
    passwordChange(String userId, String userIp, String userAgent, es.kukenan.smartfi.microservice.clients.dto.PasswordChangeDto passwordChangeDto, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Change password for a user.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.UserDto>
    patchUserLanguage(String userId, es.kukenan.smartfi.microservice.clients.dto.language.UserLanguageDto languageDto, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Updated user language.
    org.springframework.http.ResponseEntity<Void>
    rootedFlagUpdate(String userId, String deviceId, es.kukenan.smartfi.microservice.clients.dto.RootedControlDto rootedControlDto, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Updated if user devices is rooted.
    org.springframework.http.ResponseEntity<Void>
    userUpdateData(String userId, es.kukenan.smartfi.microservice.clients.dto.UserUpdatedDto userUpdatedDto, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
    Change user data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • API_PATH

      public static final String API_PATH
      REST API base path.
      See Also:
    • API_USERS_PATH

      public static final String API_USERS_PATH
      REST API users resources base path.
      See Also:
    • API_USERID_PATH

      public static final String API_USERID_PATH
      REST API user resources base path.
      See Also:
    • API_USER_DEVICES_PATH

      public static final String API_USER_DEVICES_PATH
      REST API user devices resources base path.
      See Also:
    • API_USERS_SSO_LOGIN

      public static final String API_USERS_SSO_LOGIN
      REST API sso login processes resources base path.
      See Also:
    • API_USERS_BOLSA_KUKENBANK

      public static final String API_USERS_BOLSA_KUKENBANK
      REST API sso login with bolsa kukenbank url resources base path.
      See Also:
    • API_USER_PASSWORD_PATH

      public static final String API_USER_PASSWORD_PATH
      REST API user change password path.
      See Also:
    • API_LANGUAGES_PATH

      public static final String API_LANGUAGES_PATH
      REST API user devices resources base path.
      See Also:
    • API_USER_LANGUAGE_PATH

      public static final String API_USER_LANGUAGE_PATH
      REST API user devices resources base path.
      See Also:
    • API_PWD_CHANGE_AUTHORITIES

      private static final String API_PWD_CHANGE_AUTHORITIES
      Password change API access authorities.
      See Also:
    • API_USER_AUTHORITIES

      private static final String API_USER_AUTHORITIES
      General user API access authorities.
      See Also:
    • API_USER_DETAIL_AUTHORITIES

      private static final String API_USER_DETAIL_AUTHORITIES
      General user API access authorities.
      See Also:
    • API_USER_OR_INTERNAL_AUTHORITIES

      private static final String API_USER_OR_INTERNAL_AUTHORITIES
      General user API access authorities.
      See Also:
    • userService

      @Autowired private UserService userService
      Users service.
    • userDeviceService

      @Autowired private UserDeviceService userDeviceService
      User device service.
    • contextManager

      @Autowired private es.kukenan.smartfi.common.context.RequestContextManager contextManager
      Request context manager.
  • Constructor Details

    • UserController

      public UserController()
  • Method Details

    • passwordChange

      @PutMapping(path="/api/v1/users/{userId}/password", produces="application/json", consumes="application/json") @PreAuthorize("hasRole(\'ROLE_ACCESS_USER\') and ( hasRole(\'ROLE_LEVEL_USER_RESTRICTED\') or hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\') )") public org.springframework.http.ResponseEntity<Void> passwordChange(@PathVariable("userId") String userId, @RequestHeader(name="X-SKYLINE-USER-IP",defaultValue="127.0.0.1") String userIp, @RequestHeader(name="X-USER-AGENT") String userAgent, @RequestBody es.kukenan.smartfi.microservice.clients.dto.PasswordChangeDto passwordChangeDto, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Change password for a user.
      Parameters:
      userId - User identifier
      userIp - user real ip
      userAgent - user-agent header
      passwordChangeDto - New password and extra data
      authentication - authorized credentials. Used to extract additional query criteria, like the user company.
      Returns:
      a ResponseEntity containing JWT details if user authorization has been elevated, or empty in other case.
    • userUpdateData

      @PatchMapping(path="/api/v1/users/{userId}", produces="application/json", consumes="application/json") @PreAuthorize("( hasRole(\'ROLE_ACCESS_USER\') and ( hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\') ) ) or hasRole(\'ROLE_ACCESS_MICROSERVICE\')") public org.springframework.http.ResponseEntity<Void> userUpdateData(@PathVariable("userId") String userId, @RequestBody es.kukenan.smartfi.microservice.clients.dto.UserUpdatedDto userUpdatedDto, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Change user data.
      Parameters:
      userId - User identifier
      userUpdatedDto - user data.
      authentication - authorized credentials. Used to extract additional query criteria, like the user company.
      Returns:
      User data
    • rootedFlagUpdate

      @PatchMapping(path="/api/v1/users/{userId}/devices/{deviceId}", produces="application/json", consumes="application/json") @PreAuthorize("hasRole(\'ROLE_ACCESS_USER\') and ( hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\') )") public org.springframework.http.ResponseEntity<Void> rootedFlagUpdate(@PathVariable("userId") String userId, @PathVariable("deviceId") String deviceId, @RequestBody es.kukenan.smartfi.microservice.clients.dto.RootedControlDto rootedControlDto, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Updated if user devices is rooted.
      Parameters:
      userId - User identifier
      deviceId - Device unique identifier.
      rootedControlDto - flag locked state.
      authentication - authorized credentials. Used to extract additional query criteria, like the user company.
      Returns:
      User data
    • getUser

      @GetMapping(path="/api/v1/users/{userId}", produces="application/json", consumes="application/json") @PreAuthorize("(hasRole(\'ROLE_ACCESS_USER\') or hasRole(\'ROLE_ACCESS_AGENT\')) and (hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\'))") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.UserDto> getUser(@PathVariable("userId") String userId, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Getting Personal data for userId.
      Parameters:
      userId - User identifier
      authentication - authorized credentials.
      Returns:
      User data
    • getSsoLogin

      @GetMapping(path="/api/v1/users/{userId}/sso-login", produces="application/json", consumes="application/json") @PreAuthorize("(hasRole(\'ROLE_ACCESS_USER\') or hasRole(\'ROLE_ACCESS_AGENT\')) and (hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\'))") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.SsoLoginDto> getSsoLogin(@RequestHeader("X-SKYLINE-USER-IP") String userIp, @RequestHeader("X-USER-AGENT") String userAgent, @PathVariable("userId") String userId, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Getting sso login access.
      Parameters:
      userIp - User ip
      userAgent - User Agent
      userId - User identifier
      authentication - authorized credentials.
      Returns:
      sso login data
    • activeBiometric

      @PostMapping(path="/api/v1/users/{userId}/devices/{deviceId}/biometric", produces="application/json") @PreAuthorize("hasRole(\'ROLE_ACCESS_USER\') and ( hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\') )") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.UserDeviceBiometricResponseDto> activeBiometric(@PathVariable("userId") String userId, @PathVariable("deviceId") String deviceId, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Biometric device activation.
      Parameters:
      userId - user identifier
      deviceId - device identifier
      authentication - authorized credentials
      Returns:
      biometric activation response
    • getBolsaKukenbankSession

      @GetMapping(path="/api/v1/users/{userId}/bolsa-kukenbank-session", produces="application/json", consumes="application/json") @PreAuthorize("(hasRole(\'ROLE_ACCESS_USER\') or hasRole(\'ROLE_ACCESS_AGENT\')) and (hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\'))") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.UrlBolsaKukenanDto> getBolsaKukenbankSession(@RequestHeader("X-SKYLINE-USER-IP") String userIp, @RequestHeader("X-USER-AGENT") String userAgent, @PathVariable("userId") String userId, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Getting bolsa kukenbank url access.
      Parameters:
      userIp - User ip
      userAgent - User Agent
      userId - User identifier
      authentication - authorized credentials.
      Returns:
      url bolsa kukenbank data
    • getLanguages

      @GetMapping(path="/api/v1/users/languages", produces="application/json") @PreAuthorize("hasRole(\'ROLE_ACCESS_USER\') and ( hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\') )") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.language.UserLanguageResponseDto> getLanguages(es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Getting languages for users.
      Parameters:
      authentication - authorized credentials.
      Returns:
      languages list
    • patchUserLanguage

      @PatchMapping(path="/api/v1/users/{userId}/language", produces="application/json") @PreAuthorize("hasRole(\'ROLE_ACCESS_USER\') and ( hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\') )") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.clients.dto.UserDto> patchUserLanguage(@PathVariable("userId") String userId, @RequestBody es.kukenan.smartfi.microservice.clients.dto.language.UserLanguageDto languageDto, es.kukenan.smartfi.common.service.jwt.WalletAuthenticationJwtImpl authentication)
      Updated user language.
      Parameters:
      userId - User identifier
      languageDto - language request
      authentication - authorized credentials. Used to extract additional query criteria, like the user company.
      Returns:
      User data