Skip to content

Conversation

@dcshzj
Copy link
Contributor

@dcshzj dcshzj commented Jul 22, 2025

Problem

What problem are you trying to solve? What issue does this close?

We need to support the caching of the safe browsing scan results for at least 24 hours.

Solution

How did you solve the problem?

Features:

  • Add a new safeBrowsingExpiry column to the urls table to support storing of the safe browsing scan result's expiry date.
    • This date represents the time in which no further safe browsing scanning is required.
    • The duration will be decided later by the producer of this information, so there is flexibility in determining when a scan result expires.

Tests

What tests should be run to confirm functionality?

  • Run the DB migration to add the safeBrowsingExpiry column. Verify that the new column appears in the urls table.
  • Create a new link, verify that link creation still works as intended.
  • Edit the new link you have created, verify that link editing still works as intended.

Deploy Notes

Notes regarding deployment of the contained body of work. These should note any
new dependencies, new scripts, etc.

  • Run DB migration to add the safeBrowsingExpiry column.

@dcshzj dcshzj requested a review from a team July 22, 2025 02:05
@dcshzj dcshzj force-pushed the feat/add-safebrowsing-expiry branch from 97d9c8d to c005a60 Compare July 22, 2025 02:36
@dcshzj dcshzj force-pushed the feat/add-safebrowsing-expiry branch from c005a60 to 948c2c8 Compare July 22, 2025 02:50
Copy link
Collaborator

@seaerchin seaerchin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 comment, could we also run this on staging (technically edge) to ensure that it's working properly?

i think might be hard to check manually so there's some value in having unit tests here to make sure that we rescan past 24 hours

@dcshzj dcshzj requested a review from seaerchin August 14, 2025 07:44
@dcshzj dcshzj merged commit 6b13e7f into develop Aug 20, 2025
16 checks passed
dcshzj added a commit that referenced this pull request Aug 20, 2025
* Merge pull request #2402 from opengovsg/feat/add-safebrowsing-expiry

feat: add safeBrowsingExpiry column to urls table

* feat: check for malicious link just before redirect (#2403)

* feat: check for malicious link just before redirect

* fix: do not update as JSON object yet

* fix: update method signature

* 1.83.0
@seaerchin seaerchin mentioned this pull request Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants