@sphereon/ssi-express-support 0.18.2-next.3 → 0.18.2-unstable.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/dist/auth-utils.d.ts +20 -20
- package/dist/auth-utils.js +143 -143
- package/dist/entra-id-auth.d.ts +9 -9
- package/dist/entra-id-auth.js +60 -60
- package/dist/express-builders.d.ts +99 -99
- package/dist/express-builders.js +279 -279
- package/dist/express-utils.d.ts +3 -3
- package/dist/express-utils.js +52 -52
- package/dist/functions.d.ts +1 -1
- package/dist/functions.js +10 -10
- package/dist/index.d.ts +8 -8
- package/dist/index.js +41 -41
- package/dist/openid-connect-rp.d.ts +53 -53
- package/dist/openid-connect-rp.js +213 -213
- package/dist/static-bearer-auth.d.ts +33 -33
- package/dist/static-bearer-auth.js +145 -145
- package/dist/types.d.ts +193 -193
- package/dist/types.js +7 -7
- package/package.json +2 -2
- package/src/express-utils.ts +47 -47
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Enforcer } from 'casbin';
|
|
3
|
-
import express, { Express } from 'express';
|
|
4
|
-
import { Application, ApplicationRequestHandler } from 'express-serve-static-core';
|
|
5
|
-
import session from 'express-session';
|
|
6
|
-
import http from 'http';
|
|
7
|
-
import { HttpTerminator } from 'http-terminator';
|
|
8
|
-
import morgan from 'morgan';
|
|
9
|
-
import { InitializeOptions } from 'passport';
|
|
10
|
-
import { ExpressSupport, IExpressServerOpts } from './types';
|
|
11
|
-
type Handler<Request extends http.IncomingMessage, Response extends http.ServerResponse> = (req: Request, res: Response, callback: (err?: Error) => void) => void;
|
|
12
|
-
export declare class ExpressBuilder {
|
|
13
|
-
private existingExpress?;
|
|
14
|
-
private hostnameOrIP?;
|
|
15
|
-
private port?;
|
|
16
|
-
private _handlers?;
|
|
17
|
-
private listenCallback?;
|
|
18
|
-
private _startListen?;
|
|
19
|
-
private readonly envVarPrefix?;
|
|
20
|
-
private _corsConfigurer?;
|
|
21
|
-
private _sessionOpts?;
|
|
22
|
-
private _usePassportAuth?;
|
|
23
|
-
private _passportInitOpts?;
|
|
24
|
-
private _userIsInRole?;
|
|
25
|
-
private _enforcer?;
|
|
26
|
-
private _server?;
|
|
27
|
-
private _terminator?;
|
|
28
|
-
private _morgan?;
|
|
29
|
-
private constructor();
|
|
30
|
-
static fromExistingExpress(opts?: {
|
|
31
|
-
existingExpress?: Express;
|
|
32
|
-
envVarPrefix?: string;
|
|
33
|
-
}): ExpressBuilder;
|
|
34
|
-
static fromServerOpts(opts: IExpressServerOpts & {
|
|
35
|
-
envVarPrefix?: string;
|
|
36
|
-
}): ExpressBuilder;
|
|
37
|
-
enableListen(startOnBuild?: boolean): this;
|
|
38
|
-
withMorganLogging(opts?: {
|
|
39
|
-
existingMorgan?: Handler<any, any>;
|
|
40
|
-
format?: string;
|
|
41
|
-
options?: morgan.Options<any, any>;
|
|
42
|
-
}): this;
|
|
43
|
-
withEnableListenOpts({ port, hostnameOrIP, callback, startOnBuild, }: {
|
|
44
|
-
port?: number;
|
|
45
|
-
hostnameOrIP?: string;
|
|
46
|
-
startOnBuild?: boolean;
|
|
47
|
-
callback?: () => void;
|
|
48
|
-
}): this;
|
|
49
|
-
withPort(port: number): this;
|
|
50
|
-
withHostname(hostnameOrIP: string): this;
|
|
51
|
-
withListenCallback(callback: () => void): this;
|
|
52
|
-
withExpress(existingExpress: Express): this;
|
|
53
|
-
withCorsConfigurer(configurer: ExpressCorsConfigurer): this;
|
|
54
|
-
withPassportAuth(usePassport: boolean, initializeOptions?: InitializeOptions): this;
|
|
55
|
-
withGlobalUserIsInRole(userIsInRole: string | string[]): this;
|
|
56
|
-
withEnforcer(enforcer: Enforcer): this;
|
|
57
|
-
startListening(express: Express): {
|
|
58
|
-
server: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
|
|
59
|
-
terminator: HttpTerminator;
|
|
60
|
-
};
|
|
61
|
-
getHostname(): string;
|
|
62
|
-
getPort(): number;
|
|
63
|
-
setHandlers(handlers: ApplicationRequestHandler<any> | ApplicationRequestHandler<any>[]): this;
|
|
64
|
-
addHandler(handler: ApplicationRequestHandler<any>): this;
|
|
65
|
-
withSessionOptions(sessionOpts: session.SessionOptions): this;
|
|
66
|
-
build<T extends Application>(opts?: {
|
|
67
|
-
express?: Express;
|
|
68
|
-
startListening?: boolean;
|
|
69
|
-
handlers?: ApplicationRequestHandler<T> | ApplicationRequestHandler<T>[];
|
|
70
|
-
}): ExpressSupport;
|
|
71
|
-
protected buildExpress<T extends Application>(opts?: {
|
|
72
|
-
express?: Express;
|
|
73
|
-
startListening?: boolean;
|
|
74
|
-
handlers?: ApplicationRequestHandler<T> | ApplicationRequestHandler<T>[];
|
|
75
|
-
}): express.Express;
|
|
76
|
-
}
|
|
77
|
-
export declare class ExpressCorsConfigurer {
|
|
78
|
-
private _disableCors?;
|
|
79
|
-
private _enablePreflightOptions?;
|
|
80
|
-
private _allowOrigin?;
|
|
81
|
-
private _allowMethods?;
|
|
82
|
-
private _allowedHeaders?;
|
|
83
|
-
private _allowCredentials?;
|
|
84
|
-
private readonly _express?;
|
|
85
|
-
private readonly _envVarPrefix?;
|
|
86
|
-
constructor(args?: {
|
|
87
|
-
existingExpress?: Express;
|
|
88
|
-
envVarPrefix?: string;
|
|
89
|
-
});
|
|
90
|
-
allowOrigin(value: string | boolean | RegExp | Array<string | boolean | RegExp>): this;
|
|
91
|
-
disableCors(value: boolean): this;
|
|
92
|
-
allowMethods(value: string | string[]): this;
|
|
93
|
-
allowedHeaders(value: string | string[]): this;
|
|
94
|
-
allowCredentials(value: boolean): this;
|
|
95
|
-
configure({ existingExpress }: {
|
|
96
|
-
existingExpress?: Express;
|
|
97
|
-
}): void;
|
|
98
|
-
}
|
|
99
|
-
export {};
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Enforcer } from 'casbin';
|
|
3
|
+
import express, { Express } from 'express';
|
|
4
|
+
import { Application, ApplicationRequestHandler } from 'express-serve-static-core';
|
|
5
|
+
import session from 'express-session';
|
|
6
|
+
import http from 'http';
|
|
7
|
+
import { HttpTerminator } from 'http-terminator';
|
|
8
|
+
import morgan from 'morgan';
|
|
9
|
+
import { InitializeOptions } from 'passport';
|
|
10
|
+
import { ExpressSupport, IExpressServerOpts } from './types';
|
|
11
|
+
type Handler<Request extends http.IncomingMessage, Response extends http.ServerResponse> = (req: Request, res: Response, callback: (err?: Error) => void) => void;
|
|
12
|
+
export declare class ExpressBuilder {
|
|
13
|
+
private existingExpress?;
|
|
14
|
+
private hostnameOrIP?;
|
|
15
|
+
private port?;
|
|
16
|
+
private _handlers?;
|
|
17
|
+
private listenCallback?;
|
|
18
|
+
private _startListen?;
|
|
19
|
+
private readonly envVarPrefix?;
|
|
20
|
+
private _corsConfigurer?;
|
|
21
|
+
private _sessionOpts?;
|
|
22
|
+
private _usePassportAuth?;
|
|
23
|
+
private _passportInitOpts?;
|
|
24
|
+
private _userIsInRole?;
|
|
25
|
+
private _enforcer?;
|
|
26
|
+
private _server?;
|
|
27
|
+
private _terminator?;
|
|
28
|
+
private _morgan?;
|
|
29
|
+
private constructor();
|
|
30
|
+
static fromExistingExpress(opts?: {
|
|
31
|
+
existingExpress?: Express;
|
|
32
|
+
envVarPrefix?: string;
|
|
33
|
+
}): ExpressBuilder;
|
|
34
|
+
static fromServerOpts(opts: IExpressServerOpts & {
|
|
35
|
+
envVarPrefix?: string;
|
|
36
|
+
}): ExpressBuilder;
|
|
37
|
+
enableListen(startOnBuild?: boolean): this;
|
|
38
|
+
withMorganLogging(opts?: {
|
|
39
|
+
existingMorgan?: Handler<any, any>;
|
|
40
|
+
format?: string;
|
|
41
|
+
options?: morgan.Options<any, any>;
|
|
42
|
+
}): this;
|
|
43
|
+
withEnableListenOpts({ port, hostnameOrIP, callback, startOnBuild, }: {
|
|
44
|
+
port?: number;
|
|
45
|
+
hostnameOrIP?: string;
|
|
46
|
+
startOnBuild?: boolean;
|
|
47
|
+
callback?: () => void;
|
|
48
|
+
}): this;
|
|
49
|
+
withPort(port: number): this;
|
|
50
|
+
withHostname(hostnameOrIP: string): this;
|
|
51
|
+
withListenCallback(callback: () => void): this;
|
|
52
|
+
withExpress(existingExpress: Express): this;
|
|
53
|
+
withCorsConfigurer(configurer: ExpressCorsConfigurer): this;
|
|
54
|
+
withPassportAuth(usePassport: boolean, initializeOptions?: InitializeOptions): this;
|
|
55
|
+
withGlobalUserIsInRole(userIsInRole: string | string[]): this;
|
|
56
|
+
withEnforcer(enforcer: Enforcer): this;
|
|
57
|
+
startListening(express: Express): {
|
|
58
|
+
server: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
|
|
59
|
+
terminator: HttpTerminator;
|
|
60
|
+
};
|
|
61
|
+
getHostname(): string;
|
|
62
|
+
getPort(): number;
|
|
63
|
+
setHandlers(handlers: ApplicationRequestHandler<any> | ApplicationRequestHandler<any>[]): this;
|
|
64
|
+
addHandler(handler: ApplicationRequestHandler<any>): this;
|
|
65
|
+
withSessionOptions(sessionOpts: session.SessionOptions): this;
|
|
66
|
+
build<T extends Application>(opts?: {
|
|
67
|
+
express?: Express;
|
|
68
|
+
startListening?: boolean;
|
|
69
|
+
handlers?: ApplicationRequestHandler<T> | ApplicationRequestHandler<T>[];
|
|
70
|
+
}): ExpressSupport;
|
|
71
|
+
protected buildExpress<T extends Application>(opts?: {
|
|
72
|
+
express?: Express;
|
|
73
|
+
startListening?: boolean;
|
|
74
|
+
handlers?: ApplicationRequestHandler<T> | ApplicationRequestHandler<T>[];
|
|
75
|
+
}): express.Express;
|
|
76
|
+
}
|
|
77
|
+
export declare class ExpressCorsConfigurer {
|
|
78
|
+
private _disableCors?;
|
|
79
|
+
private _enablePreflightOptions?;
|
|
80
|
+
private _allowOrigin?;
|
|
81
|
+
private _allowMethods?;
|
|
82
|
+
private _allowedHeaders?;
|
|
83
|
+
private _allowCredentials?;
|
|
84
|
+
private readonly _express?;
|
|
85
|
+
private readonly _envVarPrefix?;
|
|
86
|
+
constructor(args?: {
|
|
87
|
+
existingExpress?: Express;
|
|
88
|
+
envVarPrefix?: string;
|
|
89
|
+
});
|
|
90
|
+
allowOrigin(value: string | boolean | RegExp | Array<string | boolean | RegExp>): this;
|
|
91
|
+
disableCors(value: boolean): this;
|
|
92
|
+
allowMethods(value: string | string[]): this;
|
|
93
|
+
allowedHeaders(value: string | string[]): this;
|
|
94
|
+
allowCredentials(value: boolean): this;
|
|
95
|
+
configure({ existingExpress }: {
|
|
96
|
+
existingExpress?: Express;
|
|
97
|
+
}): void;
|
|
98
|
+
}
|
|
99
|
+
export {};
|
|
100
100
|
//# sourceMappingURL=express-builders.d.ts.map
|