chyz 2.0.0-rc.44 → 2.0.0-rc.46
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/base/CWebController.d.ts.map +1 -1
- package/filters/auth/HttpBasicAuth.js +1 -1
- package/filters/auth/HttpBearerAuth.d.ts.map +1 -1
- package/filters/auth/HttpHeaderAuth.d.ts +4 -0
- package/filters/auth/HttpHeaderAuth.d.ts.map +1 -1
- package/filters/auth/HttpHeaderAuth.js +9 -2
- package/filters/auth/JwtHttpBearerAuth.d.ts.map +1 -1
- package/filters/auth/JwtHttpBearerAuth.js +1 -1
- package/filters/auth/KeyCloakHttpBearerAuth.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CWebController.d.ts","sourceRoot":"","sources":["../../src/base/CWebController.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAI1C,qBAAa,cAAe,SAAQ,SAAS;IAGzC;;OAEG;IACI,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,SAAW;gBAEnB,MAAM,EAAE,GAAG;IAKhB,IAAI;IAKX;;;OAGG;IACU,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"CWebController.d.ts","sourceRoot":"","sources":["../../src/base/CWebController.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAI1C,qBAAa,cAAe,SAAQ,SAAS;IAGzC;;OAEG;IACI,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,SAAW;gBAEnB,MAAM,EAAE,GAAG;IAKhB,IAAI;IAKX;;;OAGG;IACU,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IAc7E;;;OAGG;IACI,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IAK3D;;;;;;;OAOG;IACI,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,OAAO,EAAE,MAAM,GAAE,GAAQ;IAI9D;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,GAAG;IAIhB;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,GAAG;CAIlB"}
|
|
@@ -50,7 +50,7 @@ class HttpBasicAuth extends AuthMethod_1.AuthMethod {
|
|
|
50
50
|
return __awaiter(this, arguments, void 0, function* () {
|
|
51
51
|
let autHeader = this.getHeaderByKey(request.headers, this.header);
|
|
52
52
|
if (autHeader == null || (autHeader = this.patternCheck(autHeader, this.pattern)) == null) {
|
|
53
|
-
return
|
|
53
|
+
return this.fail(response);
|
|
54
54
|
}
|
|
55
55
|
let identity = null;
|
|
56
56
|
let token = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpBearerAuth.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/HttpBearerAuth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,qBAAa,cAAe,SAAQ,cAAc;IAE9C;;OAEG;IACI,MAAM,SAAmB;IAEzB,OAAO,SAAsB;IACpC;;OAEG;IACI,KAAK,SAAS;IAGrB;;OAEG;IACI,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"HttpBearerAuth.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/HttpBearerAuth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,qBAAa,cAAe,SAAQ,cAAc;IAE9C;;OAEG;IACI,MAAM,SAAmB;IAEzB,OAAO,SAAsB;IACpC;;OAEG;IACI,KAAK,SAAS;IAGrB;;OAEG;IACI,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAE,QAAQ;CAMhD"}
|
|
@@ -11,5 +11,9 @@ export declare class HttpHeaderAuth extends AuthMethod {
|
|
|
11
11
|
*/
|
|
12
12
|
pattern: string;
|
|
13
13
|
authenticate(user: WebUser, request: Request, response: Response): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* @throws UnauthorizedHttpException
|
|
16
|
+
*/
|
|
17
|
+
fail(response: Response): void;
|
|
14
18
|
}
|
|
15
19
|
//# sourceMappingURL=HttpHeaderAuth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpHeaderAuth.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/HttpHeaderAuth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE1C,qBAAa,cAAe,SAAQ,UAAU;IAC1C;;OAEG;IACI,MAAM,SAAe;IAG5B;;OAEG;IAEI,OAAO,EAAG,MAAM,CAAC;IAGlB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,QAAQ;
|
|
1
|
+
{"version":3,"file":"HttpHeaderAuth.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/HttpHeaderAuth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE1C,qBAAa,cAAe,SAAQ,UAAU;IAC1C;;OAEG;IACI,MAAM,SAAe;IAG5B;;OAEG;IAEI,OAAO,EAAG,MAAM,CAAC;IAGlB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,QAAQ;IA2BpE;;OAEG;IACI,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAIxC"}
|
|
@@ -39,7 +39,7 @@ class HttpHeaderAuth extends AuthMethod_1.AuthMethod {
|
|
|
39
39
|
authHeader = matches[1];
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
|
-
return
|
|
42
|
+
return this.fail(response);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
let identity = yield user.loginByAccessToken(authHeader, "HttpHeaderAuth");
|
|
@@ -50,8 +50,15 @@ class HttpHeaderAuth extends AuthMethod_1.AuthMethod {
|
|
|
50
50
|
return identity;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return this.fail(response);
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* @throws UnauthorizedHttpException
|
|
58
|
+
*/
|
|
59
|
+
fail(response) {
|
|
60
|
+
this.challenge(response);
|
|
61
|
+
this.handleFailure(response);
|
|
62
|
+
}
|
|
56
63
|
}
|
|
57
64
|
exports.HttpHeaderAuth = HttpHeaderAuth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JwtHttpBearerAuth.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/JwtHttpBearerAuth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAI1C,qBAAa,iBAAkB,SAAQ,cAAc;IACjD;;;OAGG;IACI,GAAG,SAAQ;IACX,IAAI,EAAE,GAAG,CAAQ;IAGxB;;OAEG;IACI,IAAI,IAAI,IAAI;IAWN,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"JwtHttpBearerAuth.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/JwtHttpBearerAuth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAI1C,qBAAa,iBAAkB,SAAQ,cAAc;IACjD;;;OAGG;IACI,GAAG,SAAQ;IACX,IAAI,EAAE,GAAG,CAAQ;IAGxB;;OAEG;IACI,IAAI,IAAI,IAAI;IAWN,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAsC7E;;OAEG;IACI,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAKxC"}
|
|
@@ -48,7 +48,7 @@ class JwtHttpBearerAuth extends HttpBearerAuth_1.HttpBearerAuth {
|
|
|
48
48
|
return __awaiter(this, arguments, void 0, function* () {
|
|
49
49
|
let autHeader = this.getHeaderByKey(request.headers, this.header);
|
|
50
50
|
if (autHeader == null || (autHeader = this.patternCheck(autHeader, this.pattern)) == null) {
|
|
51
|
-
return
|
|
51
|
+
return this.fail(response);
|
|
52
52
|
}
|
|
53
53
|
let identity = null;
|
|
54
54
|
let token = null;
|
|
@@ -61,7 +61,7 @@ class KeyCloakHttpBearerAuth extends HttpBearerAuth_1.HttpBearerAuth {
|
|
|
61
61
|
let token = null;
|
|
62
62
|
let autHeader = this.getHeaderByKey(request.headers, this.header);
|
|
63
63
|
if (autHeader == null || (autHeader = this.patternCheck(autHeader, this.pattern)) == null) {
|
|
64
|
-
return
|
|
64
|
+
return this.fail(response);
|
|
65
65
|
}
|
|
66
66
|
token = JsonWebToken.decode(autHeader[1], { complete: true });
|
|
67
67
|
if (!token) {
|
|
@@ -110,7 +110,7 @@ class KeyCloakHttpBearerAuth extends HttpBearerAuth_1.HttpBearerAuth {
|
|
|
110
110
|
*/
|
|
111
111
|
fail(response) {
|
|
112
112
|
// this.challenge(response)
|
|
113
|
-
|
|
113
|
+
this.handleFailure(response);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
exports.KeyCloakHttpBearerAuth = KeyCloakHttpBearerAuth;
|
package/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare module "express-serve-static-core" {
|
|
|
13
13
|
/**
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
|
-
export declare const Chyz_Version = "2.0.0-rc.
|
|
16
|
+
export declare const Chyz_Version = "2.0.0-rc.46";
|
|
17
17
|
declare const Chyz: BaseChyz;
|
|
18
18
|
export { Request, Response, NextFunction } from "./base/CRequest";
|
|
19
19
|
export { RouteDefinition } from "./model/RouteDefinition";
|
package/index.js
CHANGED
|
@@ -41,7 +41,7 @@ String.prototype.tokenReplace = function (obj) {
|
|
|
41
41
|
/**
|
|
42
42
|
*
|
|
43
43
|
*/
|
|
44
|
-
exports.Chyz_Version = "2.0.0-rc.
|
|
44
|
+
exports.Chyz_Version = "2.0.0-rc.46";
|
|
45
45
|
const Chyz = new BaseChyz_1.default();
|
|
46
46
|
var WebUser_1 = require("./web/WebUser");
|
|
47
47
|
Object.defineProperty(exports, "WebUser", { enumerable: true, get: function () { return WebUser_1.WebUser; } });
|