-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
930 lines (907 loc) · 35.7 KB
/
index.html
File metadata and controls
930 lines (907 loc) · 35.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Redactor</title>
<meta
name="description"
content="Redactor is a browser-based utility that redacts sensitive data across JSON, HTTP requests, configs, and more so you can safely share payloads while keeping structure intact."
/>
<meta
name="keywords"
content="redact data, payload sanitizer, PII redaction, JSON redactor, API request redaction, configuration redaction, privacy tooling"
/>
<link rel="canonical" href="https://redactor.sh" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Redactor – Share payloads safely" />
<meta
property="og:description"
content="Paste any request, response, or config and get a structure-preserving, redacted version ready to share with teammates or AI assistants."
/>
<meta property="og:url" content="https://redactor.sh" />
<meta property="og:image" content="https://redactor.sh/src/images/logo.png" />
<meta property="og:image:alt" content="Redactor logo" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Redactor – Share payloads safely" />
<meta
name="twitter:description"
content="Browser-based redaction utility that keeps sensitive details private while preserving payload structure."
/>
<meta name="twitter:image" content="https://redactor.sh/src/images/logo.png" />
<meta name="twitter:image:alt" content="Redactor logo" />
<link rel="icon" href="src/images/icon.ico" />
<!-- CodeMirror CSS -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.css"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/theme/material-darker.min.css"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/theme/eclipse.min.css"
/>
<link rel="stylesheet" href="src/css/styles.css" />
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
darkMode: "class",
};
</script>
<script src="src/js/ui.js"></script>
</head>
<body
class="bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-200 font-sans h-screen flex flex-col transition-colors duration-300 pb-8 md:pb-0 md:overflow-hidden"
>
<!-- Tab Bar -->
<div
id="tab-bar"
class="flex items-center bg-gray-100 dark:bg-gray-900 px-2 select-none border-b border-gray-300 dark:border-gray-700"
>
<button
id="scroll-left-button"
class="hidden p-1 text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md transition-colors duration-150"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="15 18 9 12 15 6"></polyline>
</svg>
</button>
<div id="tabs-wrapper" class="flex-grow overflow-hidden">
<div
id="tabs-container"
class="flex items-end overflow-x-auto scroll-smooth"
>
<!-- Tabs and the add button will be dynamically inserted here -->
</div>
</div>
<button
id="scroll-right-button"
class="hidden p-1 text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md transition-colors duration-150"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</button>
<div class="flex items-center space-x-2 ml-4">
<button
id="theme-toggle-button"
title="Toggle theme"
class="p-1 text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md transition-colors duration-150"
type="button"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</button>
<button
id="settings-button"
title="Redaction Settings"
class="p-1 text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md transition-colors duration-150"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="3"></circle>
<path
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
></path>
</svg>
</button>
</div>
</div>
<div
id="container"
class="flex-grow flex flex-col md:flex-row w-full overflow-x-hidden overflow-y-auto md:overflow-hidden px-4 pt-4 gap-4 md:gap-0 md:min-h-0"
>
<!-- Input Panel -->
<div
id="left-panel"
class="flex flex-col w-full md:w-1/2 h-auto md:h-full p-2 md:min-h-0"
>
<div class="flex justify-between items-center mb-2">
<div class="flex items-center space-x-3">
<label class="text-lg font-semibold">Original Data</label>
<span
id="detected-format"
class="text-sm bg-gray-200 dark:bg-gray-700 px-2 py-1 rounded cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500"
role="button"
tabindex="0"
title="Click to adjust settings for this format"
></span>
</div>
<div class="flex items-center space-x-2 relative">
<button
id="open-file-button"
class="text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white p-1 rounded-md transition-colors duration-150"
title="Open data from examples or your device"
type="button"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5l2 2h9a2 2 0 0 1 2 2z"
></path>
<line x1="12" y1="11" x2="12" y2="17"></line>
<line x1="9" y1="14" x2="15" y2="14"></line>
</svg>
</button>
<button
id="clear-input-button"
class="text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white p-1 rounded-md transition-colors duration-150"
title="Clear input editor"
type="button"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="3 6 5 6 21 6"></polyline>
<path
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
></path>
<line x1="10" y1="11" x2="10" y2="17"></line>
<line x1="14" y1="11" x2="14" y2="17"></line>
</svg>
</button>
<div
id="open-file-menu"
class="hidden absolute top-8 right-0 z-30 w-72 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg"
>
<div
class="px-4 py-2 border-b border-gray-200 dark:border-gray-700"
>
<p
class="text-sm font-semibold text-gray-700 dark:text-gray-200"
>
Load Data
</p>
<p class="text-xs text-gray-500 dark:text-gray-400">
Pick from bundled examples or upload your own file.
</p>
</div>
<div
id="example-files-list"
class="max-h-60 overflow-y-auto divide-y divide-gray-100 dark:divide-gray-700"
></div>
<button
id="choose-local-file-button"
class="w-full text-left px-4 py-3 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-gray-700 transition-colors duration-150"
type="button"
>
Upload from your device...
</button>
</div>
</div>
</div>
<div
id="input-editor-wrapper"
class="relative flex-grow overflow-hidden rounded-2xl my-1 editor-frame"
>
<div id="input-editor" class="h-full w-full"></div>
<div
id="input-drop-overlay"
class="hidden pointer-events-none absolute inset-0 z-10 flex flex-col items-center justify-center rounded-2xl bg-blue-600/10 text-blue-800 dark:text-blue-100 text-sm font-medium tracking-wide"
aria-hidden="true"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="32"
height="32"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="mb-2"
>
<path d="M21 15a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2"></path>
<path d="M7 10l5-5 5 5M12 5v12"></path>
</svg>
Drop file to load
</div>
<div
id="input-loading-overlay"
class="hidden absolute inset-0 z-20 flex items-center justify-center bg-white/80 dark:bg-gray-900/70"
aria-live="polite"
aria-busy="false"
>
<div class="loading-spinner" aria-hidden="true"></div>
<span class="sr-only">Loading sample data…</span>
</div>
</div>
</div>
<div
id="mobile-redact-button-slot"
class="flex md:hidden w-full px-2 pb-2 justify-center"
></div>
<div
id="splitter"
class="splitter bg-gray-300 dark:bg-gray-600 md:h-full md:mx-4 hidden md:block"
></div>
<!-- Output Panel -->
<div
id="right-panel"
class="flex flex-col w-full md:w-1/2 h-auto md:h-full p-2 md:min-h-0"
>
<div class="flex items-center justify-between mb-2">
<label class="text-lg font-semibold">Redacted Data</label>
<div class="flex items-center space-x-2">
<button
id="copy-button"
title="Copy to clipboard"
class="text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-150 p-1 rounded-md"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path
d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"
></path>
</svg>
</button>
<button
id="save-button"
title="Save to file"
type="button"
class="text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-150 p-1 rounded-md"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M21 19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5Z"
></path>
<path d="M17 21v-8H7v8"></path>
<path d="M7 3v5h8"></path>
</svg>
</button>
<button
id="bulk-save-button"
title="Generate bulk redactions"
type="button"
class="text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-150 p-1 rounded-md"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect x="3" y="3" width="7" height="7"></rect>
<rect x="14" y="3" width="7" height="7"></rect>
<rect x="14" y="14" width="7" height="7"></rect>
<rect x="3" y="14" width="7" height="7"></rect>
</svg>
</button>
</div>
</div>
<div
id="output-editor"
class="flex-grow overflow-hidden rounded-2xl my-1 editor-frame"
></div>
</div>
<div id="footer" class="w-full px-2 pb-4 md:hidden text-xs">
<div
class="flex flex-wrap gap-3 items-center bg-white/80 dark:bg-gray-900/80 backdrop-blur px-3 py-1.5 rounded-full shadow border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-300"
>
<span class="font-semibold text-gray-700 dark:text-gray-100"
>Found a bug?</span
>
<a
href="https://github.com/RefactorSecurity/redactor/issues"
target="_blank"
class="text-blue-600 hover:text-blue-500 dark:text-blue-400 dark:hover:text-blue-300 font-medium"
>Open an issue</a
>
<span class="text-gray-400 dark:text-gray-500">•</span>
<span>
Powered by
<a
href="https://refactorsecurity.com"
target="_blank"
class="underline hover:text-blue-500 dark:hover:text-blue-400"
>Refactor Security</a
>
</span>
</div>
</div>
</div>
<input type="file" id="local-file-input" class="hidden" />
<div
id="bulk-save-modal"
class="hidden fixed inset-0 z-40 flex items-center justify-center bg-black bg-opacity-50 px-4"
>
<div
class="bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-md p-6 space-y-4"
>
<div>
<h3 class="text-xl font-semibold text-gray-900 dark:text-gray-100">
Bulk Redaction
</h3>
<p class="text-sm text-gray-600 dark:text-gray-400 mt-1">
Enter how many unique redacted files you would like to generate.
</p>
</div>
<div>
<label
for="bulk-save-count"
class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"
>Number of files</label
>
<input
type="number"
id="bulk-save-count"
min="1"
max="50"
value="5"
class="w-full p-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-blue-500 focus:outline-none"
/>
<p
id="bulk-save-status"
class="text-xs text-gray-500 dark:text-gray-400 mt-2 h-4"
></p>
</div>
<div class="flex justify-end space-x-3">
<button
id="bulk-save-cancel"
type="button"
class="px-4 py-2 rounded-md border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-150"
>
Cancel
</button>
<button
id="bulk-save-confirm"
type="button"
class="px-4 py-2 rounded-md bg-blue-600 text-white hover:bg-blue-700 transition-colors duration-150"
>
Generate ZIP
</button>
</div>
</div>
</div>
<!-- File Import Confirmation Modal -->
<div
id="file-confirmation-modal"
class="hidden fixed inset-0 z-40 flex items-center justify-center bg-black bg-opacity-50 px-4"
role="dialog"
aria-modal="true"
>
<div
class="bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-lg p-6 space-y-4 border border-gray-200 dark:border-gray-700"
>
<div class="flex items-start justify-between">
<div>
<h3 class="text-xl font-semibold text-gray-900 dark:text-gray-100">
Review file before importing
</h3>
<p
id="file-confirmation-message"
class="text-sm text-gray-600 dark:text-gray-300 mt-1"
></p>
</div>
<button
id="file-confirmation-close"
type="button"
class="text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white text-2xl leading-none"
aria-label="Close"
>
×
</button>
</div>
<div class="space-y-2 text-sm text-gray-700 dark:text-gray-200">
<div>
File:
<span id="file-confirmation-file-name" class="font-semibold"></span>
</div>
<ul
id="file-confirmation-warnings"
class="list-disc pl-5 space-y-1"
></ul>
</div>
<div class="flex justify-end space-x-3 pt-2">
<button
id="file-confirmation-cancel"
type="button"
class="px-4 py-2 rounded-md border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-150"
>
Cancel
</button>
<button
id="file-confirmation-confirm"
type="button"
class="px-4 py-2 rounded-md bg-blue-600 text-white hover:bg-blue-700 transition-colors duration-150"
>
Import anyway
</button>
</div>
</div>
</div>
<div
id="desktop-redact-button-slot"
class="hidden md:flex justify-end px-6 py-4 flex-shrink-0"
>
<button
id="redact-button"
class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded-lg text-lg transition duration-200 w-full md:w-auto text-center"
>
Redact
</button>
</div>
<div
id="footer-desktop"
class="hidden md:flex justify-end w-full px-6 pb-6 text-xs flex-shrink-0"
>
<div
class="flex gap-3 items-center bg-white/80 dark:bg-gray-900/80 backdrop-blur px-3 py-1.5 rounded-full shadow border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-300"
>
<span class="font-semibold text-gray-700 dark:text-gray-100"
>Found a bug?</span
>
<a
href="https://github.com/RefactorSecurity/redactor/issues"
target="_blank"
class="text-blue-600 hover:text-blue-500 dark:text-blue-400 dark:hover:text-blue-300 font-medium"
>Open an issue</a
>
<span class="text-gray-400 dark:text-gray-500">•</span>
<span>
Powered by
<a
href="https://refactorsecurity.com"
target="_blank"
class="underline hover:text-blue-500 dark:hover:text-blue-400"
>Refactor Security</a
>
</span>
</div>
</div>
<!-- Error Toast -->
<div
id="error-toast"
class="hidden fixed bottom-5 right-5 bg-red-600 text-white py-2 px-4 rounded-lg shadow-lg"
>
<span id="error-message"></span>
</div>
<!-- Settings Modal -->
<div
id="settings-modal"
class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"
>
<div
class="bg-white dark:bg-gray-800 rounded-lg shadow-xl p-6 border border-gray-300 dark:border-gray-700 w-[720px] max-w-[720px] h-[600px] max-h-[600px] flex flex-col"
>
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-bold">Settings</h2>
<button
id="close-settings-button"
class="text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white text-3xl font-light"
>
×
</button>
</div>
<div class="space-y-6 flex-1 overflow-hidden flex flex-col">
<div
class="settings-tabs border-b border-gray-300 dark:border-gray-700 pb-3"
>
<button
type="button"
class="settings-tab-button active"
data-settings-tab="general"
>
General
</button>
<button
type="button"
class="settings-tab-button"
data-settings-tab="json"
>
JSON
</button>
<button
type="button"
class="settings-tab-button"
data-settings-tab="csv"
>
CSV
</button>
<button
type="button"
class="settings-tab-button"
data-settings-tab="http"
>
HTTP
</button>
<button
type="button"
class="settings-tab-button"
data-settings-tab="ui"
>
UI
</button>
</div>
<div
data-settings-panel="general"
class="settings-panel active space-y-6 flex-1 overflow-auto pr-2"
>
<div class="space-y-3 pl-2">
<div>
<label
for="setting-ignored-words"
class="block mb-2 text-sm font-medium"
>Ignored Words (comma-separated)</label
>
<textarea
id="setting-ignored-words"
rows="3"
class="w-full p-2 bg-gray-200 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-2 focus:ring-blue-500 focus:outline-none text-sm"
placeholder="e.g. Bearer, token, secret"
></textarea>
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Case-insensitive terms that remain untouched even in
plain-text redaction.
</p>
</div>
<div>
<label
for="setting-protected-fields"
class="block mb-2 text-sm font-medium"
>Protected Fields (comma-separated)</label
>
<textarea
id="setting-protected-fields"
rows="3"
class="w-full p-2 bg-gray-200 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-2 focus:ring-blue-500 focus:outline-none text-sm"
placeholder="e.g. request_id, email, correlationId"
></textarea>
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Schema keys in JSON/YAML/XML that stay verbatim. For CSV, use
column names from the header, or <code>column1</code>,
<code>column2</code>, etc. for headerless CSVs.
</p>
</div>
</div>
</div>
<div
data-settings-panel="json"
class="settings-panel space-y-6 flex-1 overflow-auto pr-2"
>
<div class="space-y-3 pl-2">
<p class="text-sm text-gray-600 dark:text-gray-400">
Control how JSON payloads are presented before redaction.
</p>
<label class="flex items-start cursor-pointer">
<input
type="checkbox"
id="setting-json-sort-keys"
class="mt-1 bg-gray-300 dark:bg-gray-600"
/>
<span class="ml-3">
<span class="block text-sm font-medium"
>Sort keys alphabetically</span
>
<span class="block text-xs text-gray-500 dark:text-gray-400">
When enabled, JSON objects are re-ordered A→Z prior to
display. Leave unchecked to preserve the original key order.
</span>
</span>
</label>
</div>
</div>
<div
data-settings-panel="csv"
class="settings-panel space-y-6 flex-1 overflow-auto pr-2"
>
<div class="space-y-4 pl-2">
<p class="text-sm text-gray-600 dark:text-gray-400">
Tell Redactor how to interpret CSV uploads so headers stay
untouched while data rows are anonymized correctly.
</p>
<div class="space-y-3">
<label class="flex items-start cursor-pointer">
<input
type="radio"
name="setting-csv-header-mode"
id="setting-csv-with-header"
class="mt-1 bg-gray-300 dark:bg-gray-600"
checked
/>
<span class="ml-3">
<span class="block text-sm font-medium"
>First row contains column titles</span
>
<span
class="block text-xs text-gray-500 dark:text-gray-400"
>
Leaves the header row intact and uses the titles for
protected-field matching.
</span>
</span>
</label>
<label class="flex items-start cursor-pointer">
<input
type="radio"
name="setting-csv-header-mode"
id="setting-csv-no-header"
class="mt-1 bg-gray-300 dark:bg-gray-600"
/>
<span class="ml-3">
<span class="block text-sm font-medium"
>Treat first row as data</span
>
<span
class="block text-xs text-gray-500 dark:text-gray-400"
>
Redacts every row the same way—perfect for files that omit
column headers.
</span>
</span>
</label>
</div>
</div>
</div>
<div
data-settings-panel="http"
class="settings-panel space-y-6 flex-1 overflow-auto pr-2"
>
<div class="space-y-3 pl-2">
<div>
<label class="flex items-center cursor-pointer">
<input
type="checkbox"
id="setting-redact-url-path"
class="bg-gray-300 dark:bg-gray-600"
/>
<span class="ml-3">Redact URL path</span>
</label>
<p class="text-xs text-gray-500 dark:text-gray-400 ml-8 mt-1">
Scrubs path segments (e.g., <code>/tenant/123</code>) that may
contain IDs.
</p>
</div>
<div>
<label class="flex items-center cursor-pointer">
<input
type="checkbox"
id="setting-redact-host"
class="bg-gray-300 dark:bg-gray-600"
checked
/>
<span class="ml-3">Redact Host header</span>
</label>
<p class="text-xs text-gray-500 dark:text-gray-400 ml-8 mt-1">
Replaces hostnames so internal domains never leave the page.
</p>
</div>
<div>
<label class="flex items-center cursor-pointer">
<input
type="checkbox"
id="setting-redact-query-string"
class="bg-gray-300 dark:bg-gray-600"
checked
/>
<span class="ml-3">Redact query string values</span>
</label>
<p class="text-xs text-gray-500 dark:text-gray-400 ml-8 mt-1">
Keeps parameter names visible while anonymizing their values.
</p>
</div>
<div>
<label class="flex items-center cursor-pointer">
<input
type="checkbox"
id="setting-redact-param-names"
class="bg-gray-300 dark:bg-gray-600"
/>
<span class="ml-3">Redact parameter names</span>
</label>
<p class="text-xs text-gray-500 dark:text-gray-400 ml-8 mt-1">
Renames query or form keys when even the field names are
sensitive.
</p>
</div>
<div>
<label class="flex items-center cursor-pointer">
<input
type="checkbox"
id="setting-redact-cookies"
class="bg-gray-300 dark:bg-gray-600"
checked
/>
<span class="ml-3"
>Redact cookie/auth values (preserves names)</span
>
</label>
<p class="text-xs text-gray-500 dark:text-gray-400 ml-8 mt-1">
Masks cookie/auth header values but keeps cookie names intact.
</p>
</div>
<div>
<label class="flex items-center cursor-pointer">
<input
type="checkbox"
id="setting-redact-csrf"
class="bg-gray-300 dark:bg-gray-600"
checked
/>
<span class="ml-3">Redact CSRF tokens</span>
</label>
<p class="text-xs text-gray-500 dark:text-gray-400 ml-8 mt-1">
Neutralizes common CSRF headers/form fields so tokens never
leak.
</p>
</div>
</div>
</div>
<div
data-settings-panel="ui"
class="settings-panel space-y-6 flex-1 overflow-auto pr-2"
>
<div class="space-y-3 pl-2">
<label class="flex items-center cursor-pointer">
<input
type="checkbox"
id="setting-dark-theme"
class="bg-gray-300 dark:bg-gray-600"
/>
<span class="ml-3">Use Dark Theme</span>
</label>
<label class="flex items-center cursor-pointer">
<input
type="checkbox"
id="setting-syntax-highlight"
class="bg-gray-300 dark:bg-gray-600"
checked
/>
<span class="ml-3">Enable Syntax Highlighting</span>
</label>
</div>
</div>
<div
class="flex items-center justify-end space-x-3 pt-4 border-t border-gray-200 dark:border-gray-700"
>
<span
id="settings-unsaved-indicator"
class="hidden text-xs font-medium text-blue-600 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/30 px-3 py-1 rounded-full"
>
Unsaved changes
</span>
<button
id="settings-cancel-button"
type="button"
class="px-4 py-2 rounded-md border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-150"
>
Cancel
</button>
<button
id="settings-save-button"
type="button"
class="px-4 py-2 rounded-md bg-blue-600 text-white hover:bg-blue-700 transition-colors duration-150"
>
Save
</button>
</div>
</div>
</div>
</div>
<!-- CodeMirror Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/javascript/javascript.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/xml/xml.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/http/http.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/yaml/yaml.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/display/placeholder.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/mode/simple.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="src/js/redaction-core.js"></script>
</body>
</html>