othernet-project / bottle-utils Goto Github PK
View Code? Open in Web Editor NEWMiscellaneous utiltiies for Bottle, Python web framework
Home Page: http://bottle-utils.readthedocs.org/en/latest/
License: Other
Miscellaneous utiltiies for Bottle, Python web framework
Home Page: http://bottle-utils.readthedocs.org/en/latest/
License: Other
There should be a switch or function that swaps lazy versions of gettext functions with dummy version.
When the label is assigned a text that is non-string value (e.g., numbers, non-standard objects, etc), the label's str() method fails.
I recently ran into a situation where pgettext
was the only way to provide translation strings. More on that here:
https://www.gnu.org/software/gettext/manual/html_node/Contexts.html
The CSRF token is using 64 bits of entropy :
sha256 = hashlib.sha256()
sha256.update(os.urandom(8))
token = sha256.hexdigest().encode(ENCODING)
response.set_cookie(token_name, token, path=path,
secret=secret, max_age=expires)
request.csrf_token = token.decode(ENCODING)
Apparently, the 128 bits of entropy is considered a minimum these days, the OWASP example is using 512 bits of entropy.
Path is being ignored on current firefox because it's sent as str(path.encode('latin1'))
which comes out as "b'/path'" because str() of bytes is weird.
On line 117. Looks like request.locale
is unset.
The setup module classifier says GPLv3 but should be BSD.
Wouldn't it be better to be isolated plugins? Example:
So I don't have to install the bottle-utils
to use only the bottle_utils.meta
Both should be present on all fields and default to empty string.
_csrf_token cookie is not set properly in safari browser when path is bytes not str.
Function generate_csrf_token
is getting path configuration from get_conf
:
csrf_path = conf.get('csrf.path', ROOT).encode(ENCODING)
When I'm converting bytes to str in generate_csrf_token
cookie is set correctly.
response.set_cookie(token_name, token, path=path.decode(),
secret=secret, max_age=expires)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.