Commit 0250684e authored by Matija Obreza's avatar Matija Obreza

BasicUserService#assureGoodPassword is exposed in app-blocks:1.2-SNAPSHOT

Signed-off-by: Matija Obreza's avatarMatija Obreza <matija.obreza@croptrust.org>
parent bc232ba0
......@@ -19,12 +19,12 @@ compile and test:
script:
- echo "CI_COMMIT_REF_SLUG ${CI_COMMIT_REF_SLUG}"
- echo "CI_ENVIRONMENT_SLUG ${CI_ENVIRONMENT_SLUG}"
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn compile test -B
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn compile test -B -U
.package_template: &maven_package
image: dockerhub.croptrust.org/docker/custom/maven-with-compass:latest
script:
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn package -B
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn package -B -U
artifacts:
name: "${CI_PROJECT_NAME}-${CI_COMMIT_REF_NAME}"
expire_in: 1 day
......
/**
* Copyright 2014 Global Crop Diversity Trust
/*
* Copyright 2017 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -31,7 +31,6 @@ import org.genesys.blocks.security.NotUniqueUserException;
import org.genesys.blocks.security.SecurityContextUtil;
import org.genesys.blocks.security.UserException;
import org.genesys.blocks.security.model.BasicUser.AccountType;
import org.genesys.blocks.security.service.PasswordPolicy;
import org.genesys.blocks.security.service.PasswordPolicy.PasswordPolicyException;
import org.genesys.blocks.security.service.impl.BasicUserServiceImpl;
import org.genesys2.server.model.UserRole;
......@@ -72,9 +71,6 @@ public class UserServiceImpl extends BasicUserServiceImpl<UserRole, User> implem
@Autowired
private UserRepository userRepository;
@Autowired
private PasswordPolicy passwordPolicy;
private final List<UserRole> availableRoles = ListUtils.unmodifiableList(Arrays.asList(UserRole.values()));
private EmailValidator emailValidator = EmailValidator.getInstance();
......@@ -177,7 +173,7 @@ public class UserServiceImpl extends BasicUserServiceImpl<UserRole, User> implem
/**
* @param user
* @return
* @return
* @throws UserException
* @throws PasswordPolicyException
*/
......@@ -418,7 +414,7 @@ public class UserServiceImpl extends BasicUserServiceImpl<UserRole, User> implem
@Transactional
@PreAuthorize("hasRole('ADMINISTRATOR') || principal.user.id == #user.id")
public void setFtpPassword(final User user, final String ftpPassword) throws PasswordPolicyException {
passwordPolicy.assureGoodPassword(ftpPassword);
assureGoodPassword(ftpPassword);
user.setFtpPassword(passwordEncoder.encode(ftpPassword));
userRepository.save(user);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment