Skip to content

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

Closed

Description

@undiabler

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.

Activity

  1. alex commented on Apr 19, 2023

    @alex
    Member

    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.

  2. undiabler commented on Apr 19, 2023

    @undiabler
    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.

  3. alex commented on Apr 19, 2023

    @alex
    Member

    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.

  4. locked as resolved and limited conversation to collaborators on Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions