summaryrefslogtreecommitdiffstats
path: root/cadi/client/src
diff options
context:
space:
mode:
authorRene Glover <rene.glover@att.com>2020-04-14 16:32:16 -0500
committerGlover, Rene <rene.glover@att.com>2020-04-15 15:50:12 -0500
commit861b557b294032f9443ee1fca6b42d7252e92481 (patch)
tree05c25d8388906afb069930d9dd19f8c63947c2c7 /cadi/client/src
parentd2f8381eeef23535e17b770022060a5ba06eedba (diff)
Fix CADI Connection to Remote DNS AAF servers on proxied network
Java CADI client code and web filter has been fixed to allow specification of a fixed hostname for connecting to AAF service and avoiding use of the AAF Locator service to bootstrap. The CADI code was also updated to avoid pre-resolving DNS in this scenario. This fix is necessary to address use cases where the AAF servers live in a different network domain from the CADI client where the access point is through a proxied endpoint and the DNS name is unresolvable on the network where the CADI client code is executing. Issue-ID: AAF-1123 Signed-off-by: Rene Glover <rene.glover@att.com> Change-Id: I8835b7445e9bc1f6e89380462062748b53e078e5
Diffstat (limited to 'cadi/client/src')
-rw-r--r--cadi/client/src/main/java/org/onap/aaf/cadi/locator/SingleEndpointLocator.java8
-rw-r--r--cadi/client/src/test/java/org/onap/aaf/cadi/locator/test/JU_DNSLocator.java5
2 files changed, 11 insertions, 2 deletions
diff --git a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/SingleEndpointLocator.java b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/SingleEndpointLocator.java
index 862868f0..e9e9708f 100644
--- a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/SingleEndpointLocator.java
+++ b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/SingleEndpointLocator.java
@@ -25,12 +25,20 @@ import java.net.URISyntaxException;
import java.util.Date;
import org.onap.aaf.cadi.LocatorException;
+import org.onap.aaf.cadi.config.SecurityInfoC;
public class SingleEndpointLocator implements SizedLocator<URI> {
private final URI uri;
private final static Item item = new Item() {};
private Date noRetryUntil;
+ /**
+ * New constructor that works with the Config.loadLocator function
+ */
+ public SingleEndpointLocator(final SecurityInfoC<?> sec, final URI uri) throws LocatorException {
+ this.uri = uri;
+ }
+
public SingleEndpointLocator(final URI uri) {
this.uri = uri;
}
diff --git a/cadi/client/src/test/java/org/onap/aaf/cadi/locator/test/JU_DNSLocator.java b/cadi/client/src/test/java/org/onap/aaf/cadi/locator/test/JU_DNSLocator.java
index 77213e6a..69632e57 100644
--- a/cadi/client/src/test/java/org/onap/aaf/cadi/locator/test/JU_DNSLocator.java
+++ b/cadi/client/src/test/java/org/onap/aaf/cadi/locator/test/JU_DNSLocator.java
@@ -22,6 +22,7 @@
package org.onap.aaf.cadi.locator.test;
import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.anyOf;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
@@ -58,9 +59,9 @@ public class JU_DNSLocator {
item = dl.best();
uri = dl.get(item);
- assertThat(uri.toString(), is("https://localhost:8100"));
+ assertThat(uri.toString(), anyOf(is("https://localhost:8100"), is("https://127.0.0.1:8100")));
item = dl.best();
- assertThat(uri.toString(), is("https://localhost:8100"));
+ assertThat(uri.toString(), anyOf(is("https://localhost:8100"), is("https://127.0.0.1:8100")));
assertThat(dl.hasItems(), is(true));
for (item = dl.first(); item != null; item = dl.next(item)) {