Minor changes for Organization needs
[aaf/authz.git] / cadi / core / src / main / java / org / onap / aaf / cadi / config / Config.java
index 62623fb..2bea195 100644 (file)
@@ -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.
@@ -64,7 +64,7 @@ import org.onap.aaf.cadi.util.Split;
 /**
  * Create a Consistent Configuration mechanism, even when configuration styles are as vastly different as
  * Properties vs JavaBeans vs FilterConfigs...
- * 
+ *
  * @author Jonathan
  *
  */
@@ -73,6 +73,8 @@ public class Config {
     private static final String AAF_V2_0 = "org.onap.aaf.cadi.aaf.v2_0";
     private static final String AAF_V2_0_AAFCON = AAF_V2_0+".AAFCon";
     private static final String AAF_V2_0_AAF_LUR_PERM = AAF_V2_0+".AAFLurPerm";
+    public static final String AAF_V2_0_AAF_CON_HTTP = AAF_V2_0+".AAFConHttp";
+
     private static final String OAUTH = "org.onap.auth.oauth";
     private static final String OAUTH_TOKEN_MGR = OAUTH+".TokenMgr";
     private static final String OAUTH_HTTP_TAF = OAUTH+".OAuth2HttpTaf";
@@ -88,10 +90,14 @@ public class Config {
     public static final String CADI_LOGDIR = "cadi_log_dir";
     public static final String CADI_ETCDIR = "cadi_etc_dir";
     public static final String CADI_LOGNAME = "cadi_logname";
+//    public static final String CADI_LOGFMT="cad_logging_format";
+//    public static final String CADI_LOGFMT_UTC="UTC";
+//    public static final String CADI_LOGFMT_ISO8601="ISO-8601";
     public static final String CADI_KEYFILE = "cadi_keyfile";
     public static final String CADI_KEYSTORE = "cadi_keystore";
     public static final String CADI_KEYSTORE_PASSWORD = "cadi_keystore_password";
     public static final String CADI_ALIAS = "cadi_alias";
+    public static final String CADI_CLIENT_ALIAS = "cadi_client_alias";
     public static final String CADI_LOGINPAGE_URL = "cadi_loginpage_url";
     public static final String CADI_LATITUDE = "cadi_latitude";
     public static final String CADI_LONGITUDE = "cadi_longitude";
@@ -106,79 +112,82 @@ public class Config {
     public static final String CADI_PROTOCOLS = "cadi_protocols";
     public static final String CADI_NOAUTHN = "cadi_noauthn";
     public static final String CADI_LOC_LIST = "cadi_loc_list";
-    
+
     // Special Behaviors
     public static final String CADI_BATH_CONVERT = "cadi_bath_convert";
     public static final String CADI_API_ENFORCEMENT = "cadi_api_enforcement";
     public static final String CADI_ADD_TAFS = "cadi_add_tafs";
     public static final String CADI_ADD_LURS = "cadi_add_lurs";
-    
+
     public static final String CADI_USER_CHAIN_TAG = "cadi_user_chain";
     public static final String CADI_USER_CHAIN = "USER_CHAIN";
-    
+
     public static final String CADI_OAUTH2_URL="cadi_oauth2_url";
     public static final String CADI_TOKEN_DIR = "cadi_token_dir";
 
     public static final String HTTPS_PROTOCOLS = "https.protocols";
-    public static final String HTTPS_CIPHER_SUITES = "https.cipherSuites";
     public static final String HTTPS_CLIENT_PROTOCOLS="jdk.tls.client.protocols";
+    public static final String HTTPS_PROTOCOLS_DEFAULT = "TLSv1.1,TLSv1.2";
+    public static final String HTTPS_CIPHER_SUITES = "https.cipherSuites";
     public static final String HTTPS_CIPHER_SUITES_DEFAULT="TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,"
             + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA,"
             + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_DSS_WITH_AES_128_CBC_SHA,"
             + "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,TLS_ECDHE_RSA_WITH_RC4_128_SHA,TLS_ECDH_ECDSA_WITH_RC4_128_SHA,"
             + "TLS_ECDH_RSA_WITH_RC4_128_SHA,TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,"
             + "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,TLS_EMPTY_RENEGOTIATION_INFO_SCSV";
-             
+
 
     public static final String LOCALHOST_ALLOW = "localhost_allow";
     public static final String LOCALHOST_DENY = "localhost_deny";
-    
-    public static final String BASIC_REALM = "basic_realm";  // what is sent to the client 
-    public static final String BASIC_WARN = "basic_warn";  // Warning of insecure channel 
+
+    public static final String BASIC_REALM = "basic_realm";  // what is sent to the client
+    public static final String BASIC_WARN = "basic_warn";  // Warning of insecure channel
     public static final String USERS = "local_users";
     public static final String GROUPS = "local_groups";
     public static final String WRITE_TO = "local_writeto"; // dump RBAC to local file in Tomcat Style (some apps use)
-    
+
     public static final String OAUTH_CLIENT_ID="client_id";
     public static final String OAUTH_CLIENT_SECRET="client_secret";
-    
+
     public static final String AAF_ENV = "aaf_env";
     public static final String AAF_ROOT_NS = "aaf_root_ns";
     public static final String AAF_ROOT_NS_DEF = "org.osaaf.aaf";
     public static final String AAF_ROOT_COMPANY = "aaf_root_company";
+    /**
+     * Use Config.getAAFLocateUrl(access) to get correct property in/out of container
+     */
     public static final String AAF_LOCATE_URL = "aaf_locate_url"; //URL for AAF locator
     public static final String AAF_LOCATE_URL_TAG = "AAF_LOCATE_URL"; // Name of Above for use in Config Variables.
     public static final String AAF_DEFAULT_API_VERSION = "2.1";
+    public static final String AAF_DEPLOYED_VERSION="aaf_deployed_version";
     public static final String AAF_API_VERSION = "aaf_api_version";
     public static final String AAF_URL = "aaf_url"; //URL for AAF... Use to trigger AAF configuration
-    public static final String AAF_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.service:" + AAF_DEFAULT_API_VERSION;
-    public static final String GUI_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.gui:" + AAF_DEFAULT_API_VERSION;
-    public static final String CM_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.cm:" + AAF_DEFAULT_API_VERSION;
-    public static final String FS_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.fs:" + AAF_DEFAULT_API_VERSION;
-    public static final String HELLO_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.hello:" + AAF_DEFAULT_API_VERSION;
-    public static final String OAUTH2_TOKEN_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.token:" + AAF_DEFAULT_API_VERSION +"/token";
-    public static final String OAUTH2_INTROSPECT_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.introspect:" + AAF_DEFAULT_API_VERSION +"/introspect";;
-
     public static final String AAF_LOCATOR_CLASS = "aaf_locator_class";
     // AAF Locator Entries are ADDITIONAL entries, which also gives the Property ability
     // to set these entries manually
     // example: adding a K8S name like "oom"
-    // this will allow Registrations to pick up 
+    // this will allow Registrations to pick up
     // locator_ns.oom for onap's "OOM" based k8s entries, etc.
     public static final String AAF_LOCATOR_CONTAINER="aaf_locator_container";
-    // An ID for another Container, to be used to avoid picking up the wrong internal info 
+    // An ID for another Container, to be used to avoid picking up the wrong internal info
     // for another container.
     public static final String AAF_LOCATOR_CONTAINER_ID = "aaf_locator_container_id";
     public static final String AAF_LOCATOR_CONTAINER_NS = "aaf_locator_container_ns";
     public static final String AAF_LOCATOR_VERSION = "aaf_locator_version";
     public static final String AAF_LOCATOR_PROTOCOL = "aaf_locator_protocol";
     public static final String AAF_LOCATOR_SUBPROTOCOL = "aaf_locator_subprotocol";
-    public static final String AAF_LOCATOR_NS = "aaf_locator_ns";
+    public static final String AAF_LOCATOR_APP_NS = "aaf_locator_app_ns";
     public static final String AAF_LOCATOR_ENTRIES = "aaf_locator_entries";
     public static final String AAF_LOCATOR_FQDN = "aaf_locator_fqdn";
     public static final String AAF_LOCATOR_NAME = "aaf_locator_name";
     public static final String AAF_LOCATOR_PUBLIC_PORT = "aaf_locator_public_port";
-    public static final String AAF_LOCATOR_PUBLIC_HOSTNAME = "aaf_locator_public_hostname";
+    public static final String AAF_LOCATOR_PUBLIC_FQDN = "aaf_locator_public_fqdn";
+    public static final String AAF_LOCATOR_PUBLIC_NAME = "aaf_locator_public_name";
+
+    // AAF Service will write to the Audit Log if a past due AAF stored Password
+    // is being used within # of days specified.
+    public static final String AAF_CRED_WARN_DAYS="aaf_cred_warn_days";
+    public static final String AAF_CRED_WARN_DAYS_DFT="7";
 
     public static final String AAF_APPID = "aaf_id";
     public static final String AAF_APPPASS = "aaf_password";
@@ -189,7 +198,7 @@ public class Config {
     public static final String AAF_CONN_TIMEOUT_DEF = "3000";
     public static final String AAF_CONN_IDLE_TIMEOUT = "aaf_conn_idle_timeout"; // only for Direct Jetty Access.
     public static final String AAF_CONN_IDLE_TIMEOUT_DEF = "10000"; // only for Direct Jetty Access.
-     
+
     // Default Classes: These are for Class loading to avoid direct compile links
     public static final String AAF_TAF_CLASS_DEF = "org.onap.aaf.cadi.aaf.v2_0.AAFTaf";
     public static final String AAF_LOCATOR_CLASS_DEF = "org.onap.aaf.cadi.aaf.v2_0.AAFLocator";
@@ -205,7 +214,7 @@ public class Config {
     public static final String AAF_CLEAN_INTERVAL_DEF = "30000"; // Default is 30 seconds
     public static final String AAF_REFRESH_TRIGGER_COUNT = "aaf_refresh_trigger_count";
     public static final String AAF_REFRESH_TRIGGER_COUNT_DEF = "3"; // Default is 10 mins
-    
+
     public static final String AAF_HIGH_COUNT = "aaf_high_count";
     public static final String AAF_HIGH_COUNT_DEF = "1000"; // Default is 1000 entries
     public static final String AAF_PERM_MAP = "aaf_perm_map";
@@ -213,11 +222,19 @@ public class Config {
     public static final String AAF_CERT_IDS = "aaf_cert_ids";
     public static final String AAF_DEBUG_IDS = "aaf_debug_ids"; // comma delimited
     public static final String AAF_DATA_DIR = "aaf_data_dir"; // AAF processes and Components only.
-    public static final String AAF_RELEASE = "aaf_release";
 
-    public static final String GW_URL = "gw_url";
-    public static final String CM_URL = "cm_url";
+    public static final String AAF_URL_OAUTH = "aaf_url_oauth";
+    public static final String AAF_URL_GUI="aaf_url_gui";
+    public static final String AAF_URL_FS="aaf_url_fs";
+    public static final String AAF_URL_CM = "aaf_url_cm";
+    public static final String AAF_URL_CM_DEF = "https://AAF_LOCATE_URL/AAF_NS.cm:"+AAF_DEFAULT_API_VERSION;
+    public static final String AAF_URL_HELLO = "aaf_url_hello";
     public static final String CM_TRUSTED_CAS = "cm_trusted_cas";
+    // let NS Owners choose with <ns>.certman aaf ignoreIPs" to ignoreIP Check for Configs
+    // Probably only want to allow in a DEV Env.
+    public static final String CM_ALLOW_IGNORE_IPS="cm_allow_ignore_ips";
+    // Docker doesn't have a default DNS. The property turns off IP Checking of DNSs before creating.
+    public static final String CM_ALWAYS_IGNORE_IPS="cm_always_ignore_ips";
 
     public static final String PATHFILTER_URLPATTERN = "pathfilter_urlpattern";
     public static final String PATHFILTER_STACK = "pathfilter_stack";
@@ -236,12 +253,11 @@ public class Config {
     public static final String AAF_OAUTH2_INTROSPECT_URL = "aaf_oauth2_introspect_url";
     public static final String AAF_ALT_OAUTH2_TOKEN_URL = "aaf_alt_oauth2_token_url";
     public static final String AAF_ALT_OAUTH2_INTROSPECT_URL = "aaf_alt_oauth2_introspect_url";
-    public static final String AAF_ALT_OAUTH2_DOMAIN = "aaf_alt_oauth2_domain"; 
+    public static final String AAF_ALT_OAUTH2_DOMAIN = "aaf_alt_oauth2_domain";
     public static final String AAF_ALT_CLIENT_ID = "aaf_alt_oauth2_client_id";
     public static final String AAF_ALT_CLIENT_SECRET = "aaf_alt_oauth2_client_secret";
     public static final String AAF_OAUTH2_HELLO_URL = "aaf_oauth2_hello_url";
 
-    private static final String AAF_V2_0_AAF_CON_HTTP = "org.onap.aaf.cadi.aaf.v2_0.AAFConHttp";
 
 
     public static void setDefaultRealm(Access access) {
@@ -260,10 +276,10 @@ public class Config {
         Access access = si.access;
         RegistrationPropHolder rph;
         try {
-                       rph = new RegistrationPropHolder(access, 0);
-               } catch (UnknownHostException e2) {
-                       throw new CadiException(e2);
-               }
+            rph = new RegistrationPropHolder(access, 0);
+        } catch (UnknownHostException e2) {
+            throw new CadiException(e2);
+        }
         /////////////////////////////////////////////////////
         // Setup AAFCon for any following
         /////////////////////////////////////////////////////
@@ -285,9 +301,9 @@ public class Config {
         // IMPORTANT!  Don't attempt to load AAF Connector if there is no AAF URL
         String aafURL = logProp(rph, AAF_URL,null);
         if (!hasDirectAAF && aafcon==null && aafURL!=null) {
-            aafcon = loadAAFConnector(si, aafURL);    
+            aafcon = loadAAFConnector(si, aafURL);
         }
-        
+
         HttpTaf taf;
         // Setup Host, in case Network reports an unusable Hostname (i.e. VTiers, VPNs, etc)
         String hostname = logProp(access, HOSTNAME,null);
@@ -298,7 +314,7 @@ public class Config {
                 throw new CadiException("Unable to determine Hostname",e1);
             }
         }
-        
+
         access.log(Level.INIT, "Hostname set to",hostname);
         // Get appropriate TAFs
         ArrayList<Priori<HttpTaf>> htlist = new ArrayList<>();
@@ -340,7 +356,7 @@ public class Config {
         } else {
             access.log(Level.INIT,"Certificate Authorization not enabled");
         }
-        
+
         /////////////////////////////////////////////////////
         // Configure Basic Auth (local content)
         /////////////////////////////////////////////////////
@@ -391,7 +407,7 @@ public class Config {
                 } else {
                     access.log(Level.INIT,"Local Basic Authorization is disabled.  Enable by setting basicRealm=<appropriate realm, i.e. my.att.com>");
                 }
-            
+
                 /////////////////////////////////////////////////////
                 // Configure AAF Driven Basic Auth
                 /////////////////////////////////////////////////////
@@ -399,10 +415,10 @@ public class Config {
                     access.log(Level.INIT,"AAF Connection (AAFcon) is null.  Cannot create an AAF TAF");
                 } else if (aafURL==null) {
                     access.log(Level.INIT,"No AAF URL in properties, Cannot create an AAF TAF");
-                } else {// There's an AAF_URL... try to configure an AAF 
+                } else {// There's an AAF_URL... try to configure an AAF
                     String aafTafClassName = logProp(access, AAF_TAF_CLASS,AAF_TAF_CLASS_DEF);
                     // Only 2.0 available at this time
-                    if (AAF_TAF_CLASS_DEF.equals(aafTafClassName)) { 
+                    if (AAF_TAF_CLASS_DEF.equals(aafTafClassName)) {
                         try {
                             Class<?> aafTafClass = loadClass(access,aafTafClassName);
                             if (aafTafClass!=null) {
@@ -432,7 +448,7 @@ public class Config {
                     }
                 }
             }
-            
+
             /////////////////////////////////////////////////////
             // Configure OAuth TAF
             /////////////////////////////////////////////////////
@@ -475,7 +491,7 @@ public class Config {
                     access.log(Level.INIT,"OAuth TAF is not configured");
                 }
             }
-    
+
             /////////////////////////////////////////////////////
             // Adding BasicAuth (AAF) last, after other primary Cookie Based
             // Needs to be before Cert... see below
@@ -483,13 +499,13 @@ public class Config {
             if (aaftaf!=null) {
                 htlist.add(new Priori<HttpTaf>(aaftaf,40));
             }
-        }    
+        }
 
         /////////////////////////////////////////////////////
         // Any Additional Tafs passed in Constructor
         /////////////////////////////////////////////////////
         if (additionalTafLurs!=null) {
-               int i=0;
+            int i=0;
             for (Object additional : additionalTafLurs) {
                 if (additional instanceof BasicHttpTaf) {
                     BasicHttpTaf ht = (BasicHttpTaf)additional;
@@ -519,7 +535,7 @@ public class Config {
                 }
             }
         }
-        
+
         // Add BasicAuth, if any, to x509Taf
         if (x509TAF!=null) {
             for ( Priori<HttpTaf> ht : htlist) {
@@ -528,12 +544,12 @@ public class Config {
                 }
             }
         }
-        
+
         /////////////////////////////////////////////////////
         // Additional TAFs by Plugin
         /////////////////////////////////////////////////////
         Priori.add(access, CADI_ADD_TAFS, htlist);
-        
+
         /////////////////////////////////////////////////////
         // Create EpiTaf from configured TAFs
         /////////////////////////////////////////////////////
@@ -541,44 +557,44 @@ public class Config {
             // just return the one
             taf = htlist.get(0).t;
         } else {
-               Collections.sort(htlist);
+            Collections.sort(htlist);
             HttpTaf[] htarray = new HttpTaf[htlist.size()];
             int i=-1;
             StringBuilder sb = new StringBuilder("Tafs processed in this order:\n");
             for(Priori<HttpTaf> pht : htlist) {
-               htarray[++i] = pht.t;
-               sb.append("    ");
-               sb.append(pht.t.getClass().getName());
-               sb.append('(');
-               sb.append(pht.priority);
-               sb.append(")\n");
+                htarray[++i] = pht.t;
+                sb.append("    ");
+                sb.append(pht.t.getClass().getName());
+                sb.append('(');
+                sb.append(pht.priority);
+                sb.append(")\n");
             }
             access.log(Level.INIT, sb);
 
-            Locator<URI> locator = loadLocator(si, logProp(rph, AAF_LOCATE_URL, null));
-            
+            Locator<URI> locator = loadLocator(si, aafURL);
+
             taf = new HttpEpiTaf(access,locator, tc, htarray); // ok to pass locator == null
             String level = logProp(access, CADI_LOGLEVEL, null);
             if (level!=null) {
                 access.setLogLevel(Level.valueOf(level));
             }
         }
-        
+
         return taf;
     }
-    
+
     public static String logProp(RegistrationPropHolder rph, String tag, String def) {
         String rv = rph.access().getProperty(tag, def);
         if (rv == null) {
-               rph.access().log(Level.INIT,tag,"is not explicitly set");
+            rph.access().log(Level.INIT,tag,"is not explicitly set");
         } else {
-               rv = rph.replacements(rv, null, null);
-               rph.access().log(Level.INIT,tag,"is set to",rv);
+            rv = rph.replacements("Config.logProp",rv, null, null);
+            rph.access().log(Level.INIT,tag,"is set to",rv);
         }
         return rv;
-       
+
     }
-    
+
     public static String logProp(Access access,String tag, String def) {
         String rv = access.getProperty(tag, def);
         if (rv == null) {
@@ -588,18 +604,18 @@ public class Config {
         }
         return rv;
     }
-    
+
     public static Lur configLur(SecurityInfoC<HttpURLConnection> si, Connector con, Object ... additionalTafLurs) throws CadiException {
         Access access = si.access;
         RegistrationPropHolder rph;
         try {
-                       rph = new RegistrationPropHolder(access, 0);
-               } catch (UnknownHostException e2) {
-                       throw new CadiException(e2);
-               }
+            rph = new RegistrationPropHolder(access, 0);
+        } catch (UnknownHostException e2) {
+            throw new CadiException(e2);
+        }
 
         List<Priori<Lur>> lurs = new ArrayList<>();
-        
+
         /////////////////////////////////////////////////////
         // Configure a Local Property Based RBAC/LUR
         /////////////////////////////////////////////////////
@@ -610,7 +626,7 @@ public class Config {
             if (groups!=null || users!=null) {
                 LocalLur ll = new LocalLur(access, users, groups);  // note b64==null is ok.. just means no encryption.
                 lurs.add(new Priori<Lur>(ll,10));
-                
+
                 String writeto = access.getProperty(WRITE_TO,null);
                 if (writeto!=null) {
                     String msg = UsersDump.updateUsers(writeto, ll);
@@ -645,14 +661,14 @@ public class Config {
                     msg = e.getCause().getMessage();
                 }
                 access.log(Level.INIT,"AAF/OAuth LUR is not instantiated.",msg,e);
-            } 
+            }
         } else {
             access.log(Level.INIT, "OAuth2 Lur disabled");
         }
 
         if (con!=null) { // try to reutilize connector
             lurs.add(new Priori<Lur>(con.newLur(),30));
-        } else { 
+        } else {
             /////////////////////////////////////////////////////
             // Configure the AAF Lur (if any)
             /////////////////////////////////////////////////////
@@ -678,7 +694,7 @@ public class Config {
                 } else {// There's an AAF_URL... try to configure an AAF
                     String aafLurClassStr = logProp(access,AAF_LUR_CLASS,AAF_V2_0_AAF_LUR_PERM);
                     ////////////AAF Lur 2.0 /////////////
-                    if (aafLurClassStr!=null && aafLurClassStr.startsWith(AAF_V2_0)) { 
+                    if (aafLurClassStr!=null && aafLurClassStr.startsWith(AAF_V2_0)) {
                         try {
                             Object aafcon = loadAAFConnector(si, aafURL);
                             if (aafcon==null) {
@@ -688,7 +704,7 @@ public class Config {
                                 if (aafAbsAAFCon!=null) {
                                     Method mNewLur = aafAbsAAFCon.getMethod("newLur");
                                     Object aaflur = mNewLur.invoke(aafcon);
-                
+
                                     if (aaflur==null) {
                                         access.log(Level.INIT,"ERROR! AAF LUR Failed construction.  NOT Configured");
                                     } else {
@@ -704,7 +720,7 @@ public class Config {
                         } catch (Exception e) {
                             access.log(e,"AAF LUR class,",aafLurClassStr,"could not be constructed with given Constructors.");
                         }
-                    } 
+                    }
                 }
             }
         }
@@ -713,7 +729,7 @@ public class Config {
         // Any Additional passed in Constructor
         /////////////////////////////////////////////////////
         if (additionalTafLurs!=null) {
-               int i=0;
+            int i=0;
             for (Object additional : additionalTafLurs) {
                 if (additional instanceof Lur) {
                     lurs.add(new Priori<Lur>((Lur)additional,50+i++));
@@ -725,13 +741,13 @@ public class Config {
         /////////////////////////////////////////////////////
         // Additional LURs by Plugin
         /////////////////////////////////////////////////////
-        Priori.add(access, CADI_ADD_LURS, lurs);       
+        Priori.add(access, CADI_ADD_LURS, lurs);
 
         /////////////////////////////////////////////////////
-        // Return a Lur based on how many there are... 
+        // Return a Lur based on how many there are...
         /////////////////////////////////////////////////////
         switch(lurs.size()) {
-            case 0: 
+            case 0:
                 access.log(Level.INIT,"WARNING! No CADI LURs configured");
                 // Return a NULL Lur that does nothing.
                 return new NullLur();
@@ -739,23 +755,23 @@ public class Config {
                 return lurs.get(0).t; // Only one, just return it, save processing
             default:
                 // Multiple Lurs, use EpiLUR to handle
-               Collections.sort(lurs);
+                Collections.sort(lurs);
                 Lur[] la = new Lur[lurs.size()];
                 int i=-1;
                 StringBuilder sb = new StringBuilder("Lurs processed in this order:\n");
                 for(Priori<Lur> pht : lurs) {
-                       la[++i] = pht.t;
-                       sb.append("    ");
-                       sb.append(pht.t.getClass().getName());
-                       sb.append('(');
-                       sb.append(pht.priority);
-                       sb.append(")\n");
+                    la[++i] = pht.t;
+                    sb.append("    ");
+                    sb.append(pht.t.getClass().getName());
+                    sb.append('(');
+                    sb.append(pht.priority);
+                    sb.append(")\n");
                 }
                 access.log(Level.INIT, sb);
                 return new EpiLur(la);
         }
     }
-    
+
     private static boolean hasDirect(String simpleClassName, Object[] additionalTafLurs) {
         if (additionalTafLurs!=null) {
             for (Object tf : additionalTafLurs) {
@@ -767,7 +783,8 @@ public class Config {
         return false;
     }
 
-    public static Object loadAAFConnector(SecurityInfoC<HttpURLConnection> si, String aafURL) {
+    @SuppressWarnings("unchecked")
+       public static Object loadAAFConnector(SecurityInfoC<?> si, String aafURL) {
         Access access = si.access;
         Object aafcon = null;
         Class<?> aafConClass = null;
@@ -784,7 +801,7 @@ public class Config {
                                 if (pc.equals(Access.class)) {
                                     lo.add(access);
                                 } else if (pc.equals(Locator.class)) {
-                                    lo.add(loadLocator(si, aafURL));
+                                    lo.add(loadLocator((SecurityInfoC<HttpURLConnection>)si, aafURL));
                                 }
                             }
                             if (c.getParameterTypes().length != lo.size()) {
@@ -840,29 +857,65 @@ public class Config {
         if (_url==null) {
             access.log(Level.INIT,"No URL passed to 'loadLocator'. Disabled");
         } else {
+            try {
+                Class<?> aalCls = Class.forName("org.onap.aaf.cadi.aaf.v2_0.AbsAAFLocator");
+                Method aalMth = aalCls.getMethod("create", String.class,String.class);
+                int colon = _url.lastIndexOf(':');
+                if(colon>=0) {
+                    int slash = _url.indexOf('/',colon);
+                    String version;
+                    if(slash<0) {
+                        version = _url.substring(colon+1);
+                    } else {
+                        version = _url.substring(colon+1,slash);
+                    }
+                    slash = _url.lastIndexOf('/',colon);
+                    if(slash>=0) {
+                        Object aal = aalMth.invoke(null/*static*/, _url.substring(slash+1, colon),version);
+                        return (Locator<URI>)aal;
+                    }
+                }
+            } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+                String msg;
+                char quote;
+                if(e.getCause()!=null) {
+                    msg=e.getCause().getMessage();
+                    quote='"';
+                } else {
+                    msg = "-";
+                    quote=' ';
+                }
+                access.printf(Level.DEBUG, "Configured AbsAAFLocator not found%c%s%cContinuing Locator creation ",quote,msg,quote);
+            }
 //            String url = _url.replace("/AAF_NS.", "/%C%CID%AAF_NS.");
 //            String root_ns = access.getProperty(Config.AAF_ROOT_NS, null);
-               String url;
+            String url;
             RegistrationPropHolder rph;
             try {
-                        rph = new RegistrationPropHolder(access, 0);
-                        url = rph.replacements(_url, null, null);
-                        access.printf(Level.INFO, "loadLocator URL is %s",url);
-               } catch (UnknownHostException | CadiException e1) {
-                       throw new LocatorException(e1);
-               }
-            
+                 rph = new RegistrationPropHolder(access, 0);
+                 url = rph.replacements("Config.loadLocator",_url, null, null);
+                 access.printf(Level.INFO, "loadLocator URL is %s",url);
+            } catch (UnknownHostException | CadiException e1) {
+                throw new LocatorException(e1);
+            }
+
+            String aaf_locator_class;
+            if(_url.equals(url) && !url.contains("/locate/")) {
+                aaf_locator_class = "org.onap.aaf.cadi.locator.DNSLocator";
+            } else {
+                aaf_locator_class = AAF_LOCATOR_CLASS_DEF;
+            }
             try {
-                Class<?> lcls = loadClass(access,AAF_LOCATOR_CLASS_DEF);
+                Class<?> lcls = loadClass(access,aaf_locator_class);
                 if (lcls==null) {
                     throw new CadiException("Need to include aaf-cadi-aaf jar for AAFLocator");
                 }
                 // First check for preloaded
                 try {
-                    Method meth = lcls.getMethod("create",String.class);
-                    locator = (Locator<URI>)meth.invoke(null,url);
+                    Method meth = lcls.getMethod("create",Access.class,String.class);
+                    locator = (Locator<URI>)meth.invoke(null,access,url);
                 } catch (Exception e) {
-                    access.log(Level.DEBUG, "(Not fatal) Cannot load by create(String)", e);
+                    access.log(Level.NONE, "(Not fatal) Cannot load by create(String)", e);
                 }
                 if (locator==null) {
                     URI locatorURI = new URI(url);
@@ -871,7 +924,7 @@ public class Config {
                     locator = (Locator<URI>)cnst.newInstance(new Object[] {si,locatorURI});
                     int port = fui.getPort();
                     String portS = port<0?"":(":"+port);
-                    
+
                     access.log(Level.INFO, "AAFLocator enabled using " + locatorURI.getScheme() +"://"+fui.getHost() + portS);
                 } else {
                     access.log(Level.INFO, "AAFLocator enabled using preloaded " + locator.getClass().getSimpleName());
@@ -893,66 +946,84 @@ public class Config {
         return defaultRealm;
     }
 
+    public static String getAAFLocateUrl(Access access) {
+        String rv = null;
+        String cont = access.getProperty(AAF_LOCATOR_CONTAINER,null);
+        if(cont!=null) {
+            rv = access.getProperty(AAF_LOCATE_URL + '.' +cont, null);
+        }
+        if(rv==null) {
+            rv = access.getProperty(AAF_LOCATE_URL, null);
+        }
+        return rv;
+    }
+
     private static class Priori<T> implements Comparable<Priori<T>> {
-       public final T t;
-       public final int priority;
-       
-       public Priori(final T t, final int priority) {
-               this.t = t;
-               this.priority = priority;
-       }
-
-               @Override
-               public int compareTo(Priori<T> o) {
-                       if(priority==o.priority) {
-                               return 0;
-                       } else if(priority<o.priority) {
-                               return -1;
-                       } else {
-                               return 1;
-                       }
-               }
-           public static<T> void add(Access access, final String tag, List<Priori<T>> list) {
-                   String plugins = access.getProperty(tag, null);
-                   if(plugins!=null) {
-                       for(String tafs : Split.splitTrim(';', plugins)) {
-                               String[] pluginArray = Split.splitTrim(',', tafs);
-                               String clssn = null;
-                               int priority = 60;
-                               switch(pluginArray.length) {
-                                       case 0:
-                                               break;
-                                       case 1:
-                                               clssn = tafs;
-                                               break;
-                                       default:
-                                               clssn = pluginArray[0];
-                                               try {
-                                                       priority = Integer.parseInt(pluginArray[1]);
-                                               } catch (NumberFormatException nfe) {
-                                                       access.printf(Level.ERROR, "%s format is <classname>,priority[;...]\n",CADI_ADD_TAFS);
-                                               }
-                               }
-                               
-                               if(clssn!=null) {
-                                       Class<?> cls = loadClass(access, clssn);
-                                       if(cls!=null) {
-                                               try {
-                                                               @SuppressWarnings("unchecked")
-                                                               Constructor<T> cnst = (Constructor<T>)cls.getConstructor(Access.class);
-                                               try {
-                                                                       list.add(new Priori<T>(cnst.newInstance(access),priority));
-                                                               } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-                                                                       access.printf(Level.ERROR, "%s cannot be constructed with Access.\n",clssn);
-                                                               }
-                                                       } catch (NoSuchMethodException | SecurityException e) {
-                                                               access.printf(Level.ERROR, "%s needs a Constructor taking Access as sole param.\n",clssn);
-                                                       }
-                                       }
-                               }
-                       }
-                   }
-               }
+        public final T t;
+        public final int priority;
+
+        public Priori(final T t, final int priority) {
+            this.t = t;
+            this.priority = priority;
+        }
+
+        @Override
+        public int compareTo(Priori<T> o) {
+            if(priority==o.priority) {
+                return 0;
+            } else if(priority<o.priority) {
+                return -1;
+            } else {
+                return 1;
+            }
+        }
+        public static<T> void add(Access access, final String tag, List<Priori<T>> list) {
+            String plugins = access.getProperty(tag, null);
+            if(plugins!=null) {
+                access.log(Level.INIT, "Adding TAF Plugins: ", plugins);
+                for(String tafs : Split.splitTrim(';', plugins)) {
+                    String[] pluginArray = Split.splitTrim(',', tafs);
+                    String clssn = null;
+                    int priority = 60;
+                    switch(pluginArray.length) {
+                        case 0:
+                            break;
+                        case 1:
+                            clssn = tafs;
+                            break;
+                        default:
+                            clssn = pluginArray[0];
+                            try {
+                                priority = Integer.parseInt(pluginArray[1]);
+                            } catch (NumberFormatException nfe) {
+                                access.printf(Level.ERROR, "%s format is <classname>,priority[;...]\n",CADI_ADD_TAFS);
+                            }
+                    }
+
+                    if(clssn!=null) {
+                        Class<?> cls = loadClass(access, clssn);
+                        if(cls!=null) {
+                            try {
+                                @SuppressWarnings("unchecked")
+                                Constructor<T> cnst = (Constructor<T>)cls.getConstructor(Access.class);
+                                try {
+                                    list.add(new Priori<T>(cnst.newInstance(access),priority));
+                                } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+                                    String hostname = access.getProperty(Config.HOSTNAME,null);
+                                    if(hostname==null) {
+                                        access.printf(Level.ERROR, "%s cannot be constructed on this machine.  Set valid 'hostname' in your properties\n",clssn);
+                                    } else {
+                                        access.printf(Level.ERROR, "%s cannot be constructed on %s with Access.\n",clssn, hostname);
+                                    }
+                                }
+                            } catch (NoSuchMethodException | SecurityException e) {
+                                access.printf(Level.ERROR, "%s needs a Constructor taking Access as sole param.\n",clssn);
+                            }
+                        }
+                    }
+                }
+            }
+        }
    }
 }