Skip to content

Commit

Permalink
ADD documentation field password
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil1marczak committed Jun 1, 2021
1 parent 10f3074 commit 57039f8
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 0 deletions.
Empty file modified .github/workflows/Release.yml
100644 → 100755
Empty file.
Empty file modified README.rst
100644 → 100755
Empty file.
Empty file modified django_crypto_extensions/django_fields.py
100644 → 100755
Empty file.
Empty file modified django_crypto_extensions/tests/__init__.py
100644 → 100755
Empty file.
Empty file modified django_crypto_extensions/tests/apps.py
100644 → 100755
Empty file.
Empty file modified django_crypto_extensions/tests/models.py
100644 → 100755
Empty file.
Empty file modified django_crypto_extensions/tests/settings.py
100644 → 100755
Empty file.
17 changes: 17 additions & 0 deletions docs/3_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Example of how to use to create custom CryptoTextField::
+ each CryptoField has 2 kwargs ``salt_settings_env`` and ``password``.
+ salt_settings_env - name of variable stored in ``settings.py`` file, which will be used as cryptographic salt. ``default: salt_settings_env = 'SECRET_KEY'`` if settings not set or no SECRET_KEY in setting ``default: salt = "Salt123!!!"``
+ password - password to be used in encryption process of given field (together with salt set globally) ``default = 'password'``
+ password_field - name of field from which to import password. It i most recommended to ue @property instead of actual field

**Example**::

Expand All @@ -50,6 +51,22 @@ Example of how to use to create custom CryptoTextField::
value = CryptoEmailField(salt_settings_env='NEW_SECRET_KEY', password='new_password')


**Example2**::

# models.py

from django.db import models

from django_crypto_extensions.django_fields import CryptoEmailField

class CryptoTextModelPasswordFromField(models.Model):

@property
def password(self):
return "password_field_to_be_used_as_key"

value = CryptoTextField(password_field="password")

CryptoBinaryField and CryptoCharField
---------------------------------------

Expand Down
Empty file modified docs/4_contribution.rst
100644 → 100755
Empty file.
Empty file modified pytest.ini
100644 → 100755
Empty file.
Empty file modified setup.cfg
100644 → 100755
Empty file.
Empty file modified tests/test_django_fields.py
100644 → 100755
Empty file.

0 comments on commit 57039f8

Please sign in to comment.