-
-
Notifications
You must be signed in to change notification settings - Fork 41
fix: integrate DOMPurify to sanitize innerHTML assignments in dashboard #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
593f64c
Initial plan
Copilot 7f3a507
fix: integrate DOMPurify for XSS protection in dashboard
Copilot 9f27dfa
fix: add DOMPurify sanitization to event and rejection list innerHTML…
Copilot 589a82b
fix: upgrade DOMPurify to v3.3.1 and add SRI hash for CDN security
Copilot 53d37de
fix: correct DOMPurify 3.3.1 SRI hash to resolve browser blocking
Copilot 42b6498
fix: switch to cdnjs CDN for DOMPurify 3.2.7 with verified SRI hash
Copilot 2987798
fix: Format and fix SRI
pm7y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,98 +1,127 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta content="width=device-width, initial-scale=1.0" name="viewport"> | ||
| <title>Azure Event Grid Simulator - Dashboard</title> | ||
| <link href="/dashboard/styles.css" rel="stylesheet"> | ||
| </head> | ||
| <body> | ||
| <header class="header"> | ||
| <h1>Azure Event Grid Simulator</h1> | ||
| <div class="header-controls"> | ||
| <button class="clear-btn" id="clearBtn">Clear</button> | ||
| <label class="auto-refresh-toggle"> | ||
| <input checked id="autoRefresh" type="checkbox"> | ||
| <span>Auto-refresh</span> | ||
| </label> | ||
| <span class="refresh-indicator" id="refreshIndicator"></span> | ||
| </div> | ||
| </header> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta content="width=device-width, initial-scale=1.0" name="viewport" /> | ||
| <title>Azure Event Grid Simulator - Dashboard</title> | ||
| <link href="/dashboard/styles.css" rel="stylesheet" /> | ||
| </head> | ||
| <body> | ||
| <header class="header"> | ||
| <h1>Azure Event Grid Simulator</h1> | ||
| <div class="header-controls"> | ||
| <button class="clear-btn" id="clearBtn">Clear</button> | ||
| <label class="auto-refresh-toggle"> | ||
| <input checked id="autoRefresh" type="checkbox" /> | ||
| <span>Auto-refresh</span> | ||
| </label> | ||
| <span class="refresh-indicator" id="refreshIndicator"></span> | ||
| </div> | ||
| </header> | ||
|
|
||
| <main class="main-content"> | ||
| <section class="stats-section" id="statsSection"> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statTotalReceived">0</span> | ||
| <span class="stat-label">Total Received</span> | ||
| </div> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statInHistory">0</span> | ||
| <span class="stat-label">In History</span> | ||
| </div> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statDelivered">0</span> | ||
| <span class="stat-label">Delivered</span> | ||
| </div> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statFailed">0</span> | ||
| <span class="stat-label">Failed</span> | ||
| </div> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statPending">0</span> | ||
| <span class="stat-label">Pending</span> | ||
| </div> | ||
| <div class="stat-card stat-card-rejected"> | ||
| <span class="stat-value" id="statRejected">0</span> | ||
| <span class="stat-label">Rejected</span> | ||
| </div> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statTopics">0</span> | ||
| <span class="stat-label">Active Topics</span> | ||
| </div> | ||
| </section> | ||
| <main class="main-content"> | ||
| <section class="stats-section" id="statsSection"> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statTotalReceived">0</span> | ||
| <span class="stat-label">Total Received</span> | ||
| </div> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statInHistory">0</span> | ||
| <span class="stat-label">In History</span> | ||
| </div> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statDelivered">0</span> | ||
| <span class="stat-label">Delivered</span> | ||
| </div> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statFailed">0</span> | ||
| <span class="stat-label">Failed</span> | ||
| </div> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statPending">0</span> | ||
| <span class="stat-label">Pending</span> | ||
| </div> | ||
| <div class="stat-card stat-card-rejected"> | ||
| <span class="stat-value" id="statRejected">0</span> | ||
| <span class="stat-label">Rejected</span> | ||
| </div> | ||
| <div class="stat-card"> | ||
| <span class="stat-value" id="statTopics">0</span> | ||
| <span class="stat-label">Active Topics</span> | ||
| </div> | ||
| </section> | ||
|
|
||
| <section class="events-section"> | ||
| <div class="events-header"> | ||
| <div class="tab-container"> | ||
| <button class="tab-btn active" data-tab="events" id="tabEvents">Events</button> | ||
| <button class="tab-btn" data-tab="rejections" id="tabRejections">Rejections <span | ||
| class="rejection-count" id="rejectionCount"></span></button> | ||
| </div> | ||
| <select class="topic-filter" id="topicFilter"> | ||
| <option value="">All Topics</option> | ||
| </select> | ||
| </div> | ||
| <section class="events-section"> | ||
| <div class="events-header"> | ||
| <div class="tab-container"> | ||
| <button | ||
| class="tab-btn active" | ||
| data-tab="events" | ||
| id="tabEvents" | ||
| > | ||
| Events | ||
| </button> | ||
| <button | ||
| class="tab-btn" | ||
| data-tab="rejections" | ||
| id="tabRejections" | ||
| > | ||
| Rejections | ||
| <span | ||
| class="rejection-count" | ||
| id="rejectionCount" | ||
| ></span> | ||
| </button> | ||
| </div> | ||
| <select class="topic-filter" id="topicFilter"> | ||
| <option value="">All Topics</option> | ||
| </select> | ||
| </div> | ||
|
|
||
| <div class="tab-content" id="eventsTab"> | ||
| <div class="empty-state" id="emptyState"> | ||
| <div class="empty-state-icon">📫</div> | ||
| <h3>No events received yet</h3> | ||
| <p>Events will appear here when they are published to the simulator.</p> | ||
| </div> | ||
| <div class="events-list" id="eventsList"></div> | ||
| </div> | ||
| <div class="tab-content" id="eventsTab"> | ||
| <div class="empty-state" id="emptyState"> | ||
| <div class="empty-state-icon">📫</div> | ||
| <h3>No events received yet</h3> | ||
| <p> | ||
| Events will appear here when they are published to | ||
| the simulator. | ||
| </p> | ||
| </div> | ||
| <div class="events-list" id="eventsList"></div> | ||
| </div> | ||
|
|
||
| <div class="tab-content hidden" id="rejectionsTab"> | ||
| <div class="empty-state" id="emptyRejectionsState"> | ||
| <div class="empty-state-icon">✓</div> | ||
| <h3>No rejected events</h3> | ||
| <p>Validation errors will appear here when invalid events are sent to the simulator.</p> | ||
| </div> | ||
| <div class="events-list" id="rejectionsList"></div> | ||
| </div> | ||
| </section> | ||
| <div class="tab-content hidden" id="rejectionsTab"> | ||
| <div class="empty-state" id="emptyRejectionsState"> | ||
| <div class="empty-state-icon">✓</div> | ||
| <h3>No rejected events</h3> | ||
| <p> | ||
| Validation errors will appear here when invalid | ||
| events are sent to the simulator. | ||
| </p> | ||
| </div> | ||
| <div class="events-list" id="rejectionsList"></div> | ||
| </div> | ||
| </section> | ||
|
|
||
| <aside class="detail-panel" id="detailPanel"> | ||
| <div class="detail-header"> | ||
| <h3>Event Details</h3> | ||
| <button class="close-btn" id="closeDetail">×</button> | ||
| </div> | ||
| <div class="detail-content" id="detailContent"> | ||
| <p class="detail-placeholder">Select an event to view details</p> | ||
| </div> | ||
| </aside> | ||
| </main> | ||
| <aside class="detail-panel" id="detailPanel"> | ||
| <div class="detail-header"> | ||
| <h3>Event Details</h3> | ||
| <button class="close-btn" id="closeDetail">×</button> | ||
| </div> | ||
| <div class="detail-content" id="detailContent"> | ||
| <p class="detail-placeholder"> | ||
| Select an event to view details | ||
| </p> | ||
| </div> | ||
| </aside> | ||
| </main> | ||
|
|
||
| <script src="/dashboard/app.js"></script> | ||
| </body> | ||
| <script | ||
| src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.2.7/purify.min.js" | ||
| integrity="sha512-78KH17QLT5e55GJqP76vutp1D2iAoy06WcYBXB6iBCsmO6wWzx0Qdg8EDpm8mKXv68BcvHOyeeP4wxAL0twJGQ==" | ||
| crossorigin="anonymous" | ||
| referrerpolicy="no-referrer" | ||
| ></script> | ||
| <script src="/dashboard/app.js"></script> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.