- + "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 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";
- public static final String AAF_LOCATE_URL = "aaf_locate_url"; //URL for AAF locator
- private static final String AAF_LOCATE_URL_TAG = "AAF_LOCATE_URL"; // Name of Above for use in Config Variables.
- public static final String AAF_DEFAULT_VERSION = "2.1";
- 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/AAF_NS.service:" + AAF_DEFAULT_VERSION;
- public static final String GUI_URL_DEF = "https://AAF_LOCATE_URL/AAF_NS.gui:" + AAF_DEFAULT_VERSION;
- public static final String CM_URL_DEF = "https://AAF_LOCATE_URL/AAF_NS.cm:" + AAF_DEFAULT_VERSION;
- public static final String FS_URL_DEF = "https://AAF_LOCATE_URL/AAF_NS.fs:" + AAF_DEFAULT_VERSION;
- public static final String HELLO_URL_DEF = "https://AAF_LOCATE_URL/AAF_NS.hello:" + AAF_DEFAULT_VERSION;
- public static final String OAUTH2_TOKEN_URL = "https://AAF_LOCATE_URL/AAF_NS.token:" + AAF_DEFAULT_VERSION;
- public static final String OAUTH2_INTROSPECT_URL = "https://AAF_LOCATE_URL/AAF_NS.introspect:" + AAF_DEFAULT_VERSION;
-
- public static final String AAF_REGISTER_AS = "aaf_register_as";
- public static final String AAF_APPID = "aaf_id";
- public static final String AAF_APPPASS = "aaf_password";
- public static final String AAF_LUR_CLASS = "aaf_lur_class";
- public static final String AAF_TAF_CLASS = "aaf_taf_class";
- public static final String AAF_CONNECTOR_CLASS = "aaf_connector_class";
- public static final String AAF_LOCATOR_CLASS = "aaf_locator_class";
- public static final String AAF_CONN_TIMEOUT = "aaf_conn_timeout";
- 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";
- public static final String CADI_OLUR_CLASS_DEF = "org.onap.aaf.cadi.olur.OLur";
- public static final String CADI_OBASIC_HTTP_TAF_DEF = "org.onap.aaf.cadi.obasic.OBasicHttpTaf";
- public static final String CADI_AAF_CON_DEF = "org.onap.aaf.cadi.aaf.v2_0.AAFCon";
-
- public static final String AAF_CALL_TIMEOUT = "aaf_timeout";
- public static final String AAF_CALL_TIMEOUT_DEF = "5000";
- public static final String AAF_USER_EXPIRES = "aaf_user_expires";
- public static final String AAF_USER_EXPIRES_DEF = "600000"; // Default is 10 mins
- public static final String AAF_CLEAN_INTERVAL = "aaf_clean_interval";
- 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";
- public static final String AAF_COMPONENT = "aaf_component";
- 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 GW_URL = "gw_url";
- public static final String CM_URL = "cm_url";
- public static final String CM_TRUSTED_CAS = "cm_trusted_cas";
-
- public static final String PATHFILTER_URLPATTERN = "pathfilter_urlpattern";
- public static final String PATHFILTER_STACK = "pathfilter_stack";
- public static final String PATHFILTER_NS = "pathfilter_ns";
- public static final String PATHFILTER_NOT_AUTHORIZED_MSG = "pathfilter_not_authorized_msg";
-
- // This one should go unpublic
- public static final String AAF_DEFAULT_REALM = "aaf_default_realm";
- private static String defaultRealm="none";
-
- public static final String AAF_DOMAIN_SUPPORT = "aaf_domain_support";
- public static final String AAF_DOMAIN_SUPPORT_DEF = ".com:.org";
-
- // OAUTH2
- public static final String AAF_OAUTH2_TOKEN_URL = "aaf_oauth2_token_url";
- 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_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";
-
-
-
- public static void setDefaultRealm(Access access) throws CadiException {
- try {
- defaultRealm = logProp(access,Config.AAF_DEFAULT_REALM,
- logProp(access,Config.BASIC_REALM,
- logProp(access,HOSTNAME,InetAddress.getLocalHost().getHostName())
- )
- );
- } catch (UnknownHostException e) {
- //defaultRealm="none";
- }
- }
-
- public static HttpTaf configHttpTaf(Connector con, SecurityInfoC<HttpURLConnection> si, TrustChecker tc, CredVal up, Lur lur, Object ... additionalTafLurs) throws CadiException, LocatorException {
- Access access = si.access;
- /////////////////////////////////////////////////////
- // Setup AAFCon for any following
- /////////////////////////////////////////////////////
- Class<?> aafConClass = loadClass(access,CADI_AAF_CON_DEF);
- Object aafcon = null;
- if(con!=null && aafConClass!=null && aafConClass.isAssignableFrom(con.getClass())) {
- aafcon = con;
- } else if(lur != null) {
- Field f = null;
- try {
- f = lur.getClass().getField("aaf");
- aafcon = f.get(lur);
- } catch (Exception nsfe) {
- }
- }
-
-
- boolean hasDirectAAF = hasDirect("DirectAAFLur",additionalTafLurs);
- // IMPORTANT! Don't attempt to load AAF Connector if there is no AAF URL
- String aafURL = access.getProperty(AAF_URL,null);
- if(!hasDirectAAF && aafcon==null && aafURL!=null) {
- 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);
- if(hostname==null) {
- try {
- hostname = InetAddress.getLocalHost().getHostName();
- } catch (UnknownHostException e1) {
- throw new CadiException("Unable to determine Hostname",e1);
- }
- }
-
- access.log(Level.INIT, "Hostname set to",hostname);
- // Get appropriate TAFs
- ArrayList<HttpTaf> htlist = new ArrayList<>();
-
- /////////////////////////////////////////////////////
- // Add a Denial of Service TAF
- // Note: how IPs and IDs are added are up to service type.
- // They call "DenialOfServiceTaf.denyIP(String) or denyID(String)
- /////////////////////////////////////////////////////
- htlist.add(new DenialOfServiceTaf(access));
-
- /////////////////////////////////////////////////////
- // Configure Client Cert TAF
- /////////////////////////////////////////////////////
- X509Taf x509TAF = null;
- String truststore = logProp(access, CADI_TRUSTSTORE,null);
- if(truststore!=null) {
- String truststore_pwd = access.getProperty(CADI_TRUSTSTORE_PASSWORD,null);
- if(truststore_pwd!=null) {
- if(truststore_pwd.startsWith(Symm.ENC)) {
- try {
- truststore_pwd = access.decrypt(truststore_pwd,false);
- } catch (IOException e) {
- throw new CadiException(CADI_TRUSTSTORE_PASSWORD + " cannot be decrypted",e);
- }
- }
- try {
- htlist.add(x509TAF=new X509Taf(access,lur));
- access.log(Level.INIT,"Certificate Authorization enabled");
- } catch (SecurityException e) {
- access.log(Level.INIT,"AAFListedCertIdentity cannot be instantiated. Certificate Authorization is now disabled",e);
- } catch (IllegalArgumentException e) {
- access.log(Level.INIT,"AAFListedCertIdentity cannot be instantiated. Certificate Authorization is now disabled",e);
- } catch (CertificateException e) {
- access.log(Level.INIT,"Certificate Authorization failed, it is disabled",e);
- } catch (NoSuchAlgorithmException e) {
- access.log(Level.INIT,"Certificate Authorization failed, wrong Security Algorithm",e);
- }
- }
- } else {
- access.log(Level.INIT,"Certificate Authorization not enabled");
- }
-
- /////////////////////////////////////////////////////
- // Configure Basic Auth (local content)
- /////////////////////////////////////////////////////
- boolean hasOAuthDirectTAF = hasDirect("DirectOAuthTAF", additionalTafLurs);
- String basic_realm = logProp(access, BASIC_REALM,null);
- String aafCleanup = logProp(access, AAF_USER_EXPIRES,AAF_USER_EXPIRES_DEF); // Default is 10 mins
- long userExp = Long.parseLong(aafCleanup);
- boolean basic_warn = "TRUE".equals(access.getProperty(BASIC_WARN,"FALSE"));
-
- if(!hasDirectAAF) {
- HttpTaf aaftaf=null;
- if(!hasOAuthDirectTAF) {
- if(basic_realm!=null) {
- @SuppressWarnings("unchecked")
- Class<HttpTaf> obasicCls = (Class<HttpTaf>)loadClass(access,CADI_OBASIC_HTTP_TAF_DEF);
- if(obasicCls!=null) {
- try {
- String tokenurl = logProp(access,Config.AAF_OAUTH2_TOKEN_URL, null);
- String introspecturl = logProp(access,Config.AAF_OAUTH2_INTROSPECT_URL, null);
- if(tokenurl==null || introspecturl==null) {
- access.log(Level.INIT,"Both tokenurl and introspecturl are required. Oauth Authorization is disabled.");
- }
- Constructor<HttpTaf> obasicConst = obasicCls.getConstructor(PropAccess.class,String.class, String.class, String.class);
- htlist.add(obasicConst.newInstance(access,basic_realm,tokenurl,introspecturl));
- access.log(Level.INIT,"Oauth supported Basic Authorization is enabled");
- } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- } else if(up!=null) {
- access.log(Level.INIT,"Basic Authorization is enabled using realm",basic_realm);
- // Allow warning about insecure channel to be turned off
- if(!basic_warn)access.log(Level.INIT,"WARNING! The basic_warn property has been set to false.",
- " There will be no additional warning if Basic Auth is used on an insecure channel"
- );
- BasicHttpTaf bht = new BasicHttpTaf(access, up, basic_realm, userExp, basic_warn);
- for(Object o : additionalTafLurs) {
- if(o instanceof CredValDomain) {
- bht.add((CredValDomain)o);
- }
- }
- if(x509TAF!=null) {
- x509TAF.add(bht);
- }
- htlist.add(bht);
- access.log(Level.INIT,"Basic Authorization is enabled");
- }
- } else {
- access.log(Level.INIT,"Local Basic Authorization is disabled. Enable by setting basic_realm=<appropriate realm, i.e. my.att.com>");
- }
-
- /////////////////////////////////////////////////////
- // Configure AAF Driven Basic Auth
- /////////////////////////////////////////////////////
- if(aafcon==null) {
- 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
- 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)) {
- try {
- Class<?> aafTafClass = loadClass(access,aafTafClassName);
- if(aafTafClass!=null) {
- Constructor<?> cstr = aafTafClass.getConstructor(Connector.class,boolean.class,AbsUserCache.class);
- if(cstr!=null) {
- if(lur instanceof AbsUserCache) {
- aaftaf = (HttpTaf)cstr.newInstance(aafcon,basic_warn,lur);
- } else {
- cstr = aafTafClass.getConstructor(Connector.class,boolean.class);
- if(cstr!=null) {
- aaftaf = (HttpTaf)cstr.newInstance(aafcon,basic_warn);
- }
- }
- if(aaftaf==null) {
- access.log(Level.INIT,"ERROR! AAF TAF Failed construction. NOT Configured");
- } else {
- access.log(Level.INIT,"AAF TAF Configured to ",aafURL);
- // Note: will add later, after all others configured
- }
- }
- } else {
- access.log(Level.INIT, "There is no AAF TAF class available: %s. AAF TAF not configured.",aafTafClassName);
- }
- } catch(Exception e) {
- access.log(Level.INIT,"ERROR! AAF TAF Failed construction. NOT Configured",e);
- }
- }
- }
- }
-
- /////////////////////////////////////////////////////
- // Configure OAuth TAF
- /////////////////////////////////////////////////////
- if(!hasOAuthDirectTAF) {
- String oauth_token_url = logProp(access,Config.AAF_OAUTH2_TOKEN_URL,null);
- Class<?> oadtClss;
- try {
- oadtClss = Class.forName(OAUTH_DIRECT_TAF);
- } catch (ClassNotFoundException e1) {
- oadtClss = null;
- }
- if(additionalTafLurs!=null && additionalTafLurs.length>0 && (oadtClss!=null && additionalTafLurs[0].getClass().isAssignableFrom(oadtClss))) {
- htlist.add((HttpTaf)additionalTafLurs[0]);
- String array[] = new String[additionalTafLurs.length-1];
- if(array.length>0) {
- System.arraycopy(htlist, 1, array, 0, array.length);
- }
- additionalTafLurs = array;
- access.log(Level.INIT,"OAuth2 Direct is enabled");
- } else if(oauth_token_url!=null) {
- String oauth_introspect_url = logProp(access,Config.AAF_OAUTH2_INTROSPECT_URL,null);
- @SuppressWarnings("unchecked")
- Class<HttpTaf> oaTCls = (Class<HttpTaf>)loadClass(access,OAUTH_HTTP_TAF);
- if(oaTCls!=null) {
- Class<?> oaTTmgrCls = loadClass(access, OAUTH_TOKEN_MGR);
- if(oaTTmgrCls!=null) {
- try {
- Method oaTTmgrGI = oaTTmgrCls.getMethod("getInstance",PropAccess.class,String.class,String.class);
- Object oaTTmgr = oaTTmgrGI.invoke(null /*this is static method*/,access,oauth_token_url,oauth_introspect_url);
- Constructor<HttpTaf> oaTConst = oaTCls.getConstructor(Access.class,oaTTmgrCls);
- htlist.add(oaTConst.newInstance(access,oaTTmgr));
- access.log(Level.INIT,"OAuth2 TAF is enabled");
- } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | InstantiationException e) {
- access.log(Level.INIT,"OAuth2HttpTaf cannot be instantiated. OAuth2 is disabled",e);
- }
- }
- }
- } else {
- 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
- /////////////////////////////////////////////////////
- if(aaftaf!=null) {
- htlist.add(aaftaf);
- }
- }
-
- /////////////////////////////////////////////////////
- // Any Additional Lurs passed in Constructor
- /////////////////////////////////////////////////////
- if(additionalTafLurs!=null) {
- for(Object additional : additionalTafLurs) {
- if(additional instanceof BasicHttpTaf) {
- BasicHttpTaf ht = (BasicHttpTaf)additional;
- for(Object cv : additionalTafLurs) {
- if(cv instanceof CredValDomain) {
- ht.add((CredValDomain)cv);
- access.printf(Level.INIT,"%s Authentication is enabled",cv);
- }
- }
- htlist.add(ht);
- } else if(additional instanceof HttpTaf) {
- HttpTaf ht = (HttpTaf)additional;
- htlist.add(ht);
- access.printf(Level.INIT,"%s Authentication is enabled",additional.getClass().getSimpleName());
- } else if(hasOAuthDirectTAF) {
- Class<?> daupCls;
- try {
- daupCls = Class.forName("org.onap.aaf.auth.direct.DirectAAFUserPass");
- } catch (ClassNotFoundException e) {
- daupCls = null;
- }
- if(daupCls != null && additional.getClass().isAssignableFrom(daupCls)) {
- htlist.add(new BasicHttpTaf(access, (CredVal)additional , basic_realm, userExp, basic_warn));
- access.printf(Level.INIT,"Direct BasicAuth Authentication is enabled",additional.getClass().getSimpleName());
- }
- }
- }
- }
-
- // Add BasicAuth, if any, to x509Taf
- if(x509TAF!=null) {
- for( HttpTaf ht : htlist) {
- if(ht instanceof BasicHttpTaf) {
- x509TAF.add((BasicHttpTaf)ht);
- }
- }
- }
- /////////////////////////////////////////////////////
- // Create EpiTaf from configured TAFs
- /////////////////////////////////////////////////////
- if(htlist.size()==1) {
- // just return the one
- taf = htlist.get(0);
- } else {
- HttpTaf[] htarray = new HttpTaf[htlist.size()];
- htlist.toArray(htarray);
- Locator<URI> locator = loadLocator(si, logProp(access, AAF_LOCATE_URL, null));
-
- 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(Access access,String tag, String def) {
- String rv = access.getProperty(tag, def);
- if(rv == null) {
- access.log(Level.INIT,tag,"is not explicitly set");
- } else {
- access.log(Level.INIT,tag,"is set to",rv);
+ + "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 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_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
+ // 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
+ // 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_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_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";
+ public static final String AAF_LUR_CLASS = "aaf_lur_class";
+ public static final String AAF_TAF_CLASS = "aaf_taf_class";
+ public static final String AAF_CONNECTOR_CLASS = "aaf_connector_class";
+ public static final String AAF_CONN_TIMEOUT = "aaf_conn_timeout";
+ 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";
+ public static final String CADI_OLUR_CLASS_DEF = "org.onap.aaf.cadi.olur.OLur";
+ public static final String CADI_OBASIC_HTTP_TAF_DEF = "org.onap.aaf.cadi.obasic.OBasicHttpTaf";
+ public static final String CADI_AAF_CON_DEF = "org.onap.aaf.cadi.aaf.v2_0.AAFCon";
+
+ public static final String AAF_CALL_TIMEOUT = "aaf_timeout";
+ public static final String AAF_CALL_TIMEOUT_DEF = "5000";
+ public static final String AAF_USER_EXPIRES = "aaf_user_expires";
+ public static final String AAF_USER_EXPIRES_DEF = "600000"; // Default is 10 mins
+ public static final String AAF_CLEAN_INTERVAL = "aaf_clean_interval";
+ 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";
+// public static final String AAF_COMPONENT = "aaf_component";
+ 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_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";
+
+ public static final String PATHFILTER_URLPATTERN = "pathfilter_urlpattern";
+ public static final String PATHFILTER_STACK = "pathfilter_stack";
+ public static final String PATHFILTER_NS = "pathfilter_ns";
+ public static final String PATHFILTER_NOT_AUTHORIZED_MSG = "pathfilter_not_authorized_msg";
+
+ // This one should go unpublic
+ public static final String AAF_DEFAULT_REALM = "aaf_default_realm";
+ private static String defaultRealm="none";
+
+ public static final String AAF_DOMAIN_SUPPORT = "aaf_domain_support";
+ public static final String AAF_DOMAIN_SUPPORT_DEF = ".com:.org";
+
+ // OAUTH2
+ public static final String AAF_OAUTH2_TOKEN_URL = "aaf_oauth2_token_url";
+ 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_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) {
+ try {
+ defaultRealm = logProp(access,Config.AAF_DEFAULT_REALM,
+ logProp(access,Config.BASIC_REALM,
+ logProp(access,HOSTNAME,InetAddress.getLocalHost().getHostName())
+ )
+ );
+ } catch (UnknownHostException e) {
+ access.log(Level.INIT, "Unable to determine Hostname",e);
+ }
+ }
+
+ public static HttpTaf configHttpTaf(Connector con, SecurityInfoC<HttpURLConnection> si, TrustChecker tc, CredVal up, Lur lur, Object ... additionalTafLurs) throws CadiException, LocatorException {
+ Access access = si.access;
+ RegistrationPropHolder rph;
+ try {
+ rph = new RegistrationPropHolder(access, 0);
+ } catch (UnknownHostException e2) {
+ throw new CadiException(e2);