You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by bh...@apache.org on 2019/04/12 09:51:29 UTC

[incubator-dlab] branch bugfix-DLAB-602 created (now d7d9757)

This is an automated email from the ASF dual-hosted git repository.

bhliva pushed a change to branch bugfix-DLAB-602
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


      at d7d9757  DLAB-602 fixed bug connected with wrong error message in case of wrong user login entered

This branch includes the following new commits:

     new 1ae0eb5  Merge remote-tracking branch 'origin/develop' into develop
     new d7d9757  DLAB-602 fixed bug connected with wrong error message in case of wrong user login entered

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 01/02: Merge remote-tracking branch 'origin/develop' into develop

Posted by bh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bhliva pushed a commit to branch bugfix-DLAB-602
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 1ae0eb5056439b0c01cdbe4cb7ada3b59e310620
Merge: 216a632 4bfaf01
Author: bhliva <bo...@epam.com>
AuthorDate: Fri Apr 12 12:04:57 2019 +0300

    Merge remote-tracking branch 'origin/develop' into develop

 .../general/files/gcp/dataengine-service_description.json  |  4 ++--
 .../src/general/lib/aws/actions_lib.py                     |  6 ++++++
 .../general/scripts/gcp/dataengine-service_jars_parser.py  | 14 +++++++-------
 3 files changed, 15 insertions(+), 9 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 02/02: DLAB-602 fixed bug connected with wrong error message in case of wrong user login entered

Posted by bh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bhliva pushed a commit to branch bugfix-DLAB-602
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit d7d9757ece309343d92f1b171a5351341a2b57d1
Author: bhliva <bo...@epam.com>
AuthorDate: Fri Apr 12 12:51:13 2019 +0300

    DLAB-602 fixed bug connected with wrong error message in case of wrong user login entered
---
 .../main/java/com/epam/dlab/auth/dao/UserInfoDAOMongoImpl.java |  4 ----
 .../epam/dlab/auth/service/impl/LdapAuthenticationService.java | 10 ++++++++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/services/security-service/src/main/java/com/epam/dlab/auth/dao/UserInfoDAOMongoImpl.java b/services/security-service/src/main/java/com/epam/dlab/auth/dao/UserInfoDAOMongoImpl.java
index 845c73a..647e46e 100644
--- a/services/security-service/src/main/java/com/epam/dlab/auth/dao/UserInfoDAOMongoImpl.java
+++ b/services/security-service/src/main/java/com/epam/dlab/auth/dao/UserInfoDAOMongoImpl.java
@@ -74,7 +74,6 @@ public class UserInfoDAOMongoImpl implements UserInfoDAO {
 
 	@Override
 	public void deleteUserInfo(String accessToken) {
-		//delete used in logout and has to be synchronized
 		BasicDBObject uiDoc = new BasicDBObject();
 		uiDoc.put("_id", accessToken);
 		MongoCollection<BasicDBObject> security = ms.getCollection(SECURITY_COLLECTION, BasicDBObject.class);
@@ -84,9 +83,6 @@ public class UserInfoDAOMongoImpl implements UserInfoDAO {
 
 	@Override
 	public void saveUserInfo(UserInfo ui) {
-		//UserInfo first cached and immediately becomes available
-		//Saving can be asynch
-
 		BasicDBObject uiDoc = new BasicDBObject();
 		uiDoc.put("_id", ui.getAccessToken());
 		uiDoc.put("name", ui.getName());
diff --git a/services/security-service/src/main/java/com/epam/dlab/auth/service/impl/LdapAuthenticationService.java b/services/security-service/src/main/java/com/epam/dlab/auth/service/impl/LdapAuthenticationService.java
index 3271558..b324cad 100644
--- a/services/security-service/src/main/java/com/epam/dlab/auth/service/impl/LdapAuthenticationService.java
+++ b/services/security-service/src/main/java/com/epam/dlab/auth/service/impl/LdapAuthenticationService.java
@@ -25,6 +25,7 @@ import com.epam.dlab.auth.UserVerificationService;
 import com.epam.dlab.auth.dao.LdapUserDAO;
 import com.epam.dlab.auth.dto.UserCredentialDTO;
 import com.epam.dlab.auth.service.AuthenticationService;
+import com.epam.dlab.exceptions.DlabAuthenticationException;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
 import lombok.extern.slf4j.Slf4j;
@@ -57,8 +58,13 @@ public class LdapAuthenticationService implements AuthenticationService {
 
 	@Override
 	public Optional<UserInfo> login(UserCredentialDTO credentialDTO) {
-		final String token = credentialDTO.getAccessToken();
-		return StringUtils.isNoneBlank(token) ? getUserInfo(token) : getLdapUserInfo(credentialDTO);
+		try {
+			final String token = credentialDTO.getAccessToken();
+			return StringUtils.isNoneBlank(token) ? getUserInfo(token) : getLdapUserInfo(credentialDTO);
+		} catch (Exception e) {
+			log.error("Error occurred during login for user {}: {}", credentialDTO.getUsername(), e.getMessage());
+			throw new DlabAuthenticationException("Username or password is invalid");
+		}
 	}
 
 	@Override


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org