permissions-contractx 1.0.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/LICENSE +21 -0
- package/README.md +1397 -0
- package/dist/constants/contractx-permissions.constants.d.ts +310 -0
- package/dist/constants/contractx-permissions.constants.d.ts.map +1 -0
- package/dist/constants/contractx-permissions.constants.js +1061 -0
- package/dist/constants/contractx-roles.constants.d.ts +295 -0
- package/dist/constants/contractx-roles.constants.d.ts.map +1 -0
- package/dist/constants/contractx-roles.constants.js +238 -0
- package/dist/constants/index.d.ts +3 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +18 -0
- package/dist/constants/security.constants.d.ts +77 -0
- package/dist/constants/security.constants.d.ts.map +1 -0
- package/dist/constants/security.constants.js +139 -0
- package/dist/decorators/current-user.decorator.d.ts +73 -0
- package/dist/decorators/current-user.decorator.d.ts.map +1 -0
- package/dist/decorators/current-user.decorator.js +91 -0
- package/dist/decorators/index.d.ts +5 -0
- package/dist/decorators/index.d.ts.map +1 -0
- package/dist/decorators/index.js +20 -0
- package/dist/decorators/permissions.decorator.d.ts +97 -0
- package/dist/decorators/permissions.decorator.d.ts.map +1 -0
- package/dist/decorators/permissions.decorator.js +106 -0
- package/dist/decorators/public.decorator.d.ts +18 -0
- package/dist/decorators/public.decorator.d.ts.map +1 -0
- package/dist/decorators/public.decorator.js +22 -0
- package/dist/decorators/roles.decorator.d.ts +79 -0
- package/dist/decorators/roles.decorator.d.ts.map +1 -0
- package/dist/decorators/roles.decorator.js +87 -0
- package/dist/guards/index.d.ts +4 -0
- package/dist/guards/index.d.ts.map +1 -0
- package/dist/guards/index.js +19 -0
- package/dist/guards/jwt-auth.guard.d.ts +21 -0
- package/dist/guards/jwt-auth.guard.d.ts.map +1 -0
- package/dist/guards/jwt-auth.guard.js +115 -0
- package/dist/guards/permissions.guard.d.ts +14 -0
- package/dist/guards/permissions.guard.d.ts.map +1 -0
- package/dist/guards/permissions.guard.js +77 -0
- package/dist/guards/roles.guard.d.ts +13 -0
- package/dist/guards/roles.guard.d.ts.map +1 -0
- package/dist/guards/roles.guard.js +59 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/interfaces/index.d.ts +2 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +17 -0
- package/dist/interfaces/jwt-payload.interface.d.ts +93 -0
- package/dist/interfaces/jwt-payload.interface.d.ts.map +1 -0
- package/dist/interfaces/jwt-payload.interface.js +2 -0
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +17 -0
- package/dist/modules/permissions-contractx.module.d.ts +41 -0
- package/dist/modules/permissions-contractx.module.d.ts.map +1 -0
- package/dist/modules/permissions-contractx.module.js +215 -0
- package/dist/services/contractx-authorization.service.d.ts +107 -0
- package/dist/services/contractx-authorization.service.d.ts.map +1 -0
- package/dist/services/contractx-authorization.service.js +362 -0
- package/dist/services/contractx-document-compliance.service.d.ts +85 -0
- package/dist/services/contractx-document-compliance.service.d.ts.map +1 -0
- package/dist/services/contractx-document-compliance.service.js +536 -0
- package/dist/services/contractx-validation.service.d.ts +76 -0
- package/dist/services/contractx-validation.service.d.ts.map +1 -0
- package/dist/services/contractx-validation.service.js +305 -0
- package/dist/services/index.d.ts +6 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +20 -0
- package/dist/services/user-context.service.d.ts +114 -0
- package/dist/services/user-context.service.d.ts.map +1 -0
- package/dist/services/user-context.service.js +199 -0
- package/dist/test-document-compliance.d.ts +7 -0
- package/dist/test-document-compliance.d.ts.map +1 -0
- package/dist/test-document-compliance.js +118 -0
- package/package.json +405 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequireRoles = exports.SuperAdminOnly = exports.ProviderOnly = exports.ClientOnly = exports.AdminOnly = exports.Roles = exports.ROLES_KEY = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
/**
|
|
6
|
+
* Metadata key for required roles
|
|
7
|
+
*/
|
|
8
|
+
exports.ROLES_KEY = 'roles';
|
|
9
|
+
/**
|
|
10
|
+
* Decorator to specify required roles for accessing a route.
|
|
11
|
+
* Can be applied at controller or method level.
|
|
12
|
+
* User must have at least one of the specified roles (OR logic).
|
|
13
|
+
*
|
|
14
|
+
* @param roles - Array of role names required to access the route
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* @Roles('superadmin', 'client_contract_admin')
|
|
19
|
+
* @Get('admin-data')
|
|
20
|
+
* getAdminData() {
|
|
21
|
+
* // Only users with superadmin OR client_contract_admin role
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
const Roles = (...roles) => (0, common_1.SetMetadata)(exports.ROLES_KEY, roles);
|
|
26
|
+
exports.Roles = Roles;
|
|
27
|
+
/**
|
|
28
|
+
* Decorator for ContractX specific admin roles
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* @AdminOnly()
|
|
33
|
+
* @Delete(':id')
|
|
34
|
+
* deleteResource() {
|
|
35
|
+
* // Only admin roles can access
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
const AdminOnly = () => (0, exports.Roles)('superadmin', 'client_contract_admin', 'provider_contract_admin');
|
|
40
|
+
exports.AdminOnly = AdminOnly;
|
|
41
|
+
/**
|
|
42
|
+
* Decorator for client-side roles only
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* @ClientOnly()
|
|
47
|
+
* @Get('client-data')
|
|
48
|
+
* getClientData() {
|
|
49
|
+
* // Only client-side roles can access
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
const ClientOnly = () => (0, exports.Roles)('client_contract_admin', 'client_performance_manager', 'client_finance_manager', 'client_reports_manager', 'client_relationship_manager', 'client_risk_manager');
|
|
54
|
+
exports.ClientOnly = ClientOnly;
|
|
55
|
+
/**
|
|
56
|
+
* Decorator for provider-side roles only
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* @ProviderOnly()
|
|
61
|
+
* @Get('provider-data')
|
|
62
|
+
* getProviderData() {
|
|
63
|
+
* // Only provider-side roles can access
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
const ProviderOnly = () => (0, exports.Roles)('provider_contract_admin', 'provider_performance_manager', 'provider_finance_manager', 'provider_reports_manager', 'provider_relationship_manager', 'provider_risk_manager');
|
|
68
|
+
exports.ProviderOnly = ProviderOnly;
|
|
69
|
+
/**
|
|
70
|
+
* Decorator for superadmin access only
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* @SuperAdminOnly()
|
|
75
|
+
* @Post('system/configure')
|
|
76
|
+
* configureSystem() {
|
|
77
|
+
* // Only superadmin can access
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
const SuperAdminOnly = () => (0, exports.Roles)('superadmin');
|
|
82
|
+
exports.SuperAdminOnly = SuperAdminOnly;
|
|
83
|
+
/**
|
|
84
|
+
* Alias for Roles decorator for backward compatibility
|
|
85
|
+
* @deprecated Use Roles instead
|
|
86
|
+
*/
|
|
87
|
+
exports.RequireRoles = exports.Roles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guards/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./jwt-auth.guard"), exports);
|
|
18
|
+
__exportStar(require("./roles.guard"), exports);
|
|
19
|
+
__exportStar(require("./permissions.guard"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import { Reflector } from '@nestjs/core';
|
|
3
|
+
import { JwtService } from '@nestjs/jwt';
|
|
4
|
+
import { PermissionsModuleOptions } from '../interfaces';
|
|
5
|
+
/**
|
|
6
|
+
* JWT Authentication Guard for ContractX
|
|
7
|
+
* Validates JWT tokens and attaches user information to requests
|
|
8
|
+
*/
|
|
9
|
+
export declare class JwtAuthGuard implements CanActivate {
|
|
10
|
+
private readonly jwtService;
|
|
11
|
+
private readonly reflector;
|
|
12
|
+
private readonly options;
|
|
13
|
+
private readonly logger;
|
|
14
|
+
constructor(jwtService: JwtService, reflector: Reflector, options: PermissionsModuleOptions);
|
|
15
|
+
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* Extract JWT token from Authorization header
|
|
18
|
+
*/
|
|
19
|
+
private extractTokenFromHeader;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=jwt-auth.guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwt-auth.guard.d.ts","sourceRoot":"","sources":["../../src/guards/jwt-auth.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,gBAAgB,EAIjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAc,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAIrE;;;GAGG;AACH,qBACa,YAAa,YAAW,WAAW;IAI5C,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAE1B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiC;gBAGrC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EAEpB,OAAO,EAAE,wBAAwB;IAG9C,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IA2E9D;;OAEG;IACH,OAAO,CAAC,sBAAsB;CAe/B"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var JwtAuthGuard_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.JwtAuthGuard = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const core_1 = require("@nestjs/core");
|
|
19
|
+
const jwt_1 = require("@nestjs/jwt");
|
|
20
|
+
const decorators_1 = require("../decorators");
|
|
21
|
+
const constants_1 = require("../constants");
|
|
22
|
+
/**
|
|
23
|
+
* JWT Authentication Guard for ContractX
|
|
24
|
+
* Validates JWT tokens and attaches user information to requests
|
|
25
|
+
*/
|
|
26
|
+
let JwtAuthGuard = JwtAuthGuard_1 = class JwtAuthGuard {
|
|
27
|
+
constructor(jwtService, reflector, options) {
|
|
28
|
+
this.jwtService = jwtService;
|
|
29
|
+
this.reflector = reflector;
|
|
30
|
+
this.options = options;
|
|
31
|
+
this.logger = new common_1.Logger(JwtAuthGuard_1.name);
|
|
32
|
+
}
|
|
33
|
+
async canActivate(context) {
|
|
34
|
+
// Check if route is marked as public
|
|
35
|
+
const isPublic = this.reflector.getAllAndOverride(decorators_1.IS_PUBLIC_KEY, [
|
|
36
|
+
context.getHandler(),
|
|
37
|
+
context.getClass(),
|
|
38
|
+
]);
|
|
39
|
+
if (isPublic) {
|
|
40
|
+
this.logger.debug('Public route accessed, skipping authentication');
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
// Check if authentication is disabled in development
|
|
44
|
+
if (this.options.development?.disableAuth) {
|
|
45
|
+
this.logger.debug('Authentication disabled in development mode');
|
|
46
|
+
// Inject mock user if provided
|
|
47
|
+
if (this.options.development.mockUser) {
|
|
48
|
+
const request = context.switchToHttp().getRequest();
|
|
49
|
+
request.user = this.options.development.mockUser;
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
const request = context.switchToHttp().getRequest();
|
|
54
|
+
const token = this.extractTokenFromHeader(request);
|
|
55
|
+
if (!token) {
|
|
56
|
+
this.logger.warn(`Authentication failed: No token provided for ${request.method} ${request.url}`);
|
|
57
|
+
throw new common_1.UnauthorizedException('Access token is required');
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const payload = await this.jwtService.verifyAsync(token, {
|
|
61
|
+
secret: this.options.jwt.secret,
|
|
62
|
+
issuer: this.options.jwt.issuer,
|
|
63
|
+
audience: this.options.jwt.audience,
|
|
64
|
+
ignoreExpiration: this.options.jwt.ignoreExpiration,
|
|
65
|
+
clockTolerance: this.options.jwt.clockTolerance,
|
|
66
|
+
});
|
|
67
|
+
// Attach user to request
|
|
68
|
+
request.user = payload;
|
|
69
|
+
this.logger.debug(`Authentication successful for user: ${payload.sub} (${payload.fullName})`);
|
|
70
|
+
// Log security information if enabled
|
|
71
|
+
if (this.options.security?.enableLogging) {
|
|
72
|
+
this.logger.log(`User ${payload.sub} accessed ${request.method} ${request.url} with roles: [${payload.role?.join(', ')}]`);
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
this.logger.warn(`Authentication failed: ${error.message}`);
|
|
78
|
+
// Provide specific error messages based on error type
|
|
79
|
+
if (error.name === 'TokenExpiredError') {
|
|
80
|
+
throw new common_1.UnauthorizedException('Access token has expired');
|
|
81
|
+
}
|
|
82
|
+
else if (error.name === 'JsonWebTokenError') {
|
|
83
|
+
throw new common_1.UnauthorizedException('Invalid access token');
|
|
84
|
+
}
|
|
85
|
+
else if (error.name === 'NotBeforeError') {
|
|
86
|
+
throw new common_1.UnauthorizedException('Access token not active yet');
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
throw new common_1.UnauthorizedException('Authentication failed');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Extract JWT token from Authorization header
|
|
95
|
+
*/
|
|
96
|
+
extractTokenFromHeader(request) {
|
|
97
|
+
const authHeader = request.headers.authorization;
|
|
98
|
+
if (!authHeader) {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
// Support both "Bearer TOKEN" and "TOKEN" formats
|
|
102
|
+
if (authHeader.startsWith('Bearer ')) {
|
|
103
|
+
return authHeader.substring(7);
|
|
104
|
+
}
|
|
105
|
+
// Direct token without Bearer prefix
|
|
106
|
+
return authHeader;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
exports.JwtAuthGuard = JwtAuthGuard;
|
|
110
|
+
exports.JwtAuthGuard = JwtAuthGuard = JwtAuthGuard_1 = __decorate([
|
|
111
|
+
(0, common_1.Injectable)(),
|
|
112
|
+
__param(2, (0, common_1.Inject)(constants_1.MODULE_CONSTANTS.MODULE_OPTIONS_TOKEN)),
|
|
113
|
+
__metadata("design:paramtypes", [jwt_1.JwtService,
|
|
114
|
+
core_1.Reflector, Object])
|
|
115
|
+
], JwtAuthGuard);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import { Reflector } from '@nestjs/core';
|
|
3
|
+
/**
|
|
4
|
+
* Permission-based Authorization Guard for ContractX
|
|
5
|
+
* Validates that user has all required permissions (AND logic)
|
|
6
|
+
* Also supports anyPermissions metadata for OR logic
|
|
7
|
+
*/
|
|
8
|
+
export declare class PermissionsGuard implements CanActivate {
|
|
9
|
+
private readonly reflector;
|
|
10
|
+
private readonly logger;
|
|
11
|
+
constructor(reflector: Reflector);
|
|
12
|
+
canActivate(context: ExecutionContext): boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=permissions.guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.guard.d.ts","sourceRoot":"","sources":["../../src/guards/permissions.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,gBAAgB,EAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC;;;;GAIG;AACH,qBACa,gBAAiB,YAAW,WAAW;IAGtC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAFtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;gBAE/B,SAAS,EAAE,SAAS;IAEjD,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;CAwFhD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var PermissionsGuard_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.PermissionsGuard = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const core_1 = require("@nestjs/core");
|
|
16
|
+
const decorators_1 = require("../decorators");
|
|
17
|
+
/**
|
|
18
|
+
* Permission-based Authorization Guard for ContractX
|
|
19
|
+
* Validates that user has all required permissions (AND logic)
|
|
20
|
+
* Also supports anyPermissions metadata for OR logic
|
|
21
|
+
*/
|
|
22
|
+
let PermissionsGuard = PermissionsGuard_1 = class PermissionsGuard {
|
|
23
|
+
constructor(reflector) {
|
|
24
|
+
this.reflector = reflector;
|
|
25
|
+
this.logger = new common_1.Logger(PermissionsGuard_1.name);
|
|
26
|
+
}
|
|
27
|
+
canActivate(context) {
|
|
28
|
+
// Check for required permissions (AND logic)
|
|
29
|
+
const requiredPermissions = this.reflector.getAllAndOverride(decorators_1.PERMISSIONS_KEY, [context.getHandler(), context.getClass()]);
|
|
30
|
+
// Check for any permissions (OR logic)
|
|
31
|
+
const anyPermissions = this.reflector.getAllAndOverride('anyPermissions', [context.getHandler(), context.getClass()]);
|
|
32
|
+
// If no permissions are specified, allow access
|
|
33
|
+
if ((!requiredPermissions || requiredPermissions.length === 0) &&
|
|
34
|
+
(!anyPermissions || anyPermissions.length === 0)) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
const request = context.switchToHttp().getRequest();
|
|
38
|
+
const user = request.user;
|
|
39
|
+
if (!user) {
|
|
40
|
+
this.logger.warn('Permissions guard: User not found in request context');
|
|
41
|
+
throw new common_1.ForbiddenException('Authentication required for permission-based access');
|
|
42
|
+
}
|
|
43
|
+
const userPermissions = user.permissions || [];
|
|
44
|
+
// Check anyPermissions first (OR logic - user needs at least one)
|
|
45
|
+
if (anyPermissions && anyPermissions.length > 0) {
|
|
46
|
+
const hasAnyPermission = anyPermissions.some((permission) => userPermissions.includes(permission));
|
|
47
|
+
if (!hasAnyPermission) {
|
|
48
|
+
this.logger.warn(`Access denied: User ${user.sub} (${user.fullName}) missing any required permissions. ` +
|
|
49
|
+
`Required (any): [${anyPermissions.join(', ')}], ` +
|
|
50
|
+
`User has: [${userPermissions.join(', ')}]`);
|
|
51
|
+
throw new common_1.ForbiddenException(`Access denied. Required permissions (any): [${anyPermissions.join(', ')}]`);
|
|
52
|
+
}
|
|
53
|
+
this.logger.debug(`Permission access granted: User ${user.sub} has at least one required permission from [${anyPermissions.join(', ')}]`);
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
// Check required permissions (AND logic - user needs all)
|
|
57
|
+
if (requiredPermissions && requiredPermissions.length > 0) {
|
|
58
|
+
const hasAllPermissions = requiredPermissions.every((permission) => userPermissions.includes(permission));
|
|
59
|
+
if (!hasAllPermissions) {
|
|
60
|
+
const missingPermissions = requiredPermissions.filter((permission) => !userPermissions.includes(permission));
|
|
61
|
+
this.logger.warn(`Access denied: User ${user.sub} (${user.fullName}) missing required permissions. ` +
|
|
62
|
+
`Required (all): [${requiredPermissions.join(', ')}], ` +
|
|
63
|
+
`User has: [${userPermissions.join(', ')}], ` +
|
|
64
|
+
`Missing: [${missingPermissions.join(', ')}]`);
|
|
65
|
+
throw new common_1.ForbiddenException(`Access denied. Missing permissions: [${missingPermissions.join(', ')}]`);
|
|
66
|
+
}
|
|
67
|
+
this.logger.debug(`Permission access granted: User ${user.sub} has all required permissions [${requiredPermissions.join(', ')}]`);
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
exports.PermissionsGuard = PermissionsGuard;
|
|
74
|
+
exports.PermissionsGuard = PermissionsGuard = PermissionsGuard_1 = __decorate([
|
|
75
|
+
(0, common_1.Injectable)(),
|
|
76
|
+
__metadata("design:paramtypes", [core_1.Reflector])
|
|
77
|
+
], PermissionsGuard);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import { Reflector } from '@nestjs/core';
|
|
3
|
+
/**
|
|
4
|
+
* Role-based Authorization Guard for ContractX
|
|
5
|
+
* Validates that user has at least one of the required roles
|
|
6
|
+
*/
|
|
7
|
+
export declare class RolesGuard implements CanActivate {
|
|
8
|
+
private readonly reflector;
|
|
9
|
+
private readonly logger;
|
|
10
|
+
constructor(reflector: Reflector);
|
|
11
|
+
canActivate(context: ExecutionContext): boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=roles.guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.guard.d.ts","sourceRoot":"","sources":["../../src/guards/roles.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,gBAAgB,EAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC;;;GAGG;AACH,qBACa,UAAW,YAAW,WAAW;IAGhC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAFtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+B;gBAEzB,SAAS,EAAE,SAAS;IAEjD,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;CA2ChD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var RolesGuard_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.RolesGuard = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const core_1 = require("@nestjs/core");
|
|
16
|
+
const decorators_1 = require("../decorators");
|
|
17
|
+
/**
|
|
18
|
+
* Role-based Authorization Guard for ContractX
|
|
19
|
+
* Validates that user has at least one of the required roles
|
|
20
|
+
*/
|
|
21
|
+
let RolesGuard = RolesGuard_1 = class RolesGuard {
|
|
22
|
+
constructor(reflector) {
|
|
23
|
+
this.reflector = reflector;
|
|
24
|
+
this.logger = new common_1.Logger(RolesGuard_1.name);
|
|
25
|
+
}
|
|
26
|
+
canActivate(context) {
|
|
27
|
+
const requiredRoles = this.reflector.getAllAndOverride(decorators_1.ROLES_KEY, [
|
|
28
|
+
context.getHandler(),
|
|
29
|
+
context.getClass(),
|
|
30
|
+
]);
|
|
31
|
+
// If no roles are specified, allow access
|
|
32
|
+
if (!requiredRoles || requiredRoles.length === 0) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
const request = context.switchToHttp().getRequest();
|
|
36
|
+
const user = request.user;
|
|
37
|
+
if (!user) {
|
|
38
|
+
this.logger.warn('Roles guard: User not found in request context');
|
|
39
|
+
throw new common_1.ForbiddenException('Authentication required for role-based access');
|
|
40
|
+
}
|
|
41
|
+
const userRoles = user.role || [];
|
|
42
|
+
const hasRole = requiredRoles.some((role) => userRoles.includes(role));
|
|
43
|
+
if (!hasRole) {
|
|
44
|
+
const missingRoles = requiredRoles.filter(role => !userRoles.includes(role));
|
|
45
|
+
this.logger.warn(`Access denied: User ${user.sub} (${user.fullName}) missing required roles. ` +
|
|
46
|
+
`Required: [${requiredRoles.join(', ')}], ` +
|
|
47
|
+
`User has: [${userRoles.join(', ')}], ` +
|
|
48
|
+
`Missing: [${missingRoles.join(', ')}]`);
|
|
49
|
+
throw new common_1.ForbiddenException(`Access denied. Required roles: [${requiredRoles.join(', ')}]`);
|
|
50
|
+
}
|
|
51
|
+
this.logger.debug(`Role access granted: User ${user.sub} has required role(s) [${requiredRoles.join(', ')}]`);
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.RolesGuard = RolesGuard;
|
|
56
|
+
exports.RolesGuard = RolesGuard = RolesGuard_1 = __decorate([
|
|
57
|
+
(0, common_1.Injectable)(),
|
|
58
|
+
__metadata("design:paramtypes", [core_1.Reflector])
|
|
59
|
+
], RolesGuard);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './modules';
|
|
2
|
+
export * from './guards';
|
|
3
|
+
export * from './decorators';
|
|
4
|
+
export * from './services';
|
|
5
|
+
export * from './interfaces';
|
|
6
|
+
export * from './constants';
|
|
7
|
+
export type { JwtPayload, AuthenticatedRequest, PermissionsModuleOptions, JwtAuthConfig } from './interfaces';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAG1B,cAAc,UAAU,CAAC;AAGzB,cAAc,cAAc,CAAC;AAG7B,cAAc,YAAY,CAAC;AAG3B,cAAc,cAAc,CAAC;AAG7B,cAAc,aAAa,CAAC;AAG5B,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
// Main module
|
|
18
|
+
__exportStar(require("./modules"), exports);
|
|
19
|
+
// Guards
|
|
20
|
+
__exportStar(require("./guards"), exports);
|
|
21
|
+
// Decorators
|
|
22
|
+
__exportStar(require("./decorators"), exports);
|
|
23
|
+
// Services
|
|
24
|
+
__exportStar(require("./services"), exports);
|
|
25
|
+
// Interfaces
|
|
26
|
+
__exportStar(require("./interfaces"), exports);
|
|
27
|
+
// Constants
|
|
28
|
+
__exportStar(require("./constants"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./jwt-payload.interface"), exports);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JWT Payload interface for ContractX authentication system
|
|
3
|
+
*/
|
|
4
|
+
export interface JwtPayload {
|
|
5
|
+
/** User ID */
|
|
6
|
+
sub: string | number;
|
|
7
|
+
/** Alternative user ID field */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** User roles array */
|
|
10
|
+
role: string[];
|
|
11
|
+
/** User permissions array */
|
|
12
|
+
permissions: string[];
|
|
13
|
+
/** User's full name */
|
|
14
|
+
fullName: string;
|
|
15
|
+
/** User's email */
|
|
16
|
+
email?: string;
|
|
17
|
+
/** Client organization ID */
|
|
18
|
+
clientId?: string;
|
|
19
|
+
/** Session ID for tracking */
|
|
20
|
+
sessionId?: string;
|
|
21
|
+
/** Token issued at timestamp */
|
|
22
|
+
iat?: number;
|
|
23
|
+
/** Token expiration timestamp */
|
|
24
|
+
exp?: number;
|
|
25
|
+
/** Token issuer */
|
|
26
|
+
iss?: string;
|
|
27
|
+
/** Token audience */
|
|
28
|
+
aud?: string;
|
|
29
|
+
/** Additional custom properties */
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Extended request interface with authenticated user
|
|
34
|
+
*/
|
|
35
|
+
export interface AuthenticatedRequest extends Request {
|
|
36
|
+
user: JwtPayload;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Configuration options for JWT authentication
|
|
40
|
+
*/
|
|
41
|
+
export interface JwtAuthConfig {
|
|
42
|
+
/** JWT secret key */
|
|
43
|
+
secret: string;
|
|
44
|
+
/** Token issuer */
|
|
45
|
+
issuer?: string;
|
|
46
|
+
/** Token audience */
|
|
47
|
+
audience?: string;
|
|
48
|
+
/** Token expiration time */
|
|
49
|
+
expiresIn?: string;
|
|
50
|
+
/** Refresh token secret */
|
|
51
|
+
refreshSecret?: string;
|
|
52
|
+
/** Refresh token expiration time */
|
|
53
|
+
refreshExpiresIn?: string;
|
|
54
|
+
/** Clock tolerance for token validation */
|
|
55
|
+
clockTolerance?: number;
|
|
56
|
+
/** Ignore expiration for development */
|
|
57
|
+
ignoreExpiration?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Module configuration options
|
|
61
|
+
*/
|
|
62
|
+
export interface PermissionsModuleOptions {
|
|
63
|
+
/** JWT configuration */
|
|
64
|
+
jwt: JwtAuthConfig;
|
|
65
|
+
/** Global guards configuration */
|
|
66
|
+
guards?: {
|
|
67
|
+
/** Apply authentication guard globally */
|
|
68
|
+
enableGlobalAuth?: boolean;
|
|
69
|
+
/** Apply roles guard globally */
|
|
70
|
+
enableGlobalRoles?: boolean;
|
|
71
|
+
/** Apply permissions guard globally */
|
|
72
|
+
enableGlobalPermissions?: boolean;
|
|
73
|
+
};
|
|
74
|
+
/** Security configuration */
|
|
75
|
+
security?: {
|
|
76
|
+
/** Enable request logging */
|
|
77
|
+
enableLogging?: boolean;
|
|
78
|
+
/** Enable rate limiting */
|
|
79
|
+
enableRateLimit?: boolean;
|
|
80
|
+
/** Rate limit window in milliseconds */
|
|
81
|
+
rateLimitWindow?: number;
|
|
82
|
+
/** Maximum requests per window */
|
|
83
|
+
rateLimitMax?: number;
|
|
84
|
+
};
|
|
85
|
+
/** Development mode settings */
|
|
86
|
+
development?: {
|
|
87
|
+
/** Disable authentication in development */
|
|
88
|
+
disableAuth?: boolean;
|
|
89
|
+
/** Mock user for development */
|
|
90
|
+
mockUser?: JwtPayload;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=jwt-payload.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwt-payload.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/jwt-payload.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,cAAc;IACd,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAErB,gCAAgC;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,uBAAuB;IACvB,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf,6BAA6B;IAC7B,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IAEjB,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gCAAgC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,mBAAmB;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,qBAAqB;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,mCAAmC;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,OAAO;IACnD,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IAEf,mBAAmB;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,2BAA2B;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,wBAAwB;IACxB,GAAG,EAAE,aAAa,CAAC;IAEnB,kCAAkC;IAClC,MAAM,CAAC,EAAE;QACP,0CAA0C;QAC1C,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAE3B,iCAAiC;QACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAE5B,uCAAuC;QACvC,uBAAuB,CAAC,EAAE,OAAO,CAAC;KACnC,CAAC;IAEF,6BAA6B;IAC7B,QAAQ,CAAC,EAAE;QACT,6BAA6B;QAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;QAExB,2BAA2B;QAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;QAE1B,wCAAwC;QACxC,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,kCAAkC;QAClC,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IAEF,gCAAgC;IAChC,WAAW,CAAC,EAAE;QACZ,4CAA4C;QAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;QAEtB,gCAAgC;QAChC,QAAQ,CAAC,EAAE,UAAU,CAAC;KACvB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./permissions-contractx.module"), exports);
|