Skip to content

Commit

Permalink
Merge pull request #138 from null-open-security-community/main
Browse files Browse the repository at this point in the history
update password hasher
  • Loading branch information
YogeshUpdhyay authored Oct 27, 2024
2 parents be7cee7 + 3b04b04 commit afbc80e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ jobs:
docker load -i /tmp/null_job_backend_latest.tar/null_job_backend_latest.tar
docker stop null_jobs_backend || true
docker rm null_jobs_backend || true
docker run -d --network null_jobs --env-file /home/dev@null/projects/nulljobs/backend/.env null_jobs_backend:latest python manage.py migrate
docker run -d --network null_jobs -v /home/dev@null/projects/nulljobs/backend/media:/workspace/media --env-file /home/dev@null/projects/nulljobs/backend/.env null_jobs_backend:latest python manage.py migrate
docker run -d --name null_jobs_backend --network null_jobs --restart always --env-file /home/dev@null/projects/nulljobs/backend/.env null_jobs_backend:latest python manage.py runserver 0.0.0.0:8000
rm -r /tmp/null_job_backend_latest.tar
12 changes: 6 additions & 6 deletions null_jobs_backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@
# User Model
AUTH_USER_MODEL = "accounts.User"

PASSWORD_HASHERS = [
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
]

# google auth settings
ACCOUNT_AUTHENTICATION_METHOD = "email"
ACCOUNT_EMAIL_REQUIRED = True
Expand Down Expand Up @@ -186,12 +190,8 @@
DISABLE_TOKEN_EXPIRATION = True if DEBUG else False
ENABLE_AUTHENTICATION = True
SIMPLE_JWT = {
"ACCESS_TOKEN_LIFETIME": timedelta(days=365)
if DISABLE_TOKEN_EXPIRATION
else timedelta(minutes=3),
"REFRESH_TOKEN_LIFETIME": timedelta(days=365)
if DISABLE_TOKEN_EXPIRATION
else timedelta(minutes=7),
"ACCESS_TOKEN_LIFETIME": timedelta(days=365) if DISABLE_TOKEN_EXPIRATION else timedelta(minutes=3),
"REFRESH_TOKEN_LIFETIME": timedelta(days=365) if DISABLE_TOKEN_EXPIRATION else timedelta(minutes=7),
"ROTATE_REFRESH_TOKENS": False,
"BLACKLIST_AFTER_ROTATION": False,
"CHECK_REVOKE_TOKEN": True,
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ asgiref==3.7.2
astroid==2.15.6
attrs==23.2.0
backports.zoneinfo==0.2.1
bcrypt==4.2.0
certifi==2023.7.22
cfgv==3.3.1
charset-normalizer==3.2.0
Expand Down

0 comments on commit afbc80e

Please sign in to comment.