@tsed/passport 6.95.9 → 6.95.10

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/passport",
3
- "version": "6.95.9",
3
+ "version": "6.95.10",
4
4
  "description": "Passport package for Ts.ED framework",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/cjs/index.js",
@@ -21,9 +21,9 @@
21
21
  "tslib": "2.2.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@tsed/common": "6.95.9",
25
- "@tsed/core": "6.95.9",
26
- "@tsed/di": "6.95.9",
24
+ "@tsed/common": "6.95.10",
25
+ "@tsed/core": "6.95.10",
26
+ "@tsed/di": "6.95.10",
27
27
  "@types/passport": "1.0.4",
28
28
  "@types/passport-http": "0.3.8",
29
29
  "@types/passport-local": "1.0.34",
@@ -34,13 +34,13 @@
34
34
  "passport-strategy": "1.0.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@tsed/common": "^6.95.9",
38
- "@tsed/core": "^6.95.9",
39
- "@tsed/di": "^6.95.9",
40
- "@tsed/json-mapper": "^6.95.9",
37
+ "@tsed/common": "^6.95.10",
38
+ "@tsed/core": "^6.95.10",
39
+ "@tsed/di": "^6.95.10",
40
+ "@tsed/json-mapper": "^6.95.10",
41
41
  "@tsed/logger": ">=6.0.0",
42
- "@tsed/openspec": "^6.95.9",
43
- "@tsed/schema": "^6.95.9",
42
+ "@tsed/openspec": "^6.95.10",
43
+ "@tsed/schema": "^6.95.10",
44
44
  "passport": ">=0.4.1",
45
45
  "passport-http": ">=0.3.0",
46
46
  "passport-local": ">=1.0.0",
@@ -1,18 +0,0 @@
1
- import { BeforeRoutesInit, OnInit, PlatformApplication, Logger } from "@tsed/common";
2
- import { PassportSerializerService } from "./services/PassportSerializerService";
3
- import { ProtocolsService } from "./services/ProtocolsService";
4
- /**
5
- * @ignore
6
- */
7
- export declare class PassportModule implements OnInit, BeforeRoutesInit {
8
- private app;
9
- private protocolsService;
10
- private passportSerializer;
11
- userProperty: string;
12
- pauseStream: boolean;
13
- platformName: string;
14
- logger: Logger;
15
- constructor(app: PlatformApplication, protocolsService: ProtocolsService, passportSerializer: PassportSerializerService);
16
- $onInit(): Promise<any> | void;
17
- $beforeRoutesInit(): void | Promise<any>;
18
- }
@@ -1 +0,0 @@
1
- export declare const PROVIDER_TYPE_PROTOCOL = "protocol";
@@ -1,6 +0,0 @@
1
- /**
2
- * Inject args resolve by the passport strategy on verify method.
3
- * @decorator
4
- */
5
- export declare function Args(): any;
6
- export declare function Arg(index: number): any;
@@ -1,8 +0,0 @@
1
- import { AuthenticateOptions as PassportAuthenticateOptions } from "passport";
2
- export interface AuthenticateOptions extends PassportAuthenticateOptions {
3
- security?: {
4
- [key: string]: string[];
5
- };
6
- originalUrl?: boolean;
7
- }
8
- export declare function Authenticate(protocol?: string | string[], options?: AuthenticateOptions): Function;
@@ -1,8 +0,0 @@
1
- import { AuthenticateOptions } from "passport";
2
- export interface AuthorizeOptions extends AuthenticateOptions {
3
- security?: {
4
- [key: string]: string[];
5
- };
6
- originalUrl?: boolean;
7
- }
8
- export declare function Authorize(protocol?: string | string[], options?: AuthorizeOptions): Function;
@@ -1,11 +0,0 @@
1
- import { ProtocolOptions } from "../interfaces/ProtocolOptions";
2
- /**
3
- * Declare a new Protocol base on a Passport Strategy
4
- *
5
- * @decorator
6
- * @class
7
- */
8
- export declare function Protocol<T = any>(options: ProtocolOptionsDecorator<T>): any;
9
- export declare type ProtocolOptionsDecorator<T = any> = {
10
- name: string;
11
- } & Partial<ProtocolOptions<T>>;
@@ -1,5 +0,0 @@
1
- export declare class UserInfo {
2
- id: string;
3
- email: string;
4
- password: string;
5
- }
@@ -1,4 +0,0 @@
1
- import { Exception } from "@tsed/exceptions";
2
- export declare class PassportException extends Exception {
3
- constructor(error: any);
4
- }
@@ -1,12 +0,0 @@
1
- import "./PassportModule";
2
- export * from "./decorators/authenticate";
3
- export * from "./decorators/authorize";
4
- export * from "./decorators/protocol";
5
- export * from "./decorators/args";
6
- export * from "./interfaces";
7
- export * from "./domain/UserInfo";
8
- export * from "./errors/PassportException";
9
- export * from "./contants";
10
- export * from "./services/ProtocolsService";
11
- export * from "./services/PassportSerializerService";
12
- export * from "./middlewares/PassportMiddleware";
@@ -1,4 +0,0 @@
1
- import { OnInstall } from "./OnInstall";
2
- import { OnVerify } from "./OnVerify";
3
- export interface IProtocol extends OnVerify, OnInstall {
4
- }
@@ -1,4 +0,0 @@
1
- import { Strategy } from "passport";
2
- export interface OnInstall {
3
- $onInstall(strategy: Strategy): void;
4
- }
@@ -1,3 +0,0 @@
1
- export interface OnVerify {
2
- $onVerify(...args: any[]): Promise<any | any[]> | any | any[];
3
- }
@@ -1,7 +0,0 @@
1
- import { Type } from "@tsed/core";
2
- import { Strategy } from "passport";
3
- export interface ProtocolOptions<T = any> {
4
- name: string;
5
- useStrategy: Type<Strategy>;
6
- settings: T;
7
- }
@@ -1,20 +0,0 @@
1
- import { Type } from "@tsed/core";
2
- import { ProtocolOptions } from "./ProtocolOptions";
3
- declare global {
4
- namespace TsED {
5
- interface Configuration {
6
- passport: {
7
- userProperty?: string;
8
- pauseStream?: string;
9
- userInfoModel?: Type<any> | false;
10
- protocols?: {
11
- [protocolName: string]: Partial<ProtocolOptions>;
12
- };
13
- };
14
- }
15
- }
16
- }
17
- export * from "./ProtocolOptions";
18
- export * from "./IProtocol";
19
- export * from "./OnInstall";
20
- export * from "./OnVerify";
@@ -1,7 +0,0 @@
1
- import { Context } from "@tsed/common";
2
- import { ProtocolsService } from "../services/ProtocolsService";
3
- export declare class PassportMiddleware {
4
- protocolsService: ProtocolsService;
5
- shouldSkip(ctx: Context): any;
6
- use(ctx: Context): Promise<void>;
7
- }
@@ -1,9 +0,0 @@
1
- import { UserInfo } from "../domain/UserInfo";
2
- /**
3
- * @ignore
4
- */
5
- export declare class PassportSerializerService {
6
- private model;
7
- serialize(user: UserInfo, done: any): void;
8
- deserialize(obj: any, done: any): void;
9
- }
@@ -1,53 +0,0 @@
1
- import { PlatformContext } from "@tsed/common";
2
- import { InjectorService, Provider } from "@tsed/di";
3
- import { Strategy } from "passport";
4
- /**
5
- * @ignore
6
- */
7
- export declare class ProtocolsService {
8
- private injector;
9
- readonly strategies: Map<string, Strategy>;
10
- constructor(injector: InjectorService);
11
- getProtocols(): Provider[];
12
- getProtocolsNames(): string[];
13
- /**
14
- * Invoke provider and bind it to passport.
15
- * @param provider
16
- */
17
- invoke(provider: Provider): any;
18
- /**
19
- * Call authenticate passport method.
20
- * @param protocols
21
- * @param options
22
- * @param ctx
23
- */
24
- authenticate(protocols: string | string[], options: Record<string, any>, ctx: PlatformContext): Promise<void>;
25
- /**
26
- * Call authorize passport method.
27
- * @param protocols
28
- * @param options
29
- * @param ctx
30
- */
31
- authorize(protocols: string | string[], options: Record<string, any>, ctx: PlatformContext): Promise<void>;
32
- /**
33
- * Call passport authenticate or authorize depending on the chosen method.
34
- * @param method
35
- * @param protocols
36
- * @param options
37
- * @param ctx
38
- * @private
39
- */
40
- private call;
41
- /**
42
- * Create strategy options based on decorator metadata and global configuration
43
- * @param provider
44
- * @private
45
- */
46
- private getOptions;
47
- /**
48
- * Create the verifier handler for passport
49
- * @param provider
50
- * @private
51
- */
52
- private createHandler;
53
- }
@@ -1,4 +0,0 @@
1
- /**
2
- * @ignore
3
- */
4
- export declare function getProtocolsFromRequest(req: any, protocol: string | string[], defaultProtocols: string[]): string[];