nestjs-authentication 0.4.2 → 0.5.0
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/CHANGELOG.md +77 -2
- package/README.md +108 -0
- package/SECURITY.md +15 -0
- package/dist/classes/email.password.user.d.ts +13 -0
- package/dist/classes/email.password.user.d.ts.map +1 -0
- package/dist/classes/email.password.user.js +3 -0
- package/dist/classes/email.password.user.js.map +1 -0
- package/dist/constants.d.ts +13 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +14 -1
- package/dist/constants.js.map +1 -1
- package/dist/context/auth.context.d.ts +38 -0
- package/dist/context/auth.context.d.ts.map +1 -0
- package/dist/context/auth.context.js +39 -0
- package/dist/context/auth.context.js.map +1 -0
- package/dist/context/decorators.d.ts +25 -0
- package/dist/context/decorators.d.ts.map +1 -0
- package/dist/context/decorators.js +38 -0
- package/dist/context/decorators.js.map +1 -0
- package/dist/context/index.d.ts +5 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +21 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/interceptor.d.ts +15 -0
- package/dist/context/interceptor.d.ts.map +1 -0
- package/dist/context/interceptor.js +51 -0
- package/dist/context/interceptor.js.map +1 -0
- package/dist/context/service.d.ts +18 -0
- package/dist/context/service.d.ts.map +1 -0
- package/dist/context/service.js +45 -0
- package/dist/context/service.js.map +1 -0
- package/dist/encryptor.d.ts +20 -0
- package/dist/encryptor.d.ts.map +1 -1
- package/dist/encryptor.js +36 -6
- package/dist/encryptor.js.map +1 -1
- package/dist/encryptors/index.d.ts +3 -0
- package/dist/encryptors/index.d.ts.map +1 -0
- package/dist/encryptors/index.js +19 -0
- package/dist/encryptors/index.js.map +1 -0
- package/dist/encryptors/migrating.d.ts +28 -0
- package/dist/encryptors/migrating.d.ts.map +1 -0
- package/dist/encryptors/migrating.js +72 -0
- package/dist/encryptors/migrating.js.map +1 -0
- package/dist/encryptors/scrypt.d.ts +42 -0
- package/dist/encryptors/scrypt.d.ts.map +1 -0
- package/dist/encryptors/scrypt.js +85 -0
- package/dist/encryptors/scrypt.js.map +1 -0
- package/dist/errors.d.ts +32 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +63 -0
- package/dist/errors.js.map +1 -0
- package/dist/guard.d.ts +115 -15
- package/dist/guard.d.ts.map +1 -1
- package/dist/guard.js +302 -90
- package/dist/guard.js.map +1 -1
- package/dist/index.d.ts +10 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/dist/injection.d.ts +3 -0
- package/dist/injection.d.ts.map +1 -0
- package/dist/injection.js +9 -0
- package/dist/injection.js.map +1 -0
- package/dist/interfaces/auth.user.d.ts +16 -5
- package/dist/interfaces/auth.user.d.ts.map +1 -1
- package/dist/interfaces/auth.user.js +6 -0
- package/dist/interfaces/auth.user.js.map +1 -1
- package/dist/interfaces/encrypt.d.ts +29 -1
- package/dist/interfaces/encrypt.d.ts.map +1 -1
- package/dist/interfaces/options.d.ts +52 -5
- package/dist/interfaces/options.d.ts.map +1 -1
- package/dist/interfaces/provider.d.ts +26 -3
- package/dist/interfaces/provider.d.ts.map +1 -1
- package/dist/module.d.ts +48 -6
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +153 -50
- package/dist/module.js.map +1 -1
- package/dist/providers/auth.provider.d.ts +12 -4
- package/dist/providers/auth.provider.d.ts.map +1 -1
- package/dist/providers/auth.provider.js +7 -1
- package/dist/providers/auth.provider.js.map +1 -1
- package/dist/providers/email.password.auth.provider.d.ts +75 -0
- package/dist/providers/email.password.auth.provider.d.ts.map +1 -0
- package/dist/providers/email.password.auth.provider.js +120 -0
- package/dist/providers/email.password.auth.provider.js.map +1 -0
- package/dist/providers/memory.user.provider.d.ts +39 -6
- package/dist/providers/memory.user.provider.d.ts.map +1 -1
- package/dist/providers/memory.user.provider.js +70 -15
- package/dist/providers/memory.user.provider.js.map +1 -1
- package/dist/scopes/decorators.d.ts +41 -0
- package/dist/scopes/decorators.d.ts.map +1 -0
- package/dist/scopes/decorators.js +44 -0
- package/dist/scopes/decorators.js.map +1 -0
- package/dist/scopes/index.d.ts +4 -0
- package/dist/scopes/index.d.ts.map +1 -0
- package/dist/scopes/index.js +20 -0
- package/dist/scopes/index.js.map +1 -0
- package/dist/scopes/service.d.ts +32 -0
- package/dist/scopes/service.d.ts.map +1 -0
- package/dist/scopes/service.js +90 -0
- package/dist/scopes/service.js.map +1 -0
- package/dist/scopes/utils.d.ts +8 -0
- package/dist/scopes/utils.d.ts.map +1 -0
- package/dist/scopes/utils.js +29 -0
- package/dist/scopes/utils.js.map +1 -0
- package/dist/service.d.ts +25 -6
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +36 -5
- package/dist/service.js.map +1 -1
- package/dist/session/index.d.ts +3 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +19 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/manager.d.ts +32 -0
- package/dist/session/manager.d.ts.map +1 -0
- package/dist/session/manager.js +131 -0
- package/dist/session/manager.js.map +1 -0
- package/dist/session/request.d.ts +14 -0
- package/dist/session/request.d.ts.map +1 -0
- package/dist/session/request.js +59 -0
- package/dist/session/request.js.map +1 -0
- package/dist/strategies/emailpassword.d.ts +20 -7
- package/dist/strategies/emailpassword.d.ts.map +1 -1
- package/dist/strategies/emailpassword.js +42 -19
- package/dist/strategies/emailpassword.js.map +1 -1
- package/dist/strategies/extract.d.ts +23 -0
- package/dist/strategies/extract.d.ts.map +1 -0
- package/dist/strategies/extract.js +57 -0
- package/dist/strategies/extract.js.map +1 -0
- package/dist/strategies/index.d.ts +8 -0
- package/dist/strategies/index.d.ts.map +1 -0
- package/dist/strategies/index.js +24 -0
- package/dist/strategies/index.js.map +1 -0
- package/dist/strategies/interfaces.d.ts +65 -0
- package/dist/strategies/interfaces.d.ts.map +1 -0
- package/dist/{classes/memory.user.js → strategies/interfaces.js} +1 -1
- package/dist/strategies/interfaces.js.map +1 -0
- package/dist/strategies/jwt.d.ts +87 -15
- package/dist/strategies/jwt.d.ts.map +1 -1
- package/dist/strategies/jwt.js +140 -9
- package/dist/strategies/jwt.js.map +1 -1
- package/dist/strategies/passport.d.ts +22 -0
- package/dist/strategies/passport.d.ts.map +1 -0
- package/dist/strategies/passport.js +90 -0
- package/dist/strategies/passport.js.map +1 -0
- package/dist/strategies/registry.d.ts +33 -0
- package/dist/strategies/registry.d.ts.map +1 -0
- package/dist/strategies/registry.js +67 -0
- package/dist/strategies/registry.js.map +1 -0
- package/dist/strategies/session.d.ts +18 -0
- package/dist/strategies/session.d.ts.map +1 -0
- package/dist/strategies/session.js +79 -0
- package/dist/strategies/session.js.map +1 -0
- package/dist/transports/graphql.d.ts +28 -0
- package/dist/transports/graphql.d.ts.map +1 -0
- package/dist/transports/graphql.js +59 -0
- package/dist/transports/graphql.js.map +1 -0
- package/dist/transports/http.d.ts +13 -0
- package/dist/transports/http.d.ts.map +1 -0
- package/dist/transports/http.js +31 -0
- package/dist/transports/http.js.map +1 -0
- package/dist/transports/index.d.ts +8 -0
- package/dist/transports/index.d.ts.map +1 -0
- package/dist/transports/index.js +24 -0
- package/dist/transports/index.js.map +1 -0
- package/dist/transports/interfaces.d.ts +36 -0
- package/dist/transports/interfaces.d.ts.map +1 -0
- package/dist/transports/interfaces.js +3 -0
- package/dist/transports/interfaces.js.map +1 -0
- package/dist/transports/registry.d.ts +25 -0
- package/dist/transports/registry.d.ts.map +1 -0
- package/dist/transports/registry.js +55 -0
- package/dist/transports/registry.js.map +1 -0
- package/dist/transports/rpc.d.ts +23 -0
- package/dist/transports/rpc.d.ts.map +1 -0
- package/dist/transports/rpc.js +54 -0
- package/dist/transports/rpc.js.map +1 -0
- package/dist/transports/utils.d.ts +21 -0
- package/dist/transports/utils.d.ts.map +1 -0
- package/dist/transports/utils.js +86 -0
- package/dist/transports/utils.js.map +1 -0
- package/dist/transports/ws.d.ts +31 -0
- package/dist/transports/ws.d.ts.map +1 -0
- package/dist/transports/ws.js +52 -0
- package/dist/transports/ws.js.map +1 -0
- package/package.json +102 -60
- package/dist/classes/memory.user.d.ts +0 -7
- package/dist/classes/memory.user.d.ts.map +0 -1
- package/dist/classes/memory.user.js.map +0 -1
- package/dist/providers/auth.memory.user.provider.d.ts +0 -15
- package/dist/providers/auth.memory.user.provider.d.ts.map +0 -1
- package/dist/providers/auth.memory.user.provider.js +0 -30
- package/dist/providers/auth.memory.user.provider.js.map +0 -1
- package/dist/user.serializer.d.ts +0 -10
- package/dist/user.serializer.d.ts.map +0 -1
- package/dist/user.serializer.js +0 -53
- package/dist/user.serializer.js.map +0 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.DEFAULT_SESSION_KEY = void 0;
|
|
24
|
+
exports.removeSessionUser = removeSessionUser;
|
|
25
|
+
exports.getSessionPayload = getSessionPayload;
|
|
26
|
+
exports.sessionLogIn = sessionLogIn;
|
|
27
|
+
exports.sessionLogOut = sessionLogOut;
|
|
28
|
+
/** The session property that holds the login, `passport` like passport (existing sessions keep working). */
|
|
29
|
+
exports.DEFAULT_SESSION_KEY = 'passport';
|
|
30
|
+
const NO_SESSION = 'Login sessions require session support. Did you forget to use `express-session` middleware?';
|
|
31
|
+
/**
|
|
32
|
+
* Calls `regenerate()` or `save()` of a session, whatever the library:
|
|
33
|
+
*
|
|
34
|
+
* - express-session, @fastify/session: with a callback (or a promise)
|
|
35
|
+
* - cookie sessions without `save()` (@fastify/secure-session, cookie-session): synchronous
|
|
36
|
+
*/
|
|
37
|
+
function call(session, method) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (typeof (session === null || session === void 0 ? void 0 : session[method]) !== 'function') {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (typeof session.save !== 'function') {
|
|
43
|
+
yield session[method]();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
yield new Promise((resolve, reject) => {
|
|
47
|
+
const result = session[method]((err) => (err ? reject(err) : resolve()));
|
|
48
|
+
if (result !== undefined && result !== null && typeof result.then === 'function') {
|
|
49
|
+
result.then(() => resolve(), reject);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/** Returns a copy of the data of a session (`data()` of @fastify/secure-session, else its own properties). */
|
|
55
|
+
function copySession(session) {
|
|
56
|
+
const data = typeof session.data === 'function' ? session.data() : Object.assign({}, session);
|
|
57
|
+
delete data.cookie;
|
|
58
|
+
return data;
|
|
59
|
+
}
|
|
60
|
+
/** Restores the data of a session, with assignments (the cookie sessions only save assigned properties). */
|
|
61
|
+
function restoreSession(session, data) {
|
|
62
|
+
for (const [key, value] of Object.entries(data)) {
|
|
63
|
+
// skips the read-only properties of the new session (the metadata of @fastify/session)
|
|
64
|
+
const descriptor = Object.getOwnPropertyDescriptor(session, key);
|
|
65
|
+
const readOnly = descriptor !== undefined &&
|
|
66
|
+
('value' in descriptor ? descriptor.writable === false : descriptor.set === undefined);
|
|
67
|
+
if (readOnly) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
session[key] = value;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Removes the user from the login property of a session. The property is assigned again (not mutated): the cookie
|
|
75
|
+
* sessions (@fastify/secure-session) only save the assigned properties.
|
|
76
|
+
*/
|
|
77
|
+
function removeSessionUser(session, key = exports.DEFAULT_SESSION_KEY) {
|
|
78
|
+
const login = session === null || session === void 0 ? void 0 : session[key];
|
|
79
|
+
if (login !== undefined && login !== null && typeof login === 'object') {
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
81
|
+
const { user } = login, rest = __rest(login, ["user"]);
|
|
82
|
+
session[key] = rest;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/** Returns the payload of the user stored in the session, or `undefined`. */
|
|
86
|
+
function getSessionPayload(request, key = exports.DEFAULT_SESSION_KEY) {
|
|
87
|
+
var _a, _b;
|
|
88
|
+
const payload = (_b = (_a = request.session) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.user;
|
|
89
|
+
return payload !== undefined && payload !== null ? payload : undefined;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Stores the payload of a user in the session (format of passport: `session.passport.user`).
|
|
93
|
+
* The session is regenerated first (a new id, against session fixation), then saved.
|
|
94
|
+
*
|
|
95
|
+
* @throws Error if the request has no session
|
|
96
|
+
*/
|
|
97
|
+
function sessionLogIn(request_1, payload_1) {
|
|
98
|
+
return __awaiter(this, arguments, void 0, function* (request, payload, options = {}) {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
if (request.session === undefined || request.session === null) {
|
|
101
|
+
throw new Error(NO_SESSION);
|
|
102
|
+
}
|
|
103
|
+
const key = (_a = options.key) !== null && _a !== void 0 ? _a : exports.DEFAULT_SESSION_KEY;
|
|
104
|
+
const previous = options.keepSessionInfo === true ? copySession(request.session) : {};
|
|
105
|
+
// @fastify/session replaces request.session: read it again after regenerate()
|
|
106
|
+
yield call(request.session, 'regenerate');
|
|
107
|
+
restoreSession(request.session, previous);
|
|
108
|
+
request.session[key] = Object.assign(Object.assign({}, ((_b = request.session[key]) !== null && _b !== void 0 ? _b : {})), { user: payload });
|
|
109
|
+
yield call(request.session, 'save');
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Removes the user from the session, saves it, then regenerates it.
|
|
114
|
+
*
|
|
115
|
+
* @throws Error if the request has no session
|
|
116
|
+
*/
|
|
117
|
+
function sessionLogOut(request_1) {
|
|
118
|
+
return __awaiter(this, arguments, void 0, function* (request, options = {}) {
|
|
119
|
+
var _a;
|
|
120
|
+
if (request.session === undefined || request.session === null) {
|
|
121
|
+
throw new Error(NO_SESSION);
|
|
122
|
+
}
|
|
123
|
+
const key = (_a = options.key) !== null && _a !== void 0 ? _a : exports.DEFAULT_SESSION_KEY;
|
|
124
|
+
removeSessionUser(request.session, key);
|
|
125
|
+
const previous = options.keepSessionInfo === true ? copySession(request.session) : {};
|
|
126
|
+
yield call(request.session, 'save');
|
|
127
|
+
yield call(request.session, 'regenerate');
|
|
128
|
+
restoreSession(request.session, previous);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/session/manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgEA,8CAOC;AA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,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtF,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACpC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAC1C,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AuthUserPayload } from '../interfaces/auth.user';
|
|
2
|
+
import { AuthRequest } from '../transports/interfaces';
|
|
3
|
+
import { SessionLogInOptions } from './manager';
|
|
4
|
+
/** Options of {@link decorateRequest}. */
|
|
5
|
+
export interface DecorateRequestOptions extends SessionLogInOptions {
|
|
6
|
+
/** Returns the payload of a user stored by `logIn()`. Default: `user.authSerialize()`. */
|
|
7
|
+
serialize?: (user: any) => AuthUserPayload;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Adds `logIn()`, `logOut()`, `isAuthenticated()` and `isUnauthenticated()` to a request, compatible with passport
|
|
11
|
+
* (and their `login()` / `logout()` aliases), if it does not have them. They use the session of the request.
|
|
12
|
+
*/
|
|
13
|
+
export declare function decorateRequest(request: AuthRequest, defaults?: DecorateRequestOptions): void;
|
|
14
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/session/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAA+B,MAAM,WAAW,CAAC;AAI7E,0CAA0C;AAC1C,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IAC/D,0FAA0F;IAC1F,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,eAAe,CAAC;CAC9C;AAWD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,GAAE,sBAA2B,GAAG,IAAI,CAkDjG"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.decorateRequest = decorateRequest;
|
|
15
|
+
const manager_1 = require("./manager");
|
|
16
|
+
function defaultSerialize(user) {
|
|
17
|
+
if (typeof (user === null || user === void 0 ? void 0 : user.authSerialize) !== 'function') {
|
|
18
|
+
throw new Error('Cannot store the user in the session: give a serialize function, or implement authSerialize()');
|
|
19
|
+
}
|
|
20
|
+
return user.authSerialize();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Adds `logIn()`, `logOut()`, `isAuthenticated()` and `isUnauthenticated()` to a request, compatible with passport
|
|
24
|
+
* (and their `login()` / `logout()` aliases), if it does not have them. They use the session of the request.
|
|
25
|
+
*/
|
|
26
|
+
function decorateRequest(request, defaults = {}) {
|
|
27
|
+
const { serialize = defaultSerialize } = defaults, sessionDefaults = __rest(defaults, ["serialize"]);
|
|
28
|
+
if (typeof request.isAuthenticated !== 'function') {
|
|
29
|
+
request.isAuthenticated = function () {
|
|
30
|
+
return this.user !== undefined && this.user !== null;
|
|
31
|
+
};
|
|
32
|
+
request.isUnauthenticated = function () {
|
|
33
|
+
return !this.isAuthenticated();
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (typeof request.logIn !== 'function') {
|
|
37
|
+
request.logIn = request.login = function (user, options, done) {
|
|
38
|
+
const opts = typeof options === 'function' ? {} : (options !== null && options !== void 0 ? options : {});
|
|
39
|
+
const cb = typeof options === 'function' ? options : (done !== null && done !== void 0 ? done : (() => undefined));
|
|
40
|
+
const promise = opts.session === false
|
|
41
|
+
? Promise.resolve()
|
|
42
|
+
: Promise.resolve().then(() => (0, manager_1.sessionLogIn)(this, serialize(user), Object.assign(Object.assign({}, sessionDefaults), opts)));
|
|
43
|
+
promise.then(() => {
|
|
44
|
+
this.user = user;
|
|
45
|
+
cb();
|
|
46
|
+
}, (err) => cb(err));
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (typeof request.logOut !== 'function') {
|
|
50
|
+
request.logOut = request.logout = function (options, done) {
|
|
51
|
+
const opts = typeof options === 'function' ? {} : (options !== null && options !== void 0 ? options : {});
|
|
52
|
+
const cb = typeof options === 'function' ? options : (done !== null && done !== void 0 ? done : (() => undefined));
|
|
53
|
+
this.user = null;
|
|
54
|
+
const promise = this.session ? (0, manager_1.sessionLogOut)(this, Object.assign(Object.assign({}, sessionDefaults), opts)) : Promise.resolve();
|
|
55
|
+
promise.then(() => cb(), (err) => cb(err));
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/session/request.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAyBA,0CAkDC;AAzED,uCAA6E;AAU7E,SAAS,gBAAgB,CAAC,IAAS;IAC/B,IAAI,OAAO,CAAA,IAAI,aAAJ,IAA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AC"}
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import { Request } from 'express';
|
|
2
|
-
import { Strategy } from 'passport-local';
|
|
3
1
|
import { AuthService } from '../service';
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { AuthRequest } from '../transports/interfaces';
|
|
3
|
+
import { AuthStrategy, AuthStrategyContext, AuthStrategyResult } from './interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* The `emailpassword` strategy: reads `email` and `password` from the body (or the query) and loads the user with
|
|
6
|
+
* the auth provider of the namespace, which checks the password.
|
|
7
|
+
*
|
|
8
|
+
* The namespace is read from the `namespace` query parameter or body field, `default` if not set.
|
|
9
|
+
*/
|
|
10
|
+
export declare class EmailPasswordStrategy<User = any> implements AuthStrategy<User> {
|
|
6
11
|
protected readonly authService: AuthService;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
protected readonly usernameField: string;
|
|
14
|
+
protected readonly passwordField: string;
|
|
7
15
|
constructor(authService: AuthService);
|
|
8
|
-
protected getNamespace(req:
|
|
9
|
-
|
|
16
|
+
protected getNamespace(req: AuthRequest): string;
|
|
17
|
+
protected getField(req: AuthRequest, field: string): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Loads the user of the credentials.
|
|
20
|
+
* Returns the user (`undefined` fails the authentication) and the auth info.
|
|
21
|
+
*/
|
|
22
|
+
validate(req: AuthRequest, email: string, password: string): Promise<[User | undefined, {
|
|
10
23
|
namespace: string;
|
|
11
24
|
}]>;
|
|
25
|
+
authenticate({ request }: AuthStrategyContext): Promise<AuthStrategyResult<User> | undefined>;
|
|
12
26
|
}
|
|
13
|
-
export {};
|
|
14
27
|
//# sourceMappingURL=emailpassword.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emailpassword.d.ts","sourceRoot":"","sources":["../../src/strategies/emailpassword.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emailpassword.d.ts","sourceRoot":"","sources":["../../src/strategies/emailpassword.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAErF;;;;;GAKG;AACH,qBACa,qBAAqB,CAAC,IAAI,GAAG,GAAG,CAAE,YAAW,YAAY,CAAC,IAAI,CAAC;IAK5D,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW;IAJvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAmB;IACxC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAW;IACnD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAc;gBAEvB,WAAW,EAAE,WAAW;IAEvD,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM;IAKhD,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAKvE;;;OAGG;IACG,QAAQ,CACV,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,CAAC,IAAI,GAAG,SAAS,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAM/C,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;CAYtG"}
|
|
@@ -20,37 +20,60 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.EmailPasswordStrategy = void 0;
|
|
22
22
|
const common_1 = require("@nestjs/common");
|
|
23
|
-
const
|
|
24
|
-
const passport_local_1 = require("passport-local");
|
|
23
|
+
const constants_1 = require("../constants");
|
|
25
24
|
const service_1 = require("../service");
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The `emailpassword` strategy: reads `email` and `password` from the body (or the query) and loads the user with
|
|
27
|
+
* the auth provider of the namespace, which checks the password.
|
|
28
|
+
*
|
|
29
|
+
* The namespace is read from the `namespace` query parameter or body field, `default` if not set.
|
|
30
|
+
*/
|
|
31
|
+
let EmailPasswordStrategy = class EmailPasswordStrategy {
|
|
27
32
|
constructor(authService) {
|
|
28
|
-
super({
|
|
29
|
-
usernameField: 'email',
|
|
30
|
-
passwordField: 'password',
|
|
31
|
-
passReqToCallback: true
|
|
32
|
-
});
|
|
33
33
|
this.authService = authService;
|
|
34
|
+
this.name = 'emailpassword';
|
|
35
|
+
this.usernameField = 'email';
|
|
36
|
+
this.passwordField = 'password';
|
|
34
37
|
}
|
|
35
38
|
getNamespace(req) {
|
|
36
|
-
var _a, _b;
|
|
37
|
-
|
|
39
|
+
var _a, _b, _c;
|
|
40
|
+
const namespace = (_b = (_a = req.query) === null || _a === void 0 ? void 0 : _a.namespace) !== null && _b !== void 0 ? _b : (_c = req.body) === null || _c === void 0 ? void 0 : _c.namespace;
|
|
41
|
+
return typeof namespace === 'string' && namespace !== '' ? namespace : constants_1.DEFAULT_NAMESPACE;
|
|
42
|
+
}
|
|
43
|
+
getField(req, field) {
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
const value = (_b = (_a = req.body) === null || _a === void 0 ? void 0 : _a[field]) !== null && _b !== void 0 ? _b : (_c = req.query) === null || _c === void 0 ? void 0 : _c[field];
|
|
46
|
+
return typeof value === 'string' && value !== '' ? value : undefined;
|
|
38
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Loads the user of the credentials.
|
|
50
|
+
* Returns the user (`undefined` fails the authentication) and the auth info.
|
|
51
|
+
*/
|
|
39
52
|
validate(req, email, password) {
|
|
40
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
const namespace = this.getNamespace(req);
|
|
55
|
+
const user = yield this.authService.loadUser({ email, password, namespace });
|
|
56
|
+
return [user, { namespace }];
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
authenticate(_a) {
|
|
60
|
+
return __awaiter(this, arguments, void 0, function* ({ request }) {
|
|
61
|
+
const email = this.getField(request, this.usernameField);
|
|
62
|
+
const password = this.getField(request, this.passwordField);
|
|
63
|
+
if (email === undefined || password === undefined) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
const [user, info] = yield this.validate(request, email, password);
|
|
67
|
+
if (user === undefined || user === null) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
return { user, namespace: info.namespace, info };
|
|
48
71
|
});
|
|
49
72
|
}
|
|
50
73
|
};
|
|
51
|
-
EmailPasswordStrategy =
|
|
74
|
+
exports.EmailPasswordStrategy = EmailPasswordStrategy;
|
|
75
|
+
exports.EmailPasswordStrategy = EmailPasswordStrategy = __decorate([
|
|
52
76
|
(0, common_1.Injectable)(),
|
|
53
77
|
__metadata("design:paramtypes", [service_1.AuthService])
|
|
54
78
|
], EmailPasswordStrategy);
|
|
55
|
-
exports.EmailPasswordStrategy = EmailPasswordStrategy;
|
|
56
79
|
//# sourceMappingURL=emailpassword.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emailpassword.js","sourceRoot":"","sources":["../../src/strategies/emailpassword.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;
|
|
1
|
+
{"version":3,"file":"emailpassword.js","sourceRoot":"","sources":["../../src/strategies/emailpassword.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAE5C,4CAAiD;AACjD,wCAAyC;AAIzC;;;;;GAKG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAq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CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAC5D,IAAI,KAAK,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAChD,OAAO,SAAS,CAAC;YACrB,CAAC;YACD,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;YACnE,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBACtC,OAAO,SAAS,CAAC;YACrB,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;QACrD,CAAC;KAAA;CACJ,CAAA;AA3CY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAMmC,qBAAW;GAL9C,qBAAqB,CA2CjC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AuthRequest } from '../transports/interfaces';
|
|
2
|
+
/** Returns the token of a request, `null` or `undefined` if there is none. */
|
|
3
|
+
export type JwtFromRequestFunction = (request: AuthRequest) => string | null | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Token extractors, with the API of passport-jwt's `ExtractJwt` (its extractors work too).
|
|
6
|
+
*/
|
|
7
|
+
export declare const ExtractJwt: {
|
|
8
|
+
/** The value of a header. */
|
|
9
|
+
fromHeader: (name: string) => JwtFromRequestFunction;
|
|
10
|
+
/** A field of the body. */
|
|
11
|
+
fromBodyField: (field: string) => JwtFromRequestFunction;
|
|
12
|
+
/** A query parameter. */
|
|
13
|
+
fromUrlQueryParameter: (name: string) => JwtFromRequestFunction;
|
|
14
|
+
/** A cookie (needs a cookie parser, e.g. cookie-parser, or reads the `cookie` header). */
|
|
15
|
+
fromCookie: (name: string) => JwtFromRequestFunction;
|
|
16
|
+
/** The `authorization` header with a scheme (case insensitive): `<scheme> <token>`. */
|
|
17
|
+
fromAuthHeaderWithScheme: (scheme: string) => JwtFromRequestFunction;
|
|
18
|
+
/** The `authorization` header: `Bearer <token>`. */
|
|
19
|
+
fromAuthHeaderAsBearerToken: () => JwtFromRequestFunction;
|
|
20
|
+
/** The first token found by the extractors. */
|
|
21
|
+
fromExtractors: (extractors: JwtFromRequestFunction[]) => JwtFromRequestFunction;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=extract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/strategies/extract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,8EAA8E;AAC9E,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAOzF;;GAEG;AACH,eAAO,MAAM,UAAU;IACnB,6BAA6B;uBAElB,MAAM,KAAG,sBAAsB;IAI1C,2BAA2B;2BAEf,MAAM,KAAG,sBAAsB;IAM3C,yBAAyB;kCAEd,MAAM,KAAG,sBAAsB;IAM1C,0FAA0F;uBAE/E,MAAM,KAAG,sBAAsB;IAc1C,uFAAuF;uCAE1E,MAAM,KAAG,sBAAsB;IAM5C,oDAAoD;uCACnB,sBAAsB;IAEvD,+CAA+C;iCAE9B,sBAAsB,EAAE,KAAG,sBAAsB;CAUrE,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtractJwt = void 0;
|
|
4
|
+
const header = (request, name) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const value = (_a = request.headers) === null || _a === void 0 ? void 0 : _a[name.toLowerCase()];
|
|
7
|
+
return Array.isArray(value) ? value[0] : value;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Token extractors, with the API of passport-jwt's `ExtractJwt` (its extractors work too).
|
|
11
|
+
*/
|
|
12
|
+
exports.ExtractJwt = {
|
|
13
|
+
/** The value of a header. */
|
|
14
|
+
fromHeader: (name) => (request) => { var _a; return (_a = header(request, name)) !== null && _a !== void 0 ? _a : null; },
|
|
15
|
+
/** A field of the body. */
|
|
16
|
+
fromBodyField: (field) => (request) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const value = (_a = request.body) === null || _a === void 0 ? void 0 : _a[field];
|
|
19
|
+
return typeof value === 'string' ? value : null;
|
|
20
|
+
},
|
|
21
|
+
/** A query parameter. */
|
|
22
|
+
fromUrlQueryParameter: (name) => (request) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const value = (_a = request.query) === null || _a === void 0 ? void 0 : _a[name];
|
|
25
|
+
return typeof value === 'string' ? value : null;
|
|
26
|
+
},
|
|
27
|
+
/** A cookie (needs a cookie parser, e.g. cookie-parser, or reads the `cookie` header). */
|
|
28
|
+
fromCookie: (name) => (request) => {
|
|
29
|
+
var _a;
|
|
30
|
+
const parsed = (_a = request.cookies) === null || _a === void 0 ? void 0 : _a[name];
|
|
31
|
+
if (typeof parsed === 'string') {
|
|
32
|
+
return parsed;
|
|
33
|
+
}
|
|
34
|
+
const cookies = header(request, 'cookie');
|
|
35
|
+
const match = cookies === null || cookies === void 0 ? void 0 : cookies.split(';').map((c) => c.trim()).find((c) => c.startsWith(`${name}=`));
|
|
36
|
+
return match !== undefined ? decodeURIComponent(match.slice(name.length + 1)) : null;
|
|
37
|
+
},
|
|
38
|
+
/** The `authorization` header with a scheme (case insensitive): `<scheme> <token>`. */
|
|
39
|
+
fromAuthHeaderWithScheme: (scheme) => (request) => {
|
|
40
|
+
var _a;
|
|
41
|
+
const match = /^(\S+)\s+(\S+)$/.exec((_a = header(request, 'authorization')) !== null && _a !== void 0 ? _a : '');
|
|
42
|
+
return match !== null && match[1].toLowerCase() === scheme.toLowerCase() ? match[2] : null;
|
|
43
|
+
},
|
|
44
|
+
/** The `authorization` header: `Bearer <token>`. */
|
|
45
|
+
fromAuthHeaderAsBearerToken: () => exports.ExtractJwt.fromAuthHeaderWithScheme('bearer'),
|
|
46
|
+
/** The first token found by the extractors. */
|
|
47
|
+
fromExtractors: (extractors) => (request) => {
|
|
48
|
+
for (const extractor of extractors) {
|
|
49
|
+
const token = extractor(request);
|
|
50
|
+
if (typeof token === 'string' && token !== '') {
|
|
51
|
+
return token;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=extract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/strategies/extract.ts"],"names":[],"mappings":";;;AAKA,MAAM,MAAM,GAAG,CAAC,OAAoB,EAAE,IAAY,EAAsB,EAAE;;IACtE,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACpD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACnD,CAAC,CAAC;AAEF;;GAEG;AACU,QAAA,UAAU,GAAG;IACtB,6BAA6B;IAC7B,UAAU,EACN,CAAC,IAAY,EAA0B,EAAE,CACzC,CAAC,OAAO,EAAE,EAAE,WACR,OAAA,MAAA,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,mCAAI,IAAI,CAAA,EAAA;IAErC,2BAA2B;IAC3B,aAAa,EACT,CAAC,KAAa,EAA0B,EAAE,CAC1C,CAAC,OAAO,EAAE,EAAE;;QACR,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,IAAI,0CAAG,KAAK,CAAC,CAAC;QACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;I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QAC7E,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/F,CAAC;IAEL,oDAAoD;IACpD,2BAA2B,EAAE,GAA2B,EAAE,CAAC,kBAAU,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IAExG,+CAA+C;IAC/C,cAAc,EACV,CAAC,UAAoC,EAA0B,EAAE,CACjE,CAAC,OAAO,EAAE,EAAE;QACR,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACjC,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;YACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;gBAC5C,OAAO,KAAK,CAAC;YACjB,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/strategies/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./emailpassword"), exports);
|
|
18
|
+
__exportStar(require("./extract"), exports);
|
|
19
|
+
__exportStar(require("./interfaces"), exports);
|
|
20
|
+
__exportStar(require("./jwt"), exports);
|
|
21
|
+
__exportStar(require("./passport"), exports);
|
|
22
|
+
__exportStar(require("./registry"), exports);
|
|
23
|
+
__exportStar(require("./session"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/strategies/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,4CAA0B;AAC1B,+CAA6B;AAC7B,wCAAsB;AACtB,6CAA2B;AAC3B,6CAA2B;AAC3B,4CAA0B"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import { AuthRequest } from '../transports/interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* The options of a strategy in a guard: `@Auth({ strategies: { jwt: { ... } } })`, given to the strategy.
|
|
5
|
+
* To save the user into the session, see the `saveSession` option of the guard.
|
|
6
|
+
*/
|
|
7
|
+
export interface AuthStrategyOptions {
|
|
8
|
+
/** The scopes requested from the provider (OAuth strategies). Listed by {@link AuthScopes}. */
|
|
9
|
+
scope?: string | string[];
|
|
10
|
+
[option: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
/** What a strategy receives. */
|
|
13
|
+
export interface AuthStrategyContext {
|
|
14
|
+
/** The request of the transport: `headers`, `query`, `body`, `session`. */
|
|
15
|
+
request: AuthRequest;
|
|
16
|
+
/** The response of the transport, if it has one. */
|
|
17
|
+
response?: any;
|
|
18
|
+
/** The name of the transport (`http`, `graphql`, `ws`, `rpc`...). */
|
|
19
|
+
transport: string;
|
|
20
|
+
/** The NestJS execution context. */
|
|
21
|
+
executionContext: ExecutionContext;
|
|
22
|
+
/** The options of the strategy in the guard. */
|
|
23
|
+
options: AuthStrategyOptions;
|
|
24
|
+
}
|
|
25
|
+
/** A successful authentication. */
|
|
26
|
+
export interface AuthStrategyResult<User = any> {
|
|
27
|
+
user: User;
|
|
28
|
+
/** The namespace of the auth provider that loaded the user. */
|
|
29
|
+
namespace?: string;
|
|
30
|
+
/** Info about the authentication (token payload...), set in `request.authInfo[strategy]`. */
|
|
31
|
+
info?: unknown;
|
|
32
|
+
/** The scopes granted to this authentication (e.g. the `scope` claim of a token). */
|
|
33
|
+
scopes?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* `true` if the strategy already sent the response (e.g. an OAuth redirect): the guard stops and the handler
|
|
36
|
+
* is not called.
|
|
37
|
+
*/
|
|
38
|
+
handled?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* An authentication strategy. Register it with `AuthModule.registerStrategies()`.
|
|
42
|
+
*
|
|
43
|
+
* `authenticate()` returns the result when the credentials are valid, `undefined` when there are none or they are
|
|
44
|
+
* not valid (the next strategy is tried), and throws for the other errors.
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* @Injectable()
|
|
48
|
+
* export class ApiKeyStrategy implements AuthStrategy<ApiClient> {
|
|
49
|
+
* readonly name = 'apikey';
|
|
50
|
+
* constructor(private readonly clients: ApiClientRepository) {}
|
|
51
|
+
*
|
|
52
|
+
* async authenticate({ request }: AuthStrategyContext) {
|
|
53
|
+
* const key = request.headers['x-api-key'];
|
|
54
|
+
* const client = typeof key === 'string' ? await this.clients.findByKey(key) : undefined;
|
|
55
|
+
* return client ? { user: client, namespace: 'api', scopes: client.scopes } : undefined;
|
|
56
|
+
* }
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export interface AuthStrategy<User = any> {
|
|
61
|
+
/** The name used in the guards. */
|
|
62
|
+
readonly name: string;
|
|
63
|
+
authenticate(context: AuthStrategyContext): Promise<AuthStrategyResult<User> | undefined>;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/strategies/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,+FAA+F;IAC/F,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAED,gCAAgC;AAChC,MAAM,WAAW,mBAAmB;IAChC,2EAA2E;IAC3E,OAAO,EAAE,WAAW,CAAC;IACrB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,gDAAgD;IAChD,OAAO,EAAE,mBAAmB,CAAC;CAChC;AAED,mCAAmC;AACnC,MAAM,WAAW,kBAAkB,CAAC,IAAI,GAAG,GAAG;IAC1C,IAAI,EAAE,IAAI,CAAC;IACX,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qFAAqF;IACrF,MAAM,CAAC,EAAE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