X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cadi%2Faaf%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Faaf%2Fv2_0%2FAAFTaf.java;h=c77444077b3c053cb76b6645b5b138ab5795c039;hb=refs%2Fchanges%2F24%2F97124%2F3;hp=81b55507da71679b722ff9dc2f62f24481958ec0;hpb=bdce7667a6e272e2fa32e298d957a0d9090c5bc9;p=aaf%2Fauthz.git diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFTaf.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFTaf.java index 81b55507..c7744407 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFTaf.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFTaf.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -58,7 +58,7 @@ public class AAFTaf extends AbsUserCache implements HttpT private AAFCon aaf; private boolean warn; private MapBathConverter mapIds; - + public AAFTaf(AAFCon con, boolean turnOnWarning) { super(con.access,con.cleanInterval,con.highCount, con.usageRefreshTriggerCount); aaf = con; @@ -73,7 +73,7 @@ public class AAFTaf extends AbsUserCache implements HttpT initMapBathConverter(); } - + // Note: Needed for Creation of this Object with Generics @SuppressWarnings("unchecked") public AAFTaf(Connector mustBeAAFCon, boolean turnOnWarning, AbsUserCache other) { @@ -133,10 +133,10 @@ public class AAFTaf extends AbsUserCache implements HttpT Miss miss = missed(bp.getName(), bp.getCred()); if (miss!=null && !miss.mayContinue()) { return new BasicHttpTafResp(aaf.access,bp.getName(),buildMsg(bp,req, - "User/Pass Retry limit exceeded"), + "User/Pass Retry limit exceeded"), RESP.TRY_AUTHENTICATING,resp,aaf.getRealm(),true); } - + return aaf.bestForUser( new GetSetter() { @Override @@ -159,11 +159,11 @@ public class AAFTaf extends AbsUserCache implements HttpT boolean rv= addMiss(bp.getName(),bp.getCred()); if (rv) { return new BasicHttpTafResp(aaf.access,bp.getName(),buildMsg(bp,req, - "user/pass combo invalid via AAF from " + req.getRemoteAddr()), + "user/pass combo invalid via AAF from " + req.getRemoteAddr()), RESP.TRY_AUTHENTICATING,resp,aaf.getRealm(),true); } else { return new BasicHttpTafResp(aaf.access,bp.getName(),buildMsg(bp,req, - "user/pass combo invalid via AAF from " + req.getRemoteAddr() + " - Retry limit exceeded"), + "user/pass combo invalid via AAF from " + req.getRemoteAddr() + " - Retry limit exceeded"), RESP.FAIL,resp,aaf.getRealm(),true); } } @@ -187,7 +187,7 @@ public class AAFTaf extends AbsUserCache implements HttpT } return new BasicHttpTafResp(aaf.access,target,"Requesting HTTP Basic Authorization",RESP.TRY_AUTHENTICATING,resp,aaf.getRealm(),false); } - + private String buildMsg(Principal pr, HttpServletRequest req, Object... msg) { StringBuilder sb = new StringBuilder(); for (Object s : msg) { @@ -205,7 +205,7 @@ public class AAFTaf extends AbsUserCache implements HttpT } - + public Resp revalidate(CachedPrincipal prin, Object state) { // !!!! TEST THIS.. Things may not be revalidated, if not BasicPrincipal if (prin instanceof BasicPrincipal) {