@Test public void getIncomingAuthTypeWithJwtHs256() { IlpOverHttpLinkSettings.AuthType authType = IlpOverHttpLinkSettings.AuthType.JWT_HS_256; assertThat( LinkSettingsUtils.getIncomingAuthType(AbstractHttpLinkSettingsTest.customSettingsJwtFlat(authType))) .isEqualTo(Optional.of(authType)); assertThat( LinkSettingsUtils.getIncomingAuthType(AbstractHttpLinkSettingsTest.customSettingsJwtHierarchical(authType))) .isEqualTo(Optional.of(authType)); }
public static Optional<IlpOverHttpLinkSettings.AuthType> getIncomingAuthType(Map<String, Object> customSettings) { return Optional.ofNullable(flattenSettings(customSettings).get(IncomingLinkSettings.HTTP_INCOMING_AUTH_TYPE)) .map(Object::toString) .map(String::toUpperCase) .map(IlpOverHttpLinkSettings.AuthType::valueOf); }
LinkSettingsUtils { public static Optional<IlpOverHttpLinkSettings.AuthType> getIncomingAuthType(Map<String, Object> customSettings) { return Optional.ofNullable(flattenSettings(customSettings).get(IncomingLinkSettings.HTTP_INCOMING_AUTH_TYPE)) .map(Object::toString) .map(String::toUpperCase) .map(IlpOverHttpLinkSettings.AuthType::valueOf); } }
LinkSettingsUtils { public static Optional<IlpOverHttpLinkSettings.AuthType> getIncomingAuthType(Map<String, Object> customSettings) { return Optional.ofNullable(flattenSettings(customSettings).get(IncomingLinkSettings.HTTP_INCOMING_AUTH_TYPE)) .map(Object::toString) .map(String::toUpperCase) .map(IlpOverHttpLinkSettings.AuthType::valueOf); }  }
LinkSettingsUtils { public static Optional<IlpOverHttpLinkSettings.AuthType> getIncomingAuthType(Map<String, Object> customSettings) { return Optional.ofNullable(flattenSettings(customSettings).get(IncomingLinkSettings.HTTP_INCOMING_AUTH_TYPE)) .map(Object::toString) .map(String::toUpperCase) .map(IlpOverHttpLinkSettings.AuthType::valueOf); }  static Map<String, Object> flattenSettings(Map<String, Object> settings); static Optional<IlpOverHttpLinkSettings.AuthType> getIncomingAuthType(Map<String, Object> customSettings); static Optional<IlpOverHttpLinkSettings.AuthType> getOutgoingAuthType(Map<String, Object> customSettings); static void validate(AuthenticatedLinkSettings linkSettings); }
LinkSettingsUtils { public static Optional<IlpOverHttpLinkSettings.AuthType> getIncomingAuthType(Map<String, Object> customSettings) { return Optional.ofNullable(flattenSettings(customSettings).get(IncomingLinkSettings.HTTP_INCOMING_AUTH_TYPE)) .map(Object::toString) .map(String::toUpperCase) .map(IlpOverHttpLinkSettings.AuthType::valueOf); }  static Map<String, Object> flattenSettings(Map<String, Object> settings); static Optional<IlpOverHttpLinkSettings.AuthType> getIncomingAuthType(Map<String, Object> customSettings); static Optional<IlpOverHttpLinkSettings.AuthType> getOutgoingAuthType(Map<String, Object> customSettings); static void validate(AuthenticatedLinkSettings linkSettings);  }