@celljs/oauth2-client 3.4.4 → 3.5.2
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/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/oauth2-client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/node/index.js",
|
|
6
6
|
"typings": "lib/node/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@celljs/core": "3.
|
|
9
|
-
"@celljs/http": "3.
|
|
10
|
-
"@celljs/oauth2-core": "3.
|
|
11
|
-
"@celljs/oauth2-jose": "3.
|
|
12
|
-
"@celljs/security": "3.
|
|
13
|
-
"@celljs/web": "3.
|
|
8
|
+
"@celljs/core": "3.5.2",
|
|
9
|
+
"@celljs/http": "3.5.2",
|
|
10
|
+
"@celljs/oauth2-core": "3.5.2",
|
|
11
|
+
"@celljs/oauth2-jose": "3.5.2",
|
|
12
|
+
"@celljs/security": "3.5.2",
|
|
13
|
+
"@celljs/web": "3.5.2",
|
|
14
14
|
"axios": "^0.26.1",
|
|
15
15
|
"crypto-js": "^3.1.47",
|
|
16
16
|
"jose": "^4.9.3",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"test": "cell-component test:js"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@celljs/component": "3.
|
|
48
|
+
"@celljs/component": "3.5.2",
|
|
49
49
|
"@types/crypto-js": "^3.1.47"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "4dc9306d54b4ff068f18e0183426946a4afe2500"
|
|
52
52
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ErrorHandler, Context, RedirectStrategy } from '@celljs/web/lib/node';
|
|
2
|
-
import { OAuth2AuthorizationError, AuthorizationRequest } from '@celljs/oauth2-core';
|
|
3
|
-
import { AuthorizationRequestManager } from '../authorization';
|
|
4
|
-
export declare class OAuth2AuthorizationErrorHandler implements ErrorHandler {
|
|
5
|
-
readonly priority: number;
|
|
6
|
-
protected readonly redirectStrategy: RedirectStrategy;
|
|
7
|
-
protected readonly authorizationRequestManager: AuthorizationRequestManager<AuthorizationRequest>;
|
|
8
|
-
canHandle(ctx: Context, err: Error): Promise<boolean>;
|
|
9
|
-
handle(ctx: Context, err: OAuth2AuthorizationError): Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=error-hander.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-hander.d.ts","sourceRoot":"","sources":["../../../src/node/error/error-hander.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAwB,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAG/D,qBACa,+BAAgC,YAAW,YAAY;IAChE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAA+C;IAGxE,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAGtD,SAAS,CAAC,QAAQ,CAAC,2BAA2B,EAAE,2BAA2B,CAAC,oBAAoB,CAAC,CAAC;IAElG,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/C,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;CAiB3E"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OAuth2AuthorizationErrorHandler = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const error_protocol_1 = require("./error-protocol");
|
|
6
|
-
const node_1 = require("@celljs/web/lib/node");
|
|
7
|
-
const core_1 = require("@celljs/core");
|
|
8
|
-
const oauth2_core_1 = require("@celljs/oauth2-core");
|
|
9
|
-
const authorization_1 = require("../authorization");
|
|
10
|
-
const crypto_js_1 = require("crypto-js");
|
|
11
|
-
let OAuth2AuthorizationErrorHandler = class OAuth2AuthorizationErrorHandler {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.priority = error_protocol_1.OAUTH2_AUTHORIZATION_ERROR_HANDLER_PRIORITY;
|
|
14
|
-
}
|
|
15
|
-
canHandle(ctx, err) {
|
|
16
|
-
return Promise.resolve(err instanceof oauth2_core_1.OAuth2AuthorizationError);
|
|
17
|
-
}
|
|
18
|
-
async handle(ctx, err) {
|
|
19
|
-
const { oauth2Error } = err;
|
|
20
|
-
const authorizationRequest = await this.authorizationRequestManager.remove();
|
|
21
|
-
let redirectUri = `${authorizationRequest.redirectUri}?${oauth2_core_1.OAuth2ParameterNames.ERROR}=${oauth2Error.errorCode}`;
|
|
22
|
-
if (oauth2Error.description) {
|
|
23
|
-
redirectUri = `${redirectUri}&${oauth2_core_1.OAuth2ParameterNames.ERROR_DESCRIPTION}=${crypto_js_1.enc.Base64.stringify(crypto_js_1.enc.Utf8.parse(oauth2Error.description))}`;
|
|
24
|
-
}
|
|
25
|
-
if (oauth2Error.uri) {
|
|
26
|
-
redirectUri = `${redirectUri}&${oauth2_core_1.OAuth2ParameterNames.ERROR_URI}=${crypto_js_1.enc.Base64.stringify(crypto_js_1.enc.Utf8.parse(oauth2Error.uri))}`;
|
|
27
|
-
}
|
|
28
|
-
await this.redirectStrategy.send(redirectUri);
|
|
29
|
-
ctx.response.end(err.message);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
tslib_1.__decorate([
|
|
33
|
-
(0, core_1.Autowired)(node_1.RedirectStrategy),
|
|
34
|
-
tslib_1.__metadata("design:type", Object)
|
|
35
|
-
], OAuth2AuthorizationErrorHandler.prototype, "redirectStrategy", void 0);
|
|
36
|
-
tslib_1.__decorate([
|
|
37
|
-
(0, core_1.Autowired)(authorization_1.AuthorizationRequestManager),
|
|
38
|
-
tslib_1.__metadata("design:type", Object)
|
|
39
|
-
], OAuth2AuthorizationErrorHandler.prototype, "authorizationRequestManager", void 0);
|
|
40
|
-
OAuth2AuthorizationErrorHandler = tslib_1.__decorate([
|
|
41
|
-
(0, core_1.Component)(node_1.ErrorHandler)
|
|
42
|
-
], OAuth2AuthorizationErrorHandler);
|
|
43
|
-
exports.OAuth2AuthorizationErrorHandler = OAuth2AuthorizationErrorHandler;
|
|
44
|
-
//# sourceMappingURL=error-hander.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-hander.js","sourceRoot":"","sources":["../../../src/node/error/error-hander.ts"],"names":[],"mappings":";;;;AAAA,qDAA+E;AAC/E,+CAA+E;AAC/E,uCAAoD;AACpD,qDAA2G;AAC3G,oDAA+D;AAC/D,yCAAgC;AAGzB,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAArC;QACM,aAAQ,GAAW,4DAA2C,CAAC;IA6B5E,CAAC;IArBG,SAAS,CAAC,GAAY,EAAE,GAAU;QAC9B,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,YAAY,sCAAwB,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAY,EAAE,GAA6B;QACpD,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC;QAC5B,MAAM,oBAAoB,GAAyB,MAAM,IAAI,CAAC,2BAA2B,CAAC,MAAM,EAAE,CAAC;QAEnG,IAAI,WAAW,GAAG,GAAG,oBAAoB,CAAC,WAAW,IAAI,kCAAoB,CAAC,KAAK,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC;QAC/G,IAAI,WAAW,CAAC,WAAW,EAAE;YACzB,WAAW,GAAG,GAAG,WAAW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