Skip to content

Commit ec35bd3

Browse files
authored
fix(security): update swagger-ui to v4.1.3 (#2855)
swagger-ui <4.1.3 are affected by GHSA-qrmm-w75w-3wpx. This commit also exposes new docker env variable: QUERY_CONFIG_ENABLED. Closes #2853
1 parent 3190cd4 commit ec35bd3

File tree

5 files changed

+80
-51
lines changed

5 files changed

+80
-51
lines changed

docker-run.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ if [[ -f "$SWAGGER_FILE" ]]; then
3131
sed -i "s|#SWAGGER_ROOT|root $SWAGGER_ROOT/;|g" $NGINX_CONF
3232
fi
3333

34-
# Gzip after replacements
35-
find /usr/share/nginx/html/ -type f -regex ".*\.\(html\|js\|css\)" -exec sh -c "gzip < {} > {}.gz" \;
34+
## Adding env var support for `queryConfigEnabled` core configuration parameter of SwaggerUI
35+
if [[ "${QUERY_CONFIG_ENABLED}" = "true" ]]; then
36+
sed -i 's|queryConfigEnabled: false|queryConfigEnabled: true|' $INDEX_FILE
37+
fi
3638

37-
exec nginx -g 'daemon off;'
39+
## Gzip after replacements
40+
#find /usr/share/nginx/html/ -type f -regex ".*\.\(html\|js\|css\)" -exec sh -c "gzip < {} > {}.gz" \;
41+
#
42+
#exec nginx -g 'daemon off;'

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
layout: 'StandaloneLayout',
5656
presets: [
5757
SwaggerEditorStandalonePreset
58-
]
58+
],
59+
queryConfigEnabled: false,
5960
})
6061

6162
window.editor = editor

package-lock.json

Lines changed: 66 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"redux": "=4.1.2",
8888
"reselect": "^4.0.0",
8989
"swagger-client": "^3.17.0",
90-
"swagger-ui": "^4.1.2",
90+
"swagger-ui": "^4.1.3",
9191
"traverse": "^0.6.6",
9292
"validator": "=13.7.0",
9393
"yaml-js": "^0.3.1"

test/e2e/static/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
layout: 'StandaloneLayout',
6868
presets: [
6969
SwaggerEditorStandalonePreset
70-
]
70+
],
71+
queryConfigEnabled: true,
7172
})
7273

7374
window.editor = editor
@@ -114,4 +115,4 @@
114115

115116
</body>
116117

117-
</html>
118+
</html>

0 commit comments

Comments
 (0)