@midwayjs/passport 4.0.0-beta.7 → 4.0.0-beta.9
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/configuration.js +2 -0
- package/dist/decorator/strategy.js +1 -2
- package/dist/passport/authenticator.d.ts +0 -1
- package/dist/passport/authenticator.js +9 -7
- package/dist/passport/passport.service.js +7 -3
- package/dist/passport/pause.d.ts +0 -1
- package/dist/passport/pause.js +1 -2
- package/dist/passport/request.js +1 -2
- package/dist/passport/session.stratey.js +2 -0
- package/dist/passport/strategy.d.ts +0 -1
- package/dist/passport/strategy.js +1 -0
- package/package.json +8 -8
package/dist/configuration.js
CHANGED
|
@@ -14,6 +14,8 @@ const DefaultConfig = require("./config/config.default");
|
|
|
14
14
|
const core_1 = require("@midwayjs/core");
|
|
15
15
|
const authenticator_1 = require("./passport/authenticator");
|
|
16
16
|
let PassportConfiguration = class PassportConfiguration {
|
|
17
|
+
applicationManager;
|
|
18
|
+
configService;
|
|
17
19
|
async onReady(container) {
|
|
18
20
|
await container.getAsync(authenticator_1.PassportAuthenticator);
|
|
19
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CustomStrategy =
|
|
3
|
+
exports.CustomStrategy = CustomStrategy;
|
|
4
4
|
const core_1 = require("@midwayjs/core");
|
|
5
5
|
function CustomStrategy() {
|
|
6
6
|
return target => {
|
|
@@ -8,5 +8,4 @@ function CustomStrategy() {
|
|
|
8
8
|
(0, core_1.Provide)()(target);
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
exports.CustomStrategy = CustomStrategy;
|
|
12
11
|
//# sourceMappingURL=strategy.js.map
|
|
@@ -13,13 +13,15 @@ exports.PassportAuthenticator = void 0;
|
|
|
13
13
|
const core_1 = require("@midwayjs/core");
|
|
14
14
|
const session_stratey_1 = require("./session.stratey");
|
|
15
15
|
let PassportAuthenticator = class PassportAuthenticator {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
strategies = new Map();
|
|
17
|
+
userProperty;
|
|
18
|
+
sessionUserProperty;
|
|
19
|
+
_key = 'passport';
|
|
20
|
+
_serializers = [];
|
|
21
|
+
_deserializers = [];
|
|
22
|
+
_infoTransformers = [];
|
|
23
|
+
applicationContext;
|
|
24
|
+
passportConfig;
|
|
23
25
|
init() {
|
|
24
26
|
this.userProperty = this.passportConfig['userProperty'];
|
|
25
27
|
this.sessionUserProperty = this.passportConfig['sessionUserProperty'];
|
|
@@ -9,7 +9,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.PassportStrategy = PassportStrategy;
|
|
13
|
+
exports.PassportMiddleware = PassportMiddleware;
|
|
13
14
|
const core_1 = require("@midwayjs/core");
|
|
14
15
|
const interface_1 = require("../interface");
|
|
15
16
|
const authenticator_1 = require("./authenticator");
|
|
@@ -17,6 +18,8 @@ const strategy_1 = require("./strategy");
|
|
|
17
18
|
const request_1 = require("./request");
|
|
18
19
|
function PassportStrategy(Strategy, name) {
|
|
19
20
|
class InnerStrategyAbstractClass extends strategy_1.AbstractStrategyWrapper {
|
|
21
|
+
strategy;
|
|
22
|
+
passport;
|
|
20
23
|
async init() {
|
|
21
24
|
const cb = (...params) => {
|
|
22
25
|
const done = params[params.length - 1];
|
|
@@ -69,9 +72,11 @@ function PassportStrategy(Strategy, name) {
|
|
|
69
72
|
], InnerStrategyAbstractClass.prototype, "init", null);
|
|
70
73
|
return InnerStrategyAbstractClass;
|
|
71
74
|
}
|
|
72
|
-
exports.PassportStrategy = PassportStrategy;
|
|
73
75
|
function PassportMiddleware(strategy) {
|
|
74
76
|
class InnerPassportMiddleware extends interface_1.AbstractPassportMiddleware {
|
|
77
|
+
passportConfig;
|
|
78
|
+
app;
|
|
79
|
+
passport;
|
|
75
80
|
resolve() {
|
|
76
81
|
return this.authenticate(this.getAuthenticateOptions());
|
|
77
82
|
}
|
|
@@ -410,5 +415,4 @@ function PassportMiddleware(strategy) {
|
|
|
410
415
|
], InnerPassportMiddleware.prototype, "passport", void 0);
|
|
411
416
|
return InnerPassportMiddleware;
|
|
412
417
|
}
|
|
413
|
-
exports.PassportMiddleware = PassportMiddleware;
|
|
414
418
|
//# sourceMappingURL=passport.service.js.map
|
package/dist/passport/pause.d.ts
CHANGED
package/dist/passport/pause.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* MIT Licensed
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.pause =
|
|
9
|
+
exports.pause = pause;
|
|
10
10
|
/**
|
|
11
11
|
* Pause the data events on a stream.
|
|
12
12
|
*
|
|
@@ -35,7 +35,6 @@ function pause(stream) {
|
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
exports.pause = pause;
|
|
39
38
|
function createEventListener(name, events) {
|
|
40
39
|
return function onEvent() {
|
|
41
40
|
const args = new Array(arguments.length + 1);
|
package/dist/passport/request.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.create =
|
|
4
|
+
exports.create = create;
|
|
5
5
|
// Koa and Express are fundamental different in how they deal with extensions
|
|
6
6
|
// to the incoming request.
|
|
7
7
|
// Express pollutes Node's IncomingRequest directly, while Koa keeps Node's
|
|
@@ -135,5 +135,4 @@ function create(ctx, userProperty) {
|
|
|
135
135
|
}
|
|
136
136
|
return req;
|
|
137
137
|
}
|
|
138
|
-
exports.create = create;
|
|
139
138
|
//# sourceMappingURL=request.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/passport",
|
|
3
3
|
"description": "midway passport component",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.9",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"author": "Nawbc",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@midwayjs/core": "^4.0.0-beta.
|
|
26
|
-
"@midwayjs/express": "^4.0.0-beta.
|
|
27
|
-
"@midwayjs/jwt": "^4.0.0-beta.
|
|
28
|
-
"@midwayjs/koa": "^4.0.0-beta.
|
|
29
|
-
"@midwayjs/mock": "^4.0.0-beta.
|
|
30
|
-
"@midwayjs/web": "^4.0.0-beta.
|
|
25
|
+
"@midwayjs/core": "^4.0.0-beta.9",
|
|
26
|
+
"@midwayjs/express": "^4.0.0-beta.9",
|
|
27
|
+
"@midwayjs/jwt": "^4.0.0-beta.9",
|
|
28
|
+
"@midwayjs/koa": "^4.0.0-beta.9",
|
|
29
|
+
"@midwayjs/mock": "^4.0.0-beta.9",
|
|
30
|
+
"@midwayjs/web": "^4.0.0-beta.9",
|
|
31
31
|
"@types/passport-local": "1.0.38",
|
|
32
32
|
"after": "0.8.2",
|
|
33
33
|
"express-session": "1.18.1",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"passport-local": "1.0.0",
|
|
37
37
|
"passport-openidconnect": "0.1.2"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "771e83974ef9f3d78c296e4ee0c8c68db44f6b31"
|
|
40
40
|
}
|