Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/IPv6 compatibility for AuthTktAuthenticationPolicy #837

Merged
merged 5 commits into from
Mar 19, 2013
Merged

Bugfix/IPv6 compatibility for AuthTktAuthenticationPolicy #837

merged 5 commits into from
Mar 19, 2013

Conversation

digitalresistor
Copy link
Member

I've added tests for IPv6 compatibility in the AuthTktAuthenticationPolicy when include_ip is set to True. I have also updated the documentation to add an extra note that it is not suggested on IPv6, and fixed the actual issue in calculate_digest() so that if it is called with an IPv6 address it doesn't try to call encode_ip_timestamp().

This came about directly because of issue #831 and would effectively close that issue.

If there any style or code issues that I need to fix, please let me know and I will update my brach and submit an updated pull request.

Add a note that using the include_ip functionality with IPv6 is not a
good idea due to the users network expiring IPv6 addresses quickly.

See preferred lifetime/valid lifetime for routers doing SLAAC in IPv6
for more information.
Add an extra test that sets environ['REMOTE_ADDR'] to an IPv6 address
"::1".
Add some simple tests that test IPv6 compatibility with the AuthTicket
class and the parse_ticket function.
This is a quick fix for adding IPv6 compatibility so that if the
AuthTktAuthenticationPolicy is used with include_ip enabled then it
won't throw an error.
@digitalresistor
Copy link
Member Author

@tshepang thanks for the fixes on the grammar. Fixed those issues, squashed the commits and it looks like Github automatically updated this pull request!

@tshepang
Copy link
Contributor

tshepang commented Feb 2, 2013

koolnes

@digitalresistor
Copy link
Member Author

So call me slow ... but just realized that auth_tkt is actually a standard of sorts, and not something that was simply added to Pyramid/Paste...

Anyway there is currently no support for IPv6 in mod_auth_tkt, and that will itself segfault when the IP isn't an IPv4 address. Some patches have been proposed on the mailing list for mod_auth_tkt, but none have been accepted yet from what I can find.

Not sure what the best course of action is to fix the situation. At the moment the IPv4 setup is still compatible with mod_auth_tkt, so that will continue to function, and my patch fixes IPv6 as well, but with the knowledge that most likely it is going to have to be changed in the future to be compatible with mod_auth_tkt.

Would like to hear from someone on the Pyramid team what the suggested way to move forward is. @tseaver? @goodwillcoding?

@mmerickel
Copy link
Member

Is it crazy to ignore the include_ip setting in IPv6 cookies until mod_auth_tkt is updated? Or we can just fix it and have a bw-incompat change to the cookies if we have to re-fix it when the standard is created.

@digitalresistor
Copy link
Member Author

I don't think that simply disabling it is a good idea. If the developer has specifically turned on the feature it should definitely be enabled.

Although, as I stated in this patch: https://github.com/bertjwregeer/pyramid/commit/918c9d9dd632d346909d2429647758352d753a42 I don't think it is a good idea because of the way that IPv6 addresses are provided to most users (SLAAC)

@digitalresistor
Copy link
Member Author

@mmerickel since you are looking through old pull requests, any updates on how to proceed with this one?

@digitalresistor
Copy link
Member Author

Figured since I asked you to look at it again, I should do some looking and see if mod_auth_tkt has moved forward, they have not.

Here is one patch I found though:

http://sourceforge.net/mailarchive/forum.php?thread_name=20110811071556.GA32744%40openfusion.com.au&forum_name=modauthtkt-users

Which packs a 0 for the IPv4 address if the address is IPv6 and appends the IPv6 address to the timestamp.

If we want to be compatible with that patch, it is a very simple change.

Although I haven't seen any movement towards adopting that patch, nor any work on mod_auth_tkt in general...

@mmerickel mmerickel merged commit 4b71102 into Pylons:master Mar 19, 2013
@mmerickel
Copy link
Member

Thanks! Sorry this took so long to handle.

@digitalresistor digitalresistor deleted the bugfix/ipv6_compat branch November 8, 2013 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants