Skip to content

Commit d7dc0ce

Browse files
authored
fix: pin Swagger UI dark theme CSS to a commit SHA (#4083)
1 parent 0ba3386 commit d7dc0ce

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'fets': patch
3+
---
4+
5+
Pin the Swagger UI dark-theme CSS to an immutable jsDelivr GitHub commit
6+
7+
The dark stylesheet is loaded from `cdn.jsdelivr.net/gh/Itz-fork/Fastapi-Swagger-UI-Dark@868ea5da…` with SRI, so upstream default-branch changes cannot invalidate the integrity hash or swap the file silently.

.changeset/swagger-ui-sri.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
Pin Swagger UI CDN assets and load them with Subresource Integrity (SRI)
66

7-
Swagger UI previously pulled unversioned `unpkg.com/swagger-ui-dist` scripts/styles without integrity checks. Assets are now pinned to `swagger-ui-dist@5.11.0` (and the dark theme CSS) and loaded via `<link>`/`<script>` tags with `integrity` + `crossorigin`, so a compromised CDN cannot silently swap the payload.
7+
Swagger UI previously pulled unversioned `unpkg.com/swagger-ui-dist` scripts/styles without integrity checks. Assets are now pinned to `swagger-ui-dist@5.11.0` and loaded via `<link>`/`<script>` tags with `integrity` + `crossorigin`, so a compromised CDN cannot silently swap the payload.

packages/fets/src/swagger-ui.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<title>SwaggerUI</title>
88
<link
99
rel="stylesheet"
10-
href="https://cdn.jsdelivr.net/gh/Itz-fork/Fastapi-Swagger-UI-Dark/assets/swagger_ui_dark.min.css"
10+
href="https://cdn.jsdelivr.net/gh/Itz-fork/Fastapi-Swagger-UI-Dark@868ea5da89b4e7d9aa7fe57f601485d68f26695d/assets/swagger_ui_dark.min.css"
1111
media="(prefers-color-scheme: dark)"
1212
crossorigin="anonymous"
1313
integrity="sha384-uFFUYDzMQNCAsNQHyjX9WExpaDBrtT+3F/7yo37l/lUEsOa7yAUqDFRlDEG2u8RY"

0 commit comments

Comments
 (0)