[ckan-dev] intercepting http request info

Vitor Baptista vitor at vitorbaptista.com
Fri Apr 5 17:22:07 UTC 2013


Hi George,

It's not specific to CKAN or Drupal, but it might be good to see how
Facebook implemented this.

When you create a FB Canvas app, your application runs in an iframe inside
FB. The first time the user open it, she gets a signed_request POST
parameter with the user_id and other info (
https://developers.facebook.com/docs/howtos/login/signed-request/). Then
the idea is that you would save this in your user table, to link the local
users with FB's.

It's kinda simple to implement. Might be good to think about a similar way
to do the same to link CKAN and Drupal.

Cheers,
Vítor Baptista.

2013/4/4 George Sattler <George.sattler at xvt.com.au>

> Thanks, Adrià. The wordpresser extention might just be the lead I've been
> looking for.
>
> -----Original Message-----
> From: ckan-dev-bounces at lists.okfn.org [mailto:
> ckan-dev-bounces at lists.okfn.org] On Behalf Of Adrià Mercader
> Sent: Friday, 5 April 2013 5:24 AM
> To: CKAN Development Discussions
> Subject: Re: [ckan-dev] intercepting http request info
>
> Hi George,
>
> Perhaps the IMiddleware [1] interface could be useful for that, as it will
> allow you to hook into the Pylons middleware used by CKAN.
> The only problem may be that there aren't many examples around. The only
> one I'm aware of is ckanext-wordpresser, an extension not really maintained
> right now and which I don't have much experience with, but that it does
> capture any HTTP request being made to CKAN.
>
> Have a look at this to see if it gives you a start (I guess that basically
> you'd need to adapt the __call__ method to your own needs)
>
>
> https://github.com/okfn/ckanext-wordpresser/blob/master/ckanext/wordpresser/plugin.py
>
> https://github.com/okfn/ckanext-wordpresser/blob/master/ckanext/wordpresser/middleware.py
>
> Hope this helps,
>
> Adrià
>
>
> [1]
> https://github.com/okfn/ckan/blob/master/ckan/plugins/interfaces.py#L44
>
> On 3 April 2013 06:12, George Sattler <George.sattler at xvt.com.au> wrote:
> > Hi
> >
> > I want to get http request information each time a CKAN page is
> > requested (for cookies and other bits and pieces). Does anyone know
> > what the best approach is?
> >
> >
> >
> > The two ideas I have upfront are:
> >
> > -          Create CKAN extension (though looking at the API - I can't see
> > any hook for something like this)
> >
> > -          Extend the wsgi script
> >
> >
> >
> > If anyone's done this please let me know which would be the best
> approach.
> >
> > Thanks
> >
> > George
> >
> >
> > ________________________________
> > This email and any files transmitted with it is confidential and
> > intended solely for the use of the addressee. The unauthorised use,
> > dissemination, forwarding, printing or copying of this communication
> > is strictly prohibited. If you have received this communication in
> > error please notify us immediately by reply email and destroy this
> > communication. Any views and opinions presented in this email are
> > solely those of the author and do not necessarily represent the views
> > of XVT Solutions. The recipient should check this email and any
> > attachments for viruses. XVT Solutions accepts no liability for the
> > content of this email, and any damage caused by any viruses that could
> potentially be transmitted through this email.
> >
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > http://lists.okfn.org/mailman/listinfo/ckan-dev
> > Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
> >
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130405/1efb0711/attachment-0001.html>


More information about the ckan-dev mailing list