package org.onap.aaf.auth.oauth;
-import java.io.File;
import java.util.Map;
import javax.servlet.Filter;
import org.onap.aaf.cadi.oauth.TokenMgr.TokenPermLoader;
import org.onap.aaf.cadi.register.Registrant;
import org.onap.aaf.misc.env.APIException;
-import org.onap.aaf.misc.env.Env;
import org.onap.aaf.misc.env.Data.TYPE;
+import org.onap.aaf.misc.env.Env;
import com.datastax.driver.core.Cluster;
}
@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
public static void main(final String[] args) {
try {
- String propsFile = getArg(AAF_LOG4J_PREFIX, args, "org.osaaf")+".log4j.props";
- String log_dir = getArg(Config.CADI_LOGDIR,args,"./logs");
- String log_level = getArg(Config.CADI_LOGLEVEL,args,"INFO");
- File logs = new File(log_dir);
- if(!logs.isDirectory()) {
- logs.delete();
- }
- if(!logs.exists()) {
- logs.mkdirs();
- }
- Log4JLogIt logIt = new Log4JLogIt(log_dir,log_level,propsFile, "oauth");
+ Log4JLogIt logIt = new Log4JLogIt(args, "oauth");
PropAccess propAccess = new PropAccess(logIt,args);
-
+
AAF_OAuth service = new AAF_OAuth(new AuthzEnv(propAccess));
JettyServiceStarter<AuthzEnv,AuthzTrans> jss = new JettyServiceStarter<AuthzEnv,AuthzTrans>(service);
jss.start();