Skip to content

Instantly share code, notes, and snippets.

View nbrahms's full-sized avatar

Nathan Brahms nbrahms

  • P0 Security
  • San Francisco, CA
  • 13:46 (UTC -07:00)
View GitHub Profile
@nbrahms
nbrahms / databases.py
Created September 25, 2020 19:32
Flask SqlAlchemy engine with obfuscated string columns
from typing import Any
from typing import Optional
import sqlalchemy.types as types
from flask_sqlalchemy import SQLAlchemy
class ObfuscatedString(types.TypeDecorator):
"""
String column type for use with SQLAlchemy models whose
content should not appear in logs or exceptions