Thursday, April 2, 2026
1 change · 17.0
New functionality added to Odoo
This update introduces a new tool for securely generating and verifying tokens. The primary goal is to reduce the storage of individual tokens by using signed payloads instead, improving security and efficiency. This change enhances the system's ability to manage access and permissions.
Original PR description
Backport of fd94042de04682895b90624c0a27639cfa7694bf Add a tool to generate signed payload to be used as token. The main purpose is to stop storing every token. Two functions are added: `odoo.tools.misc.hash_sign()` This functions takes as required arguments, a json dumpable payload, a scope as a string, a sudo environnement, and finally either and expiration as datetime.datetime, or expiration_hours as an int. `odoo.tools.misc.verify_hash_signed()` This function takes as arguments, a sudo environnement, a scope as a string (must be the same as the encoding scope), and a token generated by hash_sign()