odc-client
odc-client copied to clipboard
Ai sensitive web
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:
- When viewing a table's structure.
- Above the results grid after executing a SQL query.
- Client-Side Caching: Implemented a multi-level client-side caching strategy (
in-memoryfor 5 mins,localStoragefor 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
SELECTquery 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.