odc-client icon indicating copy to clipboard operation
odc-client copied to clipboard

Ai sensitive web

Open fenyf opened this issue 2 months ago • 1 comments

What type of PR is this?

type-feature module-datasecurity

What this PR does / why we need it:

This PR implements the front-end components and logic for the new AI-based sensitive column identification feature. It provides users with an intuitive interface to configure, trigger, and view the results of AI-powered scans, working in conjunction with the back-end services.

Implementation Overview

  • Updated Scan Interface: The sensitive column scanning page has been updated to support a new "AI-Enhanced" mode, allowing users to select both traditional and AI-based rules.
  • Dynamic UI State: The "AI-Enhanced" option and AI rule selections are dynamically enabled or disabled based on the server's AI configuration status, which is checked on page load.
  • Passive Scan Indicators: A new, non-intrusive status component has been created to display the status of passive scans. It shows a "Scanning..." message, followed by the scan result (e.g., "Found 3 sensitive columns") in two key locations:
    1. When viewing a table's structure.
    2. Above the results grid after executing a SQL query.
  • Client-Side Caching: Implemented a multi-level client-side caching strategy (in-memory for 5 mins, localStorage for 24 hours) to store scan results. This significantly improves performance on repeated views of the same table and reduces redundant API calls.

Which issue(s) this PR fixes:

Fixes #73

Special notes for your reviewer:

Testing Suggestions

  • 1. Dynamic Configuration: Please test the UI with the backend AI service configured correctly and incorrectly. Verify that the "AI-Enhanced" mode in the scan settings becomes available/unavailable as expected.
  • 2. Passive Scan Flow: The core user experience to check is the passive scanning. Please:
    • Navigate to a table's structure page and confirm the "Scanning..." -> "Result" flow in the top-right.
    • Execute a SELECT query and observe the same status flow above the results panel.
  • 3. Caching Logic: This is a key non-functional requirement. Please use the browser's Developer Tools to verify the caching behavior:
    • First visit: A network request to the scan API should be visible.
    • Navigate away and back (within 5 mins): The result should load instantly from memory with no new network request.
    • Refresh the page (or visit after 5 mins): The result should still load instantly from localStorage, again with no new network request.

fenyf avatar Sep 17 '25 08:09 fenyf

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 17 '25 08:09 CLAassistant