Skip to content
Closed

ssds #4833

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ def functional_test_fixtures():
SQLALCHEMY_DATABASE_URI
REDIS_URL
SECRET_KEY
TOKEN_SECRET_KEY
INTERNAL_CLIENT_API_KEYS
ADMIN_BASE_URL
API_HOST_NAME
Expand Down
2 changes: 2 additions & 0 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class Config:

# encyption secret/salt
SECRET_KEY = os.getenv("SECRET_KEY")
TOKEN_SECRET_KEY = os.getenv("TOKEN_SECRET_KEY")
DANGEROUS_SALT = os.getenv("DANGEROUS_SALT")

# DB conection string
Expand Down Expand Up @@ -614,6 +615,7 @@ class Development(Config):
}

SECRET_KEY = "dev-notify-secret-key"
TOKEN_SECRET_KEY = "5YNWU0e_pN5ZyaSZvBd5uZb_sZlrVDFeOjiea6dq4zQ="
DANGEROUS_SALT = "dev-notify-salt"

MMG_INBOUND_SMS_AUTH = ["testkey"]
Expand Down
6 changes: 5 additions & 1 deletion app/one_click_unsubscribe/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def one_click_unsubscribe(notification_id, token):

try:
email_address = check_token(
token, current_app.config["SECRET_KEY"], current_app.config["DANGEROUS_SALT"], max_age_seconds
token,
current_app.config["SECRET_KEY"],
current_app.config["DANGEROUS_SALT"],
max_age_seconds,
current_app.config["TOKEN_SECRET_KEY"],
)
except BadData as e:
errors = {"unsubscribe request": "This is not a valid unsubscribe link."}
Expand Down
6 changes: 5 additions & 1 deletion app/organisation/invite_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ def validate_invitation_token(token):

try:
invited_user_id = check_token(
token, current_app.config["SECRET_KEY"], current_app.config["DANGEROUS_SALT"], max_age_seconds
token,
current_app.config["SECRET_KEY"],
current_app.config["DANGEROUS_SALT"],
max_age_seconds,
current_app.config["TOKEN_SECRET_KEY"],
)
except SignatureExpired as e:
errors = {
Expand Down
6 changes: 5 additions & 1 deletion app/service_invite/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ def validate_service_invitation_token(token):

try:
invited_user_id = check_token(
token, current_app.config["SECRET_KEY"], current_app.config["DANGEROUS_SALT"], max_age_seconds
token,
current_app.config["SECRET_KEY"],
current_app.config["DANGEROUS_SALT"],
max_age_seconds,
current_app.config["TOKEN_SECRET_KEY"],
)
except SignatureExpired as e:
errors = {
Expand Down
6 changes: 0 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ case "$1" in
api-worker-jobs-save-documents)
exec $COMMON_CMD database-tasks-documents
;;
api-worker-jobs-save)
exec $COMMON_CMD database-tasks,job-tasks
;;
api-worker-jobs-save-documents)
exec $COMMON_CMD database-tasks,job-tasks
;;
api-worker-research)
exec $COMMON_CMD research-mode-tasks
;;
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ kombu @ git+https://github.com/celery/kombu.git@860e40a6c904c4d8551577d9f4e8c00f

Flask-Bcrypt~=1.0
flask-marshmallow~=1.4
Flask-Migrate~=3.1
Flask-Migrate~=4.1
flask-sqlalchemy~=3.1
click-datetime~=0.2
gunicorn[eventlet]~=25.1
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ flask-bcrypt==1.0.1
# via -r requirements.in
flask-marshmallow==1.4.0
# via -r requirements.in
flask-migrate==3.1.0
flask-migrate==4.1.0
# via -r requirements.in
flask-redis==0.4.0
# via notifications-utils
Expand Down
2 changes: 1 addition & 1 deletion requirements_for_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ flask-bcrypt==1.0.1
# via -r requirements.txt
flask-marshmallow==1.4.0
# via -r requirements.txt
flask-migrate==3.1.0
flask-migrate==4.1.0
# via -r requirements.txt
flask-redis==0.4.0
# via
Expand Down
Loading