Skip to content

Commit

Permalink
CVE-2019-17495 CVE-2018-25031 Bump swagger-ui from 2.2.6 to 4.1.3 (#47)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: maximthomas <[email protected]>
  • Loading branch information
dependabot[bot] and maximthomas authored Jun 25, 2024
1 parent 8c261be commit 0c9ef7b
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 74 deletions.
21 changes: 8 additions & 13 deletions openidm-ui/openidm-ui-api/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,13 @@ module.exports = function (grunt) {
swagger: {
files: [{
expand: true,
cwd: 'node_modules/swagger-ui/dist/',
src: ['swagger-ui.js', 'swagger-ui.min.js','css/*', 'fonts/*', 'images/*', 'lang/*', 'lib/*'],
cwd: 'node_modules/swagger-ui-dist',
src: ['swagger-ui-bundle.js', 'swagger-ui-standalone-preset.js', 'swagger-ui.css'],
dest: 'target/www/'
}]
},
swaggerThemes: {
files: [{
expand: true,
cwd: 'node_modules/swagger-ui-themes/themes/',
src: ['theme-flattop.css'],
dest: 'target/www/css/'
}]
}],
options: {
noProcess: ['**/*.{png,gif,jpg,ico,svg,ttf,eot,woff}']
}
},
resources: {
files: [{
Expand All @@ -45,6 +40,6 @@ module.exports = function (grunt) {

grunt.loadNpmTasks('grunt-contrib-copy');

grunt.registerTask('build:dev', ['copy:swagger', 'copy:swaggerThemes', 'copy:resources']);
grunt.registerTask('build:prod', ['copy:swagger', 'copy:swaggerThemes', 'copy:resources']);
grunt.registerTask('build:dev', ['copy:swagger', 'copy:resources']);
grunt.registerTask('build:prod', ['copy:swagger', 'copy:resources']);
};
3 changes: 1 addition & 2 deletions openidm-ui/openidm-ui-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"grunt": ">=1.5.3",
"grunt-cli": "1.2.0",
"grunt-contrib-copy": "1.0.0",
"swagger-ui": "2.2.6",
"swagger-ui-themes": "^2.0.1"
"swagger-ui-dist": "^5.17.14"
}
}
94 changes: 35 additions & 59 deletions openidm-ui/openidm-ui-api/src/main/resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,34 @@
<head>
<meta charset="UTF-8">
<title>API Explorer</title>
<link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
<link href='css/theme-flattop.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >

<script src='lib/object-assign-pollyfill.js' type='text/javascript'></script>
<script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
<script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
<script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
<script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
<script src='lib/handlebars-4.0.5.js' type='text/javascript'></script>
<script src='lib/lodash.min.js' type='text/javascript'></script>
<script src='lib/backbone-min.js' type='text/javascript'></script>
<script src='swagger-ui.min.js' type='text/javascript'></script>
<script src='lib/highlight.9.1.0.pack.js' type='text/javascript'></script>
<script src='lib/highlight.9.1.0.pack_extended.js' type='text/javascript'></script>
<script src='lib/jsoneditor.min.js' type='text/javascript'></script>
<script src='lib/marked.js' type='text/javascript'></script>
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}

*,
*:before,
*:after
{
box-sizing: inherit;
}

<style type="text/css">
/* theme-flattop.css fixes, needed until the theme is updated to support recent Swagger UI version */
.swagger-section .swagger-ui-wrap p {
line-height: inherit;
padding: inherit;
body
{
margin:0;
background: #fafafa;
}
</style>

<script type="text/javascript">
$(function () {
window.onload = function () {
var url = window.location.search.match(/url=([^&]+)/);
if (url && url.length > 1) {
url = decodeURIComponent(url[1]);
Expand All @@ -59,45 +54,26 @@
url = "/openidm/?_api";
}

hljs.configure({
highlightSizeThreshold: 5000
});

if (window.SwaggerTranslator) {
window.SwaggerTranslator.translate();
}
window.swaggerUi = new SwaggerUi({
const ui = SwaggerUIBundle({
url: url,
validatorUrl: null,
dom_id: "swagger-ui-div",
defaultModelRendering: 'schema',
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
apisSorter: 'alpha',
onComplete: function (swaggerApi, swaggerUi) {
// ensure that correct host is set at runtime
window.swaggerUi.api.setHost(location.hostname + ':' + location.port);

// NOTE: OpenIDM requires X-Requested-With header
window.swaggerUi.api.clientAuthorizations.add("X-Requested-With",
new SwaggerClient.ApiKeyAuthorization("X-Requested-With", "Swagger-UI", "header"));

if (window.SwaggerTranslator) {
window.SwaggerTranslator.translate();
}
},
onFailure: function (data) {
if (typeof data === 'string' && data.indexOf('401') !== -1) {
// 401: Unauthorized, so redirect to login
window.top.location.replace('/');
}
}
});

window.swaggerUi.load();
});
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
})
window.ui = ui
};
</script>
</head>
<body class="swagger-section" style="margin: 1em;">
<div id="swagger-ui-div" class="swagger-ui-wrap"></div>
<div id="swagger-ui"></div>
<script src="swagger-ui-bundle.js" type="text/javascript"></script>
<script src="swagger-ui-standalone-preset.js" type="text/javascript"></script>
</body>
</html>

0 comments on commit 0c9ef7b

Please sign in to comment.