Skip to content

Releases: ryan-shaw/django-secrets-fields

1.0.5

Choose a tag to compare

@ryan-shaw ryan-shaw released this 06 Feb 16:53
71e7015

What's Changed

Full Changelog: 1.0.4...1.0.5

1.0.4

Choose a tag to compare

@ryan-shaw ryan-shaw released this 31 Jan 17:10
9c78f41

What's Changed

Full Changelog: 1.0.3...1.0.4

1.0.3

Choose a tag to compare

@ryan-shaw ryan-shaw released this 31 Jan 12:07
42d25b6

What's Changed

Full Changelog: 1.0.2...1.0.3

1.0.2

Choose a tag to compare

@ryan-shaw ryan-shaw released this 30 Jan 19:53
1c2222b

What's Changed

Full Changelog: 1.0.1...1.0.2

1.0.1

Choose a tag to compare

@ryan-shaw ryan-shaw released this 30 Jan 15:14
347a8c3

Full Changelog: 1.0.0...1.0.1

1.0.0

Choose a tag to compare

@ryan-shaw ryan-shaw released this 29 Jan 11:48
38c0c19

Django encrypted fields with support for multiple backends, currently supports symmetric encryption using Fernet and AWS Secrets Manager. Two fields types are currently supported, SecretTextField and SecretJSONField.

⚙️ Installation

Install django-secrets-fields:

pip install django-secrets-fields

To use backend that requires AWS install using:

pip install django-secrets-fields[aws]

🤖 Usage

settings.py

DJANGO_SECRET_FIELDS = {
    "default": {
        "backend": "secrets_fields.backends.encrypted.EncryptedBackend",
        "encryption_key": b"<fernet key>",
    },
    "aws": {
        "backend": "secrets_fields.backends.secretsmanager.SecretsManagerBackend",
        "prefix": "/path/",
    },
}

A Fernet can be generated using the following command:

python manage.py generate_fernet_key

models.py

from django.db import models
from secrets_fields.fields import SecretJSONField, SecretTextField


class MyModel(models.Model):
	secret_text = SecretTextField(backend="aws")
	secret_json = SecretJSONField()