@inrupt/solid-client-authn-browser 1.15.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ClientAuthentication.d.ts +4 -13
- package/dist/Session.d.ts +4 -4
- package/dist/dependencies.d.ts +1 -1
- package/dist/index.js +772 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +745 -0
- package/dist/index.mjs.map +1 -0
- package/dist/login/oidc/AggregateOidcHandler.d.ts +2 -1
- package/dist/login/oidc/AggregateRedirectHandler.d.ts +2 -1
- package/dist/login/oidc/ClientRegistrar.d.ts +1 -1
- package/dist/login/oidc/IssuerConfigFetcher.d.ts +1 -1
- package/dist/login/oidc/OidcLoginHandler.d.ts +1 -1
- package/dist/login/oidc/Redirector.d.ts +1 -1
- package/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.d.ts +3 -6
- package/dist/login/oidc/incomingRedirectHandler/ErrorOidcHandler.d.ts +1 -1
- package/dist/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.d.ts +1 -1
- package/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.d.ts +3 -6
- package/dist/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.d.ts +1 -1
- package/dist/login/oidc/refresh/TokenRefresher.d.ts +2 -2
- package/dist/logout/buildRpInitiatedLogout.d.ts +2 -0
- package/dist/sessionInfo/SessionInfoManager.d.ts +4 -13
- package/dist/solid-client-authn.bundle.js +32 -2
- package/dist/solid-client-authn.bundle.js.map +1 -0
- package/dist/storage/BrowserStorage.d.ts +1 -1
- package/dist/storage/StorageUtility.d.ts +2 -1
- package/package.json +17 -17
- package/rollup.config.mjs +46 -0
- package/src/ClientAuthentication.spec.ts +4 -4
- package/src/ClientAuthentication.ts +8 -45
- package/src/Session.spec.ts +4 -4
- package/src/Session.ts +44 -13
- package/src/__mocks__/ClientAuthentication.ts +3 -3
- package/src/constant.ts +1 -1
- package/src/defaultSession.spec.ts +1 -1
- package/src/defaultSession.ts +5 -3
- package/src/dependencies.node.spec.ts +1 -1
- package/src/dependencies.spec.ts +1 -1
- package/src/dependencies.ts +10 -5
- package/src/index.browser.spec.ts +1 -1
- package/src/index.browser.ts +1 -1
- package/src/index.spec.ts +1 -1
- package/src/index.ts +1 -1
- package/src/login/__mocks__/LoginHandler.ts +2 -2
- package/src/login/oidc/AggregateOidcHandler.spec.ts +3 -5
- package/src/login/oidc/AggregateOidcHandler.ts +3 -3
- package/src/login/oidc/AggregateRedirectHandler.ts +3 -3
- package/src/login/oidc/ClientRegistrar.spec.ts +1 -1
- package/src/login/oidc/ClientRegistrar.ts +2 -2
- package/src/login/oidc/IssuerConfigFetcher.spec.ts +8 -4
- package/src/login/oidc/IssuerConfigFetcher.ts +7 -3
- package/src/login/oidc/OidcLoginHandler.spec.ts +3 -5
- package/src/login/oidc/OidcLoginHandler.ts +5 -3
- package/src/login/oidc/Redirector.spec.ts +1 -1
- package/src/login/oidc/Redirector.ts +2 -2
- package/src/login/oidc/__mocks__/ClientRegistrar.ts +2 -2
- package/src/login/oidc/__mocks__/IOidcHandler.ts +2 -2
- package/src/login/oidc/__mocks__/IOidcOptions.ts +2 -2
- package/src/login/oidc/__mocks__/IssuerConfigFetcher.ts +2 -2
- package/src/login/oidc/__mocks__/Redirector.ts +2 -2
- package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.spec.ts +37 -39
- package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.ts +17 -13
- package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.spec.ts +3 -4
- package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.ts +3 -3
- package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.spec.ts +3 -4
- package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.ts +2 -2
- package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.spec.ts +3 -3
- package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts +13 -51
- package/src/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.ts +2 -2
- package/src/login/oidc/refresh/TokenRefresher.spec.ts +7 -6
- package/src/login/oidc/refresh/TokenRefresher.ts +6 -4
- package/src/login/oidc/refresh/__mocks__/TokenRefresher.ts +2 -2
- package/src/logout/{GeneralLogoutHandler.ts → buildRpInitiatedLogout.ts} +21 -20
- package/src/sessionInfo/SessionInfoManager.spec.ts +2 -2
- package/src/sessionInfo/SessionInfoManager.ts +13 -91
- package/src/sessionInfo/__mocks__/SessionInfoManager.ts +2 -2
- package/src/storage/BrowserStorage.spec.ts +1 -1
- package/src/storage/BrowserStorage.ts +2 -2
- package/src/storage/StorageUtility.ts +3 -2
- package/src/storage/__mocks__/LocalStorage.ts +1 -1
- package/src/util/UUIDGenerator.spec.ts +1 -1
- package/src/util/UuidGenerator.ts +1 -1
- package/src/util/__mocks__/UuidGenerator.ts +2 -2
- package/dist/ClientAuthentication.js +0 -80
- package/dist/ClientAuthentication.js.map +0 -1
- package/dist/Session.js +0 -150
- package/dist/Session.js.map +0 -1
- package/dist/constant.js +0 -7
- package/dist/constant.js.map +0 -1
- package/dist/defaultSession.js +0 -52
- package/dist/defaultSession.js.map +0 -1
- package/dist/dependencies.js +0 -41
- package/dist/dependencies.js.map +0 -1
- package/dist/index.browser.js +0 -28
- package/dist/index.browser.js.map +0 -1
- package/dist/login/oidc/AggregateOidcHandler.js +0 -10
- package/dist/login/oidc/AggregateOidcHandler.js.map +0 -1
- package/dist/login/oidc/AggregateRedirectHandler.js +0 -10
- package/dist/login/oidc/AggregateRedirectHandler.js.map +0 -1
- package/dist/login/oidc/ClientRegistrar.js +0 -47
- package/dist/login/oidc/ClientRegistrar.js.map +0 -1
- package/dist/login/oidc/IssuerConfigFetcher.js +0 -124
- package/dist/login/oidc/IssuerConfigFetcher.js.map +0 -1
- package/dist/login/oidc/OidcLoginHandler.js +0 -40
- package/dist/login/oidc/OidcLoginHandler.js.map +0 -1
- package/dist/login/oidc/Redirector.js +0 -17
- package/dist/login/oidc/Redirector.js.map +0 -1
- package/dist/login/oidc/__mocks__/IOidcOptions.d.ts +0 -2
- package/dist/login/oidc/__mocks__/IOidcOptions.js +0 -25
- package/dist/login/oidc/__mocks__/IOidcOptions.js.map +0 -1
- package/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.js +0 -91
- package/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.js.map +0 -1
- package/dist/login/oidc/incomingRedirectHandler/ErrorOidcHandler.js +0 -26
- package/dist/login/oidc/incomingRedirectHandler/ErrorOidcHandler.js.map +0 -1
- package/dist/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.js +0 -20
- package/dist/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.js.map +0 -1
- package/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.js +0 -56
- package/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.js.map +0 -1
- package/dist/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.js +0 -47
- package/dist/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.js.map +0 -1
- package/dist/login/oidc/refresh/TokenRefresher.js +0 -31
- package/dist/login/oidc/refresh/TokenRefresher.js.map +0 -1
- package/dist/logout/GeneralLogoutHandler.d.ts +0 -7
- package/dist/logout/GeneralLogoutHandler.js +0 -15
- package/dist/logout/GeneralLogoutHandler.js.map +0 -1
- package/dist/sessionInfo/SessionInfoManager.js +0 -96
- package/dist/sessionInfo/SessionInfoManager.js.map +0 -1
- package/dist/solid-client-authn.bundle.js.LICENSE.txt +0 -17
- package/dist/storage/BrowserStorage.js +0 -18
- package/dist/storage/BrowserStorage.js.map +0 -1
- package/dist/storage/StorageUtility.js +0 -10
- package/dist/storage/StorageUtility.js.map +0 -1
- package/dist/util/UuidGenerator.js +0 -10
- package/dist/util/UuidGenerator.js.map +0 -1
- package/licenses.csv +0 -147
- package/src/logout/GeneralLogoutHandler.spec.ts +0 -72
- package/src/logout/__mocks__/LogoutHandler.ts +0 -38
- package/webpack.browser.js +0 -39
- package/webpack.common.js +0 -42
- package/webpack.config.js +0 -28
- package/webpack.dev.js +0 -37
- package/webpack.prod.js +0 -23
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const solid_client_authn_core_1 = require("@inrupt/solid-client-authn-core");
|
|
4
|
-
const oidc_client_ext_1 = require("@inrupt/oidc-client-ext");
|
|
5
|
-
class AuthorizationCodeWithPkceOidcHandler {
|
|
6
|
-
constructor(storageUtility, redirector) {
|
|
7
|
-
this.storageUtility = storageUtility;
|
|
8
|
-
this.redirector = redirector;
|
|
9
|
-
}
|
|
10
|
-
async canHandle(oidcLoginOptions) {
|
|
11
|
-
return !!(oidcLoginOptions.issuerConfiguration.grantTypesSupported &&
|
|
12
|
-
oidcLoginOptions.issuerConfiguration.grantTypesSupported.indexOf("authorization_code") > -1);
|
|
13
|
-
}
|
|
14
|
-
async handle(oidcLoginOptions) {
|
|
15
|
-
var _a;
|
|
16
|
-
const oidcOptions = {
|
|
17
|
-
authority: oidcLoginOptions.issuer.toString(),
|
|
18
|
-
client_id: oidcLoginOptions.client.clientId,
|
|
19
|
-
client_secret: oidcLoginOptions.client.clientSecret,
|
|
20
|
-
redirect_uri: oidcLoginOptions.redirectUrl.toString(),
|
|
21
|
-
post_logout_redirect_uri: oidcLoginOptions.redirectUrl.toString(),
|
|
22
|
-
response_type: "code",
|
|
23
|
-
scope: solid_client_authn_core_1.DEFAULT_SCOPES,
|
|
24
|
-
filterProtocolClaims: true,
|
|
25
|
-
loadUserInfo: false,
|
|
26
|
-
code_verifier: true,
|
|
27
|
-
prompt: (_a = oidcLoginOptions.prompt) !== null && _a !== void 0 ? _a : "consent",
|
|
28
|
-
};
|
|
29
|
-
const oidcClientLibrary = new oidc_client_ext_1.OidcClient(oidcOptions);
|
|
30
|
-
const { redirector } = this;
|
|
31
|
-
const storage = this.storageUtility;
|
|
32
|
-
try {
|
|
33
|
-
const signingRequest = await oidcClientLibrary.createSigninRequest();
|
|
34
|
-
await Promise.all([
|
|
35
|
-
storage.setForUser(signingRequest.state._id, {
|
|
36
|
-
sessionId: oidcLoginOptions.sessionId,
|
|
37
|
-
}),
|
|
38
|
-
storage.setForUser(oidcLoginOptions.sessionId, {
|
|
39
|
-
codeVerifier: signingRequest.state._code_verifier,
|
|
40
|
-
issuer: oidcLoginOptions.issuer.toString(),
|
|
41
|
-
redirectUrl: oidcLoginOptions.redirectUrl,
|
|
42
|
-
dpop: oidcLoginOptions.dpop ? "true" : "false",
|
|
43
|
-
}),
|
|
44
|
-
]);
|
|
45
|
-
redirector.redirect(signingRequest.url.toString(), {
|
|
46
|
-
handleRedirect: oidcLoginOptions.handleRedirect,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
catch (err) {
|
|
50
|
-
console.error(err);
|
|
51
|
-
}
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.default = AuthorizationCodeWithPkceOidcHandler;
|
|
56
|
-
//# sourceMappingURL=AuthorizationCodeWithPkceOidcHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationCodeWithPkceOidcHandler.js","sourceRoot":"","sources":["../../../../src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts"],"names":[],"mappings":";;AA6BA,6EAOyC;AACzC,6DAAqD;AAOrD,MAAqB,oCAAoC;IAGvD,YACU,cAA+B,EAC/B,UAAuB;QADvB,mBAAc,GAAd,cAAc,CAAiB;QAC/B,eAAU,GAAV,UAAU,CAAa;IAC9B,CAAC;IAEJ,KAAK,CAAC,SAAS,CAAC,gBAA8B;QAC5C,OAAO,CAAC,CAAC,CACP,gBAAgB,CAAC,mBAAmB,CAAC,mBAAmB;YACxD,gBAAgB,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,OAAO,CAC9D,oBAAoB,CACrB,GAAG,CAAC,CAAC,CACP,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,gBAA8B;;QAEzC,MAAM,WAAW,GAAG;YAClB,SAAS,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAAQ,EAAE;YAC7C,SAAS,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAAQ;YAC3C,aAAa,EAAE,gBAAgB,CAAC,MAAM,CAAC,YAAY;YACnD,YAAY,EAAE,gBAAgB,CAAC,WAAW,CAAC,QAAQ,EAAE;YACrD,wBAAwB,EAAE,gBAAgB,CAAC,WAAW,CAAC,QAAQ,EAAE;YACjE,aAAa,EAAE,MAAM;YACrB,KAAK,EAAE,wCAAc;YACrB,oBAAoB,EAAE,IAAI;YAI1B,YAAY,EAAE,KAAK;YACnB,aAAa,EAAE,IAAI;YACnB,MAAM,EAAE,MAAA,gBAAgB,CAAC,MAAM,mCAAI,SAAS;SAC7C,CAAC;QAGF,MAAM,iBAAiB,GAAG,IAAI,4BAAU,CAAC,WAAW,CAAC,CAAC;QAEtD,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC;QAEpC,IAAI;YACF,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC,mBAAmB,EAAE,CAAC;YACrE,MAAM,OAAO,CAAC,GAAG,CAAC;gBAWhB,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE;oBAC3C,SAAS,EAAE,gBAAgB,CAAC,SAAS;iBACtC,CAAC;gBAMF,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,SAAS,EAAE;oBAE7C,YAAY,EAAE,cAAc,CAAC,KAAK,CAAC,cAAc;oBACjD,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAAQ,EAAE;oBAE1C,WAAW,EAAE,gBAAgB,CAAC,WAAW;oBACzC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;iBAC/C,CAAC;aACH,CAAC,CAAC;YAEH,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE;gBACjD,cAAc,EAAE,gBAAgB,CAAC,cAAc;aAChD,CAAC,CAAC;SACJ;QAAC,OAAO,GAAY,EAAE;YAErB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpB;QAGD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AApFD,uDAoFC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const IOidcOptions_1 = require("../__mocks__/IOidcOptions");
|
|
4
|
-
const canHandleTests = {
|
|
5
|
-
authorizationCodeWithPkceOidcHandler: [
|
|
6
|
-
{
|
|
7
|
-
message: "should accept a configuration with many grant types including authorization code",
|
|
8
|
-
shouldPass: true,
|
|
9
|
-
oidcOptions: {
|
|
10
|
-
...IOidcOptions_1.standardOidcOptions,
|
|
11
|
-
issuerConfiguration: {
|
|
12
|
-
...IOidcOptions_1.standardOidcOptions.issuerConfiguration,
|
|
13
|
-
grantTypesSupported: ["authorization_code", "implicit", "device"],
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
message: "should accept a configuration with only the authorization code grant type",
|
|
19
|
-
shouldPass: true,
|
|
20
|
-
oidcOptions: {
|
|
21
|
-
...IOidcOptions_1.standardOidcOptions,
|
|
22
|
-
issuerConfiguration: {
|
|
23
|
-
...IOidcOptions_1.standardOidcOptions.issuerConfiguration,
|
|
24
|
-
grantTypesSupported: ["authorization_code"],
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
message: "shouldn't accept a configuration that has many grant types not including authorization code",
|
|
30
|
-
shouldPass: false,
|
|
31
|
-
oidcOptions: {
|
|
32
|
-
...IOidcOptions_1.standardOidcOptions,
|
|
33
|
-
issuerConfiguration: {
|
|
34
|
-
...IOidcOptions_1.standardOidcOptions.issuerConfiguration,
|
|
35
|
-
grantTypesSupported: ["implicit", "device"],
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
message: "shouldn't accept a configuration that does not include grant types",
|
|
41
|
-
shouldPass: false,
|
|
42
|
-
oidcOptions: IOidcOptions_1.standardOidcOptions,
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
};
|
|
46
|
-
exports.default = canHandleTests;
|
|
47
|
-
//# sourceMappingURL=OidcHandlerCanHandleTest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OidcHandlerCanHandleTest.js","sourceRoot":"","sources":["../../../../src/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.ts"],"names":[],"mappings":";;AAsBA,4DAAgE;AAEhE,MAAM,cAAc,GAMhB;IACF,oCAAoC,EAAE;QACpC;YACE,OAAO,EACL,kFAAkF;YACpF,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE;gBACX,GAAG,kCAAmB;gBACtB,mBAAmB,EAAE;oBACnB,GAAG,kCAAmB,CAAC,mBAAmB;oBAC1C,mBAAmB,EAAE,CAAC,oBAAoB,EAAE,UAAU,EAAE,QAAQ,CAAC;iBAClE;aACF;SACF;QACD;YACE,OAAO,EACL,2EAA2E;YAC7E,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE;gBACX,GAAG,kCAAmB;gBACtB,mBAAmB,EAAE;oBACnB,GAAG,kCAAmB,CAAC,mBAAmB;oBAC1C,mBAAmB,EAAE,CAAC,oBAAoB,CAAC;iBAC5C;aACF;SACF;QACD;YACE,OAAO,EACL,6FAA6F;YAC/F,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE;gBACX,GAAG,kCAAmB;gBACtB,mBAAmB,EAAE;oBACnB,GAAG,kCAAmB,CAAC,mBAAmB;oBAC1C,mBAAmB,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;iBAC5C;aACF;SACF;QACD;YACE,OAAO,EACL,oEAAoE;YACtE,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,kCAAmB;SACjC;KACF;CACF,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const solid_client_authn_core_1 = require("@inrupt/solid-client-authn-core");
|
|
4
|
-
const oidc_client_ext_1 = require("@inrupt/oidc-client-ext");
|
|
5
|
-
class TokenRefresher {
|
|
6
|
-
constructor(storageUtility, issuerConfigFetcher, clientRegistrar) {
|
|
7
|
-
this.storageUtility = storageUtility;
|
|
8
|
-
this.issuerConfigFetcher = issuerConfigFetcher;
|
|
9
|
-
this.clientRegistrar = clientRegistrar;
|
|
10
|
-
}
|
|
11
|
-
async refresh(sessionId, refreshToken, dpopKey, eventEmitter) {
|
|
12
|
-
const oidcContext = await (0, solid_client_authn_core_1.loadOidcContextFromStorage)(sessionId, this.storageUtility, this.issuerConfigFetcher);
|
|
13
|
-
const clientInfo = await this.clientRegistrar.getClient({ sessionId }, oidcContext.issuerConfig);
|
|
14
|
-
if (refreshToken === undefined) {
|
|
15
|
-
throw new Error(`Session [${sessionId}] has no refresh token to allow it to refresh its access token.`);
|
|
16
|
-
}
|
|
17
|
-
if (oidcContext.dpop && dpopKey === undefined) {
|
|
18
|
-
throw new Error(`For session [${sessionId}], the key bound to the DPoP access token must be provided to refresh said access token.`);
|
|
19
|
-
}
|
|
20
|
-
const tokenSet = await (0, oidc_client_ext_1.refresh)(refreshToken, oidcContext.issuerConfig, clientInfo, dpopKey);
|
|
21
|
-
if (tokenSet.refreshToken !== undefined) {
|
|
22
|
-
eventEmitter === null || eventEmitter === void 0 ? void 0 : eventEmitter.emit(solid_client_authn_core_1.EVENTS.NEW_REFRESH_TOKEN, tokenSet.refreshToken);
|
|
23
|
-
await this.storageUtility.setForUser(sessionId, {
|
|
24
|
-
refreshToken: tokenSet.refreshToken,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return tokenSet;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.default = TokenRefresher;
|
|
31
|
-
//# sourceMappingURL=TokenRefresher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TokenRefresher.js","sourceRoot":"","sources":["../../../../src/login/oidc/refresh/TokenRefresher.ts"],"names":[],"mappings":";;AA0BA,6EAUyC;AACzC,6DAAkD;AAUlD,MAAqB,cAAc;IACjC,YACU,cAA+B,EAC/B,mBAAyC,EACzC,eAAiC;QAFjC,mBAAc,GAAd,cAAc,CAAiB;QAC/B,wBAAmB,GAAnB,mBAAmB,CAAsB;QACzC,oBAAe,GAAf,eAAe,CAAkB;IACxC,CAAC;IAEJ,KAAK,CAAC,OAAO,CACX,SAAiB,EACjB,YAAqB,EACrB,OAAiB,EACjB,YAA2B;QAE3B,MAAM,WAAW,GAAG,MAAM,IAAA,oDAA0B,EAClD,SAAS,EACT,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,mBAAmB,CACzB,CAAC;QAEF,MAAM,UAAU,GAAY,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAC9D,EAAE,SAAS,EAAE,EACb,WAAW,CAAC,YAAY,CACzB,CAAC;QAEF,IAAI,YAAY,KAAK,SAAS,EAAE;YAE9B,MAAM,IAAI,KAAK,CACb,YAAY,SAAS,iEAAiE,CACvF,CAAC;SACH;QAED,IAAI,WAAW,CAAC,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE;YAC7C,MAAM,IAAI,KAAK,CACb,gBAAgB,SAAS,0FAA0F,CACpH,CAAC;SACH;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAO,EAC5B,YAAY,EACZ,WAAW,CAAC,YAAY,EACxB,UAAU,EACV,OAAO,CACR,CAAC;QAEF,IAAI,QAAQ,CAAC,YAAY,KAAK,SAAS,EAAE;YACvC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAC,gCAAM,CAAC,iBAAiB,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;YACpE,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE;gBAC9C,YAAY,EAAE,QAAQ,CAAC,YAAY;aACpC,CAAC,CAAC;SACJ;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AApDD,iCAoDC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ILogoutHandler, ISessionInfoManager } from "@inrupt/solid-client-authn-core";
|
|
2
|
-
export default class GeneralLogoutHandler implements ILogoutHandler {
|
|
3
|
-
private sessionInfoManager;
|
|
4
|
-
constructor(sessionInfoManager: ISessionInfoManager);
|
|
5
|
-
canHandle(): Promise<boolean>;
|
|
6
|
-
handle(userId: string): Promise<void>;
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class GeneralLogoutHandler {
|
|
4
|
-
constructor(sessionInfoManager) {
|
|
5
|
-
this.sessionInfoManager = sessionInfoManager;
|
|
6
|
-
}
|
|
7
|
-
async canHandle() {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
async handle(userId) {
|
|
11
|
-
await this.sessionInfoManager.clear(userId);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.default = GeneralLogoutHandler;
|
|
15
|
-
//# sourceMappingURL=GeneralLogoutHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GeneralLogoutHandler.js","sourceRoot":"","sources":["../../src/logout/GeneralLogoutHandler.ts"],"names":[],"mappings":";;AAkCA,MAAqB,oBAAoB;IACvC,YAAoB,kBAAuC;QAAvC,uBAAkB,GAAlB,kBAAkB,CAAqB;IAAG,CAAC;IAE/D,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc;QACzB,MAAM,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;CACF;AAVD,uCAUC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SessionInfoManager = exports.clear = exports.getUnauthenticatedSession = void 0;
|
|
4
|
-
const solid_client_authn_core_1 = require("@inrupt/solid-client-authn-core");
|
|
5
|
-
const uuid_1 = require("uuid");
|
|
6
|
-
const oidc_client_ext_1 = require("@inrupt/oidc-client-ext");
|
|
7
|
-
const universal_fetch_1 = require("@inrupt/universal-fetch");
|
|
8
|
-
function getUnauthenticatedSession() {
|
|
9
|
-
return {
|
|
10
|
-
isLoggedIn: false,
|
|
11
|
-
sessionId: (0, uuid_1.v4)(),
|
|
12
|
-
fetch: universal_fetch_1.fetch,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
exports.getUnauthenticatedSession = getUnauthenticatedSession;
|
|
16
|
-
async function clear(sessionId, storage) {
|
|
17
|
-
await Promise.all([
|
|
18
|
-
storage.deleteAllUserData(sessionId, { secure: false }),
|
|
19
|
-
storage.deleteAllUserData(sessionId, { secure: true }),
|
|
20
|
-
storage.delete("clientKey", { secure: false }),
|
|
21
|
-
]);
|
|
22
|
-
await (0, oidc_client_ext_1.clearOidcPersistentStorage)();
|
|
23
|
-
}
|
|
24
|
-
exports.clear = clear;
|
|
25
|
-
class SessionInfoManager {
|
|
26
|
-
constructor(storageUtility) {
|
|
27
|
-
this.storageUtility = storageUtility;
|
|
28
|
-
}
|
|
29
|
-
update(_sessionId, _options) {
|
|
30
|
-
throw new Error("Not Implemented");
|
|
31
|
-
}
|
|
32
|
-
async get(sessionId) {
|
|
33
|
-
var _a;
|
|
34
|
-
const isLoggedIn = await this.storageUtility.getForUser(sessionId, "isLoggedIn", {
|
|
35
|
-
secure: true,
|
|
36
|
-
});
|
|
37
|
-
const webId = await this.storageUtility.getForUser(sessionId, "webId", {
|
|
38
|
-
secure: true,
|
|
39
|
-
});
|
|
40
|
-
const clientId = await this.storageUtility.getForUser(sessionId, "clientId", {
|
|
41
|
-
secure: false,
|
|
42
|
-
});
|
|
43
|
-
const clientSecret = await this.storageUtility.getForUser(sessionId, "clientSecret", {
|
|
44
|
-
secure: false,
|
|
45
|
-
});
|
|
46
|
-
const redirectUrl = await this.storageUtility.getForUser(sessionId, "redirectUrl", {
|
|
47
|
-
secure: false,
|
|
48
|
-
});
|
|
49
|
-
const refreshToken = await this.storageUtility.getForUser(sessionId, "refreshToken", {
|
|
50
|
-
secure: true,
|
|
51
|
-
});
|
|
52
|
-
const issuer = await this.storageUtility.getForUser(sessionId, "issuer", {
|
|
53
|
-
secure: false,
|
|
54
|
-
});
|
|
55
|
-
const tokenType = (_a = (await this.storageUtility.getForUser(sessionId, "tokenType", {
|
|
56
|
-
secure: false,
|
|
57
|
-
}))) !== null && _a !== void 0 ? _a : "DPoP";
|
|
58
|
-
if (!(0, solid_client_authn_core_1.isSupportedTokenType)(tokenType)) {
|
|
59
|
-
throw new Error(`Tokens of type [${tokenType}] are not supported.`);
|
|
60
|
-
}
|
|
61
|
-
if (clientId === undefined &&
|
|
62
|
-
isLoggedIn === undefined &&
|
|
63
|
-
webId === undefined &&
|
|
64
|
-
refreshToken === undefined) {
|
|
65
|
-
return undefined;
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
sessionId,
|
|
69
|
-
webId,
|
|
70
|
-
isLoggedIn: isLoggedIn === "true",
|
|
71
|
-
redirectUrl,
|
|
72
|
-
refreshToken,
|
|
73
|
-
issuer,
|
|
74
|
-
clientAppId: clientId,
|
|
75
|
-
clientAppSecret: clientSecret,
|
|
76
|
-
tokenType,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
async getAll() {
|
|
80
|
-
throw new Error("Not implemented");
|
|
81
|
-
}
|
|
82
|
-
async clear(sessionId) {
|
|
83
|
-
return clear(sessionId, this.storageUtility);
|
|
84
|
-
}
|
|
85
|
-
async register(_sessionId) {
|
|
86
|
-
throw new Error("Not implemented");
|
|
87
|
-
}
|
|
88
|
-
async getRegisteredSessionIdAll() {
|
|
89
|
-
throw new Error("Not implemented");
|
|
90
|
-
}
|
|
91
|
-
async clearAll() {
|
|
92
|
-
throw new Error("Not implemented");
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.SessionInfoManager = SessionInfoManager;
|
|
96
|
-
//# sourceMappingURL=SessionInfoManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SessionInfoManager.js","sourceRoot":"","sources":["../../src/sessionInfo/SessionInfoManager.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The buffer module from node.js, for the browser.
|
|
3
|
-
*
|
|
4
|
-
* @author Feross Aboukhadijeh <http://feross.org>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class BrowserStorage {
|
|
4
|
-
get storage() {
|
|
5
|
-
return window.localStorage;
|
|
6
|
-
}
|
|
7
|
-
async get(key) {
|
|
8
|
-
return this.storage.getItem(key) || undefined;
|
|
9
|
-
}
|
|
10
|
-
async set(key, value) {
|
|
11
|
-
this.storage.setItem(key, value);
|
|
12
|
-
}
|
|
13
|
-
async delete(key) {
|
|
14
|
-
this.storage.removeItem(key);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.default = BrowserStorage;
|
|
18
|
-
//# sourceMappingURL=BrowserStorage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserStorage.js","sourceRoot":"","sources":["../../src/storage/BrowserStorage.ts"],"names":[],"mappings":";;AA+BA,MAAqB,cAAc;IACjC,IAAI,OAAO;QACT,OAAO,MAAM,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAa;QAClC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;CACF;AAhBD,iCAgBC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const solid_client_authn_core_1 = require("@inrupt/solid-client-authn-core");
|
|
4
|
-
class StorageUtilityBrowser extends solid_client_authn_core_1.StorageUtility {
|
|
5
|
-
constructor(secureStorage, insecureStorage) {
|
|
6
|
-
super(secureStorage, insecureStorage);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
exports.default = StorageUtilityBrowser;
|
|
10
|
-
//# sourceMappingURL=StorageUtility.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StorageUtility.js","sourceRoot":"","sources":["../../src/storage/StorageUtility.ts"],"names":[],"mappings":";;AA6BA,6EAA2E;AAS3E,MAAqB,qBAAsB,SAAQ,wCAAc;IAC/D,YAAY,aAAuB,EAAE,eAAyB;QAC5D,KAAK,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IACxC,CAAC;CACF;AAJD,wCAIC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UuidGenerator.js","sourceRoot":"","sources":["../../src/util/UuidGenerator.ts"],"names":[],"mappings":";;AA6BA,+BAA0B;AAY1B,MAAqB,aAAa;IAEhC,EAAE;QACA,OAAO,IAAA,SAAE,GAAE,CAAC;IACd,CAAC;CACF;AALD,gCAKC"}
|
package/licenses.csv
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
"module name","license","repository"
|
|
2
|
-
"@inrupt/oidc-dpop-client-browser@0.2.0","MIT",""
|
|
3
|
-
"@inrupt/solid-client-authn-browser@0.2.0","MIT","https://github.com/inrupt/solid-client-authn"
|
|
4
|
-
"@inrupt/solid-client-authn-core@0.2.0","MIT","https://github.com/inrupt/solid-client-authn"
|
|
5
|
-
"@panva/asn1.js@1.0.0","MIT","https://github.com/panva/asn1.js"
|
|
6
|
-
"@types/form-urlencoded@2.0.1","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
|
|
7
|
-
"@types/jjv@1.0.29","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
|
|
8
|
-
"@types/jsonwebtoken@8.5.0","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
|
|
9
|
-
"@types/lodash.clonedeep@4.5.6","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
|
|
10
|
-
"@types/lodash@4.14.161","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
|
|
11
|
-
"@types/node-jose@1.1.5","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
|
|
12
|
-
"@types/node@14.11.2","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
|
|
13
|
-
"@types/url-parse@1.4.3","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
|
|
14
|
-
"@types/uuid@8.3.0","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
|
|
15
|
-
"abstract-leveldown@0.12.4","MIT","https://github.com/rvagg/node-abstract-leveldown"
|
|
16
|
-
"asn1.js@5.4.1","MIT","https://github.com/indutny/asn1.js"
|
|
17
|
-
"base64-js@1.3.1","MIT","https://github.com/beatgammit/base64-js"
|
|
18
|
-
"base64url@3.0.1","MIT","https://github.com/brianloveswords/base64url"
|
|
19
|
-
"bl@0.8.2","MIT","https://github.com/rvagg/bl"
|
|
20
|
-
"bn.js@4.11.9","MIT","https://github.com/indutny/bn.js"
|
|
21
|
-
"bn.js@5.1.3","MIT","https://github.com/indutny/bn.js"
|
|
22
|
-
"brorand@1.1.0","MIT","https://github.com/indutny/brorand"
|
|
23
|
-
"browserify-aes@1.2.0","MIT","https://github.com/crypto-browserify/browserify-aes"
|
|
24
|
-
"browserify-cipher@1.0.1","MIT","https://github.com/crypto-browserify/browserify-cipher"
|
|
25
|
-
"browserify-des@1.0.2","MIT","https://github.com/crypto-browserify/browserify-des"
|
|
26
|
-
"browserify-fs@1.0.0","MIT*","https://github.com/mafintosh/browserify-fs"
|
|
27
|
-
"browserify-rsa@4.0.1","MIT","https://github.com/crypto-browserify/browserify-rsa"
|
|
28
|
-
"browserify-sign@4.2.1","ISC","https://github.com/crypto-browserify/browserify-sign"
|
|
29
|
-
"buffer-equal-constant-time@1.0.1","BSD-3-Clause","https://github.com/goinstant/buffer-equal-constant-time"
|
|
30
|
-
"buffer-es6@4.9.3","MIT","https://github.com/calvinmetcalf/buffer-es6"
|
|
31
|
-
"buffer-from@1.1.1","MIT","https://github.com/LinusU/buffer-from"
|
|
32
|
-
"buffer-xor@1.0.3","MIT","https://github.com/crypto-browserify/buffer-xor"
|
|
33
|
-
"buffer@5.6.0","MIT","https://github.com/feross/buffer"
|
|
34
|
-
"build-module@1.0.7","ISC","https://github.com/bnwan/buildModule"
|
|
35
|
-
"cipher-base@1.0.4","MIT","https://github.com/crypto-browserify/cipher-base"
|
|
36
|
-
"clone@0.1.19","MIT","https://github.com/pvorb/node-clone"
|
|
37
|
-
"concat-stream@1.6.2","MIT","https://github.com/maxogden/concat-stream"
|
|
38
|
-
"core-js@2.6.11","MIT","https://github.com/zloirock/core-js"
|
|
39
|
-
"core-util-is@1.0.2","MIT","https://github.com/isaacs/core-util-is"
|
|
40
|
-
"create-ecdh@4.0.4","MIT","https://github.com/crypto-browserify/createECDH"
|
|
41
|
-
"create-hash@1.2.0","MIT","https://github.com/crypto-browserify/createHash"
|
|
42
|
-
"create-hmac@1.1.7","MIT","https://github.com/crypto-browserify/createHmac"
|
|
43
|
-
"cross-fetch@3.0.6","MIT","https://github.com/lquixada/cross-fetch"
|
|
44
|
-
"crypto-browserify@3.12.0","MIT","https://github.com/crypto-browserify/crypto-browserify"
|
|
45
|
-
"crypto-js@3.3.0","MIT","https://github.com/brix/crypto-js"
|
|
46
|
-
"crypto-random-string@3.3.0","MIT","https://github.com/sindresorhus/crypto-random-string"
|
|
47
|
-
"deferred-leveldown@0.2.0","MIT","https://github.com/Level/deferred-leveldown"
|
|
48
|
-
"des.js@1.0.1","MIT","https://github.com/indutny/des.js"
|
|
49
|
-
"diffie-hellman@5.0.3","MIT","https://github.com/crypto-browserify/diffie-hellman"
|
|
50
|
-
"ecdsa-sig-formatter@1.0.11","Apache-2.0","https://github.com/Brightspace/node-ecdsa-sig-formatter"
|
|
51
|
-
"elliptic@6.5.3","MIT","https://github.com/indutny/elliptic"
|
|
52
|
-
"errno@0.1.7","MIT","https://github.com/rvagg/node-errno"
|
|
53
|
-
"es6-promise@4.2.8","MIT","https://github.com/stefanpenner/es6-promise"
|
|
54
|
-
"evp_bytestokey@1.0.3","MIT","https://github.com/crypto-browserify/EVP_BytesToKey"
|
|
55
|
-
"foreach@2.0.5","MIT","https://github.com/manuelstofer/foreach"
|
|
56
|
-
"form-urlencoded@4.2.1","MIT","https://github.com/iambumblehead/form-urlencoded"
|
|
57
|
-
"fwd-stream@1.0.4","MIT*","https://github.com/mafintosh/fwd-stream"
|
|
58
|
-
"hash-base@3.1.0","MIT","https://github.com/crypto-browserify/hash-base"
|
|
59
|
-
"hash.js@1.1.7","MIT","https://github.com/indutny/hash.js"
|
|
60
|
-
"hmac-drbg@1.0.1","MIT","https://github.com/indutny/hmac-drbg"
|
|
61
|
-
"idb-wrapper@1.7.2","MIT","https://github.com/jensarps/IDBWrapper"
|
|
62
|
-
"ieee754@1.1.13","BSD-3-Clause","https://github.com/feross/ieee754"
|
|
63
|
-
"indexof@0.0.1","MIT*",""
|
|
64
|
-
"inherits@2.0.4","ISC","https://github.com/isaacs/inherits"
|
|
65
|
-
"is-object@0.1.2","MIT","https://github.com/Colingo/is-object"
|
|
66
|
-
"is@0.2.7","MIT*","https://github.com/enricomarino/is"
|
|
67
|
-
"isarray@0.0.1","MIT","https://github.com/juliangruber/isarray"
|
|
68
|
-
"isarray@1.0.0","MIT","https://github.com/juliangruber/isarray"
|
|
69
|
-
"isbuffer@0.0.0","MIT","https://github.com/juliangruber/isbuffer"
|
|
70
|
-
"jose@2.0.2","MIT","https://github.com/panva/jose"
|
|
71
|
-
"jsonwebtoken@8.5.1","MIT","https://github.com/auth0/node-jsonwebtoken"
|
|
72
|
-
"jwa@1.4.1","MIT","https://github.com/brianloveswords/node-jwa"
|
|
73
|
-
"jws@3.2.2","MIT","https://github.com/brianloveswords/node-jws"
|
|
74
|
-
"level-blobs@0.1.7","MIT*","https://github.com/mafintosh/level-blobs"
|
|
75
|
-
"level-filesystem@1.2.0","MIT*","https://github.com/mafintosh/level-filesystem"
|
|
76
|
-
"level-fix-range@1.0.2","MIT","https://github.com/dominictarr/level-fix-range"
|
|
77
|
-
"level-fix-range@2.0.0","MIT","https://github.com/dominictarr/level-fix-range"
|
|
78
|
-
"level-hooks@4.5.0","MIT*","https://github.com/dominictarr/level-hooks"
|
|
79
|
-
"level-js@2.2.4","BSD-2-Clause","https://github.com/maxogden/level.js"
|
|
80
|
-
"level-peek@1.0.6","MIT","https://github.com/dominictarr/level-peek"
|
|
81
|
-
"level-sublevel@5.2.3","MIT","https://github.com/dominictarr/level-sublevel"
|
|
82
|
-
"levelup@0.18.6","MIT","https://github.com/rvagg/node-levelup"
|
|
83
|
-
"lodash.clonedeep@4.5.0","MIT","https://github.com/lodash/lodash"
|
|
84
|
-
"lodash.includes@4.3.0","MIT","https://github.com/lodash/lodash"
|
|
85
|
-
"lodash.isboolean@3.0.3","MIT","https://github.com/lodash/lodash"
|
|
86
|
-
"lodash.isinteger@4.0.4","MIT","https://github.com/lodash/lodash"
|
|
87
|
-
"lodash.isnumber@3.0.3","MIT","https://github.com/lodash/lodash"
|
|
88
|
-
"lodash.isplainobject@4.0.6","MIT","https://github.com/lodash/lodash"
|
|
89
|
-
"lodash.isstring@4.0.1","MIT","https://github.com/lodash/lodash"
|
|
90
|
-
"lodash.once@4.1.1","MIT","https://github.com/lodash/lodash"
|
|
91
|
-
"lodash@4.17.20","MIT","https://github.com/lodash/lodash"
|
|
92
|
-
"long@4.0.0","Apache-2.0","https://github.com/dcodeIO/long.js"
|
|
93
|
-
"ltgt@2.2.1","MIT","https://github.com/dominictarr/ltgt"
|
|
94
|
-
"md5.js@1.3.5","MIT","https://github.com/crypto-browserify/md5.js"
|
|
95
|
-
"miller-rabin@4.0.1","MIT","https://github.com/indutny/miller-rabin"
|
|
96
|
-
"minimalistic-assert@1.0.1","ISC","https://github.com/calvinmetcalf/minimalistic-assert"
|
|
97
|
-
"minimalistic-crypto-utils@1.0.1","MIT","https://github.com/indutny/minimalistic-crypto-utils"
|
|
98
|
-
"ms@2.1.2","MIT","https://github.com/zeit/ms"
|
|
99
|
-
"node-fetch@2.6.1","MIT","https://github.com/bitinn/node-fetch"
|
|
100
|
-
"node-forge@0.10.0","(BSD-3-Clause OR GPL-2.0)","https://github.com/digitalbazaar/forge"
|
|
101
|
-
"node-jose@2.0.0","Apache-2.0","https://github.com/cisco/node-jose"
|
|
102
|
-
"object-keys@0.2.0","MIT","https://github.com/ljharb/object-keys"
|
|
103
|
-
"object-keys@0.4.0","MIT","https://github.com/ljharb/object-keys"
|
|
104
|
-
"octal@1.0.0","MIT","https://github.com/mafintosh/octal"
|
|
105
|
-
"oidc-client@1.10.1","Apache-2.0","https://github.com/IdentityModel/oidc-client-js"
|
|
106
|
-
"once@1.4.0","ISC","https://github.com/isaacs/once"
|
|
107
|
-
"pako@1.0.11","(MIT AND Zlib)","https://github.com/nodeca/pako"
|
|
108
|
-
"parse-asn1@5.1.6","ISC","https://github.com/crypto-browserify/parse-asn1"
|
|
109
|
-
"pbkdf2@3.1.1","MIT","https://github.com/crypto-browserify/pbkdf2"
|
|
110
|
-
"process-es6@0.11.6","MIT","https://github.com/calvinmetcalf/node-process-es6"
|
|
111
|
-
"process-nextick-args@2.0.1","MIT","https://github.com/calvinmetcalf/process-nextick-args"
|
|
112
|
-
"process@0.11.10","MIT","https://github.com/shtylman/node-process"
|
|
113
|
-
"prr@0.0.0","MIT","https://github.com/rvagg/prr"
|
|
114
|
-
"prr@1.0.1","MIT","https://github.com/rvagg/prr"
|
|
115
|
-
"public-encrypt@4.0.3","MIT","https://github.com/crypto-browserify/publicEncrypt"
|
|
116
|
-
"querystringify@2.2.0","MIT","https://github.com/unshiftio/querystringify"
|
|
117
|
-
"randombytes@2.1.0","MIT","https://github.com/crypto-browserify/randombytes"
|
|
118
|
-
"randomfill@1.0.4","MIT","https://github.com/crypto-browserify/randomfill"
|
|
119
|
-
"readable-stream@1.0.34","MIT","https://github.com/isaacs/readable-stream"
|
|
120
|
-
"readable-stream@1.1.14","MIT","https://github.com/isaacs/readable-stream"
|
|
121
|
-
"readable-stream@2.3.7","MIT","https://github.com/nodejs/readable-stream"
|
|
122
|
-
"readable-stream@3.6.0","MIT","https://github.com/nodejs/readable-stream"
|
|
123
|
-
"requires-port@1.0.0","MIT","https://github.com/unshiftio/requires-port"
|
|
124
|
-
"ripemd160@2.0.2","MIT","https://github.com/crypto-browserify/ripemd160"
|
|
125
|
-
"rollup-plugin-node-builtins@2.1.2","ISC","https://github.com/calvinmetcalf/rollup-plugin-node-builtins"
|
|
126
|
-
"safe-buffer@5.1.2","MIT","https://github.com/feross/safe-buffer"
|
|
127
|
-
"safe-buffer@5.2.1","MIT","https://github.com/feross/safe-buffer"
|
|
128
|
-
"safer-buffer@2.1.2","MIT","https://github.com/ChALkeR/safer-buffer"
|
|
129
|
-
"semver@2.3.2","BSD*","https://github.com/isaacs/node-semver"
|
|
130
|
-
"semver@5.7.1","ISC","https://github.com/npm/node-semver"
|
|
131
|
-
"sha.js@2.4.11","(MIT AND BSD-3-Clause)","https://github.com/crypto-browserify/sha.js"
|
|
132
|
-
"string-range@1.2.2","MIT","https://github.com/dominictarr/string-range"
|
|
133
|
-
"string_decoder@0.10.31","MIT","https://github.com/rvagg/string_decoder"
|
|
134
|
-
"string_decoder@1.1.1","MIT","https://github.com/nodejs/string_decoder"
|
|
135
|
-
"tslib@1.13.0","0BSD","https://github.com/Microsoft/tslib"
|
|
136
|
-
"type-fest@0.8.1","(MIT OR CC0-1.0)","https://github.com/sindresorhus/type-fest"
|
|
137
|
-
"typedarray-to-buffer@1.0.4","MIT","https://github.com/feross/typedarray-to-buffer"
|
|
138
|
-
"typedarray@0.0.6","MIT","https://github.com/substack/typedarray"
|
|
139
|
-
"url-parse@1.4.7","MIT","https://github.com/unshiftio/url-parse"
|
|
140
|
-
"util-deprecate@1.0.2","MIT","https://github.com/TooTallNate/util-deprecate"
|
|
141
|
-
"uuid@3.4.0","MIT","https://github.com/uuidjs/uuid"
|
|
142
|
-
"uuid@8.3.1","MIT","https://github.com/uuidjs/uuid"
|
|
143
|
-
"wrappy@1.0.2","ISC","https://github.com/npm/wrappy"
|
|
144
|
-
"xtend@2.0.6","MIT","https://github.com/Raynos/xtend"
|
|
145
|
-
"xtend@2.1.2","MIT","https://github.com/Raynos/xtend"
|
|
146
|
-
"xtend@2.2.0","MIT","https://github.com/Raynos/xtend"
|
|
147
|
-
"xtend@3.0.0","MIT","https://github.com/Raynos/xtend"
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 Inrupt Inc.
|
|
3
|
-
//
|
|
4
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
-
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
-
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
-
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
-
// subject to the following conditions:
|
|
10
|
-
//
|
|
11
|
-
// The above copyright notice and this permission notice shall be included in
|
|
12
|
-
// all copies or substantial portions of the Software.
|
|
13
|
-
//
|
|
14
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
-
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
-
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
-
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
-
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
-
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
import { it, describe, expect } from "@jest/globals";
|
|
23
|
-
import { mockStorageUtility } from "@inrupt/solid-client-authn-core";
|
|
24
|
-
import LogoutHandler from "./GeneralLogoutHandler";
|
|
25
|
-
import { mockSessionInfoManager } from "../sessionInfo/__mocks__/SessionInfoManager";
|
|
26
|
-
|
|
27
|
-
describe("GeneralLogoutHandler", () => {
|
|
28
|
-
const defaultMocks = {
|
|
29
|
-
sessionManager: mockSessionInfoManager(mockStorageUtility({})),
|
|
30
|
-
};
|
|
31
|
-
function getInitialisedHandler(
|
|
32
|
-
mocks: Partial<typeof defaultMocks> = defaultMocks
|
|
33
|
-
): LogoutHandler {
|
|
34
|
-
return new LogoutHandler(
|
|
35
|
-
mocks.sessionManager ?? defaultMocks.sessionManager
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
describe("canHandle", () => {
|
|
40
|
-
it("should always be able to handle logout", async () => {
|
|
41
|
-
const logoutHandler = getInitialisedHandler();
|
|
42
|
-
await expect(logoutHandler.canHandle()).resolves.toBe(true);
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe("handle", () => {
|
|
47
|
-
it("should clear the local storage (both secure and not secure) when logging out", async () => {
|
|
48
|
-
const nonEmptyStorage = mockStorageUtility({
|
|
49
|
-
someUser: { someKey: "someValue" },
|
|
50
|
-
});
|
|
51
|
-
await nonEmptyStorage.setForUser(
|
|
52
|
-
"someUser",
|
|
53
|
-
{ someKey: "someValue" },
|
|
54
|
-
{ secure: true }
|
|
55
|
-
);
|
|
56
|
-
const logoutHandler = getInitialisedHandler({
|
|
57
|
-
sessionManager: mockSessionInfoManager(nonEmptyStorage),
|
|
58
|
-
});
|
|
59
|
-
await logoutHandler.handle("someUser");
|
|
60
|
-
await expect(
|
|
61
|
-
nonEmptyStorage.getForUser("someUser", "someKey", { secure: true })
|
|
62
|
-
).resolves.toBeUndefined();
|
|
63
|
-
await expect(
|
|
64
|
-
nonEmptyStorage.getForUser("someUser", "someKey", { secure: false })
|
|
65
|
-
).resolves.toBeUndefined();
|
|
66
|
-
// This test is only necessary until the key is stored safely
|
|
67
|
-
await expect(
|
|
68
|
-
nonEmptyStorage.get("clientKey", { secure: false })
|
|
69
|
-
).resolves.toBeUndefined();
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 Inrupt Inc.
|
|
3
|
-
//
|
|
4
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
-
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
-
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
-
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
-
// subject to the following conditions:
|
|
10
|
-
//
|
|
11
|
-
// The above copyright notice and this permission notice shall be included in
|
|
12
|
-
// all copies or substantial portions of the Software.
|
|
13
|
-
//
|
|
14
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
-
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
-
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
-
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
-
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
-
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
import {
|
|
23
|
-
ILogoutHandler,
|
|
24
|
-
IStorageUtility,
|
|
25
|
-
} from "@inrupt/solid-client-authn-core";
|
|
26
|
-
import { jest } from "@jest/globals";
|
|
27
|
-
import { clear } from "../../sessionInfo/SessionInfoManager";
|
|
28
|
-
|
|
29
|
-
export const mockLogoutHandler = (
|
|
30
|
-
storageUtility: IStorageUtility
|
|
31
|
-
): ILogoutHandler => {
|
|
32
|
-
return {
|
|
33
|
-
canHandle: jest.fn(async (_localUserId: string) => Promise.resolve(true)),
|
|
34
|
-
handle: jest.fn(async (localUserId: string) => {
|
|
35
|
-
return clear(localUserId, storageUtility);
|
|
36
|
-
}),
|
|
37
|
-
};
|
|
38
|
-
};
|