[Haskell-cafe] How to use http-enumerator with hoauth?

Diego Souza dsouza at bitforest.org
Wed Feb 16 02:49:16 CET 2011


thanks for the feedbacks. They sound very reasonable.

Going back in time, the first version was in fact a pure library.
However, at some point I changed this as I thought it would make it
easier to use, which might have been a mistake of mine. Back then
http-enumerator wasn't available and after it did I haven't considered
using it until now.

I'm just concerned about changing the interface once more, but it
might be justified. Perhaps splitting it into the pure oauth functions
as used to be in the beginning and another one that puts the http
layer, in case one finds it convenient. That might mitigate this
problem, and perhaps, avoid changing the interface.

What you guys think?

Again, thanks,

On Tue, Feb 15, 2011 at 10:05 PM, Jeremy Fitzhardinge <jeremy at goop.org> wrote:
> On 02/15/2011 02:14 PM, Vincent Hanquez wrote:
>> Clearly, http-enumerator is the best package for doing http/https. however
>> since it's pretty new, lots of package still uses their own abstraction for
>> doing things.
>> While it may be possible to retrofit hoauth to use http-enumerator, using the
>> httpclient typeclass, that's going to be hard to fit the full enumerator
>> interface on it, so you won't benefit of streaming; You may as well just use
>> network.curl for now, which is what i've seen used with hoauth.
> I don't really see why hoauth needs to make its own http requests at
> all, except perhaps as a convenience.  At heart, doesn't it just need to
> set up requests and parse certain responses?  It could almost be pure,
> aside from needing to get timestamps and generate nonces (which, btw,
> doesn't seem to be using a cryptographically strong RNG).  But that
> suffers from not having standard request/response types.
>> you should check the twidge twitter utility and/or yesod-auth-oauth, that both
>> uses curl/hoauth.
> Thanks for the pointers.  Does Network.Curl support interleaved
> processing on infinite streams?
>> It would be really useful to see an hoauth fully using enumerator and
>> http-enumerator (and not redefining a boat load of stuff), but IMO you'll need
>> to understand enumerators before tackling such a challenge.
>> Also Wai is for abstracting server side "transport" (cgi/fastcgi/others),
> Yes, that's what I thought, but http-enumerator dips into it for its
> http response types.
>> the HTTP package doesn't do TLS.
> That's unfortunate, but it seems like it could have been a fairly easy
> thing to address.  Or does it have other deficiencies?
> Thanks,
>    J
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

yahoo!im: paravinicius
gtalk: dsouza.rb at gmail.com
gpg pub key: http://bitforest.org/~dsouza/pub/gpg-pubkey.txt
authorized_keys: http://bitforest.org/~dsouza/pub/authorized_keys.txt

More information about the Haskell-Cafe mailing list