@midwayjs/passport 4.0.0-beta.6 → 4.0.0-beta.8

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.
@@ -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 = void 0;
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
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { IMidwayContainer } from '@midwayjs/core';
3
2
  import { AuthenticateOptions } from '../interface';
4
3
  import { Strategy } from './strategy';
@@ -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
- constructor() {
17
- this.strategies = new Map();
18
- this._key = 'passport';
19
- this._serializers = [];
20
- this._deserializers = [];
21
- this._infoTransformers = [];
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.PassportMiddleware = exports.PassportStrategy = void 0;
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
@@ -4,7 +4,6 @@
4
4
  * Copyright(c) 2015 Douglas Christopher Wilson
5
5
  * MIT Licensed
6
6
  */
7
- /// <reference types="node" />
8
7
  import { Stream } from 'stream';
9
8
  /**
10
9
  * Pause the data events on a stream.
@@ -6,7 +6,7 @@
6
6
  * MIT Licensed
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.pause = void 0;
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);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.create = void 0;
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
@@ -10,6 +10,8 @@ const pause_1 = require("./pause");
10
10
  * @api public
11
11
  */
12
12
  class SessionStrategy extends strategy_1.Strategy {
13
+ options;
14
+ _deserializeUser;
13
15
  constructor(options, deserializeUser) {
14
16
  super();
15
17
  this.options = options;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { IncomingMessage } from 'http';
3
2
  import { IPassportStrategy, StrategyCreatedStatic } from '../interface';
4
3
  export declare abstract class Strategy {
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AbstractStrategyWrapper = exports.Strategy = void 0;
4
4
  class Strategy {
5
+ name;
5
6
  }
6
7
  exports.Strategy = Strategy;
7
8
  class AbstractStrategyWrapper {
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.6",
4
+ "version": "4.0.0-beta.8",
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.6",
26
- "@midwayjs/express": "^4.0.0-beta.6",
27
- "@midwayjs/jwt": "^4.0.0-beta.6",
28
- "@midwayjs/koa": "^4.0.0-beta.6",
29
- "@midwayjs/mock": "^4.0.0-beta.6",
30
- "@midwayjs/web": "^4.0.0-beta.6",
25
+ "@midwayjs/core": "^4.0.0-beta.8",
26
+ "@midwayjs/express": "^4.0.0-beta.8",
27
+ "@midwayjs/jwt": "^4.0.0-beta.8",
28
+ "@midwayjs/koa": "^4.0.0-beta.8",
29
+ "@midwayjs/mock": "^4.0.0-beta.8",
30
+ "@midwayjs/web": "^4.0.0-beta.8",
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": "a02425777d044ec502d050993bc256dc26d5b586"
39
+ "gitHead": "355e55949fdd132b0bdcb4830222a0a027e92ded"
40
40
  }