Skip to content

fix : ensure encryption key is always bytes in PrivacyManager#1311

Open
tmdeveloper007 wants to merge 1 commit into
komalharshita:mainfrom
tmdeveloper007:#1306
Open

fix : ensure encryption key is always bytes in PrivacyManager#1311
tmdeveloper007 wants to merge 1 commit into
komalharshita:mainfrom
tmdeveloper007:#1306

Conversation

@tmdeveloper007

Copy link
Copy Markdown

Summary of What Has Been Done

In src/utils/privacy.py, the PrivacyManager.__init__ was calling Fernet(self.encryption_key) where encryption_key could be either str (from os.getenv) or bytes (from Fernet.generate_key()). Fixed by explicitly encoding the string key to bytes before passing to Fernet.

Changes Made

  • Modified __init__ in src/utils/privacy.py to call .encode("utf-8") on the key when it is a string

Impact it Made

  • Consistent bytes-only key type regardless of environment configuration
  • Prevents potential Fernet initialization failures with mixed types

Closes #1306

Note: Please assign this PR to the tmdeveloper007 account.

@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : ensure encryption key is always bytes in PrivacyManager

1 participant