Skip to content

Commit 25bce19

Browse files
authored
CVE-2019-11358 CVE-2020-11023 Update jQuery to 3.7.1 (#147)
* Update jQuery to 3.7.1 * remove space front of errorsHandler
1 parent 6152734 commit 25bce19

File tree

9 files changed

+49
-43
lines changed

9 files changed

+49
-43
lines changed

commons/selfservice/example-ui/src/main/js/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* with the fields enclosed by brackets [] replaced by
2121
* your own identifying information:
2222
* "Portions Copyrighted [year] [name of copyright owner]"
23+
*
24+
* Portions Copyrighted 2025 3A Systems LLC.
2325
*/
2426

2527
/*global require, window */
@@ -50,7 +52,7 @@ require.config({
5052
js2form: "libs/js2form-2.0",
5153
form2js: "libs/form2js-2.0",
5254
spin: "libs/spin-2.0.1-min",
53-
jquery: "libs/jquery-2.1.1-min",
55+
jquery: "libs/jquery-3.7.1-min",
5456
xdate: "libs/xdate-0.8-min",
5557
doTimeout: "libs/jquery.ba-dotimeout-1.0-min",
5658
handlebars: "libs/handlebars-4.7.7-min",

ui/commons/src/main/js/config/process/CommonConfig.js

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2011-2016 ForgeRock AS.
15+
* Portions copyright 2025 3A Systems LLC.
1516
*/
1617

1718
define([
1819
"jquery",
1920
"lodash",
2021
"org/forgerock/commons/ui/common/util/Constants",
21-
"org/forgerock/commons/ui/common/main/EventManager"
22-
], function($, _, Constants, EventManager) {
22+
"org/forgerock/commons/ui/common/main/EventManager",
23+
"org/forgerock/commons/ui/common/main/SpinnerManager",
24+
"org/forgerock/commons/ui/common/main/ErrorsHandler"
25+
], function($, _, Constants, EventManager, spinner, errorsHandler) {
2326
var obj = [
2427
{
2528
startEvent: Constants.EVENT_APP_INITIALIZED,
@@ -158,22 +161,15 @@ define([
158161
{
159162
startEvent: Constants.EVENT_REST_CALL_ERROR,
160163
description: "",
161-
dependencies: [
162-
"org/forgerock/commons/ui/common/main/SpinnerManager",
163-
"org/forgerock/commons/ui/common/main/ErrorsHandler"
164-
],
165-
processDescription: function(event, spinner, errorsHandler) {
164+
processDescription: function(event) {
166165
errorsHandler.handleError(event.data, event.errorsHandlers);
167166
spinner.hideSpinner();
168167
}
169168
},
170169
{
171170
startEvent: Constants.EVENT_START_REST_CALL,
172171
description: "",
173-
dependencies: [
174-
"org/forgerock/commons/ui/common/main/SpinnerManager"
175-
],
176-
processDescription: function(event, spinner) {
172+
processDescription: function(event) {
177173
if (!event.suppressSpinner) {
178174
spinner.showSpinner();
179175
}
@@ -182,10 +178,7 @@ define([
182178
{
183179
startEvent: Constants.EVENT_END_REST_CALL,
184180
description: "",
185-
dependencies: [
186-
"org/forgerock/commons/ui/common/main/SpinnerManager"
187-
],
188-
processDescription: function(event, spinner) {
181+
processDescription: function() {
189182
spinner.hideSpinner();
190183
}
191184
},

ui/commons/src/main/js/org/forgerock/commons/ui/common/main/ProcessConfiguration.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2011-2016 ForgeRock AS.
15+
* Portions copyright 2025 3A Systems LLC.
1516
*/
1617

1718
define([
@@ -37,6 +38,9 @@ define([
3738

3839
obj.callRegisterListenerFromConfig = function (config) {
3940
eventManager.registerListener(config.startEvent, function (event) {
41+
if (!config.dependencies) {
42+
return config.processDescription(event);
43+
}
4044
return $.when.apply($, _.map(config.dependencies, function (dep) {
4145
return ModuleLoader.load(dep);
4246
})).then(function () {

ui/commons/src/test/qunit/AbstractCollection.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2016 ForgeRock AS.
15+
* Portions copyright 2025 3A Systems LLC.
1516
*/
1617
/*globals QUnit */
1718

@@ -29,7 +30,7 @@ define([
2930

3031
testCollection.url = "/crestResource?_queryFilter=true";
3132

32-
sinon.stub(ServiceInvoker, "restCall", function (options) {
33+
sinon.stub(ServiceInvoker, "restCall").callsFake(function (options) {
3334
var response = {
3435
"result": [{
3536
"_id": 1,
@@ -57,7 +58,7 @@ define([
5758
testCollection.setPagingType("cookie");
5859
testCollection.setTotalPagedResultsPolicy("EXACT");
5960

60-
testCollection.getFirstPage().then(function () {
61+
return testCollection.getFirstPage().then(function () {
6162
assert.equal(ServiceInvoker.restCall.callCount, 1, "Only one REST call produced");
6263
restCallArg = ServiceInvoker.restCall.args[0][0]; // first invocation, first argument
6364
assert.equal(testCollection.length, 2, "collection contains two records from the backend");
@@ -92,4 +93,4 @@ define([
9293

9394
});
9495

95-
});
96+
});

ui/commons/src/test/qunit/AbstractModel.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2016 ForgeRock AS.
15+
* Portions copyright 2025 3A Systems LLC.
1516
*/
1617

1718
define([
@@ -32,14 +33,14 @@ define([
3233

3334
testModel.url = "/crestResource";
3435

35-
sinon.stub(ServiceInvoker, "restCall", function (opts) {
36+
sinon.stub(ServiceInvoker, "restCall").callsFake(function (opts) {
3637
return $.Deferred().resolve(_.extend(JSON.parse(opts.data), {
3738
"_id": 1,
3839
"_rev": 1
3940
}));
4041
});
4142

42-
testModel.save(newRecord).then(function () {
43+
return testModel.save(newRecord).then(function () {
4344
restCallArg = ServiceInvoker.restCall.args[0][0]; // first invocation, first argument
4445
assert.equal(testModel.id, 1, "Newly-created model has id from backend");
4546
assert.equal(restCallArg.url, "/crestResource?_action=create&", "correct url used to create model");
@@ -60,21 +61,21 @@ define([
6061
testModel.url = "/crestResource";
6162
testModel.id = "myCustomId";
6263

63-
sinon.stub(ServiceInvoker, "restCall", function (opts) {
64+
sinon.stub(ServiceInvoker, "restCall").callsFake(function (opts) {
6465
return $.Deferred().resolve(_.extend(JSON.parse(opts.data), {
6566
"_rev": 1
6667
}));
6768
});
6869

69-
testModel.save(newRecord).then(function () {
70+
return testModel.save(newRecord).then(function () {
7071
restCallArg = ServiceInvoker.restCall.args[0][0]; // first invocation, first argument
7172
assert.equal(testModel.get("_rev"), 1, "Model has new rev from backend");
7273
assert.equal(restCallArg.url, "/crestResource/myCustomId?", "correct url used to create model");
7374
assert.equal(restCallArg.headers["If-None-Match"], "*", "correct revision header provided");
7475
assert.equal(restCallArg.type, "PUT", "correct method used to create model");
7576

7677
ServiceInvoker.restCall.restore();
77-
})
78+
});
7879
});
7980

8081
QUnit.test("read operation", function (assert) {
@@ -84,15 +85,15 @@ define([
8485
testModel.url = "/crestResource";
8586
testModel.id = 1;
8687

87-
sinon.stub(ServiceInvoker, "restCall", function () {
88+
sinon.stub(ServiceInvoker, "restCall").callsFake(function () {
8889
return $.Deferred().resolve({
8990
"_id": 1,
9091
"_rev": 1,
9192
"name": "foo"
9293
});
9394
});
9495

95-
testModel.fetch().then(function () {
96+
return testModel.fetch().then(function () {
9697
restCallArg = ServiceInvoker.restCall.args[0][0]; // first invocation, first argument
9798
assert.equal(testModel.get("name"), "foo", "example data populated from fetch call");
9899
assert.equal(testModel.get("_rev"), 1, "revision populated from fetch call");
@@ -128,13 +129,13 @@ define([
128129

129130
testModel.url = "/crestResource";
130131

131-
sinon.stub(ServiceInvoker, "restCall", function (opts) {
132+
sinon.stub(ServiceInvoker, "restCall").callsFake(function (opts) {
132133
return $.Deferred().resolve(_.extend(JSON.parse(opts.data), {
133134
"_rev": 2
134135
}));
135136
});
136137

137-
testModel.save().then(function () {
138+
return testModel.save().then(function () {
138139
restCallArg = ServiceInvoker.restCall.args[0][0]; // first invocation, first argument
139140
assert.equal(testModel.get("_rev"), 2, "Model has new rev from backend");
140141
assert.equal(restCallArg.url, "/crestResource/1?", "correct url used to update model");
@@ -156,11 +157,11 @@ define([
156157

157158
testModel.url = "/crestResource";
158159

159-
sinon.stub(ServiceInvoker, "restCall", function (opts) {
160+
sinon.stub(ServiceInvoker, "restCall").callsFake(function () {
160161
return $.Deferred().resolve();
161162
});
162163

163-
testModel.destroy().then(function () {
164+
return testModel.destroy().then(function () {
164165
restCallArg = ServiceInvoker.restCall.args[0][0]; // first invocation, first argument
165166
assert.equal(restCallArg.url, "/crestResource/1?", "correct url used to delete model");
166167
assert.equal(restCallArg.type, "DELETE", "correct method used to DELETE model");
@@ -180,11 +181,11 @@ define([
180181

181182
testModel.url = "/crestResource";
182183

183-
sinon.stub(ServiceInvoker, "restCall", function (opts) {
184+
sinon.stub(ServiceInvoker, "restCall").callsFake(function () {
184185
return $.Deferred().resolve();
185186
});
186187

187-
testModel.save({"foo": "baz"}, {patch: true}).then(function () {
188+
return testModel.save({"foo": "baz"}, {patch: true}).then(function () {
188189
restCallArg = ServiceInvoker.restCall.args[0][0]; // first invocation, first argument
189190

190191
assert.equal(restCallArg.url, "/crestResource/1?", "correct url used to patch model");

ui/commons/src/test/qunit/OAuth.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2016 ForgeRock AS.
15+
* Portions copyright 2025 3A Systems LLC.
1516
*/
1617

1718
define([
@@ -22,10 +23,10 @@ define([
2223
QUnit.module('OAuth Functions');
2324

2425
QUnit.moduleStart(function() {
25-
sinon.stub(URIUtils, "getCurrentOrigin", function () {
26+
sinon.stub(URIUtils, "getCurrentOrigin").callsFake(function () {
2627
return "http://rp.com";
2728
});
28-
sinon.stub(URIUtils, "getCurrentPathName", function () {
29+
sinon.stub(URIUtils, "getCurrentPathName").callsFake(function () {
2930
return "/app/index.html";
3031
});
3132
});
@@ -44,7 +45,7 @@ define([
4445
);
4546
});
4647
QUnit.test("oAuth request url", function (assert) {
47-
sinon.stub(OAuth, "generateNonce", function () {
48+
sinon.stub(OAuth, "generateNonce").callsFake(function () {
4849
return "nonceValue";
4950
});
5051
assert.equal(OAuth.getRequestURL(

ui/mock/src/main/js/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2011-2016 ForgeRock AS.
15+
* Portions copyright 2025 3A Systems LLC.
1516
*/
1617

1718
require.config({
@@ -33,7 +34,7 @@ require.config({
3334
},
3435
paths: {
3536
// sinon only needed (or available) for Mock project
36-
sinon: "libs/sinon-1.15.4",
37+
sinon: "libs/sinon-15.2.0",
3738
i18next: "libs/i18next-1.7.3-min",
3839
backbone: "libs/backbone-1.1.2-min",
3940
"backbone.paginator": "libs/backbone.paginator.min-2.0.2-min",
@@ -46,7 +47,7 @@ require.config({
4647
js2form: "libs/js2form-2.0-769718a",
4748
form2js: "libs/form2js-2.0-769718a",
4849
spin: "libs/spin-2.0.1-min",
49-
jquery: "libs/jquery-2.1.1-min",
50+
jquery: "libs/jquery-3.7.1-min",
5051
xdate: "libs/xdate-0.8-min",
5152
doTimeout: "libs/jquery.ba-dotimeout-1.0-min",
5253
handlebars: "libs/handlebars-4.7.7",

ui/mock/src/test/qunit/testRunner.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2016 ForgeRock AS.
15+
* Portions copyright 2025 3A Systems LLC.
1516
*/
1617

1718
(function () {
@@ -29,7 +30,7 @@
2930
stashedRequire.original.config({
3031
baseUrl: '../www',
3132
paths: {
32-
sinon: "libs/sinon-1.15.4"
33+
sinon: "libs/sinon-15.2.0"
3334
}
3435
});
3536

@@ -43,7 +44,7 @@
4344
"org/forgerock/commons/ui/common/main/i18nManager",
4445
"ThemeManager"
4546
], function ($, sinon, i18nManager, ThemeManager) {
46-
sinon.stub(ThemeManager, "getTheme", function () {
47+
sinon.stub(ThemeManager, "getTheme").callsFake(function () {
4748
return $.Deferred().resolve({path:""});
4849
});
4950
i18nManager.init({

ui/pom.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
<properties>
3333
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3434
<node.install.directory>${project.parent.basedir}</node.install.directory>
35+
<jquery.version>3.7.1</jquery.version>
36+
<sinon.version>15.2.0</sinon.version>
3537
</properties>
3638
<groupId>org.openidentityplatform.commons</groupId>
3739
<artifactId>ui</artifactId>
@@ -150,7 +152,7 @@
150152
<artifactItem>
151153
<groupId>org.openidentityplatform.commons.ui.libs</groupId>
152154
<artifactId>sinon</artifactId>
153-
<version>1.15.4</version>
155+
<version>${sinon.version}</version>
154156
<packaging>js</packaging>
155157
<downloadUrl>https://cdnjs.cloudflare.com/ajax/libs/sinon.js/{version}/{artifactId}.{packaging}</downloadUrl>
156158
</artifactItem>
@@ -304,7 +306,7 @@
304306
<artifactItem>
305307
<groupId>org.openidentityplatform.commons.ui.libs</groupId>
306308
<artifactId>jquery</artifactId>
307-
<version>2.1.1</version>
309+
<version>${jquery.version}</version>
308310
<packaging>js</packaging>
309311
<classifier>min</classifier>
310312
<downloadUrl>https://cdnjs.cloudflare.com/ajax/libs/jquery/{version}/{artifactId}.{classifier}.{packaging}</downloadUrl>
@@ -584,7 +586,7 @@
584586
<dependency>
585587
<groupId>org.openidentityplatform.commons.ui.libs</groupId>
586588
<artifactId>jquery</artifactId>
587-
<version>2.1.1</version>
589+
<version>${jquery.version}</version>
588590
<type>js</type>
589591
<classifier>min</classifier>
590592
</dependency>
@@ -805,7 +807,7 @@
805807
<dependency>
806808
<groupId>org.openidentityplatform.commons.ui.libs</groupId>
807809
<artifactId>sinon</artifactId>
808-
<version>1.15.4</version>
810+
<version>${sinon.version}</version>
809811
<type>js</type>
810812
</dependency>
811813
<dependency>

0 commit comments

Comments
 (0)