[IMP] gmail: encrypt the database with the sub of the Gmail token#68
Open
std-odoo wants to merge 1 commit into
Open
[IMP] gmail: encrypt the database with the sub of the Gmail token#68std-odoo wants to merge 1 commit into
sub of the Gmail token#68std-odoo wants to merge 1 commit into
Conversation
std-odoo
force-pushed
the
v2-gmail-encrypt-db
branch
8 times, most recently
from
July 15, 2026 13:21
bca6d0f to
7d01326
Compare
Purpose ======= Encrypt the database with the `sub` of the Gmail token, to reduce the damage in case of a database leak. Technical ========= We don't even need to store the email anymore (the hash of the key is all we need). What's not encrypted is - user_id, for the foreign key between the log and the users - create_date, so the CRON can clean the old log Nor of those information are really important, and we won't be able to link them to a specific Odoo / Gmail user without the encryption key. The tricky point is the Odoo authentication process, the user is redirected to Odoo to accept the plugin, and then is redirected to the plugin with the Odoo token in the URL. We need to save the Odoo token in database, and so we need the encryption key. So we derive an application key from the application secret (for convenience, so there's no restriction on application secret size), and we encrypt with the application key, the user's key, user's email, login token, etc. That way those informations do not appear in the URL (and his browser history). Task-6366629
std-odoo
force-pushed
the
v2-gmail-encrypt-db
branch
from
July 15, 2026 13:49
7d01326 to
c91c3b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Encrypt the database with the
subof the Gmail token, to reduce the damage in case of a database leak.Technical
We don't even need to store the email anymore (the hash of the key is all we need).
What's not encrypted is
Nor of those information are really important, and we won't be able to link them to a specific Odoo / Gmail user without the encryption key.
The tricky point is the Odoo authentication process, the user is redirected to Odoo to accept the plugin, and then is redirected to the plugin with the Odoo token in the URL. We need to save the Odoo token in database, and so we need the encryption key. So we derive an application key from the application secret (for convenience, so there's no restriction on application secret size), and we encrypt with the application key, the user's key, user's email, login token, etc. That way those informations do not appear in the URL (and his browser history).
Task-6366629