fix(gateway-engine) Invalid clients still being inserted.
@@ -99,6 +99,7 @@ public class InMemoryRegistry implements IRegistry {
}
}
+ if (error == null) {
// Unregister the client (if it exists)
unregisterClientInternal(client, true);
@@ -106,13 +107,13 @@ public class InMemoryRegistry implements IRegistry {
String clientIdx = getClientIndex(client);
getMap().put(clientIdx, client);
getMap().put(client.getApiKey(), client);
- }
- if (error == null) {
+
handler.handle(AsyncResultImpl.create((Void) null));
} else {
handler.handle(AsyncResultImpl.create(error, Void.class));
}
}
+ }
/**
* @see io.apiman.gateway.engine.IRegistry#unregisterClient(io.apiman.gateway.engine.beans.Client, io.apiman.gateway.engine.async.IAsyncResultHandler)
@@ -286,6 +287,7 @@ public class InMemoryRegistry implements IRegistry {
return ((Client) elem).getOrganizationId();
}
})
+ .distinct()
.collect(Collectors.toList());
handler.handle(AsyncResultImpl.create(res));
}
