From b3a6814af9ab63fa59d0233f5d2ebb032f0b1597 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Wed, 24 Jul 2019 14:42:22 -0500 Subject: update Agent for Helm Issue-ID: AAF-904 Change-Id: I015cd19dcf95d1edfd86542750acc95447726120 Signed-off-by: Instrumental --- .../main/java/org/onap/aaf/cadi/configure/Agent.java | 13 +++++++++---- .../onap/aaf/cadi/register/RegistrationCreator.java | 19 ++++++++++++++++++- .../main/java/org/onap/aaf/cadi/config/Config.java | 2 ++ 3 files changed, 29 insertions(+), 5 deletions(-) (limited to 'cadi') diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java index fda591e3..1a1d68da 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java @@ -123,6 +123,7 @@ public class Agent { }); // Note: This is set by loadURLs. Use that function as singleton, not directly. private static Map aaf_urls = null; + private static boolean configNoPasswd = false; public static void main(String[] args) { @@ -160,6 +161,8 @@ public class Agent { if(idx>=0 && idx []"); System.out.println(" check []"); System.out.println(" keypairgen "); - System.out.println(" config "); + System.out.println(" config [--nopasswd]"); System.out.println(" validate .props>"); System.out.println(" connectivity .props>"); System.out.println(" --- Additional Tool Access ---"); @@ -891,9 +894,11 @@ public class Agent { cred.addEnc(Config.AAF_APPPASS, propAccess, null); // only Ask for Password when starting scratch } else if(propAccess.getProperty(Config.CADI_PROP_FILES)==null) { - char[] pwd = AAFSSO.cons.readPassword("Password for %s (leave blank for NO password): ", fqi); - if(pwd.length>0) { - cred.addEnc(Config.AAF_APPPASS, new String(pwd)); + if(!configNoPasswd) { + char[] pwd = AAFSSO.cons.readPassword("Password for %s (leave blank for NO password): ", fqi); + if(pwd.length>0) { + cred.addEnc(Config.AAF_APPPASS, new String(pwd)); + } } } diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java index 8b879e4f..fc3c18b0 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java @@ -55,6 +55,7 @@ public class RegistrationCreator { RegistrationPropHolder ph = new RegistrationPropHolder(access, port); + String firstPrivateHostname = null; // Now, loop through by Container for(String le : Split.splitTrim(',', ph.lcontainer)) { if(le.isEmpty()) { @@ -81,7 +82,23 @@ public class RegistrationCreator { } locate.setName(ph.getEntryName(entry,dot_le)); - locate.setHostname(ph.getEntryFQDN(entry,dot_le)); + /* Cover the situation where there is a Container, and multiple locator Entries, + * the first of which is the only real private FQDN + * example: oauth + * aaf_locator_entries=oauth,token,introspect + * + * Entries for token and introspect, but they point to oauth service. + */ + String locateHostname; + if(le.isEmpty()) { + locateHostname=ph.getEntryFQDN(entry, dot_le); + } else if(firstPrivateHostname==null) { + firstPrivateHostname=locateHostname=ph.getEntryFQDN(entry, dot_le); + } else { + locateHostname=firstPrivateHostname; + } + + locate.setHostname(locateHostname); locate.setPort(ph.getEntryPort(dot_le)); String specificVersion = access.getProperty(Config.AAF_LOCATOR_VERSION + dot_le,null); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java index b53b54da..30508b7d 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java @@ -231,6 +231,8 @@ public class Config { // let NS Owners choose with .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"; -- cgit 1.2.3-korg