feat: improve anonymity by not storing ids in db anymore#182
Draft
drendog wants to merge 10 commits intoUNICT-DMI:mainfrom
Draft
feat: improve anonymity by not storing ids in db anymore#182drendog wants to merge 10 commits intoUNICT-DMI:mainfrom
drendog wants to merge 10 commits intoUNICT-DMI:mainfrom
Conversation
Helias
reviewed
Feb 8, 2026
| key = self._key | ||
| PendingPost._store[key] = self | ||
| PendingPost._key_to_user[key] = PendingPost._encrypt_user_id(user_id) | ||
| PendingPost._user_to_key[PendingPost._hash_user_id(user_id)] = key |
Member
There was a problem hiding this comment.
so you want to keep the pending post in memory? What about if the bot crashes?
and if we restart the docker container for an update?
Is there a persistent cache/storage for it?
Member
|
merge conflict |
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.
Prerequisites
CHANGELOG.mdfile with an overview of the changes made.Description
reworks how the bot handles user id during the pending post lifecycle, applying encrypted in-memory approach to minimize the exposure of user id at every layer.
User/chat id are no longer plaintext written to disk at all (currently encrypted only on the backups), pending posts are held in an ephemeral in-memory encrypted splitted map that exists only for the lifetime of the process.
(If applicable) Issue closed by this PR
Does this PR introduce a breaking change?
(If yes) What are the changes that might break existing applications?
Python version you are using
3.14.2
Other information
Remember to set stop_grace_period on the compose file with the same value or more as
drain_timeoutin settings.yaml, to avoid to kill the bot before cleaning up the pending postWIP another PR based in this, to add salt on approval/reject buttons in a way to split knowledge about encryption.
WIP another PR based in this, about new post sending flow without storing chat id anywhere, without compromising the user experience too badly, but still keeping the old one