both of those views would probably just set require_csrf=False always
one is an exc view so it doesn't matter
the other is the batched view which executes subrequests so it falls back to whatever each of those methods is set to
so you're just talking about some default options for each rpc method
and obviously for jsonrpc csrf should be the same for every method
but I'm not sure about other view options
I'd lean toward just a setting for require_csrf and not a generic pass through without some other examples
the rpc api is kind of intentionally constrained
ztane
yeah. writing some test code, I guess the csrf flag if set should also be stored on the endpoint, doesn't make sense for it to be any different for the other requests...
raydeo
yeah I mean a method_options or something isn't crazy either I suppose
with view derivers in the mix now it isn't crazy to want to apply some derivers to all of your methods
dfee joined the channel
ztane
hmmm... I was thinking that it would be quite nice to have a mapper that used type hints...
garh, need to have 6 different cases for the csrf flag to test that it is actually working, 2 x 3 :D
stevepiercy: this requires pyramid 1.7 with this addition...
stevepiercy
yup
ztane
it could be made to work with 1.4, 1.5, and then only the require_csrf-specific tests need be skipped.
stevepiercy
and a tox modification
raydeo
I'm ok with you bumping the minimum dep to 1.7
ztane
as for the first failure, the views could be replaced with a lambda function ;)
stevepiercy
raydeo also remove py3.3 and add py3.6?
and add py nightly, or whatever it's called?
raydeo
yes well the feature also needs to be added to xmlrpc
XeL64 has quit
Charlie_X has quit
ztane
yea
(though I wonder who wants to build anything new with xmlrpc :D)
raydeo
warehouse uses it
ztane
yeah poor dstufft
lol, one line missed
Charlie_X joined the channel
dfee joined the channel
dfee has quit
mr_jolly has quit
strange, now I get json result '', when returning from an actual view...
*sorry, json text is ""
Belxjander has quit
I've got a custom json renderer...
Belxjander joined the channel
Charlie_X has quit
mr_jolly joined the channel
(Pdb) response.body
b'""'
lol
ah because... notification.
however shouldn't it return no body
yea
dfee joined the channel
djinni joined the channel
jhauser has quit
hyperknot joined the channel
hyperknot
Hi, when implementing Facebook login on a mobile client, what kind of auth library would you recommend for the Pyramid backend? As I see from the recently updated ones there is Authomatic and the new python-social-auth. Social's Pyramid project is very new though and only has 2 stars, I wonder if anyone has used it.
python-social-auth itself has been around for a long time probably just not a lot of usage with pyramid
anyway probably either authomatic or psa or the right answer if you don't want to implement it yourself
hyperknot
So both of them are considered reliable. Do both of them only do strictly the initial authentication, or they also go into authorization. Or I should just do it myself with session / JWT?
raydeo
I don't use them... I've just seen your type of question more than once in this channel
when I did facebook login I implemented it myself
Ergo
hyperknot: I use authomatic, worked well for me
hyperknot
Thanks. And do you know of any resources which describes how to implent it yourself, even if I'll finally settle on authomatic or psa? What I'm trying to understand is what are the needed steps for the backend when authenticating a native mobile app via facebook.
Ergo
hyperknot: there are examples for authomatic/webob on their site
the flow for native mobile might be different though
hyperknot
thanks
atomekk joined the channel
atomekk joined the channel
raydeo
hyperknot: for "diy" it's just the facebook docs
hyperknot
raydeo: I didn't really find any information in there, but probably I wasn't looking in the right place. Right now https://developers.google.com/identity/protocol... looks to be a much higher quality document.
you shouldn't dive into that stuff unless you understand oauth2 pretty well already though
hyperknot
Right now what I'm tring to understand is what kind of model I need in my database for social auth-ed users, as well as if I need to use an provider specific library, or just an oath lib, or maybe a simple request would work?
raydeo
well you need to store their userid and usually also their access token information (allowed scopes, expiration time, token, refresh token)
depends if you care about anything more than their userid really
you'll almost always need the token in order to query their email address and any other profile properties you care about when they connect the first time
but after that you might throw it away depending on what you're doing
Belxjander has quit
Belxjander joined the channel
hyperknot
raydeo: cool, that's clear! And for this one time querying of things, do I need an auth library like authomatic or just a call in a generic oath lib?
raydeo
oauth2 is pretty trivial to do on your own but in the past I've used requests-oauthlib as a helper around requests as well
it's basically just a request to the endpoint with the authorization header set to your access token... so there's not much to it unless you are trying to do stuff over a much longer period of time