Skip to content

Commit 93dab05

Browse files
authored
Merge branch 'main' into src_layout
2 parents fd1564e + 0ff2493 commit 93dab05

4 files changed

Lines changed: 75 additions & 6 deletions

File tree

.github/workflows/lint-and-test.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
name: Lint & Test
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- "LICENCE.txt"
7+
- "**/*.md"
8+
- ".pre-commit-config.yaml"
9+
push:
10+
paths-ignore:
11+
- "LICENCE.txt"
12+
- "**/*.md"
13+
- ".pre-commit-config.yaml"
414

515
permissions:
616
contents: read

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Python
2+
.Python
3+
.eggs/
4+
lib64/
5+
sdist/
6+
var/
7+
__pycache__/
8+
*$py.class
9+
*.so
110
*.egg-info/
211
*.pyc
312
build/
@@ -9,3 +18,6 @@ dist/
918
.venv_django_*
1019
.coverage*
1120
coverage.*
21+
22+
# Node
23+
node_modules/

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[![Jazzband](https://jazzband.co/static/img/jazzband.svg)](https://jazzband.co/)
2+
3+
This is a [Jazzband](https://jazzband.co/) project.
4+
By contributing you agree to abide by the [Contributor Code of Conduct](https://jazzband.co/about/conduct) and follow the [guidelines](https://jazzband.co/about/guidelines).
5+
6+
## Contributing to Django Fernet Encrypted Fields
7+
8+
We welcome contributions from the community to improve and maintain Django Fernet Encrypted Fields.
9+
Please follow these guidelines to ensure your contributions are accepted:
10+
11+
1. **Fork the Repository**: Start by forking the repository to a personal/organization GitHub account.
12+
2. **Clone the Repository**: Clone the forked repository to your local machine.
13+
3. **Set Up the Environment**: Set up a virtual environment and install the necessary
14+
dependencies for development and testing.
15+
```shell
16+
$ python -m venv .venv
17+
$ source .venv/bin/activate
18+
$ pip install -r requirements.txt
19+
```
20+
4. **Install the pre-commit hooks**: We use [pre-commit](https://pre-commit.com/) to ensure code quality.
21+
Install the pre-commit hooks by running:
22+
```shell
23+
$ pre-commit install
24+
```
25+
5. **Create a Branch**: Create a new branch for the feature or bug fix.
26+
6. **Make Changes**: Make the changes and ensure they are well-documented.
27+
7. **Run Tests**: Ensure all tests pass before submitting a pull request.
28+
```shell
29+
$ pip install coverage pytest
30+
$ coverage3 run --source='./encrypted_fields' manage.py test
31+
```
32+
8. **Submit Pull Request**: Submit a pull request with a clear title, description of the changes,
33+
motivations, and any relevant issue numbers.

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ SALT_KEY = [
3939
]
4040
```
4141

42+
To generate a new `SECRET_KEY`, you can use Django's `get_random_secret_key` function.
43+
44+
```python
45+
from django.core.management.utils import get_random_secret_key
46+
47+
new_secret_key = get_random_secret_key()
48+
print(new_secret_key)
49+
```
50+
4251
#### Rotating SECRET_KEY
4352

4453
When you would want to rotate your `SECRET_KEY`, set the new value and put your old secret key value to `SECRET_KEY_FALLBACKS` list. That way the existing encrypted fields will still work, but when you re-save the field or create new record, it will be encrypted with the new secret key. (supported in Django >=4.1)
@@ -57,7 +66,8 @@ for obj in MyModel.objects.all():
5766

5867
#### Available Fields
5968

60-
Currently build in and unit-tested fields. They have the same APIs as their non-encrypted counterparts.
69+
Currently built-in and unit-tested fields include the following.
70+
They have the same APIs as their non-encrypted counterparts.
6171

6272
- `EncryptedCharField`
6373
- `EncryptedTextField`
@@ -72,11 +82,15 @@ Currently build in and unit-tested fields. They have the same APIs as their non-
7282

7383
| Compatible Django Version | Specifically tested | Python Version Required |
7484
| ------------------------- | ------------------- | ----------------------- |
75-
| `3.2` | :heavy_check_mark: | 3.8+ |
76-
| `4.0` | :heavy_check_mark: | 3.8+ |
77-
| `4.1` | :heavy_check_mark: | 3.8+ |
85+
| `3.2` | | 3.8+ |
86+
| `4.0` | | 3.8+ |
87+
| `4.1` | | 3.8+ |
7888
| `4.2` | :heavy_check_mark: | 3.8+ |
79-
| `5.0` | :heavy_check_mark: | 3.10+ |
89+
| `5.0` | | 3.10+ |
8090
| `5.1` | :heavy_check_mark: | 3.10+ |
8191
| `5.2` | :heavy_check_mark: | 3.10+ |
8292
| `6.0` | :heavy_check_mark: | 3.12+ |
93+
94+
### Contributing
95+
96+
See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this project.

0 commit comments

Comments
 (0)