[Twisted-Python] Form based auth - problem with credential checker
I've posted code here: credential checker --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-crede... realm.py --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-realm... session wrapper --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-webau... As I point out on line 14 of realm.py the checker is matching a password against the db but its requestAvatarId (line 10 of *credentialChecker.py * <https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-credentialchecker-py>) is returning None to requestAvatar Any guidance warmly welcomed. Jonah
Hi Jonah! Can these examples be made into SSCCEs <http://www.sscce.org <http://www.sscce.org/>>? They're missing all their imports and, for example, replacing the database calls with some succeeded/failed Deferreds? I'd love to help but I'd rather not debug a bunch of zope component lookups (I'm assuming that's what getUtility is) and DB queries that are irrelevant to the problem at hand :). -g
On Jul 11, 2018, at 3:48 PM, Jonah Crawford <jonah.crawford@gmail.com> wrote:
I've posted code here:
credential checker --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-crede... <https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-credentialchecker-py>
realm.py --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-realm... <https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-realm-py>
session wrapper --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-webau... <https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-webauthsessionwrapper-py>
As I point out on line 14 of realm.py the checker is matching a password against the db but its requestAvatarId (line 10 of credentialChecker.py <https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-credentialchecker-py>) is returning None to requestAvatar
Any guidance warmly welcomed.
Jonah _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Glyph. I'll put this into SSCCE and resend in the am. Thanks for looking.
On Jul 11, 2018, at 8:31 PM, Glyph <glyph@twistedmatrix.com> wrote:
Hi Jonah!
Can these examples be made into SSCCEs <http://www.sscce.org <http://www.sscce.org/>>? They're missing all their imports and, for example, replacing the database calls with some succeeded/failed Deferreds? I'd love to help but I'd rather not debug a bunch of zope component lookups (I'm assuming that's what getUtility is) and DB queries that are irrelevant to the problem at hand :).
-g
On Jul 11, 2018, at 3:48 PM, Jonah Crawford <jonah.crawford@gmail.com <mailto:jonah.crawford@gmail.com>> wrote:
I've posted code here:
credential checker --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-crede... <https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-credentialchecker-py>
realm.py --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-realm... <https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-realm-py>
session wrapper --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-webau... <https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-webauthsessionwrapper-py>
As I point out on line 14 of realm.py the checker is matching a password against the db but its requestAvatarId (line 10 of credentialChecker.py <https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-credentialchecker-py>) is returning None to requestAvatar
Any guidance warmly welcomed.
Jonah _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com <mailto:Twisted-Python@twistedmatrix.com> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Hi Jonah, I commented on your Gist. tl;dr - your requestAvatarId method isn’t returning the Deferred you create for the database query, to which your callback is attached. Hope this helps, Daniel -- L. Daniel Burr ldanielburr@me.com (312) 656-8387 On July 11, 2018 at 10:38:47 PM, Jonah Crawford (jonah.crawford@gmail.com) wrote: Glyph. I'll put this into SSCCE and resend in the am. Thanks for looking. On Jul 11, 2018, at 8:31 PM, Glyph <glyph@twistedmatrix.com> wrote: Hi Jonah! Can these examples be made into SSCCEs <http://www.sscce.org>? They're missing all their imports and, for example, replacing the database calls with some succeeded/failed Deferreds? I'd love to help but I'd rather not debug a bunch of zope component lookups (I'm assuming that's what getUtility is) and DB queries that are irrelevant to the problem at hand :). -g On Jul 11, 2018, at 3:48 PM, Jonah Crawford <jonah.crawford@gmail.com> wrote: I've posted code here: credential checker --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-crede... realm.py --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-realm... session wrapper --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-webau... As I point out on line 14 of realm.py the checker is matching a password against the db but its requestAvatarId (line 10 of credentialChecker.py ) is returning None to requestAvatar Any guidance warmly welcomed. Jonah _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Hi Glyph, @ldanielburr spotted the missing return from the credential checker. Much thanks to you and the list! 🍻 -J https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392/revisions On Wed, Jul 11, 2018 at 8:31 PM, Glyph <glyph@twistedmatrix.com> wrote:
Hi Jonah!
Can these examples be made into SSCCEs <http://www.sscce.org>? They're missing all their imports and, for example, replacing the database calls with some succeeded/failed Deferreds? I'd love to help but I'd rather not debug a bunch of zope component lookups (I'm assuming that's what getUtility is) and DB queries that are irrelevant to the problem at hand :).
-g
On Jul 11, 2018, at 3:48 PM, Jonah Crawford <jonah.crawford@gmail.com> wrote:
I've posted code here:
credential checker --> https://gist.github.com/minskm az/ab218d7b137b24ede8ffc7e3ea6e2392#file-credentialchecker-py
realm.py --> https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6 e2392#file-realm-py
session wrapper --> https://gist.github.com/minskm az/ab218d7b137b24ede8ffc7e3ea6e2392#file-webauthsessionwrapper-py
As I point out on line 14 of realm.py the checker is matching a password against the db but its requestAvatarId (line 10 of *credentialChecker.py * <https://gist.github.com/minskmaz/ab218d7b137b24ede8ffc7e3ea6e2392#file-credentialchecker-py>) is returning None to requestAvatar
Any guidance warmly welcomed.
Jonah _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (3)
-
Glyph
-
Jonah Crawford
-
L. Daniel Burr