Skip to content

Commit

Permalink
Merge branch 'main' into DESENG-605-TenantCRUDMain
Browse files Browse the repository at this point in the history
  • Loading branch information
NatSquared authored May 23, 2024
2 parents 8e2e038 + 4993462 commit 3d4486b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
- Reworked image upload component to match the design system
- Added new form components that align with the design system

- **Bugfix** Security issue with email verification [🎟️ DESENG-618](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-618)
- Removed verification token from the response object
- Updated the test to reflect the change

- **Bugfix** Add try catch block around snowplow call [🎟️ DESENG-621](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-621)
- Added a try catch block to all snowplow calls

Expand Down
7 changes: 4 additions & 3 deletions met-api/src/met_api/services/email_verification_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ def create(cls, email_verification: EmailVerificationSchema,

email_verification['created_by'] = email_verification.get(
'participant_id')
email_verification['verification_token'] = uuid.uuid4()
EmailVerification.create(email_verification, session)
verification_token = uuid.uuid4()
EmailVerification.create({**email_verification, 'verification_token': verification_token}, session)

# TODO: remove this once email logic is brought over from submission service to here
if email_verification.get('type', None) != EmailVerificationType.RejectedComment:
cls._send_verification_email(email_verification, subscription_type)
cls._send_verification_email(
{**email_verification, 'verification_token': verification_token}, subscription_type)

return email_verification

Expand Down
7 changes: 0 additions & 7 deletions met-api/tests/unit/api/test_email_verification_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,6 @@ def test_post_subscription_email_verification(client, jwt, session, notify_mock,
headers=headers, content_type=ContentType.JSON.value)

assert rv.status_code == 200
verification_token = rv.json.get('verification_token')

rv = client.get(f'/api/email_verification/{verification_token}',
headers=headers, content_type=ContentType.JSON.value)

assert rv.status_code == 200
assert rv.json.get('type') == EmailVerificationType.Subscribe

with patch.object(EmailVerificationService, 'create', side_effect=side_effect):
rv = client.post(f'/api/email_verification/{SubscriptionTypes.PROJECT.value}/subscribe',
Expand Down

0 comments on commit 3d4486b

Please sign in to comment.