akamsteeg / AtleX.HaveIBeenPwned

A fully async .NET Standard client library for the API of HaveIBeenPwned.com
https://www.nuget.org/packages/AtleX.HaveIBeenPwned/
MIT License
5 stars 0 forks source link

Fold HaveIBeenPwnedClient and HttpHaveIBeenPwnedClient into one #26

Closed akamsteeg closed 5 years ago

akamsteeg commented 5 years ago

Originally, I created the HaveIBeenPwnedClient as a facade/factory class for when multiple IHaveIBeenPwnedClient implementations would be added. But realistically, we will only have the HTTP implementation in the foreseeable future unless HaveIBeenPwned.com significantly changes the way it works and we can't predict that so, whatever. It was just my fault of overengineering this.

Currently, having HaveIBeenPwnedClient just passing all calls to HttpHaveIBeenPwnedClient is becoming more and more of a burden. Using it in .NET Core's DI system is hard because that will always call the most specific constructor (the one with the IHaveIBeenPwnedClient). So in the end you just register HttpHaveIBeenPwnedClient for DI and not bother with HaveIBeenPwnedClient at all. Also, we now have to do a lot of unit testing etc. for something that doesn't serve any real purpose.

So, we're going to replace the business logic of HaveIBeenPwnedClient with HttpHaveIBeenPwnedClient.