logibit / Logibit.Hawk

A F# Hawk implementation with a strongly typed API that guides your usage and minimises security programming errors.
Other
36 stars 5 forks source link

PCL target & NuGet package #9

Open varon opened 8 years ago

varon commented 8 years ago

Would it be possible to get this targeting and releasing with a PCL build? It would be good to use the Hawk Client from Xamarin apps.

For the libraries, NodaTime is already supported as a PCL, so the only major work would be relatively minor adjustments.

This would be advantageous to any user wanting to consume an API secured with Hawk from Xamarin.

haf commented 8 years ago

Yes perhaps it works by now. I've been bitten by PCL before, but for you @varon I will give it a shot.

haf commented 8 years ago

It seems crypto isn't available. Using System.Cryptography breaks. Googling says I should use PCLCrypto but that just supports Windows so what's the point? https://github.com/AArnott/PCLCrypto/issues/103

haf commented 8 years ago

Also missing a memory cache that times out https://stackoverflow.com/questions/20160014/is-there-a-in-memory-cache-for-portable-class-library

haf commented 8 years ago

And it would seem we're missing a Http Client too

haf commented 8 years ago

@varon Would you consider PRing the basics? I can help out.

varon commented 8 years ago

@haf Thanks for investigating this.

PCLCrypto has NuGet packages for just about everything, including WP and Xamarin (iOS and Android). Not sure about .Net Core, but at least we could use Hawk client from the mobile apps through Xamarin.

MemoryCache I just turned off, i.e. had it default to the Choice2Of2 to get it to compile, the idea was that it could be replaced with our own implementation. I'm not sure how important this is, but I'd imagine id should be pretty trivial to provide our own implementation.

HttpClient actually is supported on most platforms, but it's as a platform specific library. We can either link to those, or we could try use the Microsoft PCL, although it's worth checking for potential licensing issues here.

For PRing the basics, I'm not actually in need of Hawk for any project at the moment, but was surprised to see that it didn't yet have support for this. If you're critically short on time, I can look at getting either myself or someone else onto this, but would prefer to use those resources elsewhere if possible.

The feedback and assistance so far is really appreciated.

haf commented 8 years ago

I'm quite time limited, to be honest. I do mostly server-side stuff too, so for me it would be .Net Core next – and that seems to use yet another API (e.g. CultureInfo from Globalization is different) I'll leave the issue open for now.

varon commented 8 years ago

No trouble at all, thanks for accommodating.