Gramex 1.82 allows revoking API keys, setting session cookie paths, and Bootstrap 5 support in g1.
Gramex allows creating an API key using handler.apikey()
, like this:
user = {id: 'user@example.com'} # Ensure there's an 'id' key
expiry = 24 * 60 * 60 # Expires in 24 hours
key = handler.apikey(expire=expiry, user=user) # Create key as specified user
To revoke an API key created this way, you can now use:
handler.revoke_apikey(key)
You can also revoke an OTP using:
handler.revoke_apikey(otp)
As part of the session settings, you can add a
Cookie Path
e.g. cookiepath: /app/path
.
This restricts the cookie to /app/path
and its subdirectories, and ensures that the cookie
does not leak to other applications on the same server.
g1 components such as FormHandler used Bootstrap 4 classes and attributes, e.g. data-dismiss="modal"
.
g1 0.18.0 enhances such components to work both with Bootstrap 4 and Bootstrap 5.
/style.scss
), the source map is linked to and served at /style.scss?_map
TypeError: can't pickle _thread.RLock objects
. This was because error messages use templates that cannot be pickled. Gramex now caches such objects in an in-memory fallback cache.<model-name>/<model-name>.pkl
. This made the models less portable. When renaming the model, the file has to be renamed too. Now, MLHandler stores models as <model-name>/model.pkl
. Renaming the model is the same as renaming the directory.Gramex 1.82 is backward compatible with previous releases unless the release notes say otherwise. Automated builds test this.
Every Gramex release is tested for security vulnerabilities using the following tools.
The Gramex code base has: