Class UserController
java.lang.Object
es.kukenan.smartfi.microservice.clients.controller.user.UserController
Rest service exposed for user management .
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringREST API user devices resources base path.static final StringREST API base path.private static final StringPassword change API access authorities.private static final StringGeneral user API access authorities.private static final StringGeneral user API access authorities.static final StringREST API user devices resources base path.static final StringREST API user devices resources base path.private static final StringGeneral user API access authorities.static final StringREST API user change password path.static final StringREST API user resources base path.static final StringREST API sso login with bolsa kukenbank url resources base path.static final StringREST API users resources base path.static final StringREST API sso login processes resources base path.private es.kukenan.smartfi.common.context.RequestContextManagerRequest context manager.private UserDeviceServiceUser device service.private UserServiceUsers service. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.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.
-
Field Details
-
API_PATH
REST API base path.- See Also:
-
API_USERS_PATH
REST API users resources base path.- See Also:
-
API_USERID_PATH
REST API user resources base path.- See Also:
-
API_USER_DEVICES_PATH
REST API user devices resources base path.- See Also:
-
API_USERS_SSO_LOGIN
REST API sso login processes resources base path.- See Also:
-
API_USERS_BOLSA_KUKENBANK
REST API sso login with bolsa kukenbank url resources base path.- See Also:
-
API_USER_PASSWORD_PATH
REST API user change password path.- See Also:
-
API_LANGUAGES_PATH
REST API user devices resources base path.- See Also:
-
API_USER_LANGUAGE_PATH
REST API user devices resources base path.- See Also:
-
API_PWD_CHANGE_AUTHORITIES
Password change API access authorities.- See Also:
-
API_USER_AUTHORITIES
General user API access authorities.- See Also:
-
API_USER_DETAIL_AUTHORITIES
General user API access authorities.- See Also:
-
API_USER_OR_INTERNAL_AUTHORITIES
General user API access authorities.- See Also:
-
userService
Users service. -
userDeviceService
User device service. -
contextManager
@Autowired private es.kukenan.smartfi.common.context.RequestContextManager contextManagerRequest 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 identifieruserIp- user real ipuserAgent- user-agent headerpasswordChangeDto- New password and extra dataauthentication- authorized credentials. Used to extract additional query criteria, like the user company.- Returns:
- a
ResponseEntitycontaining 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 identifieruserUpdatedDto- 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 identifierdeviceId- 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 identifierauthentication- 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 ipuserAgent- User AgentuserId- User identifierauthentication- 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 identifierdeviceId- device identifierauthentication- 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 ipuserAgent- User AgentuserId- User identifierauthentication- 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 identifierlanguageDto- language requestauthentication- authorized credentials. Used to extract additional query criteria, like the user company.- Returns:
- User data
-