[PR #15] [MERGED] Add Global Allowlist for Safe IPs/Domains #19

Closed
opened 2026-03-02 11:45:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/karant-dev/AutoRedact/pull/15
Author: @Copilot
Created: 12/12/2025
Status: Merged
Merged: 12/12/2025
Merged by: @karant-dev

Base: mainHead: copilot/add-safe-values-allowlist


📝 Commits (4)

  • f35146b Initial plan
  • db23420 Add Global Allowlist feature for safe IPs/domains
  • 51f8481 Address code review feedback: improve accessibility and remove 0.0.0.0 from defaults
  • ff9e2be Make remove buttons visible on mobile/touch devices

📊 Changes

8 files changed (+231 additions, -27 deletions)

View changed files

📝 src/App.tsx (+8 -2)
📝 src/components/Header.tsx (+17 -2)
📝 src/components/SettingsDropdown.tsx (+110 -5)
📝 src/constants/config.ts (+17 -0)
📝 src/hooks/useDetectionSettings.ts (+28 -0)
📝 src/hooks/useOCR.ts (+15 -7)
📝 src/types/index.ts (+1 -0)
📝 src/utils/ocr.ts (+35 -11)

📄 Description

  • Add allowlist to DetectionSettings type with default safe values (127.0.0.1, localhost, local IP ranges, public DNS like 8.8.8.8, etc.)
  • Update useDetectionSettings hook to manage allowlist state (add/remove entries, persist to localStorage)
  • Create allowlist filtering utility function for case-insensitive matching
  • Integrate allowlist filtering into useOCR hook (filter detected matches)
  • Integrate allowlist filtering into processImageForBatch function
  • Update SettingsDropdown component to include allowlist UI (display, add, remove entries)
  • Verify implementation by running the app and testing
  • Run code review and CodeQL security checks
  • Fix mobile/touch device support for remove buttons

Screenshots

Desktop

Desktop Allowlist UI

Mobile

Mobile Allowlist UI

Security Summary

No security vulnerabilities were found by CodeQL analysis.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feat]: Global Allowlist (Safe IPs/Domains)</issue_title>
<issue_description>### Is your feature request related to a problem?
AutoRedact keeps redacting my localhost IPs (127.0.0.1) and public DNS (8.8.8.8) which are safe to share.

Describe the solution you'd like

Add a "Safe Values" list in Settings.

  • Logic: If detected_text is in allow_list, skip redaction.
  • Have an opinionated default like safe IPs (ex: 127.0.0.1, localhost, local IP range, etc), but user can add more.

Describe alternatives you've considered

Deleting the redaction box manually every time.

Additional context

Should support exact strings (case-insensitive).</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/karant-dev/AutoRedact/pull/15 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 12/12/2025 **Status:** ✅ Merged **Merged:** 12/12/2025 **Merged by:** [@karant-dev](https://github.com/karant-dev) **Base:** `main` ← **Head:** `copilot/add-safe-values-allowlist` --- ### 📝 Commits (4) - [`f35146b`](https://github.com/karant-dev/AutoRedact/commit/f35146b29488b5a8ab826de3b8d6af22eb5bee04) Initial plan - [`db23420`](https://github.com/karant-dev/AutoRedact/commit/db23420297eab09bb9987b40a76b8f51c5b224d5) Add Global Allowlist feature for safe IPs/domains - [`51f8481`](https://github.com/karant-dev/AutoRedact/commit/51f8481f671f61a0dee1bf86f19b7945556c961a) Address code review feedback: improve accessibility and remove 0.0.0.0 from defaults - [`ff9e2be`](https://github.com/karant-dev/AutoRedact/commit/ff9e2bea7e3ae66de6870d0e591f2a3268671ec9) Make remove buttons visible on mobile/touch devices ### 📊 Changes **8 files changed** (+231 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `src/App.tsx` (+8 -2) 📝 `src/components/Header.tsx` (+17 -2) 📝 `src/components/SettingsDropdown.tsx` (+110 -5) 📝 `src/constants/config.ts` (+17 -0) 📝 `src/hooks/useDetectionSettings.ts` (+28 -0) 📝 `src/hooks/useOCR.ts` (+15 -7) 📝 `src/types/index.ts` (+1 -0) 📝 `src/utils/ocr.ts` (+35 -11) </details> ### 📄 Description - [x] Add `allowlist` to `DetectionSettings` type with default safe values (127.0.0.1, localhost, local IP ranges, public DNS like 8.8.8.8, etc.) - [x] Update `useDetectionSettings` hook to manage allowlist state (add/remove entries, persist to localStorage) - [x] Create allowlist filtering utility function for case-insensitive matching - [x] Integrate allowlist filtering into `useOCR` hook (filter detected matches) - [x] Integrate allowlist filtering into `processImageForBatch` function - [x] Update `SettingsDropdown` component to include allowlist UI (display, add, remove entries) - [x] Verify implementation by running the app and testing - [x] Run code review and CodeQL security checks - [x] Fix mobile/touch device support for remove buttons ## Screenshots ### Desktop ![Desktop Allowlist UI](https://github.com/user-attachments/assets/b2e534c9-6d3a-4d2b-8014-20611e5fa586) ### Mobile ![Mobile Allowlist UI](https://github.com/user-attachments/assets/772d1e69-fdb6-4946-9f54-8b24895a4d1a) ## Security Summary No security vulnerabilities were found by CodeQL analysis. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[Feat]: Global Allowlist (Safe IPs/Domains)</issue_title> > <issue_description>### Is your feature request related to a problem? > AutoRedact keeps redacting my localhost IPs (127.0.0.1) and public DNS (8.8.8.8) which are safe to share. > > ### Describe the solution you'd like > Add a "Safe Values" list in Settings. > - Logic: If detected_text is in allow_list, skip redaction. > - Have an opinionated default like safe IPs (ex: 127.0.0.1, localhost, local IP range, etc), but user can add more. > > ### Describe alternatives you've considered > Deleting the redaction box manually every time. > > ### Additional context > Should support exact strings (case-insensitive).</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes karant-dev/AutoRedact#11 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 11:45:02 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AutoRedact#19
No description provided.