Skip to content

Commit

Permalink
Cleanups for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshhari committed Dec 29, 2024
1 parent 4361dc2 commit 66b0a74
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion care/emr/api/otp_viewsets/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def login(self, request):
if not otp_object:
raise ValidationError({"otp": "Invalid OTP"})

# otp_object.is_used = True # TODO UNCOMMENT THIS !!
otp_object.is_used = True
otp_object.save()

token = PatientToken()
Expand Down
3 changes: 2 additions & 1 deletion care/emr/api/viewsets/resource_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
from care.emr.resources.resource_request.spec import (
ResourceRequestCommentCreateSpec,
ResourceRequestCommentListSpec,
ResourceRequestCommentRetrieveSpec,
ResourceRequestCreateSpec,
ResourceRequestListSpec,
ResourceRequestRetrieveSpec, ResourceRequestCommentRetrieveSpec,
ResourceRequestRetrieveSpec,
)


Expand Down
2 changes: 2 additions & 0 deletions care/emr/resources/resource_request/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,7 @@ def perform_extra_serialization(cls, mapping, obj):
if obj.created_by:
mapping["created_by"] = UserSpec.serialize(obj.created_by)


class ResourceRequestCommentRetrieveSpec(ResourceRequestCommentListSpec):
pass

18 changes: 12 additions & 6 deletions care/utils/sms/send_sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ def send_sms(phone_numbers, message, many=False):
if settings.DEBUG:
logger.error("Invalid Phone Number %s", phone)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
continue
client = boto3.client(
"sns",
aws_access_key_id=settings.SNS_ACCESS_KEY,
aws_secret_access_key=settings.SNS_SECRET_KEY,
region_name=settings.SNS_REGION,
)
if settings.SNS_ROLE_BASED_MODE:
client = boto3.client(
"sns",
region_name=settings.SNS_REGION,
)
else:
client = boto3.client(
"sns",
aws_access_key_id=settings.SNS_ACCESS_KEY,
aws_secret_access_key=settings.SNS_SECRET_KEY,
region_name=settings.SNS_REGION,
)
client.publish(PhoneNumber=phone, Message=message)
return True
1 change: 1 addition & 0 deletions config/settings/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
SNS_ACCESS_KEY = env("SNS_ACCESS_KEY", default="")
SNS_SECRET_KEY = env("SNS_SECRET_KEY", default="")
SNS_REGION = env("SNS_REGION", default="ap-south-1")
SNS_ROLE_BASED_MODE = env.bool("SNS_ROLE_BASED_MODE", default=False)

# open id connect
JWKS = JsonWebKey.import_key_set(
Expand Down

0 comments on commit 66b0a74

Please sign in to comment.