@bernierllc/auth-suite 1.4.12 → 1.4.13
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/errors.d.ts +12 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +25 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/managers/audit-manager.d.ts +26 -0
- package/dist/managers/audit-manager.d.ts.map +1 -0
- package/dist/managers/audit-manager.js +160 -0
- package/dist/managers/audit-manager.js.map +1 -0
- package/dist/managers/mfa-manager.d.ts +32 -0
- package/dist/managers/mfa-manager.d.ts.map +1 -0
- package/dist/managers/mfa-manager.js +206 -0
- package/dist/managers/mfa-manager.js.map +1 -0
- package/dist/managers/rbac-manager.d.ts +25 -0
- package/dist/managers/rbac-manager.d.ts.map +1 -0
- package/dist/managers/rbac-manager.js +192 -0
- package/dist/managers/rbac-manager.js.map +1 -0
- package/dist/managers/session-manager.d.ts +20 -0
- package/dist/managers/session-manager.d.ts.map +1 -0
- package/dist/managers/session-manager.js +110 -0
- package/dist/managers/session-manager.js.map +1 -0
- package/dist/suite.d.ts +172 -0
- package/dist/suite.d.ts.map +1 -0
- package/dist/suite.js +1145 -0
- package/dist/suite.js.map +1 -0
- package/dist/types.d.ts +250 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/package.json +4 -4
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type AuthSuiteErrorCode = 'AUTH_SUITE_ERROR' | 'INVALID_INPUT' | 'OPERATION_FAILED';
|
|
2
|
+
export interface AuthSuiteErrorOptions {
|
|
3
|
+
cause?: Error;
|
|
4
|
+
code?: AuthSuiteErrorCode;
|
|
5
|
+
context?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export declare class AuthSuiteError extends Error {
|
|
8
|
+
readonly code: AuthSuiteErrorCode;
|
|
9
|
+
readonly context?: Record<string, unknown>;
|
|
10
|
+
constructor(message: string, options?: AuthSuiteErrorOptions);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,kBAAkB,GAC1B,kBAAkB,GAClB,eAAe,GACf,kBAAkB,CAAC;AAEvB,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAE/B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB;CAS7D"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.AuthSuiteError = void 0;
|
|
11
|
+
class AuthSuiteError extends Error {
|
|
12
|
+
code;
|
|
13
|
+
context;
|
|
14
|
+
constructor(message, options) {
|
|
15
|
+
super(message, options?.cause ? { cause: options.cause } : undefined);
|
|
16
|
+
this.name = 'AuthSuiteError';
|
|
17
|
+
this.code = options?.code ?? 'AUTH_SUITE_ERROR';
|
|
18
|
+
if (options?.context !== undefined) {
|
|
19
|
+
this.context = options.context;
|
|
20
|
+
}
|
|
21
|
+
Error.captureStackTrace?.(this, this.constructor);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.AuthSuiteError = AuthSuiteError;
|
|
25
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;AAaF,MAAa,cAAe,SAAQ,KAAK;IAC9B,IAAI,CAAqB;IACzB,OAAO,CAA2B;IAE3C,YAAY,OAAe,EAAE,OAA+B;QAC1D,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,kBAAkB,CAAC;QAChD,IAAI,OAAO,EAAE,OAAO,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QACjC,CAAC;QACD,KAAK,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;CACF;AAbD,wCAaC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { AuthSuite } from './suite';
|
|
2
|
+
export { AuthSuiteError, type AuthSuiteErrorCode, type AuthSuiteErrorOptions } from './errors';
|
|
3
|
+
export type * from './types';
|
|
4
|
+
export type { EmailVerificationResult } from './types';
|
|
5
|
+
export { MemorySessionManager } from './managers/session-manager';
|
|
6
|
+
export { BasicRBACManager } from './managers/rbac-manager';
|
|
7
|
+
export { TOTPMfaManager } from './managers/mfa-manager';
|
|
8
|
+
export { FileAuditManager } from './managers/audit-manager';
|
|
9
|
+
export * from '@bernierllc/auth-service';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,KAAK,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAG/F,mBAAmB,SAAS,CAAC;AAC7B,YAAY,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAGvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,cAAc,0BAA0B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.FileAuditManager = exports.TOTPMfaManager = exports.BasicRBACManager = exports.MemorySessionManager = exports.AuthSuiteError = exports.AuthSuite = void 0;
|
|
25
|
+
// Main exports
|
|
26
|
+
var suite_1 = require("./suite");
|
|
27
|
+
Object.defineProperty(exports, "AuthSuite", { enumerable: true, get: function () { return suite_1.AuthSuite; } });
|
|
28
|
+
// Error exports
|
|
29
|
+
var errors_1 = require("./errors");
|
|
30
|
+
Object.defineProperty(exports, "AuthSuiteError", { enumerable: true, get: function () { return errors_1.AuthSuiteError; } });
|
|
31
|
+
// Manager exports for advanced usage
|
|
32
|
+
var session_manager_1 = require("./managers/session-manager");
|
|
33
|
+
Object.defineProperty(exports, "MemorySessionManager", { enumerable: true, get: function () { return session_manager_1.MemorySessionManager; } });
|
|
34
|
+
var rbac_manager_1 = require("./managers/rbac-manager");
|
|
35
|
+
Object.defineProperty(exports, "BasicRBACManager", { enumerable: true, get: function () { return rbac_manager_1.BasicRBACManager; } });
|
|
36
|
+
var mfa_manager_1 = require("./managers/mfa-manager");
|
|
37
|
+
Object.defineProperty(exports, "TOTPMfaManager", { enumerable: true, get: function () { return mfa_manager_1.TOTPMfaManager; } });
|
|
38
|
+
var audit_manager_1 = require("./managers/audit-manager");
|
|
39
|
+
Object.defineProperty(exports, "FileAuditManager", { enumerable: true, get: function () { return audit_manager_1.FileAuditManager; } });
|
|
40
|
+
// Re-export auth-service for convenience
|
|
41
|
+
__exportStar(require("@bernierllc/auth-service"), exports);
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;;;;;;;;;;;;;;;AAEF,eAAe;AACf,iCAAoC;AAA3B,kGAAA,SAAS,OAAA;AAElB,gBAAgB;AAChB,mCAA+F;AAAtF,wGAAA,cAAc,OAAA;AAMvB,qCAAqC;AACrC,8DAAkE;AAAzD,uHAAA,oBAAoB,OAAA;AAC7B,wDAA2D;AAAlD,gHAAA,gBAAgB,OAAA;AACzB,sDAAwD;AAA/C,6GAAA,cAAc,OAAA;AACvB,0DAA4D;AAAnD,iHAAA,gBAAgB,OAAA;AAEzB,yCAAyC;AACzC,2DAAyC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AuditManager, AuditLog, AuditQueryFilters } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* File-based audit manager
|
|
4
|
+
* For production use, consider database storage or external logging service
|
|
5
|
+
*/
|
|
6
|
+
export declare class FileAuditManager implements AuditManager {
|
|
7
|
+
private logs;
|
|
8
|
+
private config;
|
|
9
|
+
private maxLogs;
|
|
10
|
+
constructor(config: any);
|
|
11
|
+
log(event: Omit<AuditLog, 'id' | 'timestamp'>): Promise<void>;
|
|
12
|
+
query(filters: AuditQueryFilters): Promise<AuditLog[]>;
|
|
13
|
+
cleanup(olderThanDays: number): Promise<number>;
|
|
14
|
+
getLogStats(): Promise<{
|
|
15
|
+
total: number;
|
|
16
|
+
byLevel: Record<string, number>;
|
|
17
|
+
byEvent: Record<string, number>;
|
|
18
|
+
oldestLog?: Date;
|
|
19
|
+
newestLog?: Date;
|
|
20
|
+
}>;
|
|
21
|
+
exportLogs(format?: 'json' | 'csv'): Promise<string>;
|
|
22
|
+
searchLogs(searchTerm: string): Promise<AuditLog[]>;
|
|
23
|
+
private parseMaxSize;
|
|
24
|
+
private exportToCsv;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=audit-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-manager.d.ts","sourceRoot":"","sources":["../../src/managers/audit-manager.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE1E;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,YAAY;IACnD,OAAO,CAAC,IAAI,CAAkB;IAC9B,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,GAAG;IAKjB,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB7D,KAAK,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAsCtD,OAAO,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAY/C,WAAW,IAAI,OAAO,CAAC;QAC3B,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,SAAS,CAAC,EAAE,IAAI,CAAC;QACjB,SAAS,CAAC,EAAE,IAAI,CAAC;KAClB,CAAC;IA8BI,UAAU,CAAC,MAAM,GAAE,MAAM,GAAG,KAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ5D,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAyBzD,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,WAAW;CAuBpB"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.FileAuditManager = void 0;
|
|
11
|
+
const uuid_1 = require("uuid");
|
|
12
|
+
/**
|
|
13
|
+
* File-based audit manager
|
|
14
|
+
* For production use, consider database storage or external logging service
|
|
15
|
+
*/
|
|
16
|
+
class FileAuditManager {
|
|
17
|
+
logs = [];
|
|
18
|
+
config;
|
|
19
|
+
maxLogs;
|
|
20
|
+
constructor(config) {
|
|
21
|
+
this.config = config;
|
|
22
|
+
this.maxLogs = this.parseMaxSize(config.retention?.maxSize || '100MB');
|
|
23
|
+
}
|
|
24
|
+
async log(event) {
|
|
25
|
+
const auditLog = {
|
|
26
|
+
id: (0, uuid_1.v4)(),
|
|
27
|
+
timestamp: new Date(),
|
|
28
|
+
...event
|
|
29
|
+
};
|
|
30
|
+
this.logs.push(auditLog);
|
|
31
|
+
// Trim logs if we exceed the maximum
|
|
32
|
+
if (this.logs.length > this.maxLogs) {
|
|
33
|
+
this.logs = this.logs.slice(-this.maxLogs);
|
|
34
|
+
}
|
|
35
|
+
// In a real implementation, this would write to a file or database
|
|
36
|
+
// eslint-disable-next-line no-console
|
|
37
|
+
console.log(`[AUDIT] ${auditLog.timestamp.toISOString()} [${auditLog.level.toUpperCase()}] ${auditLog.event}`, auditLog.details);
|
|
38
|
+
}
|
|
39
|
+
async query(filters) {
|
|
40
|
+
let filteredLogs = [...this.logs];
|
|
41
|
+
// Apply filters
|
|
42
|
+
if (filters.userId) {
|
|
43
|
+
filteredLogs = filteredLogs.filter(log => log.userId === filters.userId);
|
|
44
|
+
}
|
|
45
|
+
if (filters.sessionId) {
|
|
46
|
+
filteredLogs = filteredLogs.filter(log => log.sessionId === filters.sessionId);
|
|
47
|
+
}
|
|
48
|
+
if (filters.event) {
|
|
49
|
+
filteredLogs = filteredLogs.filter(log => log.event === filters.event);
|
|
50
|
+
}
|
|
51
|
+
if (filters.level) {
|
|
52
|
+
filteredLogs = filteredLogs.filter(log => log.level === filters.level);
|
|
53
|
+
}
|
|
54
|
+
if (filters.startDate) {
|
|
55
|
+
filteredLogs = filteredLogs.filter(log => log.timestamp >= filters.startDate);
|
|
56
|
+
}
|
|
57
|
+
if (filters.endDate) {
|
|
58
|
+
filteredLogs = filteredLogs.filter(log => log.timestamp <= filters.endDate);
|
|
59
|
+
}
|
|
60
|
+
// Sort by timestamp (newest first)
|
|
61
|
+
filteredLogs.sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime());
|
|
62
|
+
// Apply pagination
|
|
63
|
+
const offset = filters.offset || 0;
|
|
64
|
+
const limit = filters.limit || 100;
|
|
65
|
+
return filteredLogs.slice(offset, offset + limit);
|
|
66
|
+
}
|
|
67
|
+
async cleanup(olderThanDays) {
|
|
68
|
+
const cutoffDate = new Date();
|
|
69
|
+
cutoffDate.setDate(cutoffDate.getDate() - olderThanDays);
|
|
70
|
+
const initialCount = this.logs.length;
|
|
71
|
+
this.logs = this.logs.filter(log => log.timestamp > cutoffDate);
|
|
72
|
+
return initialCount - this.logs.length;
|
|
73
|
+
}
|
|
74
|
+
// Additional utility methods
|
|
75
|
+
async getLogStats() {
|
|
76
|
+
const stats = {
|
|
77
|
+
total: this.logs.length,
|
|
78
|
+
byLevel: {},
|
|
79
|
+
byEvent: {},
|
|
80
|
+
oldestLog: undefined,
|
|
81
|
+
newestLog: undefined
|
|
82
|
+
};
|
|
83
|
+
if (this.logs.length === 0) {
|
|
84
|
+
return stats;
|
|
85
|
+
}
|
|
86
|
+
// Calculate statistics
|
|
87
|
+
for (const log of this.logs) {
|
|
88
|
+
// Count by level
|
|
89
|
+
stats.byLevel[log.level] = (stats.byLevel[log.level] || 0) + 1;
|
|
90
|
+
// Count by event
|
|
91
|
+
stats.byEvent[log.event] = (stats.byEvent[log.event] || 0) + 1;
|
|
92
|
+
}
|
|
93
|
+
// Find oldest and newest logs
|
|
94
|
+
const sortedByTime = [...this.logs].sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime());
|
|
95
|
+
stats.oldestLog = sortedByTime[0]?.timestamp;
|
|
96
|
+
stats.newestLog = sortedByTime[sortedByTime.length - 1]?.timestamp;
|
|
97
|
+
return stats;
|
|
98
|
+
}
|
|
99
|
+
async exportLogs(format = 'json') {
|
|
100
|
+
if (format === 'csv') {
|
|
101
|
+
return this.exportToCsv();
|
|
102
|
+
}
|
|
103
|
+
return JSON.stringify(this.logs, null, 2);
|
|
104
|
+
}
|
|
105
|
+
async searchLogs(searchTerm) {
|
|
106
|
+
const lowerSearchTerm = searchTerm.toLowerCase();
|
|
107
|
+
return this.logs.filter(log => {
|
|
108
|
+
// Search in event name
|
|
109
|
+
if (log.event.toLowerCase().includes(lowerSearchTerm)) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
// Search in user ID
|
|
113
|
+
if (log.userId?.toLowerCase().includes(lowerSearchTerm)) {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
// Search in details (JSON stringify for simple text search)
|
|
117
|
+
if (JSON.stringify(log.details).toLowerCase().includes(lowerSearchTerm)) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
return false;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
// Private helper methods
|
|
124
|
+
parseMaxSize(maxSize) {
|
|
125
|
+
const size = parseInt(maxSize);
|
|
126
|
+
const unit = maxSize.toUpperCase().slice(-2);
|
|
127
|
+
switch (unit) {
|
|
128
|
+
case 'KB':
|
|
129
|
+
return size * 1024;
|
|
130
|
+
case 'MB':
|
|
131
|
+
return size * 1024 * 1024;
|
|
132
|
+
case 'GB':
|
|
133
|
+
return size * 1024 * 1024 * 1024;
|
|
134
|
+
default:
|
|
135
|
+
return size; // Assume bytes
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exportToCsv() {
|
|
139
|
+
if (this.logs.length === 0) {
|
|
140
|
+
return 'id,timestamp,userId,sessionId,event,level,details,ipAddress,userAgent\n';
|
|
141
|
+
}
|
|
142
|
+
const headers = 'id,timestamp,userId,sessionId,event,level,details,ipAddress,userAgent\n';
|
|
143
|
+
const rows = this.logs.map(log => {
|
|
144
|
+
return [
|
|
145
|
+
log.id,
|
|
146
|
+
log.timestamp.toISOString(),
|
|
147
|
+
log.userId || '',
|
|
148
|
+
log.sessionId || '',
|
|
149
|
+
log.event,
|
|
150
|
+
log.level,
|
|
151
|
+
JSON.stringify(log.details).replace(/"/g, '""'), // Escape quotes for CSV
|
|
152
|
+
log.ipAddress || '',
|
|
153
|
+
log.userAgent || ''
|
|
154
|
+
].join(',');
|
|
155
|
+
}).join('\n');
|
|
156
|
+
return headers + rows;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.FileAuditManager = FileAuditManager;
|
|
160
|
+
//# sourceMappingURL=audit-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-manager.js","sourceRoot":"","sources":["../../src/managers/audit-manager.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;AAEF,+BAAoC;AAGpC;;;GAGG;AACH,MAAa,gBAAgB;IACnB,IAAI,GAAe,EAAE,CAAC;IACtB,MAAM,CAAM;IACZ,OAAO,CAAS;IAExB,YAAY,MAAW;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,IAAI,OAAO,CAAC,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,KAAyC;QACjD,MAAM,QAAQ,GAAa;YACzB,EAAE,EAAE,IAAA,SAAM,GAAE;YACZ,SAAS,EAAE,IAA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GAAG,IAAI,GAAG,IAAI,CAAC;YAC5B,KAAK,IAAI;gBACP,OAAO,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;YACnC;gBACE,OAAO,IAAI,CAAC,CAAC,eAAe;QAChC,CAAC;IACH,CAAC;IAEO,WAAW;QACjB,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,yEAAyE,CAAC;QACnF,CAAC;QAED,MAAM,OAAO,GAAG,yEAAyE,CAAC;QAE1F,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAC/B,OAAO;gBACL,GAAG,CAAC,EAAE;gBACN,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE;gBAC3B,GAAG,CAAC,MAAM,IAAI,EAAE;gBAChB,GAAG,CAAC,SAAS,IAAI,EAAE;gBACnB,GAAG,CAAC,KAAK;gBACT,GAAG,CAAC,KAAK;gBACT,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,wBAAwB;gBACzE,GAAG,CAAC,SAAS,IAAI,EAAE;gBACnB,GAAG,CAAC,SAAS,IAAI,EAAE;aACpB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,OAAO,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;CACF;AA3LD,4CA2LC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MfaManager, MfaChallenge } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* TOTP-based MFA manager
|
|
4
|
+
* Supports Time-based One-Time Passwords (TOTP) like Google Authenticator
|
|
5
|
+
*/
|
|
6
|
+
export declare class TOTPMfaManager implements MfaManager {
|
|
7
|
+
private userSecrets;
|
|
8
|
+
private userBackupCodes;
|
|
9
|
+
private activeChallenges;
|
|
10
|
+
private config;
|
|
11
|
+
constructor(config: any);
|
|
12
|
+
setupMfa(userId: string, type: string, _config?: Record<string, any>): Promise<{
|
|
13
|
+
secret: string;
|
|
14
|
+
qrCode?: string;
|
|
15
|
+
}>;
|
|
16
|
+
verifySetup(userId: string, code: string): Promise<boolean>;
|
|
17
|
+
generateChallenge(userId: string): Promise<MfaChallenge>;
|
|
18
|
+
verifyChallenge(challengeId: string, response: string): Promise<boolean>;
|
|
19
|
+
getBackupCodes(userId: string): Promise<string[]>;
|
|
20
|
+
verifyBackupCode(userId: string, code: string): Promise<boolean>;
|
|
21
|
+
isMfaEnabled(userId: string): Promise<boolean>;
|
|
22
|
+
disableMfa(userId: string): Promise<boolean>;
|
|
23
|
+
regenerateBackupCodes(userId: string): Promise<string[]>;
|
|
24
|
+
private generateTotpSecret;
|
|
25
|
+
private generateBackupCodes;
|
|
26
|
+
private generateQrCodeUrl;
|
|
27
|
+
private verifyTotpCode;
|
|
28
|
+
private generateTotpCode;
|
|
29
|
+
private simpleHash;
|
|
30
|
+
cleanup(): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=mfa-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfa-manager.d.ts","sourceRoot":"","sources":["../../src/managers/mfa-manager.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEzD;;;GAGG;AACH,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,WAAW,CAA6B;IAChD,OAAO,CAAC,eAAe,CAAkC;IACzD,OAAO,CAAC,gBAAgB,CAAmC;IAC3D,OAAO,CAAC,MAAM,CAAM;gBAER,MAAM,EAAE,GAAG;IAIjB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAqBnH,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS3D,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAsBxD,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAoCxE,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAKjD,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAqBhE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAc5C,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAY9D,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,mBAAmB;IAkB3B,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,UAAU;IAWlB,OAAO,IAAI,IAAI;CAShB"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TOTPMfaManager = void 0;
|
|
11
|
+
const uuid_1 = require("uuid");
|
|
12
|
+
/**
|
|
13
|
+
* TOTP-based MFA manager
|
|
14
|
+
* Supports Time-based One-Time Passwords (TOTP) like Google Authenticator
|
|
15
|
+
*/
|
|
16
|
+
class TOTPMfaManager {
|
|
17
|
+
userSecrets = new Map();
|
|
18
|
+
userBackupCodes = new Map();
|
|
19
|
+
activeChallenges = new Map();
|
|
20
|
+
config;
|
|
21
|
+
constructor(config) {
|
|
22
|
+
this.config = config;
|
|
23
|
+
}
|
|
24
|
+
async setupMfa(userId, type, _config) {
|
|
25
|
+
if (type !== 'totp') {
|
|
26
|
+
throw new Error(`MFA type ${type} not supported`);
|
|
27
|
+
}
|
|
28
|
+
// Generate a base32 secret for TOTP
|
|
29
|
+
const secret = this.generateTotpSecret();
|
|
30
|
+
this.userSecrets.set(userId, secret);
|
|
31
|
+
// Generate backup codes
|
|
32
|
+
if (this.config.backup?.enabled) {
|
|
33
|
+
const backupCodes = this.generateBackupCodes();
|
|
34
|
+
this.userBackupCodes.set(userId, new Set(backupCodes));
|
|
35
|
+
}
|
|
36
|
+
// Generate QR code URL (for apps like Google Authenticator)
|
|
37
|
+
const qrCode = this.generateQrCodeUrl(userId, secret);
|
|
38
|
+
return { secret, qrCode };
|
|
39
|
+
}
|
|
40
|
+
async verifySetup(userId, code) {
|
|
41
|
+
const secret = this.userSecrets.get(userId);
|
|
42
|
+
if (!secret) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return this.verifyTotpCode(secret, code);
|
|
46
|
+
}
|
|
47
|
+
async generateChallenge(userId) {
|
|
48
|
+
const challengeId = (0, uuid_1.v4)();
|
|
49
|
+
const now = new Date();
|
|
50
|
+
const expiresAt = new Date(now.getTime() + 5 * 60 * 1000); // 5 minutes
|
|
51
|
+
const challenge = {
|
|
52
|
+
challengeId,
|
|
53
|
+
userId,
|
|
54
|
+
type: 'totp',
|
|
55
|
+
createdAt: now,
|
|
56
|
+
expiresAt,
|
|
57
|
+
verified: false,
|
|
58
|
+
metadata: {
|
|
59
|
+
attempts: 0,
|
|
60
|
+
maxAttempts: 3
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
this.activeChallenges.set(challengeId, challenge);
|
|
64
|
+
return challenge;
|
|
65
|
+
}
|
|
66
|
+
async verifyChallenge(challengeId, response) {
|
|
67
|
+
const challenge = this.activeChallenges.get(challengeId);
|
|
68
|
+
if (!challenge || challenge.verified || challenge.expiresAt < new Date()) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
// Increment attempt count
|
|
72
|
+
if (challenge.metadata) {
|
|
73
|
+
challenge.metadata.attempts = (challenge.metadata.attempts || 0) + 1;
|
|
74
|
+
// Check if max attempts exceeded
|
|
75
|
+
if (challenge.metadata.attempts > challenge.metadata.maxAttempts) {
|
|
76
|
+
this.activeChallenges.delete(challengeId);
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const secret = this.userSecrets.get(challenge.userId);
|
|
81
|
+
if (!secret) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
const isValid = this.verifyTotpCode(secret, response);
|
|
85
|
+
if (isValid) {
|
|
86
|
+
challenge.verified = true;
|
|
87
|
+
this.activeChallenges.delete(challengeId);
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
// Update challenge with failed attempt
|
|
91
|
+
this.activeChallenges.set(challengeId, challenge);
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
async getBackupCodes(userId) {
|
|
95
|
+
const codes = this.userBackupCodes.get(userId);
|
|
96
|
+
return codes ? Array.from(codes) : [];
|
|
97
|
+
}
|
|
98
|
+
async verifyBackupCode(userId, code) {
|
|
99
|
+
const codes = this.userBackupCodes.get(userId);
|
|
100
|
+
if (!codes || !codes.has(code)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
// Remove used backup code
|
|
104
|
+
codes.delete(code);
|
|
105
|
+
if (codes.size === 0) {
|
|
106
|
+
this.userBackupCodes.delete(userId);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
this.userBackupCodes.set(userId, codes);
|
|
110
|
+
}
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
// Additional helper methods
|
|
114
|
+
async isMfaEnabled(userId) {
|
|
115
|
+
return this.userSecrets.has(userId);
|
|
116
|
+
}
|
|
117
|
+
async disableMfa(userId) {
|
|
118
|
+
const hadSecret = this.userSecrets.delete(userId);
|
|
119
|
+
this.userBackupCodes.delete(userId);
|
|
120
|
+
// Remove any active challenges for this user
|
|
121
|
+
for (const [challengeId, challenge] of this.activeChallenges.entries()) {
|
|
122
|
+
if (challenge.userId === userId) {
|
|
123
|
+
this.activeChallenges.delete(challengeId);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return hadSecret;
|
|
127
|
+
}
|
|
128
|
+
async regenerateBackupCodes(userId) {
|
|
129
|
+
if (!this.userSecrets.has(userId)) {
|
|
130
|
+
throw new Error('MFA not enabled for user');
|
|
131
|
+
}
|
|
132
|
+
const backupCodes = this.generateBackupCodes();
|
|
133
|
+
this.userBackupCodes.set(userId, new Set(backupCodes));
|
|
134
|
+
return backupCodes;
|
|
135
|
+
}
|
|
136
|
+
// Private helper methods
|
|
137
|
+
generateTotpSecret() {
|
|
138
|
+
// Generate a 32-character base32 secret
|
|
139
|
+
const base32Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
|
|
140
|
+
let secret = '';
|
|
141
|
+
for (let i = 0; i < 32; i++) {
|
|
142
|
+
secret += base32Chars.charAt(Math.floor(Math.random() * base32Chars.length));
|
|
143
|
+
}
|
|
144
|
+
return secret;
|
|
145
|
+
}
|
|
146
|
+
generateBackupCodes() {
|
|
147
|
+
const codes = [];
|
|
148
|
+
const codeCount = this.config.backup?.codeCount || 10;
|
|
149
|
+
const codeLength = this.config.backup?.codeLength || 8;
|
|
150
|
+
for (let i = 0; i < codeCount; i++) {
|
|
151
|
+
// Generate a simple alphanumeric code
|
|
152
|
+
const chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789'; // Exclude ambiguous chars
|
|
153
|
+
let code = '';
|
|
154
|
+
for (let j = 0; j < codeLength; j++) {
|
|
155
|
+
code += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
156
|
+
}
|
|
157
|
+
codes.push(code);
|
|
158
|
+
}
|
|
159
|
+
return codes;
|
|
160
|
+
}
|
|
161
|
+
generateQrCodeUrl(userId, secret) {
|
|
162
|
+
const issuer = encodeURIComponent('BernierLLC Auth Suite');
|
|
163
|
+
const accountName = encodeURIComponent(userId);
|
|
164
|
+
return `otpauth://totp/${issuer}:${accountName}?secret=${secret}&issuer=${issuer}`;
|
|
165
|
+
}
|
|
166
|
+
verifyTotpCode(secret, code) {
|
|
167
|
+
// This is a simplified TOTP verification
|
|
168
|
+
// In production, use a proper TOTP library like 'otplib'
|
|
169
|
+
const timeStep = Math.floor(Date.now() / 1000 / 30); // 30-second window
|
|
170
|
+
// Check current window and adjacent windows for clock drift tolerance
|
|
171
|
+
for (let i = -1; i <= 1; i++) {
|
|
172
|
+
const testCode = this.generateTotpCode(secret, timeStep + i);
|
|
173
|
+
if (testCode === code) {
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
generateTotpCode(secret, timeStep) {
|
|
180
|
+
// Simplified TOTP code generation
|
|
181
|
+
// In production, use proper HMAC-SHA1 implementation
|
|
182
|
+
// This is a mock implementation for demonstration
|
|
183
|
+
const hash = this.simpleHash(secret + timeStep.toString());
|
|
184
|
+
return (hash % 1000000).toString().padStart(6, '0');
|
|
185
|
+
}
|
|
186
|
+
simpleHash(str) {
|
|
187
|
+
let hash = 0;
|
|
188
|
+
for (let i = 0; i < str.length; i++) {
|
|
189
|
+
const char = str.charCodeAt(i);
|
|
190
|
+
hash = ((hash << 5) - hash) + char;
|
|
191
|
+
hash = hash & hash; // Convert to 32-bit integer
|
|
192
|
+
}
|
|
193
|
+
return Math.abs(hash);
|
|
194
|
+
}
|
|
195
|
+
// Cleanup method
|
|
196
|
+
cleanup() {
|
|
197
|
+
const now = new Date();
|
|
198
|
+
for (const [challengeId, challenge] of this.activeChallenges.entries()) {
|
|
199
|
+
if (challenge.expiresAt < now) {
|
|
200
|
+
this.activeChallenges.delete(challengeId);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
exports.TOTPMfaManager = TOTPMfaManager;
|
|
206
|
+
//# sourceMappingURL=mfa-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfa-manager.js","sourceRoot":"","sources":["../../src/managers/mfa-manager.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;AAEF,+BAAoC;AAGpC;;;GAGG;AACH,MAAa,cAAc;IACjB,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,eAAe,GAAG,IAAI,GAAG,EAAuB,CAAC;IACjD,gBAAgB,GAAG,IAAI,GAAG,EAAwB,CAAC;IACnD,MAAM,CAAM;IAEpB,YAAY,MAAW;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAAc,EAAE,IAAY,EAAE,OAA6B;QACxE,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,gBAAgB,CAAC,CAAC;QACpD,CAAC;QAED,oCAAoC;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACzC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAErC,wBAAwB;QACxB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;YAChC,MAAM,WAAW,GAAG,IA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U,CAAC,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3D,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACtD,CAAC;IAEO,UAAU,CAAC,GAAW;QAC5B,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACpC,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;YACnC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,4BAA4B;QAClD,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,iBAAiB;IACjB,OAAO;QACL,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QAEvB,KAAK,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC;YACvE,IAAI,SAAS,CAAC,SAAS,GAAG,GAAG,EAAE,CAAC;gBAC9B,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA7OD,wCA6OC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RBACManager, PermissionCheck, PermissionResult, RoleDefinition, PermissionDefinition } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Basic in-memory RBAC manager
|
|
4
|
+
* For production use, consider database storage
|
|
5
|
+
*/
|
|
6
|
+
export declare class BasicRBACManager implements RBACManager {
|
|
7
|
+
private userRoles;
|
|
8
|
+
private roles;
|
|
9
|
+
private permissions;
|
|
10
|
+
private hierarchical;
|
|
11
|
+
constructor(config: any);
|
|
12
|
+
checkPermission(check: PermissionCheck): Promise<PermissionResult>;
|
|
13
|
+
getUserRoles(userId: string): Promise<string[]>;
|
|
14
|
+
assignRole(userId: string, role: string): Promise<boolean>;
|
|
15
|
+
revokeRole(userId: string, role: string): Promise<boolean>;
|
|
16
|
+
getRolePermissions(roleName: string): Promise<string[]>;
|
|
17
|
+
createRole(role: RoleDefinition): Promise<boolean>;
|
|
18
|
+
deleteRole(roleName: string): Promise<boolean>;
|
|
19
|
+
updateRolePermissions(roleName: string, permissions: string[]): Promise<boolean>;
|
|
20
|
+
createPermission(permission: PermissionDefinition): Promise<boolean>;
|
|
21
|
+
private addInheritedRoles;
|
|
22
|
+
private checkConditions;
|
|
23
|
+
private evaluateCondition;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=rbac-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rbac-manager.d.ts","sourceRoot":"","sources":["../../src/managers/rbac-manager.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,OAAO,CAAC,SAAS,CAAkC;IACnD,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,WAAW,CAAoC;IACvD,OAAO,CAAC,YAAY,CAAU;gBAElB,MAAM,EAAE,GAAG;IAMjB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA6DlE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAkB/C,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,O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