Skip to content

Commit 5361e94

Browse files
committed
revert settings change; use debug log
1 parent a4050d4 commit 5361e94

File tree

6 files changed

+14
-20
lines changed

6 files changed

+14
-20
lines changed

src/MetadataService.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import Log from './Log';
55
import JsonService from './JsonService';
6-
import OidcClientSettings from './OidcClientSettings';
76

87
export default class MetadataService {
98
constructor(settings, JsonServiceCtor = JsonService) {
@@ -12,13 +11,7 @@ export default class MetadataService {
1211
throw new Error("settings");
1312
}
1413

15-
if (settings instanceof OidcClientSettings) {
16-
this._settings = settings;
17-
}
18-
else {
19-
this._settings = new OidcClientSettings(settings);
20-
}
21-
14+
this._settings = settings;
2215
this._jsonService = new JsonServiceCtor();
2316
}
2417

test/unit/MetadataService.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe("MetadataService", function() {
3131
new MetadataService();
3232
}
3333
catch (e) {
34+
Log.debug(e.message);
3435
e.message.should.contain('settings');
3536
return;
3637
}

test/unit/ResponseValidator.spec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MockJoseUtility {
1616
parseJwt(...args) {
1717
this.parseJwtWasCalled = true;
1818
if (this.parseJwtResult) {
19-
Log.info("MockJoseUtility.parseJwt", this.parseJwtResult)
19+
Log.debug("MockJoseUtility.parseJwt", this.parseJwtResult)
2020
return this.parseJwtResult;
2121
}
2222
return JoseUtil.parseJwt(...args);
@@ -25,7 +25,7 @@ class MockJoseUtility {
2525
validateJwt(...args) {
2626
this.validateJwtWasCalled = true;
2727
if (this.validateJwtResult) {
28-
Log.info("MockJoseUtility.validateJwt", this.validateJwtResult)
28+
Log.debug("MockJoseUtility.validateJwt", this.validateJwtResult)
2929
return this.validateJwtResult;
3030
}
3131
return JoseUtil.validateJwt(...args);
@@ -34,7 +34,7 @@ class MockJoseUtility {
3434
hashString(...args) {
3535
this.hashStringWasCalled = true;
3636
if (this.hashStringResult) {
37-
Log.info("MockJoseUtility.hashString", this.hashStringResult)
37+
Log.debug("MockJoseUtility.hashString", this.hashStringResult)
3838
return this.hashStringResult;
3939
}
4040
return JoseUtil.hashString(...args);
@@ -43,7 +43,7 @@ class MockJoseUtility {
4343
hexToBase64Url(...args) {
4444
this.hexToBase64UrlCalled = true;
4545
if (this.hexToBase64UrlResult) {
46-
Log.info("MockJoseUtility.hexToBase64Url", this.hexToBase64UrlResult)
46+
Log.debug("MockJoseUtility.hexToBase64Url", this.hexToBase64UrlResult)
4747
return this.hexToBase64UrlResult;
4848
}
4949
return JoseUtil.hexToBase64Url(...args);
@@ -67,15 +67,15 @@ class MockResponseValidator extends ResponseValidator {
6767
}
6868

6969
_mock(name, ...args) {
70-
Log.info("mock called", name);
70+
Log.debug("mock called", name);
7171
this[name + "WasCalled"] = true;
7272

7373
if (this[name + "Result"]) {
74-
Log.info("mock returning result", this[name + "Result"]);
74+
Log.debug("mock returning result", this[name + "Result"]);
7575
return this[name + "Result"];
7676
}
7777

78-
Log.info("mock calling super");
78+
Log.debug("mock calling super");
7979
return super[name](...args);
8080
}
8181

@@ -837,7 +837,7 @@ describe("ResponseValidator", function () {
837837
};
838838

839839
subject._validateAccessToken(stubResponse).then(null, err => {
840-
Log.info(err);
840+
Log.debug(err);
841841
err.message.should.contain("id_token");
842842
done();
843843
});
@@ -852,7 +852,7 @@ describe("ResponseValidator", function () {
852852
mockJoseUtility.parseJwtResult = { header: { alg: "bad" } };
853853

854854
subject._validateAccessToken(stubResponse).then(null, err => {
855-
Log.info(err);
855+
Log.debug(err);
856856
err.message.should.contain("alg");
857857
done();
858858
});

test/unit/State.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe("State", function() {
9797
inMemStore.setItem("junk5", "junk");
9898

9999
State.clearStaleState(store, 100).then(() => {
100-
Log.info("clearStaleState done");
100+
Log.debug("clearStaleState done");
101101

102102
inMemStore.length.should.equal(8);
103103
inMemStore.getItem(prefix + "s4").should.be.ok;

test/unit/StubJsonService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Log from '../../src/Log';
55

66
export default class StubJsonService {
77
getJson(url, token) {
8-
Log.info("StubJsonService.getJson", this.result);
8+
Log.debug("StubJsonService.getJson", this.result);
99

1010
this.url = url;
1111
this.token = token;

test/unit/UserManager.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe("UserManager", function () {
9898
subject = new UserManager(settings);
9999

100100
subject._signin = function(args, nav, navArgs){
101-
Log.info("_signin", args, nav, navArgs);
101+
Log.debug("_signin", args, nav, navArgs);
102102

103103
navArgs.silentRequestTimeout.should.equal(123);
104104
done();

0 commit comments

Comments
 (0)