From 732344f175150fed87e0140ad75152d325364c8b Mon Sep 17 00:00:00 2001 From: Instrumental Date: Sat, 23 Jun 2018 11:01:25 -0500 Subject: JettyStartups to improve new Filters Issue-ID: AAF-361 Change-Id: I74cac231ebac81466778c1c3ebca16c63ae6f78a Signed-off-by: Instrumental --- .../java/org/onap/aaf/auth/oauth/AAF_OAuth.java | 21 ++++++++++++++------- .../org/onap/aaf/auth/oauth/DirectOAuthTAF.java | 1 - .../org/onap/aaf/auth/oauth/mapper/Mapper1_0.java | 1 - 3 files changed, 14 insertions(+), 9 deletions(-) (limited to 'auth/auth-oauth/src') diff --git a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/AAF_OAuth.java b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/AAF_OAuth.java index ecc2ae5b..d73c3be3 100644 --- a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/AAF_OAuth.java +++ b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/AAF_OAuth.java @@ -140,19 +140,26 @@ public class AAF_OAuth extends AbsService { } @Override - public Filter[] filters() throws CadiException, LocatorException { + public Filter[] _filters(Object ... additionalTafLurs) throws CadiException, LocatorException { try { - DirectOAuthTAF doat; - return new Filter[] {new AuthzTransFilter(env,aafCon(), + DirectOAuthTAF doat = new DirectOAuthTAF(env,question,facade1_0); + Object[] atl=new Object[additionalTafLurs.length+2]; + atl[0] = doat; + atl[1] = doat.directUserPass(); + + if(additionalTafLurs.length>0) { + System.arraycopy(additionalTafLurs, 0, atl, 2, additionalTafLurs.length); + } + + return new Filter[] { + new AuthzTransFilter(env,aafCon(), new AAFTrustChecker((Env)env), - doat = new DirectOAuthTAF(env,question,facade1_0), - doat.directUserPass() - )}; + atl + )}; } catch (NumberFormatException | APIException e) { throw new CadiException("Invalid Property information", e); } } - @SuppressWarnings("unchecked") @Override diff --git a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/DirectOAuthTAF.java b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/DirectOAuthTAF.java index 16d72686..e602e863 100644 --- a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/DirectOAuthTAF.java +++ b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/DirectOAuthTAF.java @@ -101,7 +101,6 @@ public class DirectOAuthTAF implements HttpTaf { } if("application/x-www-form-urlencoded".equals(req.getContentType())) { - @SuppressWarnings("unchecked") Map map = req.getParameterMap(); String client_id=null,client_secret=null,username=null,password=null; for(Map.Entry es : map.entrySet()) { diff --git a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/mapper/Mapper1_0.java b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/mapper/Mapper1_0.java index ee4237c8..688a03ce 100644 --- a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/mapper/Mapper1_0.java +++ b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/mapper/Mapper1_0.java @@ -88,7 +88,6 @@ public class Mapper1_0 extends MapperIntrospect1_0 implements Mapper map = req.getParameterMap(); for(Entry es : map.entrySet()) { switch(es.getKey()) { -- cgit 1.2.3-korg