Giter VIP home page Giter VIP logo

django-urlcrypt's People

Contributors

christopherhesse avatar derek73 avatar dziegler avatar yourcelf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

django-urlcrypt's Issues

_session_key too long to be used with Memcached

Using the session_key as as part of they cache key in rate_limit sometimes generates a key that is too long for memcached (255 characters) causing an exception to be raised that can not be handled by our application.

Shortening the key will risk duplicate cache keys. My simple proposal is to able to disable rate limiting or using a different key.

I've noticed that this project has not been maintained for a while. Let me know if oyu don't expect to fix this. Thanks :)

Caught TypeError while rendering: character mapping must return integer, None, or unicode

At least in python 2.6 under linux, the key passed to hmac.new(key, msg, digestmod) must be of type str, not unicode. However, as the key is constructed using User's passwords, if that field is unicode (as it is in recent Djangos), the key is cast to unicode. This results in the following very confusing error:

TemplateSyntaxError at ...
Caught TypeError while rendering: character mapping must return integer, None or unicode

This can be fixed by simply coercing the key to string; though if the key had un-decodable unicode chars it would be another problem.

Patch:

--- a/urlcrypt/lib.py
+++ b/urlcrypt/lib.py
@@ -52,7 +52,7 @@ deobfuscate = obfuscate

 def encode_token(strings, secret_key_f):
     secret_key = secret_key_f(*strings)
-    signature = hmac.new(secret_key, pack(*strings), sha_hmac).hexdigest()
+    signature = hmac.new(str(secret_key), pack(*strings), sha_hmac).hexdigest()
     packed_string = pack(signature, *strings)
     return obfuscate(packed_string)

encode_url template tag doesn't support "as varname" syntax

While the encoded_url template tag parser properly parses the "as varname" syntax, the node renderer doesn't use it properly. Currently, the node renderer prints the encrypted URL, and sets the unencrypted URL to the context varname.

A forthcoming pull requests fixes this issue and the previous unicode issue, and adds tests for both.

Add Crypto to required

Crypto is used in the code but not present in the requires section off the setup.py file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.