News for hackers. Stuff that matters.
Re:Parse, Don’t Validate by squeaky-clean on Thursday November 07, 2019 @09:41PM (#21479567)
Also a good way to prevent hashed passwords from being accidentally logged.

    Class PasswordType(django.db.models.Field):
        hashed_pw = CharField()
    
        def __str__():
            # you can even raise an Exception here
            return '<confidential data>'
Not that you should be trying to log this stuff anyways, but unless you're a solo dev you can't prevent other people from creating bugs, but you can mitigate common scenarios.

There are no comments on this comment yet.