From 98adb75e5e627d28ecdf659f4c8ed640ce53ed5e Mon Sep 17 00:00:00 2001 From: Instrumental Date: Fri, 31 May 2019 10:02:47 -0500 Subject: Update DNSLocator code and use Issue-ID: AAF-838 Change-Id: Ieaf112365e40237b6f252371d2d2f95e9bc47f89 Signed-off-by: Instrumental --- .../aaf/auth/service/AuthzCassServiceImpl.java | 5 ++-- .../onap/aaf/auth/service/mapper/Mapper_2_0.java | 35 ++++++++++++---------- .../auth/service/validation/ServiceValidator.java | 1 + 3 files changed, 24 insertions(+), 17 deletions(-) (limited to 'auth/auth-service') diff --git a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/AuthzCassServiceImpl.java b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/AuthzCassServiceImpl.java index 751825c1..e311513e 100644 --- a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/AuthzCassServiceImpl.java +++ b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/AuthzCassServiceImpl.java @@ -2290,7 +2290,6 @@ public class AuthzCassServiceImpl rcred = mapper.cred(trans, from, true); if (rcred.isOKhasData()) { - byte[] rawCred = rcred.value.cred.array(); rcred = ques.userCredSetup(trans, rcred.value); final ServiceValidator v = new ServiceValidator(); @@ -2333,7 +2332,9 @@ public class AuthzCassServiceImpl 0) { - return Result.err(Status.ERR_BadData,ok); - } - } else { - to.type=0; - } - if (passwd != null) { - to.cred = ByteBuffer.wrap(passwd.getBytes()); - to.type = CredDAO.RAW; + to.type = from.getType(); + if(to.type!=null && to.type==CredDAO.FQI) { + to.cred = null; } else { - to.type = 0; - } - + String passwd = from.getPassword(); + if (requiresPass) { + String ok = trans.org().isValidPassword(trans, to.id,passwd); + if (ok.length()>0) { + return Result.err(Status.ERR_BadData,ok); + } + } else { + to.type=0; + } + if (passwd != null) { + to.cred = ByteBuffer.wrap(passwd.getBytes()); + to.type = CredDAO.RAW; + } else { + to.type = CredDAO.FQI; + } + } + // Note: Ensure requested EndDate created will match Organization Password Rules // P.S. Do not apply TempPassword rule here. Do that when you know you are doing a Create/Reset (see Service) to.expires = getExpires(trans.org(),Expiration.Password,base,from.getId()); diff --git a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/validation/ServiceValidator.java b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/validation/ServiceValidator.java index 128fdcd1..adff4612 100644 --- a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/validation/ServiceValidator.java +++ b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/validation/ServiceValidator.java @@ -162,6 +162,7 @@ public class ServiceValidator extends Validator { } else { switch(cd.type) { case CredDAO.BASIC_AUTH_SHA256: + case CredDAO.FQI: // ok break; default: -- cgit 1.2.3-korg