@ackplus/nest-auth 1.1.19 → 1.1.21
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 +1 -1
- package/src/lib/audit/services/audit.service.d.ts +15 -0
- package/src/lib/audit/services/audit.service.d.ts.map +1 -0
- package/src/lib/audit/services/audit.service.js +143 -0
- package/src/lib/auth/controllers/auth.controller.d.ts +1 -1
- package/src/lib/auth/events/index.d.ts +13 -0
- package/src/lib/auth/events/index.d.ts.map +1 -0
- package/src/lib/auth/events/index.js +15 -0
- package/src/lib/auth/events/user-2fa-disabled.event.d.ts +10 -0
- package/src/lib/auth/events/user-2fa-disabled.event.d.ts.map +1 -0
- package/src/lib/auth/events/user-2fa-disabled.event.js +12 -0
- package/src/lib/auth/events/user-2fa-enabled.event.d.ts +13 -0
- package/src/lib/auth/events/user-2fa-enabled.event.d.ts.map +1 -0
- package/src/lib/auth/events/user-2fa-enabled.event.js +15 -0
- package/src/lib/auth/events/user-password-changed.event.d.ts +12 -0
- package/src/lib/auth/events/user-password-changed.event.d.ts.map +1 -0
- package/src/lib/auth/events/user-password-changed.event.js +15 -0
- package/src/lib/auth/guards/auth.guard.d.ts +19 -1
- package/src/lib/auth/guards/auth.guard.d.ts.map +1 -1
- package/src/lib/auth/guards/auth.guard.js +90 -17
- package/src/lib/auth/services/auth.service.d.ts +10 -6
- package/src/lib/auth/services/auth.service.d.ts.map +1 -1
- package/src/lib/auth/services/auth.service.js +148 -95
- package/src/lib/auth/services/mfa.service.d.ts +1 -1
- package/src/lib/auth/services/mfa.service.d.ts.map +1 -1
- package/src/lib/auth/services/mfa.service.js +27 -2
- package/src/lib/auth.constants.d.ts +3 -0
- package/src/lib/auth.constants.d.ts.map +1 -1
- package/src/lib/auth.constants.js +3 -0
- package/src/lib/core/interfaces/auth-module-options.interface.d.ts +3 -3
- package/src/lib/core/interfaces/auth-module-options.interface.d.ts.map +1 -1
- package/src/lib/core/services/auth-config.service.js +1 -1
- package/src/lib/nest-auth.module.d.ts.map +1 -1
- package/src/lib/nest-auth.module.js +5 -2
- package/src/lib/session/services/session-manager.service.d.ts +3 -3
- package/src/lib/session/services/session-manager.service.d.ts.map +1 -1
- package/src/lib/session/services/session-manager.service.js +27 -4
- package/src/lib/user/entities/user.entity.d.ts.map +1 -1
- package/src/lib/user/entities/user.entity.js +19 -0
- package/src/lib/user/events/user-created.event.d.ts +1 -0
- package/src/lib/user/events/user-created.event.d.ts.map +1 -1
- package/src/lib/user/services/user.service.d.ts +7 -7
- package/src/lib/user/services/user.service.d.ts.map +1 -1
- package/src/lib/user/services/user.service.js +49 -56
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AuthConfigService } from '../../core/services/auth-config.service';
|
|
2
|
+
import { UserLoggedInEvent, LoggedOutEvent, UserRegisteredEvent, UserPasswordChangedEvent, User2faEnabledEvent, User2faDisabledEvent } from '../../auth/events';
|
|
3
|
+
export declare class AuditService {
|
|
4
|
+
private readonly authConfigService;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(authConfigService: AuthConfigService);
|
|
7
|
+
private emitAuditEvent;
|
|
8
|
+
handleUserLoggedIn(payload: UserLoggedInEvent): Promise<void>;
|
|
9
|
+
handleUserLoggedOut(payload: LoggedOutEvent): Promise<void>;
|
|
10
|
+
handleUserRegistered(payload: UserRegisteredEvent): Promise<void>;
|
|
11
|
+
handlePasswordChanged(payload: UserPasswordChangedEvent): Promise<void>;
|
|
12
|
+
handle2faEnabled(payload: User2faEnabledEvent): Promise<void>;
|
|
13
|
+
handle2faDisabled(payload: User2faDisabledEvent): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=audit.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nest-auth/src/lib/audit/services/audit.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,OAAO,EACH,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACvB,MAAM,mBAAmB,CAAC;AAG3B,qBACa,YAAY;IAIjB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAHtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiC;gBAGnC,iBAAiB,EAAE,iBAAiB;YAG3C,cAAc;IAiBtB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB;IAgB7C,mBAAmB,CAAC,OAAO,EAAE,cAAc;IAc3C,oBAAoB,CAAC,OAAO,EAAE,mBAAmB;IAcjD,qBAAqB,CAAC,OAAO,EAAE,wBAAwB;IAavD,gBAAgB,CAAC,OAAO,EAAE,mBAAmB;IAc7C,iBAAiB,CAAC,OAAO,EAAE,oBAAoB;CAWxD"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var AuditService_1;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AuditService = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
8
|
+
const auth_config_service_1 = require("../../core/services/auth-config.service");
|
|
9
|
+
const auth_constants_1 = require("../../auth.constants");
|
|
10
|
+
const events_1 = require("../../auth/events");
|
|
11
|
+
let AuditService = AuditService_1 = class AuditService {
|
|
12
|
+
constructor(authConfigService) {
|
|
13
|
+
this.authConfigService = authConfigService;
|
|
14
|
+
this.logger = new common_1.Logger(AuditService_1.name);
|
|
15
|
+
}
|
|
16
|
+
async emitAuditEvent(event) {
|
|
17
|
+
const config = this.authConfigService.getConfig();
|
|
18
|
+
if (config.audit?.enabled === false) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (config.audit?.onEvent) {
|
|
22
|
+
try {
|
|
23
|
+
await config.audit.onEvent(event);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
this.logger.error(`Error in audit.onEvent hook: ${error.message}`, error.stack);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async handleUserLoggedIn(payload) {
|
|
31
|
+
await this.emitAuditEvent({
|
|
32
|
+
type: 'login',
|
|
33
|
+
userId: payload.payload.user.id,
|
|
34
|
+
ip: payload.payload.session.ipAddress,
|
|
35
|
+
userAgent: payload.payload.session.userAgent,
|
|
36
|
+
success: true,
|
|
37
|
+
metadata: {
|
|
38
|
+
provider: payload.payload.provider,
|
|
39
|
+
tenantId: payload.payload.tenantId,
|
|
40
|
+
},
|
|
41
|
+
timestamp: new Date(),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async handleUserLoggedOut(payload) {
|
|
45
|
+
await this.emitAuditEvent({
|
|
46
|
+
type: 'logout',
|
|
47
|
+
userId: payload.payload.user?.id,
|
|
48
|
+
success: true,
|
|
49
|
+
metadata: {
|
|
50
|
+
reason: payload.payload.reason,
|
|
51
|
+
sessionId: payload.payload.session.id,
|
|
52
|
+
},
|
|
53
|
+
timestamp: new Date(),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async handleUserRegistered(payload) {
|
|
57
|
+
await this.emitAuditEvent({
|
|
58
|
+
type: 'signup',
|
|
59
|
+
userId: payload.payload.user.id,
|
|
60
|
+
success: true,
|
|
61
|
+
metadata: {
|
|
62
|
+
tenantId: payload.payload.tenantId,
|
|
63
|
+
provider: payload.payload.provider,
|
|
64
|
+
},
|
|
65
|
+
timestamp: new Date(),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
async handlePasswordChanged(payload) {
|
|
69
|
+
await this.emitAuditEvent({
|
|
70
|
+
type: 'password_change',
|
|
71
|
+
userId: payload.payload.user.id,
|
|
72
|
+
success: true,
|
|
73
|
+
metadata: {
|
|
74
|
+
initiatedBy: payload.payload.initiatedBy,
|
|
75
|
+
},
|
|
76
|
+
timestamp: new Date(),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
async handle2faEnabled(payload) {
|
|
80
|
+
await this.emitAuditEvent({
|
|
81
|
+
type: 'mfa_enable',
|
|
82
|
+
userId: payload.payload.user.id,
|
|
83
|
+
success: true,
|
|
84
|
+
metadata: {
|
|
85
|
+
method: payload.payload.method,
|
|
86
|
+
action: 'enabled'
|
|
87
|
+
},
|
|
88
|
+
timestamp: new Date(),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
async handle2faDisabled(payload) {
|
|
92
|
+
await this.emitAuditEvent({
|
|
93
|
+
type: 'mfa_enable', // reusing type or should add mfa_disable?
|
|
94
|
+
userId: payload.payload.user.id,
|
|
95
|
+
success: true,
|
|
96
|
+
metadata: {
|
|
97
|
+
action: 'disabled'
|
|
98
|
+
},
|
|
99
|
+
timestamp: new Date(),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
exports.AuditService = AuditService;
|
|
104
|
+
tslib_1.__decorate([
|
|
105
|
+
(0, event_emitter_1.OnEvent)(auth_constants_1.NestAuthEvents.LOGGED_IN),
|
|
106
|
+
tslib_1.__metadata("design:type", Function),
|
|
107
|
+
tslib_1.__metadata("design:paramtypes", [events_1.UserLoggedInEvent]),
|
|
108
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
109
|
+
], AuditService.prototype, "handleUserLoggedIn", null);
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
(0, event_emitter_1.OnEvent)(auth_constants_1.NestAuthEvents.LOGGED_OUT),
|
|
112
|
+
tslib_1.__metadata("design:type", Function),
|
|
113
|
+
tslib_1.__metadata("design:paramtypes", [events_1.LoggedOutEvent]),
|
|
114
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
115
|
+
], AuditService.prototype, "handleUserLoggedOut", null);
|
|
116
|
+
tslib_1.__decorate([
|
|
117
|
+
(0, event_emitter_1.OnEvent)(auth_constants_1.NestAuthEvents.REGISTERED),
|
|
118
|
+
tslib_1.__metadata("design:type", Function),
|
|
119
|
+
tslib_1.__metadata("design:paramtypes", [events_1.UserRegisteredEvent]),
|
|
120
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
121
|
+
], AuditService.prototype, "handleUserRegistered", null);
|
|
122
|
+
tslib_1.__decorate([
|
|
123
|
+
(0, event_emitter_1.OnEvent)(auth_constants_1.NestAuthEvents.PASSWORD_CHANGED),
|
|
124
|
+
tslib_1.__metadata("design:type", Function),
|
|
125
|
+
tslib_1.__metadata("design:paramtypes", [events_1.UserPasswordChangedEvent]),
|
|
126
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
127
|
+
], AuditService.prototype, "handlePasswordChanged", null);
|
|
128
|
+
tslib_1.__decorate([
|
|
129
|
+
(0, event_emitter_1.OnEvent)(auth_constants_1.NestAuthEvents.TWO_FACTOR_ENABLED),
|
|
130
|
+
tslib_1.__metadata("design:type", Function),
|
|
131
|
+
tslib_1.__metadata("design:paramtypes", [events_1.User2faEnabledEvent]),
|
|
132
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
133
|
+
], AuditService.prototype, "handle2faEnabled", null);
|
|
134
|
+
tslib_1.__decorate([
|
|
135
|
+
(0, event_emitter_1.OnEvent)(auth_constants_1.NestAuthEvents.TWO_FACTOR_DISABLED),
|
|
136
|
+
tslib_1.__metadata("design:type", Function),
|
|
137
|
+
tslib_1.__metadata("design:paramtypes", [events_1.User2faDisabledEvent]),
|
|
138
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
139
|
+
], AuditService.prototype, "handle2faDisabled", null);
|
|
140
|
+
exports.AuditService = AuditService = AuditService_1 = tslib_1.__decorate([
|
|
141
|
+
(0, common_1.Injectable)(),
|
|
142
|
+
tslib_1.__metadata("design:paramtypes", [auth_config_service_1.AuthConfigService])
|
|
143
|
+
], AuditService);
|
|
@@ -65,7 +65,7 @@ export declare class AuthController {
|
|
|
65
65
|
*/
|
|
66
66
|
resetPassword(input: ResetPasswordRequestDto): Promise<MessageResponseDto>;
|
|
67
67
|
resetPasswordWithToken(input: ResetPasswordWithTokenRequestDto): Promise<MessageResponseDto>;
|
|
68
|
-
getUser(): Promise<import("../../core").NestAuthUser
|
|
68
|
+
getUser(): Promise<Partial<import("../../core").NestAuthUser>>;
|
|
69
69
|
sendEmailVerification(input: SendEmailVerificationRequestDto): Promise<MessageResponseDto>;
|
|
70
70
|
verifyEmail(input: VerifyEmailRequestDto): Promise<MessageResponseDto>;
|
|
71
71
|
getClientConfig(): Promise<ClientConfigResponseDto>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './user-logged-in.event';
|
|
2
|
+
export * from './logged-out.event';
|
|
3
|
+
export * from './logged-out-all.event';
|
|
4
|
+
export * from './user-registered.event';
|
|
5
|
+
export * from './password-reset-requested.event';
|
|
6
|
+
export * from './password-reset.event';
|
|
7
|
+
export * from './two-factor-code-sent.event';
|
|
8
|
+
export * from './user-2fa-verified.event';
|
|
9
|
+
export * from './user-refresh-token.event';
|
|
10
|
+
export * from './user-password-changed.event';
|
|
11
|
+
export * from './user-2fa-enabled.event';
|
|
12
|
+
export * from './user-2fa-disabled.event';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nest-auth/src/lib/auth/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./user-logged-in.event"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./logged-out.event"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./logged-out-all.event"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./user-registered.event"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./password-reset-requested.event"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./password-reset.event"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./two-factor-code-sent.event"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./user-2fa-verified.event"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./user-refresh-token.event"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./user-password-changed.event"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./user-2fa-enabled.event"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./user-2fa-disabled.event"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NestAuthUser } from "../../user/entities/user.entity";
|
|
2
|
+
export interface User2faDisabledEventPayload {
|
|
3
|
+
user: NestAuthUser;
|
|
4
|
+
}
|
|
5
|
+
export declare class User2faDisabledEvent {
|
|
6
|
+
readonly payload: User2faDisabledEventPayload;
|
|
7
|
+
constructor(payload: User2faDisabledEventPayload);
|
|
8
|
+
get user(): NestAuthUser;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=user-2fa-disabled.event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-2fa-disabled.event.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nest-auth/src/lib/auth/events/user-2fa-disabled.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,WAAW,2BAA2B;IACxC,IAAI,EAAE,YAAY,CAAC;CACtB;AAED,qBAAa,oBAAoB;aAET,OAAO,EAAE,2BAA2B;gBAApC,OAAO,EAAE,2BAA2B;IAGxD,IAAI,IAAI,IAAI,YAAY,CAEvB;CACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.User2faDisabledEvent = void 0;
|
|
4
|
+
class User2faDisabledEvent {
|
|
5
|
+
constructor(payload) {
|
|
6
|
+
this.payload = payload;
|
|
7
|
+
}
|
|
8
|
+
get user() {
|
|
9
|
+
return this.payload.user;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.User2faDisabledEvent = User2faDisabledEvent;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NestAuthUser } from "../../user/entities/user.entity";
|
|
2
|
+
import { MFAMethodEnum } from "../../core/interfaces/mfa-options.interface";
|
|
3
|
+
export interface User2faEnabledEventPayload {
|
|
4
|
+
user: NestAuthUser;
|
|
5
|
+
method?: MFAMethodEnum;
|
|
6
|
+
}
|
|
7
|
+
export declare class User2faEnabledEvent {
|
|
8
|
+
readonly payload: User2faEnabledEventPayload;
|
|
9
|
+
constructor(payload: User2faEnabledEventPayload);
|
|
10
|
+
get user(): NestAuthUser;
|
|
11
|
+
get method(): MFAMethodEnum | undefined;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=user-2fa-enabled.event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-2fa-enabled.event.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nest-auth/src/lib/auth/events/user-2fa-enabled.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAE5E,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED,qBAAa,mBAAmB;aAER,OAAO,EAAE,0BAA0B;gBAAnC,OAAO,EAAE,0BAA0B;IAGvD,IAAI,IAAI,IAAI,YAAY,CAEvB;IAED,IAAI,MAAM,IAAI,aAAa,GAAG,SAAS,CAEtC;CACJ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.User2faEnabledEvent = void 0;
|
|
4
|
+
class User2faEnabledEvent {
|
|
5
|
+
constructor(payload) {
|
|
6
|
+
this.payload = payload;
|
|
7
|
+
}
|
|
8
|
+
get user() {
|
|
9
|
+
return this.payload.user;
|
|
10
|
+
}
|
|
11
|
+
get method() {
|
|
12
|
+
return this.payload.method;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.User2faEnabledEvent = User2faEnabledEvent;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NestAuthUser } from "../../user/entities/user.entity";
|
|
2
|
+
export interface UserPasswordChangedEventPayload {
|
|
3
|
+
user: NestAuthUser;
|
|
4
|
+
initiatedBy: 'user' | 'admin';
|
|
5
|
+
}
|
|
6
|
+
export declare class UserPasswordChangedEvent {
|
|
7
|
+
readonly payload: UserPasswordChangedEventPayload;
|
|
8
|
+
constructor(payload: UserPasswordChangedEventPayload);
|
|
9
|
+
get user(): NestAuthUser;
|
|
10
|
+
get initiatedBy(): 'user' | 'admin';
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=user-password-changed.event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-password-changed.event.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nest-auth/src/lib/auth/events/user-password-changed.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,WAAW,+BAA+B;IAC5C,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,qBAAa,wBAAwB;aAEb,OAAO,EAAE,+BAA+B;gBAAxC,OAAO,EAAE,+BAA+B;IAG5D,IAAI,IAAI,IAAI,YAAY,CAEvB;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,OAAO,CAElC;CACJ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserPasswordChangedEvent = void 0;
|
|
4
|
+
class UserPasswordChangedEvent {
|
|
5
|
+
constructor(payload) {
|
|
6
|
+
this.payload = payload;
|
|
7
|
+
}
|
|
8
|
+
get user() {
|
|
9
|
+
return this.payload.user;
|
|
10
|
+
}
|
|
11
|
+
get initiatedBy() {
|
|
12
|
+
return this.payload.initiatedBy;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.UserPasswordChangedEvent = UserPasswordChangedEvent;
|
|
@@ -3,6 +3,7 @@ import { Reflector } from '@nestjs/core';
|
|
|
3
3
|
import { JwtService } from '../../core/services/jwt.service';
|
|
4
4
|
import { SessionManagerService } from '../../session/services/session-manager.service';
|
|
5
5
|
import { AccessKeyService } from '../../user/services/access-key.service';
|
|
6
|
+
import { AuthConfigService } from '../../core/services/auth-config.service';
|
|
6
7
|
export declare const OPTIONAL_AUTH_KEY = "optional_auth";
|
|
7
8
|
/**
|
|
8
9
|
* NestAuthAuthGuard
|
|
@@ -23,7 +24,8 @@ export declare class NestAuthAuthGuard implements CanActivate {
|
|
|
23
24
|
private jwtService;
|
|
24
25
|
private sessionManager;
|
|
25
26
|
private accessKeyService;
|
|
26
|
-
|
|
27
|
+
private authConfigService;
|
|
28
|
+
constructor(reflector: Reflector, jwtService: JwtService, sessionManager: SessionManagerService, accessKeyService: AccessKeyService, authConfigService: AuthConfigService);
|
|
27
29
|
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
28
30
|
private handleJwtAuth;
|
|
29
31
|
private handleApiKeyAuth;
|
|
@@ -40,10 +42,26 @@ export declare class NestAuthAuthGuard implements CanActivate {
|
|
|
40
42
|
* Get required roles from decorator
|
|
41
43
|
*/
|
|
42
44
|
private getRequiredRoles;
|
|
45
|
+
/**
|
|
46
|
+
* Check if user has required roles
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* Check if user has required roles
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* Helper to resolve user roles
|
|
53
|
+
*/
|
|
54
|
+
private resolveUserRoles;
|
|
43
55
|
/**
|
|
44
56
|
* Check if user has required roles
|
|
45
57
|
*/
|
|
46
58
|
private checkRoles;
|
|
59
|
+
/**
|
|
60
|
+
* Check if user has required permissions
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* Check if user has required permissions
|
|
64
|
+
*/
|
|
47
65
|
/**
|
|
48
66
|
* Check if user has required permissions
|
|
49
67
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.guard.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nest-auth/src/lib/auth/guards/auth.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,gBAAgB,EAA6C,MAAM,gBAAgB,CAAC;AAEtH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.guard.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nest-auth/src/lib/auth/guards/auth.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,gBAAgB,EAA6C,MAAM,gBAAgB,CAAC;AAEtH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAK1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,qBACa,iBAAkB,YAAW,WAAW;IAE7C,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,iBAAiB;gBAJjB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,qBAAqB,EACrC,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB;IAG1C,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;YAyFhD,aAAa;YAgFb,gBAAgB;YAqDhB,QAAQ;IA0BtB;;OAEG;YACW,kBAAkB;IA+BhC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAc9B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAcxB;;OAEG;IACH;;OAEG;IACH;;OAEG;YACW,gBAAgB;IAoB9B;;OAEG;YACW,UAAU;IAsBxB;;OAEG;IACH;;OAEG;IACH;;OAEG;YACW,gBAAgB;IAuC9B;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAiB7B"}
|
|
@@ -11,6 +11,7 @@ const access_key_service_1 = require("../../user/services/access-key.service");
|
|
|
11
11
|
const skip_mfa_decorator_1 = require("../../core/decorators/skip-mfa.decorator");
|
|
12
12
|
const permissions_decorator_1 = require("../../core/decorators/permissions.decorator");
|
|
13
13
|
const role_decorator_1 = require("../../core/decorators/role.decorator");
|
|
14
|
+
const auth_config_service_1 = require("../../core/services/auth-config.service");
|
|
14
15
|
// Key for optional auth metadata
|
|
15
16
|
exports.OPTIONAL_AUTH_KEY = 'optional_auth';
|
|
16
17
|
/**
|
|
@@ -28,11 +29,12 @@ exports.OPTIONAL_AUTH_KEY = 'optional_auth';
|
|
|
28
29
|
* Note: For automatic token refresh, enable RefreshTokenInterceptor globally.
|
|
29
30
|
*/
|
|
30
31
|
let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
31
|
-
constructor(reflector, jwtService, sessionManager, accessKeyService) {
|
|
32
|
+
constructor(reflector, jwtService, sessionManager, accessKeyService, authConfigService) {
|
|
32
33
|
this.reflector = reflector;
|
|
33
34
|
this.jwtService = jwtService;
|
|
34
35
|
this.sessionManager = sessionManager;
|
|
35
36
|
this.accessKeyService = accessKeyService;
|
|
37
|
+
this.authConfigService = authConfigService;
|
|
36
38
|
}
|
|
37
39
|
async canActivate(context) {
|
|
38
40
|
const request = context.switchToHttp().getRequest();
|
|
@@ -122,6 +124,17 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
122
124
|
try {
|
|
123
125
|
// Verify the JWT token
|
|
124
126
|
const payload = await this.jwtService.verifyToken(token);
|
|
127
|
+
const config = this.authConfigService.getConfig();
|
|
128
|
+
// Apply guards.beforeAuth hook if configured
|
|
129
|
+
if (config.guards?.beforeAuth) {
|
|
130
|
+
const result = await config.guards.beforeAuth(request, payload);
|
|
131
|
+
if (result && result.reject) {
|
|
132
|
+
throw new common_1.UnauthorizedException({
|
|
133
|
+
message: result.reason || 'Authentication rejected by custom guard',
|
|
134
|
+
code: auth_constants_1.ERROR_CODES.ACCESS_DENIED
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
125
138
|
request.user = payload;
|
|
126
139
|
request.authType = 'jwt';
|
|
127
140
|
// Verify session exists
|
|
@@ -140,9 +153,29 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
140
153
|
});
|
|
141
154
|
}
|
|
142
155
|
}
|
|
156
|
+
// Apply jwt.validateToken hook if configured
|
|
157
|
+
if (config.jwt?.validateToken) {
|
|
158
|
+
const isValid = await config.jwt.validateToken(payload, session);
|
|
159
|
+
if (!isValid) {
|
|
160
|
+
throw new common_1.UnauthorizedException({
|
|
161
|
+
message: 'Token validation failed',
|
|
162
|
+
code: auth_constants_1.ERROR_CODES.INVALID_TOKEN
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
143
166
|
request.session = session;
|
|
144
167
|
// Check MFA requirements
|
|
145
168
|
await this.checkMfa(context, payload, isOptional);
|
|
169
|
+
// Apply guards.afterAuth hook if configured
|
|
170
|
+
if (config.guards?.afterAuth) {
|
|
171
|
+
// We need the full user object for the hook if possible, but the signature asks for NestAuthUser
|
|
172
|
+
// The payload is just the JWT payload. The session has the user data.
|
|
173
|
+
// Let's try to use session.data.user if available, otherwise we might need to fetch it or cast payload
|
|
174
|
+
// The interface says user: NestAuthUser. session.data.user is usually the user object.
|
|
175
|
+
if (session.data?.user) {
|
|
176
|
+
await config.guards.afterAuth(request, session.data.user, session);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
146
179
|
return true;
|
|
147
180
|
}
|
|
148
181
|
catch (error) {
|
|
@@ -255,11 +288,11 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
255
288
|
}
|
|
256
289
|
// Check roles if required
|
|
257
290
|
if (requiredRoles.length > 0) {
|
|
258
|
-
this.checkRoles(user, requiredRoles);
|
|
291
|
+
await this.checkRoles(user, requiredRoles);
|
|
259
292
|
}
|
|
260
293
|
// Check permissions if required
|
|
261
294
|
if (requiredPermissions.length > 0) {
|
|
262
|
-
this.checkPermissions(user, requiredPermissions);
|
|
295
|
+
await this.checkPermissions(user, requiredPermissions);
|
|
263
296
|
}
|
|
264
297
|
}
|
|
265
298
|
/**
|
|
@@ -287,17 +320,39 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
287
320
|
/**
|
|
288
321
|
* Check if user has required roles
|
|
289
322
|
*/
|
|
290
|
-
|
|
323
|
+
/**
|
|
324
|
+
* Check if user has required roles
|
|
325
|
+
*/
|
|
326
|
+
/**
|
|
327
|
+
* Helper to resolve user roles
|
|
328
|
+
*/
|
|
329
|
+
async resolveUserRoles(user) {
|
|
330
|
+
const config = this.authConfigService.getConfig();
|
|
331
|
+
// Apply authorization.resolveRoles hook if configured
|
|
332
|
+
if (config.authorization?.resolveRoles) {
|
|
333
|
+
return await config.authorization.resolveRoles(user);
|
|
334
|
+
}
|
|
335
|
+
// Default behavior
|
|
291
336
|
if (!user.roles || !Array.isArray(user.roles)) {
|
|
337
|
+
// Return empty array instead of throwing, let the caller decide
|
|
338
|
+
return [];
|
|
339
|
+
}
|
|
340
|
+
// Get active role names
|
|
341
|
+
return user.roles
|
|
342
|
+
.filter((role) => role.isActive)
|
|
343
|
+
.map((role) => role.name);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Check if user has required roles
|
|
347
|
+
*/
|
|
348
|
+
async checkRoles(user, requiredRoles) {
|
|
349
|
+
const userRoleNames = await this.resolveUserRoles(user);
|
|
350
|
+
if (userRoleNames.length === 0 && (!user.roles || !Array.isArray(user.roles))) {
|
|
292
351
|
throw new common_1.ForbiddenException({
|
|
293
352
|
message: 'Access denied: No roles assigned',
|
|
294
353
|
code: auth_constants_1.ERROR_CODES.NO_ROLES_ASSIGNED,
|
|
295
354
|
});
|
|
296
355
|
}
|
|
297
|
-
// Get active role names
|
|
298
|
-
const userRoleNames = user.roles
|
|
299
|
-
.filter(role => role.isActive)
|
|
300
|
-
.map(role => role.name);
|
|
301
356
|
// Check if user has all required roles
|
|
302
357
|
const hasAllRoles = requiredRoles.every(role => userRoleNames.includes(role));
|
|
303
358
|
if (!hasAllRoles) {
|
|
@@ -311,15 +366,32 @@ let NestAuthAuthGuard = class NestAuthAuthGuard {
|
|
|
311
366
|
/**
|
|
312
367
|
* Check if user has required permissions
|
|
313
368
|
*/
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
369
|
+
/**
|
|
370
|
+
* Check if user has required permissions
|
|
371
|
+
*/
|
|
372
|
+
/**
|
|
373
|
+
* Check if user has required permissions
|
|
374
|
+
*/
|
|
375
|
+
async checkPermissions(user, requiredPermissions) {
|
|
376
|
+
const config = this.authConfigService.getConfig();
|
|
377
|
+
let userPermissions = [];
|
|
378
|
+
// Apply authorization.resolvePermissions hook if configured
|
|
379
|
+
if (config.authorization?.resolvePermissions) {
|
|
380
|
+
// Resolve roles first as they are needed for the hook
|
|
381
|
+
const roles = await this.resolveUserRoles(user);
|
|
382
|
+
userPermissions = await config.authorization.resolvePermissions(user, roles);
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
// Default behavior
|
|
386
|
+
if (!user.roles || !Array.isArray(user.roles)) {
|
|
387
|
+
throw new common_1.ForbiddenException({
|
|
388
|
+
message: 'Access denied: No roles assigned for permission check',
|
|
389
|
+
code: auth_constants_1.ERROR_CODES.NO_ROLES_ASSIGNED,
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
// Get all permissions from user's roles
|
|
393
|
+
userPermissions = this.getUserPermissions(user.roles);
|
|
320
394
|
}
|
|
321
|
-
// Get all permissions from user's roles
|
|
322
|
-
const userPermissions = this.getUserPermissions(user.roles);
|
|
323
395
|
// Check if user has all required permissions
|
|
324
396
|
const hasAllPermissions = requiredPermissions.every(permission => userPermissions.includes(permission));
|
|
325
397
|
if (!hasAllPermissions) {
|
|
@@ -354,5 +426,6 @@ exports.NestAuthAuthGuard = NestAuthAuthGuard = tslib_1.__decorate([
|
|
|
354
426
|
tslib_1.__metadata("design:paramtypes", [core_1.Reflector,
|
|
355
427
|
jwt_service_1.JwtService,
|
|
356
428
|
session_manager_service_1.SessionManagerService,
|
|
357
|
-
access_key_service_1.AccessKeyService
|
|
429
|
+
access_key_service_1.AccessKeyService,
|
|
430
|
+
auth_config_service_1.AuthConfigService])
|
|
358
431
|
], NestAuthAuthGuard);
|
|
@@ -22,6 +22,8 @@ import { VerifyOtpResponseDto } from '../dto/responses/verify-otp.response.dto';
|
|
|
22
22
|
import { SendEmailVerificationRequestDto } from '../dto/requests/send-email-verification.request.dto';
|
|
23
23
|
import { VerifyEmailRequestDto } from '../dto/requests/verify-email.request.dto';
|
|
24
24
|
import { AuthConfigService } from '../../core/services/auth-config.service';
|
|
25
|
+
import { AuthTokensResponseDto } from '../dto/responses/auth.response.dto';
|
|
26
|
+
import { UserService } from '../../user/services/user.service';
|
|
25
27
|
export declare class AuthService {
|
|
26
28
|
private readonly userRepository;
|
|
27
29
|
private otpRepository;
|
|
@@ -33,9 +35,10 @@ export declare class AuthService {
|
|
|
33
35
|
private readonly tenantService;
|
|
34
36
|
private readonly debugLogger;
|
|
35
37
|
private readonly authConfigService;
|
|
36
|
-
|
|
38
|
+
private readonly userService;
|
|
39
|
+
constructor(userRepository: Repository<NestAuthUser>, otpRepository: Repository<NestAuthOTP>, authProviderRegistry: AuthProviderRegistryService, mfaService: MfaService, sessionManager: SessionManagerService, jwtService: JwtService, eventEmitter: EventEmitter2, tenantService: TenantService, debugLogger: DebugLoggerService, authConfigService: AuthConfigService, userService: UserService);
|
|
37
40
|
getUserWithRolesAndPermissions(userId: string, relations?: string[]): Promise<NestAuthUser>;
|
|
38
|
-
getUser(): Promise<NestAuthUser
|
|
41
|
+
getUser(): Promise<Partial<NestAuthUser>>;
|
|
39
42
|
signup(input: SignupRequestDto): Promise<AuthResponseDto>;
|
|
40
43
|
login(input: LoginRequestDto): Promise<AuthResponseDto>;
|
|
41
44
|
verify2fa(input: Verify2faRequestDto): Promise<{
|
|
@@ -45,10 +48,7 @@ export declare class AuthService {
|
|
|
45
48
|
}>;
|
|
46
49
|
send2faCode(userId: string, method: MFAMethodEnum): Promise<boolean>;
|
|
47
50
|
private handleSocialLogin;
|
|
48
|
-
refreshToken(refreshToken: string): Promise<
|
|
49
|
-
accessToken: string;
|
|
50
|
-
refreshToken: string;
|
|
51
|
-
}>;
|
|
51
|
+
refreshToken(refreshToken: string): Promise<AuthTokensResponseDto>;
|
|
52
52
|
changePassword(input: ChangePasswordRequestDto): Promise<AuthResponseDto>;
|
|
53
53
|
forgotPassword(input: ForgotPasswordRequestDto): Promise<true | {
|
|
54
54
|
message: string;
|
|
@@ -65,6 +65,10 @@ export declare class AuthService {
|
|
|
65
65
|
message: string;
|
|
66
66
|
}>;
|
|
67
67
|
private generateTokensPayload;
|
|
68
|
+
/**
|
|
69
|
+
* Handle errors using the errorHandler hook if configured
|
|
70
|
+
*/
|
|
71
|
+
private handleError;
|
|
68
72
|
private generateTokensFromSession;
|
|
69
73
|
}
|
|
70
74
|
//# sourceMappingURL=auth.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nest-auth/src/lib/auth/services/auth.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAU7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EACH,aAAa,EAChB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAUrF,OAAO,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAE9E,OAAO,EAAE,iCAAiC,EAAE,MAAM,wDAAwD,CAAC;AAC3G,OAAO,EAAE,gCAAgC,EAAE,MAAM,uDAAuD,CAAC;AACzG,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nest-auth/src/lib/auth/services/auth.service.ts"],"names":[],"mappings":"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"}
|