Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: support different encoders (not just base64) #8755

Closed
undiabler opened this issue Apr 19, 2023 · 3 comments
Closed

Feature request: support different encoders (not just base64) #8755

undiabler opened this issue Apr 19, 2023 · 3 comments

Comments

@undiabler
Copy link

By default Fernet encodes everything to base64 format.
Some environments (like shells) are more strict.
For now I use base58 for this purposes as the most safe encoder for any various environments.
But there is no way to change behavior of Fernet class.

My proposition is to separate encoding logic from Fernet class to be able to change type of encoder base64/base58/other.
For compatibility base64 will still be used as default encoding.

I can work on PR request, but I want some feedback to understand is there relevant issue or everyone is already satisfied with base64.
Thanks.

@alex
Copy link
Member

alex commented Apr 19, 2023

Fernet is defined by an external specificiation, which mandates base64: https://github.com/fernet/spec

Therefore we can't/won't make this change ourselves, since it wouldn't be compatible.

@alex alex closed this as completed Apr 19, 2023
@undiabler
Copy link
Author

Can you please specify why ability to extend something wouldn't be compatible?
It still will be base64, but with ability to switch to whatever needed without looking for exceptional ways to fork or patch this library.

@alex
Copy link
Member

alex commented Apr 19, 2023

The module implements the fernet standard, if we encode/decode a different encoding, then it's no longer fernet.

If you really want this, you can decode/re-encode values from baes64 to another encoding.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants