Repository: hyperledger/quilt
Pull request #382 (2019-11-27 20:03:53)

ignore token issuer and audience
Signed-off-by: Ian Simpson <ian.g.simpson@gmail.com>

codecov[bot]: # [Codecov](https://codecov.io/gh/hyperledger/quilt/pull/382?src=pr&el=h1) Report
> Merging [#382](https://codecov.io/gh/hyperledger/quilt/pull/382?src=pr&el=desc) into [master](https://codecov.io/gh/hyperledger/quilt/commit/a47d9c9641284c9700782f2718f9ba3d4a7238dc?src=pr&el=desc) will **decrease** coverage by `0.07%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/hyperledger/quilt/pull/382/graphs/tree.svg?width=650&token=XEfCq6zC6W&height=150&src=pr)](https://codecov.io/gh/hyperledger/quilt/pull/382?src=pr&el=tree)

```diff
@@             Coverage Diff              @@
##             master     #382      +/-   ##
============================================
- Coverage     82.57%   82.49%   -0.08%     
  Complexity      813      813              
============================================
  Files           247      247              
  Lines          3690     3674      -16     
  Branches        222      222              
============================================
- Hits           3047     3031      -16     
  Misses          547      547              
  Partials         96       96
```


| [Impacted Files](https://codecov.io/gh/hyperledger/quilt/pull/382?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...rg/interledger/link/http/IncomingLinkSettings.java](https://codecov.io/gh/hyperledger/quilt/pull/382/diff?src=pr&el=tree#diff-bGluay1wYXJlbnQvbGluay1pbHAtb3Zlci1odHRwL3NyYy9tYWluL2phdmEvb3JnL2ludGVybGVkZ2VyL2xpbmsvaHR0cC9JbmNvbWluZ0xpbmtTZXR0aW5ncy5qYXZh) | `96.77% <ø> (-1.1%)` | `7 <0> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/hyperledger/quilt/pull/382?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/hyperledger/quilt/pull/382?src=pr&el=footer). Last update [a47d9c9...9ab3e01](https://codecov.io/gh/hyperledger/quilt/pull/382?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/IncomingLinkSettings.java b/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/IncomingLinkSettings.java
index 18db367..fcf1932 100644
--- a/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/IncomingLinkSettings.java
+++ b/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/IncomingLinkSettings.java
@@ -75,38 +75,47 @@ public interface IncomingLinkSettings extends SharedSecretTokenSettings {
                   .map(Object::toString)
                   .map(String::toUpperCase)
                   .map(IlpOverHttpLinkSettings.AuthType::valueOf)
-                  .ifPresent(builder::authType);
+                  .ifPresent((authType) -> {
+                    builder.authType(authType);
+
+                    if (authType != IlpOverHttpLinkSettings.AuthType.SIMPLE) {
+                      Optional.ofNullable(incomingSettings.get(TOKEN_ISSUER))
+                          .map(Object::toString)
+                          .map(HttpUrl::parse)
+                          .ifPresent(builder::tokenIssuer);
+
+                      Optional.ofNullable(incomingSettings.get(TOKEN_AUDIENCE))
+                          .map(Object::toString)
+                          .map(HttpUrl::parse)
+                          .ifPresent(builder::tokenAudience);
+                    }
+                  });
 
               Optional.ofNullable(incomingSettings.get(SHARED_SECRET))
                   .map(Object::toString)
                   .ifPresent(builder::encryptedTokenSharedSecret);
 
-              Optional.ofNullable(incomingSettings.get(TOKEN_ISSUER))
-                  .map(Object::toString)
-                  .map(HttpUrl::parse)
-                  .ifPresent(builder::tokenIssuer);
-
-              Optional.ofNullable(incomingSettings.get(TOKEN_AUDIENCE))
-                  .map(Object::toString)
-                  .map(HttpUrl::parse)
-                  .ifPresent(builder::tokenAudience);
             }));
 
     Optional.ofNullable(customSettings.get(HTTP_INCOMING_AUTH_TYPE))
         .map(Object::toString)
         .map(String::toUpperCase)
         .map(IlpOverHttpLinkSettings.AuthType::valueOf)
-        .ifPresent(builder::authType);
-
-    Optional.ofNullable(customSettings.get(HTTP_INCOMING_TOKEN_ISSUER))
-        .map(Object::toString)
-        .map(HttpUrl::parse)
-        .ifPresent(builder::tokenIssuer);
-
-    Optional.ofNullable(customSettings.get(HTTP_INCOMING_TOKEN_AUDIENCE))
-        .map(Object::toString)
-        .map(HttpUrl::parse)
-        .ifPresent(builder::tokenAudience);
+        .ifPresent((authType) -> {
+          builder.authType(authType);
+
+          if (authType != IlpOverHttpLinkSettings.AuthType.SIMPLE) {
+            Optional.ofNullable(customSettings.get(HTTP_INCOMING_TOKEN_ISSUER))
+                .map(Object::toString)
+                .map(HttpUrl::parse)
+                .ifPresent(builder::tokenIssuer);
+
+            Optional.ofNullable(customSettings.get(HTTP_INCOMING_TOKEN_AUDIENCE))
+                .map(Object::toString)
+                .map(HttpUrl::parse)
+                .ifPresent(builder::tokenAudience);
+          }
+        });
 
     Optional.ofNullable(customSettings.get(HTTP_INCOMING_SHARED_SECRET))
         .map(Object::toString)
diff --git a/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/OutgoingLinkSettings.java b/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/OutgoingLinkSettings.java
index 9ce30ea..f3c2ec7 100644
--- a/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/OutgoingLinkSettings.java
+++ b/link-parent/link-ilp-over-http/src/main/java/org/interledger/link/http/OutgoingLinkSettings.java
@@ -78,21 +78,25 @@ public interface OutgoingLinkSettings extends SharedSecretTokenSettings {
                     .map(Object::toString)
                     .ifPresent(builder::tokenSubject);
 
-                Optional.ofNullable(outgoingSettings.get(TOKEN_ISSUER))
-                    .map(Object::toString)
-                    .map(HttpUrl::parse)
-                    .ifPresent(builder::tokenIssuer);
-
-                Optional.ofNullable(outgoingSettings.get(TOKEN_AUDIENCE))
-                    .map(Object::toString)
-                    .map(HttpUrl::parse)
-                    .ifPresent(builder::tokenAudience);
-
                 Optional.ofNullable(outgoingSettings.get(AUTH_TYPE))
-                    .map(Object::toString)
-                    .map(String::toUpperCase)
-                    .map(IlpOverHttpLinkSettings.AuthType::valueOf)
-                    .ifPresent(builder::authType);
+                  .map(Object::toString)
+                  .map(String::toUpperCase)
+                  .map(IlpOverHttpLinkSettings.AuthType::valueOf)
+                  .ifPresent((authType) -> {
+                    builder.authType(authType);
+
+                    if (authType != IlpOverHttpLinkSettings.AuthType.SIMPLE) {
+                      Optional.ofNullable(outgoingSettings.get(TOKEN_ISSUER))
+                        .map(Object::toString)
+                        .map(HttpUrl::parse)
+                        .ifPresent(builder::tokenIssuer);
+
+                      Optional.ofNullable(outgoingSettings.get(TOKEN_AUDIENCE))
+                        .map(Object::toString)
+                        .map(HttpUrl::parse)
+                        .ifPresent(builder::tokenAudience);
+                    }
+                  });
 
                 Optional.ofNullable(outgoingSettings.get(SHARED_SECRET))
                     .map(Object::toString)
@@ -111,21 +115,24 @@ public interface OutgoingLinkSettings extends SharedSecretTokenSettings {
               });
         });
 
-    Optional.ofNullable(customSettings.get(HTTP_OUTGOING_TOKEN_ISSUER))
-        .map(Object::toString)
-        .map(HttpUrl::parse)
-        .ifPresent(builder::tokenIssuer);
-
-    Optional.ofNullable(customSettings.get(HTTP_OUTGOING_TOKEN_AUDIENCE))
-        .map(Object::toString)
-        .map(HttpUrl::parse)
-        .ifPresent(builder::tokenAudience);
-
     Optional.ofNullable(customSettings.get(HTTP_OUTGOING_AUTH_TYPE))
-        .map(Object::toString)
-        .map(String::toUpperCase)
-        .map(IlpOverHttpLinkSettings.AuthType::valueOf)
-        .ifPresent(builder::authType);
+      .map(Object::toString)
+      .map(String::toUpperCase)
+      .map(IlpOverHttpLinkSettings.AuthType::valueOf)
+      .ifPresent((authType) -> {
+        builder.authType(authType);
+        if (authType != IlpOverHttpLinkSettings.AuthType.SIMPLE) {
+          Optional.ofNullable(customSettings.get(HTTP_OUTGOING_TOKEN_ISSUER))
+            .map(Object::toString)
+            .map(HttpUrl::parse)
+            .ifPresent(builder::tokenIssuer);
+
+          Optional.ofNullable(customSettings.get(HTTP_OUTGOING_TOKEN_AUDIENCE))
+            .map(Object::toString)
+            .map(HttpUrl::parse)
+            .ifPresent(builder::tokenAudience);
+        }
+      });
 
     Optional.ofNullable(customSettings.get(HTTP_OUTGOING_TOKEN_SUBJECT))
         .map(Object::toString)


Test patch:
diff --git a/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/AbstractHttpLinkSettingsTest.java b/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/AbstractHttpLinkSettingsTest.java
index 31fea4d..a822caf 100644
--- a/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/AbstractHttpLinkSettingsTest.java
+++ b/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/AbstractHttpLinkSettingsTest.java
@@ -31,13 +31,18 @@ import java.util.Map;
 public abstract class AbstractHttpLinkSettingsTest {
 
   protected Map<String, Object> customSettingsFlat() {
+    return customSettingsFlat(IlpOverHttpLinkSettings.AuthType.JWT_HS_256, IlpOverHttpLinkSettings.AuthType.JWT_HS_256);
+  }
+
+  protected Map<String, Object> customSettingsFlat(IlpOverHttpLinkSettings.AuthType incomingAuthType,
+                                                   IlpOverHttpLinkSettings.AuthType outgoingAuthType) {
     return ImmutableMap.<String, Object>builder()
-        .put(HTTP_INCOMING_AUTH_TYPE, IlpOverHttpLinkSettings.AuthType.JWT_HS_256.name())
+        .put(HTTP_INCOMING_AUTH_TYPE, incomingAuthType.name())
         .put(HTTP_INCOMING_TOKEN_ISSUER, "https://incoming-issuer.example.com/")
         .put(HTTP_INCOMING_SHARED_SECRET, "incoming-credential")
         .put(HTTP_INCOMING_TOKEN_AUDIENCE, "https://incoming-audience.example.com/")
 
-        .put(HTTP_OUTGOING_AUTH_TYPE, IlpOverHttpLinkSettings.AuthType.SIMPLE.name())
+        .put(HTTP_OUTGOING_AUTH_TYPE, outgoingAuthType.name())
         .put(HTTP_OUTGOING_TOKEN_SUBJECT, "outgoing-subject")
         .put(HTTP_OUTGOING_SHARED_SECRET, "outgoing-credential")
         .put(HTTP_OUTGOING_TOKEN_ISSUER, "https://outgoing-issuer.example.com/")
@@ -48,16 +53,22 @@ public abstract class AbstractHttpLinkSettingsTest {
         .build();
   }
 
-  protected Map<String, Object> customSettingsHeirarchical() {
+  protected Map<String, Object> customSettingsHierarchical() {
+    return customSettingsHierarchical(IlpOverHttpLinkSettings.AuthType.JWT_HS_256,
+      IlpOverHttpLinkSettings.AuthType.JWT_HS_256);
+  }
+
+  protected Map<String, Object> customSettingsHierarchical(IlpOverHttpLinkSettings.AuthType incomingAuthType,
+                                                           IlpOverHttpLinkSettings.AuthType outgoingAuthType) {
     final Map<String, Object> incomingMap = new HashMap<>();
-    incomingMap.put(AUTH_TYPE, IlpOverHttpLinkSettings.AuthType.JWT_HS_256.name());
+    incomingMap.put(AUTH_TYPE, incomingAuthType.name());
     incomingMap.put(TOKEN_SUBJECT, "incoming-subject");
     incomingMap.put(SHARED_SECRET, "incoming-credential");
     incomingMap.put(TOKEN_ISSUER, "https://incoming-issuer.example.com/");
     incomingMap.put(TOKEN_AUDIENCE, "https://incoming-audience.example.com/");
 
     final Map<String, Object> outgoingMap = new HashMap<>();
-    outgoingMap.put(AUTH_TYPE, IlpOverHttpLinkSettings.AuthType.SIMPLE.name());
+    outgoingMap.put(AUTH_TYPE, outgoingAuthType.name());
     outgoingMap.put(TOKEN_SUBJECT, "outgoing-subject");
     outgoingMap.put(SHARED_SECRET, "outgoing-credential");
     outgoingMap.put(TOKEN_ISSUER, "https://outgoing-issuer.example.com/");
diff --git a/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IlpOverIlpOverHttpLinkSettingsTest.java b/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IlpOverHttpLinkSettingsTest.java
similarity index 97%
rename from link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IlpOverIlpOverHttpLinkSettingsTest.java
rename to link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IlpOverHttpLinkSettingsTest.java
index 4fd7204..4f77c48 100644
--- a/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IlpOverIlpOverHttpLinkSettingsTest.java
+++ b/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IlpOverHttpLinkSettingsTest.java
@@ -11,7 +11,7 @@ import java.util.Map;
 /**
  * Unit tests for {@link IlpOverHttpLinkSettings}.
  */
-public class IlpOverIlpOverHttpLinkSettingsTest extends AbstractHttpLinkSettingsTest {
+public class IlpOverHttpLinkSettingsTest extends AbstractHttpLinkSettingsTest {
 
   /**
    * Tests the builder when customAttributes is a flat collection of key/value pairs using dotted-notation.
@@ -36,7 +36,7 @@ public class IlpOverIlpOverHttpLinkSettingsTest extends AbstractHttpLinkSettings
         .isEqualTo(Duration.ofMillis(2500));
 
     assertThat(ilpOverHttpLinkSettings.outgoingHttpLinkSettings().authType())
-        .isEqualTo(IlpOverHttpLinkSettings.AuthType.SIMPLE);
+        .isEqualTo(IlpOverHttpLinkSettings.AuthType.JWT_HS_256);
     assertThat(ilpOverHttpLinkSettings.outgoingHttpLinkSettings().tokenIssuer().get())
         .isEqualTo(HttpUrl.parse("https://outgoing-issuer.example.com/"));
     assertThat(ilpOverHttpLinkSettings.outgoingHttpLinkSettings().tokenAudience().get())
@@ -54,7 +54,7 @@ public class IlpOverIlpOverHttpLinkSettingsTest extends AbstractHttpLinkSettings
    */
   @Test
   public void applyCustomSettingsWithMapHeirarchy() {
-    final Map<String, Object> customSettings = this.customSettingsHeirarchical();
+    final Map<String, Object> customSettings = this.customSettingsHierarchical();
 
     final ImmutableIlpOverHttpLinkSettings.Builder builder = IlpOverHttpLinkSettings.builder();
     final ImmutableIlpOverHttpLinkSettings httpLinkSettings =
@@ -71,7 +71,7 @@ public class IlpOverIlpOverHttpLinkSettingsTest extends AbstractHttpLinkSettings
     assertThat(httpLinkSettings.incomingHttpLinkSettings().getMinMessageWindow()).isEqualTo(Duration.ofMillis(2500));
 
     assertThat(httpLinkSettings.outgoingHttpLinkSettings().authType())
-        .isEqualTo(IlpOverHttpLinkSettings.AuthType.SIMPLE);
+        .isEqualTo(IlpOverHttpLinkSettings.AuthType.JWT_HS_256);
     assertThat(httpLinkSettings.outgoingHttpLinkSettings().tokenIssuer().get())
         .isEqualTo(HttpUrl.parse("https://outgoing-issuer.example.com/"));
     assertThat(httpLinkSettings.outgoingHttpLinkSettings().tokenAudience().get())
diff --git a/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IncomingIlpOverIlpOverHttpLinkSettingsSettingsTest.java b/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IncomingIlpOverHttpLinkSettingsSettingsTest.java
similarity index 57%
rename from link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IncomingIlpOverIlpOverHttpLinkSettingsSettingsTest.java
rename to link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IncomingIlpOverHttpLinkSettingsSettingsTest.java
index 0e6f626..770ed4a 100644
--- a/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IncomingIlpOverIlpOverHttpLinkSettingsSettingsTest.java
+++ b/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/IncomingIlpOverHttpLinkSettingsSettingsTest.java
@@ -11,7 +11,7 @@ import java.util.Map;
 /**
  * Unit tests for {@link IncomingLinkSettings}.
  */
-public class IncomingIlpOverIlpOverHttpLinkSettingsSettingsTest extends AbstractHttpLinkSettingsTest {
+public class IncomingIlpOverHttpLinkSettingsSettingsTest extends AbstractHttpLinkSettingsTest {
 
   // This value doesn't _strictly_ need to be encrypted for purposes of this test. It could easily be plain-text, but
   // for completeness we use the encrypted test-variant.
@@ -28,9 +28,26 @@ public class IncomingIlpOverIlpOverHttpLinkSettingsSettingsTest extends Abstract
 
     assertThat(incomingLinksettings.authType()).isEqualTo(IlpOverHttpLinkSettings.AuthType.JWT_HS_256);
     assertThat(incomingLinksettings.tokenIssuer().get())
-        .isEqualTo(HttpUrl.parse("https://incoming-issuer.example.com/"));
+      .isEqualTo(HttpUrl.parse("https://incoming-issuer.example.com/"));
     assertThat(incomingLinksettings.tokenAudience().get())
-        .isEqualTo(HttpUrl.parse("https://incoming-audience.example.com/"));
+      .isEqualTo(HttpUrl.parse("https://incoming-audience.example.com/"));
+    assertThat(incomingLinksettings.encryptedTokenSharedSecret()).isEqualTo("incoming-credential");
+    assertThat(incomingLinksettings.getMinMessageWindow()).isEqualTo(Duration.ofMillis(2500));
+  }
+
+  /**
+   * Tests the builder when customAttributes is a flat collection of key/value pairs using dotted-notation,
+   * ignoring properties not applicable to SIMPLE auth
+   */
+  @Test
+  public void applyCustomSettingsWithFlatDottedNotationSimpleAuth() {
+    final Map<String, Object> customSettings = this.customSettingsFlat(IlpOverHttpLinkSettings.AuthType.SIMPLE,
+      IlpOverHttpLinkSettings.AuthType.SIMPLE);
+    final IncomingLinkSettings incomingLinksettings = IncomingLinkSettings.fromCustomSettings(customSettings).build();
+
+    assertThat(incomingLinksettings.authType()).isEqualTo(IlpOverHttpLinkSettings.AuthType.SIMPLE);
+    assertThat(incomingLinksettings.tokenIssuer()).isEmpty();
+    assertThat(incomingLinksettings.tokenAudience()).isEmpty();
     assertThat(incomingLinksettings.encryptedTokenSharedSecret()).isEqualTo("incoming-credential");
     assertThat(incomingLinksettings.getMinMessageWindow()).isEqualTo(Duration.ofMillis(2500));
   }
@@ -39,15 +56,31 @@ public class IncomingIlpOverIlpOverHttpLinkSettingsSettingsTest extends Abstract
    * Tests the builder when customAttributes is a Map of Maps.
    */
   @Test
-  public void applyCustomSettingsWithMapHeirarchy() {
-    final Map<String, Object> customSettings = this.customSettingsHeirarchical();
+  public void applyCustomSettingsWithMapHierarchy() {
+    final Map<String, Object> customSettings = this.customSettingsHierarchical();
     final IncomingLinkSettings incomingLinksettings = IncomingLinkSettings.fromCustomSettings(customSettings).build();
 
     assertThat(incomingLinksettings.authType()).isEqualTo(IlpOverHttpLinkSettings.AuthType.JWT_HS_256);
     assertThat(incomingLinksettings.tokenIssuer().get())
-        .isEqualTo(HttpUrl.parse("https://incoming-issuer.example.com/"));
+      .isEqualTo(HttpUrl.parse("https://incoming-issuer.example.com/"));
     assertThat(incomingLinksettings.tokenAudience().get())
-        .isEqualTo(HttpUrl.parse("https://incoming-audience.example.com/"));
+      .isEqualTo(HttpUrl.parse("https://incoming-audience.example.com/"));
+    assertThat(incomingLinksettings.encryptedTokenSharedSecret()).isEqualTo("incoming-credential");
+    assertThat(incomingLinksettings.getMinMessageWindow()).isEqualTo(Duration.ofMillis(2500));
+  }
+
+  /**
+   * Tests the builder when customAttributes is a Map of Maps, ignoring properties not applicable to SIMPLE auth
+   */
+  @Test
+  public void applyCustomSettingsWithMapHierarchySimpleAuth() {
+    final Map<String, Object> customSettings = this.customSettingsHierarchical(IlpOverHttpLinkSettings.AuthType.SIMPLE,
+      IlpOverHttpLinkSettings.AuthType.SIMPLE);
+    final IncomingLinkSettings incomingLinksettings = IncomingLinkSettings.fromCustomSettings(customSettings).build();
+
+    assertThat(incomingLinksettings.authType()).isEqualTo(IlpOverHttpLinkSettings.AuthType.SIMPLE);
+    assertThat(incomingLinksettings.tokenIssuer()).isEmpty();
+    assertThat(incomingLinksettings.tokenAudience()).isEmpty();
     assertThat(incomingLinksettings.encryptedTokenSharedSecret()).isEqualTo("incoming-credential");
     assertThat(incomingLinksettings.getMinMessageWindow()).isEqualTo(Duration.ofMillis(2500));
   }
diff --git a/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/OutgoingIlpOverIlpOverHttpLinkSettingsSettingsTest.java b/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/OutgoingIlpOverHttpLinkSettingsSettingsTest.java
similarity index 60%
rename from link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/OutgoingIlpOverIlpOverHttpLinkSettingsSettingsTest.java
rename to link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/OutgoingIlpOverHttpLinkSettingsSettingsTest.java
index 3c1dbcf..c2b8281 100644
--- a/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/OutgoingIlpOverIlpOverHttpLinkSettingsSettingsTest.java
+++ b/link-parent/link-ilp-over-http/src/test/java/org/interledger/link/http/OutgoingIlpOverHttpLinkSettingsSettingsTest.java
@@ -11,7 +11,7 @@ import java.util.Map;
 /**
  * Unit tests for {@link OutgoingLinkSettings}.
  */
-public class OutgoingIlpOverIlpOverHttpLinkSettingsSettingsTest extends AbstractHttpLinkSettingsTest {
+public class OutgoingIlpOverHttpLinkSettingsSettingsTest extends AbstractHttpLinkSettingsTest {
 
   /**
    * Tests the builder when customAttributes is a flat collection of key/value pairs using dotted-notation.
@@ -21,7 +21,7 @@ public class OutgoingIlpOverIlpOverHttpLinkSettingsSettingsTest extends Abstract
     final Map<String, Object> customSettings = this.customSettingsFlat();
     final OutgoingLinkSettings outgoingLinksettings = OutgoingLinkSettings.fromCustomSettings(customSettings).build();
 
-    assertThat(outgoingLinksettings.authType()).isEqualTo(IlpOverHttpLinkSettings.AuthType.SIMPLE);
+    assertThat(outgoingLinksettings.authType()).isEqualTo(IlpOverHttpLinkSettings.AuthType.JWT_HS_256);
     assertThat(outgoingLinksettings.tokenIssuer().get())
         .isEqualTo(HttpUrl.parse("https://outgoing-issuer.example.com/"));
     assertThat(outgoingLinksettings.tokenAudience().get())
@@ -33,14 +33,33 @@ public class OutgoingIlpOverIlpOverHttpLinkSettingsSettingsTest extends Abstract
   }
 
   /**
-   * Tests the builder when customAttributes is a Map of Maps.
+   * Tests the builder when customAttributes is a flat collection of key/value pairs using dotted-notation,
+   * ignoring properties not applicable to SIMPLE auth
    */
   @Test
-  public void applyCustomSettingsWithMapHeirarchy() {
-    final Map<String, Object> customSettings = this.customSettingsHeirarchical();
+  public void applyCustomSettingsWithFlatDottedNotationWithSimpleAuth() {
+    final Map<String, Object> customSettings = this.customSettingsFlat(IlpOverHttpLinkSettings.AuthType.SIMPLE,
+      IlpOverHttpLinkSettings.AuthType.SIMPLE);
     final OutgoingLinkSettings outgoingLinksettings = OutgoingLinkSettings.fromCustomSettings(customSettings).build();
 
     assertThat(outgoingLinksettings.authType()).isEqualTo(IlpOverHttpLinkSettings.AuthType.SIMPLE);
+    assertThat(outgoingLinksettings.tokenIssuer()).isEmpty();
+    assertThat(outgoingLinksettings.tokenAudience()).isEmpty();
+    assertThat(outgoingLinksettings.tokenSubject()).isEqualTo("outgoing-subject");
+    assertThat(outgoingLinksettings.encryptedTokenSharedSecret()).isEqualTo("outgoing-credential");
+    assertThat(outgoingLinksettings.tokenExpiry().get()).isEqualTo(Duration.ofHours(24));
+    assertThat(outgoingLinksettings.url()).isEqualTo(HttpUrl.parse("https://outgoing.example.com/"));
+  }
+
+  /**
+   * Tests the builder when customAttributes is a Map of Maps.
+   */
+  @Test
+  public void applyCustomSettingsWithMapHierarchy() {
+    final Map<String, Object> customSettings = this.customSettingsHierarchical();
+    final OutgoingLinkSettings outgoingLinksettings = OutgoingLinkSettings.fromCustomSettings(customSettings).build();
+
+    assertThat(outgoingLinksettings.authType()).isEqualTo(IlpOverHttpLinkSettings.AuthType.JWT_HS_256);
     assertThat(outgoingLinksettings.tokenIssuer().get())
         .isEqualTo(HttpUrl.parse("https://outgoing-issuer.example.com/"));
     assertThat(outgoingLinksettings.tokenAudience().get())
@@ -51,6 +70,24 @@ public class OutgoingIlpOverIlpOverHttpLinkSettingsSettingsTest extends Abstract
     assertThat(outgoingLinksettings.url()).isEqualTo(HttpUrl.parse("https://outgoing.example.com"));
   }
 
+  /**
+   * Tests the builder when customAttributes is a Map of Maps, ignoring properties not applicable to simple auth
+   */
+  @Test
+  public void applyCustomSettingsWithMapHierarchyWithSimpleAuth() {
+    final Map<String, Object> customSettings = this.customSettingsHierarchical(IlpOverHttpLinkSettings.AuthType.SIMPLE,
+      IlpOverHttpLinkSettings.AuthType.SIMPLE);
+    final OutgoingLinkSettings outgoingLinksettings = OutgoingLinkSettings.fromCustomSettings(customSettings).build();
+
+    assertThat(outgoingLinksettings.authType()).isEqualTo(IlpOverHttpLinkSettings.AuthType.SIMPLE);
+    assertThat(outgoingLinksettings.tokenIssuer()).isEmpty();
+    assertThat(outgoingLinksettings.tokenAudience()).isEmpty();
+    assertThat(outgoingLinksettings.tokenSubject()).isEqualTo("outgoing-subject");
+    assertThat(outgoingLinksettings.encryptedTokenSharedSecret()).isEqualTo("outgoing-credential");
+    assertThat(outgoingLinksettings.tokenExpiry().get()).isEqualTo(Duration.ofHours(48));
+    assertThat(outgoingLinksettings.url()).isEqualTo(HttpUrl.parse("https://outgoing.example.com"));
+  }
+
   @Test
   public void testWithoutCustomSettings() {
     final OutgoingLinkSettings outgoingLinksettings =