Conversation
…bility
Cryptography 50.0.0 added a self._aes attribute to the Fernet class
constructor. Since Fernet256 overrides __init__ without calling
super().__init__(), it needs to manually set this attribute.
Without this attribute, any code using Fernet256 (encryption/decryption
of credentials, secrets, etc.) fails with:
AttributeError: 'Fernet256' object has no attribute '_aes'
This fix:
- Imports algorithms from cryptography.hazmat.primitives.ciphers
- Sets self._aes = algorithms.AES(self._encryption_key) in __init__
The fix is backward compatible with cryptography < 50.0.0 since the
_aes attribute wasn't used by Fernet's methods in older versions.
Fixes: 277 test failures in AWX test suite when using cryptography 50.x
Related: pyca/cryptography#11234 (cryptography 50.0.0 changes)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesFernet256 compatibility
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This change addresses the reported encryption and decryption compatibility failures without introducing a remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
|
❌ Test Results - FAILEDSummary
Pass Rate: 91.2% ❌ Failed Tests
|



Issue Type
Summary
Fixes
Fernet256class to be compatible withcryptography>=50.0.0.Problem
Cryptography 50.0.0 added a
self._aesattribute to theFernetclass constructor. SinceFernet256overrides__init__()without callingsuper().__init__(), it doesn't get this attribute.This causes 277 test failures in the AWX test suite when using
cryptography>=50.0.0:The error occurs in any code path that uses
Fernet256for encryption/decryption (credentials, secrets, etc.).Solution
This PR:
algorithmsfromcryptography.hazmat.primitives.ciphersself._aes = algorithms.AES(self._encryption_key)inFernet256.__init__()Backward Compatibility
✅ This fix is backward compatible with
cryptography < 50.0.0because:_aesattribute wasn't used byFernet's methods in older versionsTesting
This fix resolves the 277 test failures when running AWX tests with
cryptography==50.0.1.Related