@illustrisinteractive/sentinel-nest 0.0.1
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/.prettierrc +4 -0
- package/README.md +98 -0
- package/config/config.json +24 -0
- package/dist/bin/commit.d.ts +1 -0
- package/dist/bin/commit.js +136 -0
- package/dist/bin/commit.js.map +1 -0
- package/dist/bin/init.d.ts +2 -0
- package/dist/bin/init.js +179 -0
- package/dist/bin/init.js.map +1 -0
- package/dist/bin/migrations/1-create-permission.d.ts +6 -0
- package/dist/bin/migrations/1-create-permission.js +30 -0
- package/dist/bin/migrations/1-create-permission.js.map +1 -0
- package/dist/bin/migrations/2-create-role.d.ts +2 -0
- package/dist/bin/migrations/2-create-role.js +29 -0
- package/dist/bin/migrations/2-create-role.js.map +1 -0
- package/dist/bin/migrations/3-create-rolepermissions.d.ts +2 -0
- package/dist/bin/migrations/3-create-rolepermissions.js +46 -0
- package/dist/bin/migrations/3-create-rolepermissions.js.map +1 -0
- package/dist/bin/migrations/4-create-model-roles.d.ts +2 -0
- package/dist/bin/migrations/4-create-model-roles.js +46 -0
- package/dist/bin/migrations/4-create-model-roles.js.map +1 -0
- package/dist/bin/resource.d.ts +1 -0
- package/dist/bin/resource.js +91 -0
- package/dist/bin/resource.js.map +1 -0
- package/dist/bin/sentinel.d.ts +2 -0
- package/dist/bin/sentinel.js +52 -0
- package/dist/bin/sentinel.js.map +1 -0
- package/dist/models/SecuredResource.d.ts +8 -0
- package/dist/models/SecuredResource.js +9 -0
- package/dist/models/SecuredResource.js.map +1 -0
- package/dist/models/SentinelConfig.d.ts +7 -0
- package/dist/models/SentinelConfig.js +3 -0
- package/dist/models/SentinelConfig.js.map +1 -0
- package/dist/models/sequelize/PermissionKey.d.ts +7 -0
- package/dist/models/sequelize/PermissionKey.js +39 -0
- package/dist/models/sequelize/PermissionKey.js.map +1 -0
- package/dist/prisma.config.d.ts +3 -0
- package/dist/prisma.config.js +14 -0
- package/dist/prisma.config.js.map +1 -0
- package/dist/src/can.decorator.d.ts +2 -0
- package/dist/src/can.decorator.js +6 -0
- package/dist/src/can.decorator.js.map +1 -0
- package/dist/src/generated/prisma/browser.d.ts +10 -0
- package/dist/src/generated/prisma/browser.js +44 -0
- package/dist/src/generated/prisma/browser.js.map +1 -0
- package/dist/src/generated/prisma/client.d.ts +14 -0
- package/dist/src/generated/prisma/client.js +46 -0
- package/dist/src/generated/prisma/client.js.map +1 -0
- package/dist/src/generated/prisma/commonInputTypes.d.ts +263 -0
- package/dist/src/generated/prisma/commonInputTypes.js +3 -0
- package/dist/src/generated/prisma/commonInputTypes.js.map +1 -0
- package/dist/src/generated/prisma/enums.d.ts +1 -0
- package/dist/src/generated/prisma/enums.js +3 -0
- package/dist/src/generated/prisma/enums.js.map +1 -0
- package/dist/src/generated/prisma/internal/class.d.ts +50 -0
- package/dist/src/generated/prisma/internal/class.js +75 -0
- package/dist/src/generated/prisma/internal/class.js.map +1 -0
- package/dist/src/generated/prisma/internal/prismaNamespace.d.ts +778 -0
- package/dist/src/generated/prisma/internal/prismaNamespace.js +128 -0
- package/dist/src/generated/prisma/internal/prismaNamespace.js.map +1 -0
- package/dist/src/generated/prisma/internal/prismaNamespaceBrowser.d.ts +88 -0
- package/dist/src/generated/prisma/internal/prismaNamespaceBrowser.js +112 -0
- package/dist/src/generated/prisma/internal/prismaNamespaceBrowser.js.map +1 -0
- package/dist/src/generated/prisma/models/ModelHasRoles.d.ts +691 -0
- package/dist/src/generated/prisma/models/ModelHasRoles.js +3 -0
- package/dist/src/generated/prisma/models/ModelHasRoles.js.map +1 -0
- package/dist/src/generated/prisma/models/PermissionKeys.d.ts +547 -0
- package/dist/src/generated/prisma/models/PermissionKeys.js +3 -0
- package/dist/src/generated/prisma/models/PermissionKeys.js.map +1 -0
- package/dist/src/generated/prisma/models/RoleHasPermissions.d.ts +675 -0
- package/dist/src/generated/prisma/models/RoleHasPermissions.js +3 -0
- package/dist/src/generated/prisma/models/RoleHasPermissions.js.map +1 -0
- package/dist/src/generated/prisma/models/Roles.d.ts +582 -0
- package/dist/src/generated/prisma/models/Roles.js +3 -0
- package/dist/src/generated/prisma/models/Roles.js.map +1 -0
- package/dist/src/generated/prisma/models/SequelizeMeta.d.ts +289 -0
- package/dist/src/generated/prisma/models/SequelizeMeta.js +3 -0
- package/dist/src/generated/prisma/models/SequelizeMeta.js.map +1 -0
- package/dist/src/generated/prisma/models/Users.d.ts +572 -0
- package/dist/src/generated/prisma/models/Users.js +3 -0
- package/dist/src/generated/prisma/models/Users.js.map +1 -0
- package/dist/src/generated/prisma/models.d.ts +7 -0
- package/dist/src/generated/prisma/models.js +3 -0
- package/dist/src/generated/prisma/models.js.map +1 -0
- package/dist/src/main.d.ts +6 -0
- package/dist/src/main.js +23 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/models/SecuredResource.d.ts +8 -0
- package/dist/src/models/SecuredResource.js +9 -0
- package/dist/src/models/SecuredResource.js.map +1 -0
- package/dist/src/models/SentinelConfig.d.ts +7 -0
- package/dist/src/models/SentinelConfig.js +3 -0
- package/dist/src/models/SentinelConfig.js.map +1 -0
- package/dist/src/models/SentinelModel.d.ts +35 -0
- package/dist/src/models/SentinelModel.js +3 -0
- package/dist/src/models/SentinelModel.js.map +1 -0
- package/dist/src/models/SentinelModuleOptions.d.ts +7 -0
- package/dist/src/models/SentinelModuleOptions.js +3 -0
- package/dist/src/models/SentinelModuleOptions.js.map +1 -0
- package/dist/src/prisma.service.d.ts +4 -0
- package/dist/src/prisma.service.js +29 -0
- package/dist/src/prisma.service.js.map +1 -0
- package/dist/src/sentinel.guard.d.ts +9 -0
- package/dist/src/sentinel.guard.js +73 -0
- package/dist/src/sentinel.guard.js.map +1 -0
- package/dist/src/sentinel.module-definition.d.ts +2 -0
- package/dist/src/sentinel.module-definition.js +7 -0
- package/dist/src/sentinel.module-definition.js.map +1 -0
- package/dist/src/sentinel.module.d.ts +3 -0
- package/dist/src/sentinel.module.js +40 -0
- package/dist/src/sentinel.module.js.map +1 -0
- package/dist/src/sentinel.service.d.ts +39 -0
- package/dist/src/sentinel.service.js +146 -0
- package/dist/src/sentinel.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/eslint.config.mjs +34 -0
- package/models/index.js +43 -0
- package/models/permissionkey.js +31 -0
- package/models/role.js +23 -0
- package/models/rolehaspermission.js +43 -0
- package/nest-cli.json +8 -0
- package/package.json +103 -0
- package/prisma/migrations/20260227023704_init/migration.sql +74 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +62 -0
- package/prisma.config.ts +14 -0
- package/src/bin/commit.ts +186 -0
- package/src/bin/init.ts +251 -0
- package/src/bin/migrations/1-create-permission.js +32 -0
- package/src/bin/migrations/2-create-role.js +29 -0
- package/src/bin/migrations/3-create-rolepermissions.js +46 -0
- package/src/bin/migrations/4-create-model-roles.js +46 -0
- package/src/bin/resource.ts +107 -0
- package/src/bin/sentinel.ts +115 -0
- package/src/bin/tsconfig.json +30 -0
- package/src/can.decorator.ts +4 -0
- package/src/generated/prisma/browser.ts +49 -0
- package/src/generated/prisma/client.ts +69 -0
- package/src/generated/prisma/commonInputTypes.ts +302 -0
- package/src/generated/prisma/enums.ts +15 -0
- package/src/generated/prisma/internal/class.ts +250 -0
- package/src/generated/prisma/internal/prismaNamespace.ts +1213 -0
- package/src/generated/prisma/internal/prismaNamespaceBrowser.ts +163 -0
- package/src/generated/prisma/models/ModelHasRoles.ts +1521 -0
- package/src/generated/prisma/models/PermissionKeys.ts +1362 -0
- package/src/generated/prisma/models/RoleHasPermissions.ts +1503 -0
- package/src/generated/prisma/models/Roles.ts +1437 -0
- package/src/generated/prisma/models/SequelizeMeta.ts +1032 -0
- package/src/generated/prisma/models/Users.ts +1402 -0
- package/src/generated/prisma/models.ts +17 -0
- package/src/main.ts +24 -0
- package/src/models/SecuredResource.d.ts +8 -0
- package/src/models/SecuredResource.ts +9 -0
- package/src/models/SentinelConfig.d.ts +7 -0
- package/src/models/SentinelConfig.ts +8 -0
- package/src/models/SentinelModel.ts +39 -0
- package/src/models/SentinelModuleOptions.ts +11 -0
- package/src/models/sequelize/PermissionKey.ts +22 -0
- package/src/models/tsconfig.json +25 -0
- package/src/prisma.service.ts +13 -0
- package/src/sentinel.guard.ts +63 -0
- package/src/sentinel.module-definition.ts +5 -0
- package/src/sentinel.module.ts +27 -0
- package/src/sentinel.service.ts +188 -0
- package/tsconfig.build.json +11 -0
- package/tsconfig.json +25 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const { Sequelize } = require('sequelize');
|
|
3
|
+
module.exports = {
|
|
4
|
+
async up({ context: queryInterface }) {
|
|
5
|
+
await queryInterface.createTable('ModelHasRoles', {
|
|
6
|
+
id: {
|
|
7
|
+
allowNull: false,
|
|
8
|
+
autoIncrement: true,
|
|
9
|
+
primaryKey: true,
|
|
10
|
+
type: Sequelize.INTEGER,
|
|
11
|
+
},
|
|
12
|
+
role: {
|
|
13
|
+
type: Sequelize.INTEGER,
|
|
14
|
+
references: {
|
|
15
|
+
model: {
|
|
16
|
+
tableName: 'Roles',
|
|
17
|
+
},
|
|
18
|
+
key: 'id',
|
|
19
|
+
},
|
|
20
|
+
allowNull: false,
|
|
21
|
+
},
|
|
22
|
+
model: {
|
|
23
|
+
type: Sequelize.INTEGER,
|
|
24
|
+
references: {
|
|
25
|
+
model: {
|
|
26
|
+
tableName: process.env.SENTINEL_MODEL_REFERENCE_TABLE || 'Roles',
|
|
27
|
+
},
|
|
28
|
+
key: process.env.SENTINEL_MODEL_REFERENCE_KEY || 'id',
|
|
29
|
+
},
|
|
30
|
+
allowNull: false,
|
|
31
|
+
},
|
|
32
|
+
createdAt: {
|
|
33
|
+
allowNull: false,
|
|
34
|
+
type: Sequelize.DATE,
|
|
35
|
+
},
|
|
36
|
+
updatedAt: {
|
|
37
|
+
allowNull: false,
|
|
38
|
+
type: Sequelize.DATE,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
async down({ context: queryInterface }) {
|
|
43
|
+
await queryInterface.dropTable('ModelHasRoles');
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=4-create-model-roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"4-create-model-roles.js","sourceRoot":"","sources":["../../../src/bin/migrations/4-create-model-roles.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE3C,MAAM,CAAC,OAAO,GAAG;IACf,KAAK,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE;QAClC,MAAM,cAAc,CAAC,WAAW,CAAC,eAAe,EAAE;YAChD,EAAE,EAAE;gBACF,SAAS,EAAE,KAAK;gBAChB,aAAa,EAAE,IAAI;gBACnB,UAAU,EAAE,IAAI;gBAChB,IAAI,EAAE,SAAS,CAAC,OAAO;aACxB;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS,CAAC,OAAO;gBACvB,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,SAAS,EAAE,OAAO;qBACnB;oBACD,GAAG,EAAE,IAAI;iBACV;gBACD,SAAS,EAAE,KAAK;aACjB;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS,CAAC,OAAO;gBACvB,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,8BAA8B,IAAI,OAAO;qBACjE;oBACD,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,IAAI;iBACtD;gBACD,SAAS,EAAE,KAAK;aACjB;YACD,SAAS,EAAE;gBACT,SAAS,EAAE,KAAK;gBAChB,IAAI,EAAE,SAAS,CAAC,IAAI;aACrB;YACD,SAAS,EAAE;gBACT,SAAS,EAAE,KAAK;gBAChB,IAAI,EAAE,SAAS,CAAC,IAAI;aACrB;SACF,CAAC,CAAC;IACL,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE;QACpC,MAAM,cAAc,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAClD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resource: (name: string, manage: boolean) => Promise<void>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.resource = void 0;
|
|
7
|
+
const prompts_1 = require("@clack/prompts");
|
|
8
|
+
const ts_morph_1 = require("ts-morph");
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const process_1 = require("process");
|
|
11
|
+
const resource = async (name, manage) => {
|
|
12
|
+
(0, prompts_1.intro)('Sentinel CLI');
|
|
13
|
+
prompts_1.log.info('Resource - Create a new Secured Resource');
|
|
14
|
+
let sentinelConfig = {
|
|
15
|
+
name: '',
|
|
16
|
+
sourceRoot: '',
|
|
17
|
+
sentinelConfigPath: '',
|
|
18
|
+
};
|
|
19
|
+
if (!fs_1.default.existsSync(process.cwd() + '\\src\\sentinel\\sentinel.config.json')) {
|
|
20
|
+
prompts_1.log.error(`"sentinel.config.json" was not found in (${process.cwd() + '\\src\\sentinel'}). Have you initialized Sentinel using "npx sentinel init"?`);
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
sentinelConfig = (await import('file://' + process.cwd() + '\\src\\sentinel\\sentinel.config.json', {
|
|
24
|
+
with: { type: 'json' },
|
|
25
|
+
})).default;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.log(error);
|
|
29
|
+
(0, process_1.exit)(-1);
|
|
30
|
+
}
|
|
31
|
+
const project = new ts_morph_1.Project();
|
|
32
|
+
const resourceFile = project.createSourceFile(process.cwd() + '\\src\\sentinel\\resources\\' + name + '.ts', `export class ${name} {}`);
|
|
33
|
+
resourceFile.addImportDeclaration({
|
|
34
|
+
moduleSpecifier: '@luminotion/sentinel',
|
|
35
|
+
namedImports: [
|
|
36
|
+
{ name: 'SecuredResource' },
|
|
37
|
+
{ name: 'SecuredResourceAction' },
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
resourceFile.getClass(name)?.setExtends('SecuredResource');
|
|
41
|
+
resourceFile.getClass(name)?.addProperties([
|
|
42
|
+
{ name: 'static name', initializer: `"${name}"` },
|
|
43
|
+
{
|
|
44
|
+
name: 'static actions: Record<string, SecuredResourceAction>',
|
|
45
|
+
initializer: (writer) => {
|
|
46
|
+
if (manage) {
|
|
47
|
+
writer.block(() => {
|
|
48
|
+
writer.writeLine(`"manage": `).block(() => {
|
|
49
|
+
writer.writeLine('description: "Allows all Actions in this Secured Resource"');
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
else
|
|
54
|
+
writer.writeLine('{}');
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
]);
|
|
58
|
+
resourceFile.getClass(name)?.addStaticBlock({
|
|
59
|
+
statements: [
|
|
60
|
+
`Object.keys(${name}.actions).forEach((key) => {
|
|
61
|
+
${name}.actions[key].source = '${name}';
|
|
62
|
+
});`,
|
|
63
|
+
],
|
|
64
|
+
});
|
|
65
|
+
resourceFile.saveSync();
|
|
66
|
+
const newResource = {
|
|
67
|
+
name,
|
|
68
|
+
actions: manage
|
|
69
|
+
? {
|
|
70
|
+
manage: {
|
|
71
|
+
description: 'Allows all Actions in this Secured Resource.',
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
: {},
|
|
75
|
+
};
|
|
76
|
+
if (sentinelConfig.resources) {
|
|
77
|
+
const matchIdx = sentinelConfig.resources.findIndex((res) => res.name == name);
|
|
78
|
+
if (matchIdx != -1) {
|
|
79
|
+
sentinelConfig.resources[matchIdx] = newResource;
|
|
80
|
+
}
|
|
81
|
+
else
|
|
82
|
+
sentinelConfig.resources.push(newResource);
|
|
83
|
+
}
|
|
84
|
+
else
|
|
85
|
+
sentinelConfig.resources = [newResource];
|
|
86
|
+
prompts_1.log.success(`New Secured Resource created in ${sentinelConfig.sentinelConfigPath}\\${name}`);
|
|
87
|
+
fs_1.default.writeFileSync(process.cwd() + '\\src\\sentinel\\sentinel.config.json', JSON.stringify(sentinelConfig, null, 2));
|
|
88
|
+
prompts_1.log.success(`${name} is ready to be committed. Edit the file with your Actions, then run "npx sentinel commit" to refresh all Secured Resource definitions.`);
|
|
89
|
+
};
|
|
90
|
+
exports.resource = resource;
|
|
91
|
+
//# sourceMappingURL=resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../src/bin/resource.ts"],"names":[],"mappings":";;;;;;AACA,4CAA4C;AAG5C,uCAAmC;AACnC,4CAAoB;AACpB,qCAA+B;AAExB,MAAM,QAAQ,GAAG,KAAK,EAAE,IAAY,EAAE,MAAe,EAAE,EAAE;IAC9D,IAAA,eAAK,EAAC,cAAc,CAAC,CAAC;IACtB,aAAG,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;IAErD,IAAI,cAAc,GAAmB;QACnC,IAAI,EAAE,EAAE;QACR,UAAU,EAAE,EAAE;QACd,kBAAkB,EAAE,EAAE;KACvB,CAAC;IACF,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,uCAAuC,CAAC,EAAE,CAAC;QAC5E,aAAG,CAAC,KAAK,CACP,4CAA4C,OAAO,CAAC,GAAG,EAAE,GAAG,iBAAiB,6DAA6D,CAC3I,CAAC;IACJ,CAAC;IACD,IAAI,CAAC;QACH,cAAc,GAAG,CACf,MAAM,MAAM,CACV,SAAS,GAAG,OAA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in/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const init_1 = require("./init");
|
|
6
|
+
const resource_1 = require("./resource");
|
|
7
|
+
const commit_1 = require("./commit");
|
|
8
|
+
const program = new commander_1.Command();
|
|
9
|
+
program
|
|
10
|
+
.name('Sentinel CLI')
|
|
11
|
+
.description('RBAC implementation for Nest.js powered by CASL and Postgres')
|
|
12
|
+
.version('0.0.1');
|
|
13
|
+
program
|
|
14
|
+
.command('init')
|
|
15
|
+
.description('Prepares your Nest.js project for Sentinel. Run this command where your `nest-cli.json` file is located.')
|
|
16
|
+
.requiredOption('--model-table <model>', 'Determines which table to reference when logging which Roles a Model has been given with. This will often be your Users or Clients table.')
|
|
17
|
+
.option('--nx-read-from <path>', 'Determines the path to read Nest projects from in an Nx monorepo. (Ie. apps/backend)')
|
|
18
|
+
.option('--model-key <key>', 'The primary key of your Model Table. Defaults to "id".', 'id')
|
|
19
|
+
.option('--env-from <path>', 'Optionally configure the CLI to load required ENV values from a file.')
|
|
20
|
+
.option('--skip-migration', 'Configures the CLI to skip running the migration files required by Sentinel')
|
|
21
|
+
.option('--verbose', 'If true, Sequelize logs are printed to the console.')
|
|
22
|
+
.action((opts) => {
|
|
23
|
+
(0, init_1.init)(opts.modelTable, opts.modelKey, opts.nxReadFrom, opts.envFrom, opts.skipMigration, opts.verbose);
|
|
24
|
+
});
|
|
25
|
+
program
|
|
26
|
+
.command('resource')
|
|
27
|
+
.description('Creates a new Secured Resource without pushing it to your database. Afterwards, you can add Actions by editing the generated file, then run `npx sentinel commit` to save them to your database.')
|
|
28
|
+
.argument('<resource>', 'Name of the Secured Resource')
|
|
29
|
+
.option('--no-manage', 'Skips generating the "manage" Action in the new Secured Resource')
|
|
30
|
+
.action((name, opts) => {
|
|
31
|
+
(0, resource_1.resource)(name, opts.manage);
|
|
32
|
+
});
|
|
33
|
+
program
|
|
34
|
+
.command('commit')
|
|
35
|
+
.description('Commits all new and modified Secured Resources to your database.')
|
|
36
|
+
.option('--env-from <path>', 'Optionally configure the CLI to load required ENV values from a file.')
|
|
37
|
+
.option('--review', 'Generate a list of all detected Secured Resources and their Actions.')
|
|
38
|
+
.option('--refresh', 'Refreshes the local Secured Resource definitions in the "sentinel.config.json" without committing to the database.')
|
|
39
|
+
.option('--skip-prompts', 'Skips all confirmation prompts and directly performs operations.')
|
|
40
|
+
.action((opts) => {
|
|
41
|
+
(0, commit_1.commit)(opts.envFrom);
|
|
42
|
+
});
|
|
43
|
+
program
|
|
44
|
+
.command('clean')
|
|
45
|
+
.description('Add flags to remove configurations and/or drop tables related to Sentinel. Does not modify any of your Nest.js code.')
|
|
46
|
+
.option('--migration', 'Resets the internal SequelizeMeta table to allow migrations to re-run again.')
|
|
47
|
+
.option('--tables', 'Drops all tables related to Sentinel (Roles, RoleHasPermissions, PermissionKeys)')
|
|
48
|
+
.option('--role-permissions <name>', 'Removes all Permissions assigned to a certain Role.')
|
|
49
|
+
.option('--role <name>', 'Deletes a Role completely.')
|
|
50
|
+
.option('--all', 'Removes all Roles, PermissionKeys, and role assignments (RoleHasPermissions)');
|
|
51
|
+
program.parse();
|
|
52
|
+
//# sourceMappingURL=sentinel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentinel.js","sourceRoot":"","sources":["../../src/bin/sentinel.ts"],"names":[],"mappings":";;;AAEA,yCAA4C;AAC5C,iCAA8B;AAC9B,yCAAsC;AACtC,qCAAkC;AAElC,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,cAAc,CAAC;KACpB,WAAW,CAAC,8DAA8D,CAAC;KAC3E,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CACV,0GAA0G,CAC3G;KACA,cAAc,CACb,uBAAuB,EACvB,2IAA2I,CAC5I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Aa,EACb,8EAA8E,CAC/E;KACA,MAAM,CACL,UAAU,EACV,kFAAkF,CACnF;KACA,MAAM,CACL,2BAA2B,EAC3B,qDAAqD,CACtD;KACA,MAAM,CAAC,eAAe,EAAE,4BAA4B,CAAC;KACrD,MAAM,CACL,OAAO,EACP,8EAA8E,CAC/E,CAAC;AAEJ,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecuredResource.js","sourceRoot":"","sources":["../../src/models/SecuredResource.ts"],"names":[],"mappings":";;;AAAA,MAAsB,eAAe;IACnC,IAAI,CAAS;IACb,OAAO,CAAwC;CAChD;AAHD,0CAGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SentinelConfig.js","sourceRoot":"","sources":["../../src/models/SentinelConfig.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PermissionKey = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
let PermissionKey = class PermissionKey extends sequelize_typescript_1.Model {
|
|
15
|
+
resource;
|
|
16
|
+
action;
|
|
17
|
+
description;
|
|
18
|
+
};
|
|
19
|
+
exports.PermissionKey = PermissionKey;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, sequelize_typescript_1.Column)({ primaryKey: true, type: sequelize_typescript_1.DataType.STRING }),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], PermissionKey.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.STRING }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], PermissionKey.prototype, "resource", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.STRING }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], PermissionKey.prototype, "action", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.STRING }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], PermissionKey.prototype, "description", void 0);
|
|
36
|
+
exports.PermissionKey = PermissionKey = __decorate([
|
|
37
|
+
(0, sequelize_typescript_1.Table)({ tableName: 'PermissionKeys' })
|
|
38
|
+
], PermissionKey);
|
|
39
|
+
//# sourceMappingURL=PermissionKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionKey.js","sourceRoot":"","sources":["../../../src/models/sequelize/PermissionKey.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAM8B;AAGvB,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,4BAAK;IAKtC,QAAQ,CAAS;IAGjB,MAAM,CAAS;IAGf,WAAW,CAAS;CACrB,CAAA;AAZY,sCAAa;AAEhB;IADP,IAAA,6BAAM,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,+BAAQ,CAAC,MAAM,EAAE,CAAC;;yCACjC;AAGnB;IADC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,MAAM,EAAE,CAAC;;+CACjB;AAGjB;IADC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,MAAM,EAAE,CAAC;;6CACnB;AAGf;IADC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,MAAM,EAAE,CAAC;;kDACd;wBAXT,aAAa;IADzB,IAAA,4BAAK,EAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;GAC1B,aAAa,CAYzB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("dotenv/config");
|
|
4
|
+
const config_1 = require("prisma/config");
|
|
5
|
+
exports.default = (0, config_1.defineConfig)({
|
|
6
|
+
schema: 'prisma/schema.prisma',
|
|
7
|
+
migrations: {
|
|
8
|
+
path: 'prisma/migrations',
|
|
9
|
+
},
|
|
10
|
+
datasource: {
|
|
11
|
+
url: `postgres://${process.env.SENTINEL_DB_USER}:${process.env.SENTINEL_DB_PASS}@${process.env.SENTINEL_DB_HOST}:${process.env.SENTINEL_DB_PORT}/${process.env.SENTINEL_DB_DATABASE}`,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=prisma.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prisma.config.js","sourceRoot":"","sources":["../prisma.config.ts"],"names":[],"mappings":";;AAEA,yBAAuB;AACvB,0CAA6C;AAE7C,kBAAe,IAAA,qBAAY,EAAC;IAC1B,MAAM,EAAE,sBAAsB;IAC9B,UAAU,EAAE;QACV,IAAI,EAAE,mBAAmB;KAC1B;IACD,UAAU,EAAE;QACV,GAAG,EAAE,cAAc,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE;KACtL;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"can.decorator.js","sourceRoot":"","sources":["../../src/can.decorator.ts"],"names":[],"mappings":";;;AACA,uCAAyC;AAE5B,QAAA,GAAG,GAAG,gBAAS,CAAC,eAAe,EAA2B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Prisma from './internal/prismaNamespaceBrowser.js';
|
|
2
|
+
export { Prisma };
|
|
3
|
+
export * as $Enums from './enums.js';
|
|
4
|
+
export * from './enums.js';
|
|
5
|
+
export type ModelHasRoles = Prisma.ModelHasRolesModel;
|
|
6
|
+
export type PermissionKeys = Prisma.PermissionKeysModel;
|
|
7
|
+
export type RoleHasPermissions = Prisma.RoleHasPermissionsModel;
|
|
8
|
+
export type Roles = Prisma.RolesModel;
|
|
9
|
+
export type SequelizeMeta = Prisma.SequelizeMetaModel;
|
|
10
|
+
export type Users = Prisma.UsersModel;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.$Enums = exports.Prisma = void 0;
|
|
40
|
+
const Prisma = __importStar(require("./internal/prismaNamespaceBrowser.js"));
|
|
41
|
+
exports.Prisma = Prisma;
|
|
42
|
+
exports.$Enums = __importStar(require("./enums.js"));
|
|
43
|
+
__exportStar(require("./enums.js"), exports);
|
|
44
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../../src/generated/prisma/browser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,6EAA8D;AACrD,wBAAM;AACf,qDAAoC;AACpC,6CAA2B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as runtime from "@prisma/client/runtime/client";
|
|
2
|
+
import * as $Class from "./internal/class.js";
|
|
3
|
+
import * as Prisma from "./internal/prismaNamespace.js";
|
|
4
|
+
export * as $Enums from './enums.js';
|
|
5
|
+
export * from "./enums.js";
|
|
6
|
+
export declare const PrismaClient: $Class.PrismaClientConstructor;
|
|
7
|
+
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>;
|
|
8
|
+
export { Prisma };
|
|
9
|
+
export type ModelHasRoles = Prisma.ModelHasRolesModel;
|
|
10
|
+
export type PermissionKeys = Prisma.PermissionKeysModel;
|
|
11
|
+
export type RoleHasPermissions = Prisma.RoleHasPermissionsModel;
|
|
12
|
+
export type Roles = Prisma.RolesModel;
|
|
13
|
+
export type SequelizeMeta = Prisma.SequelizeMetaModel;
|
|
14
|
+
export type Users = Prisma.UsersModel;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Prisma = exports.PrismaClient = exports.$Enums = void 0;
|
|
40
|
+
const $Class = __importStar(require("./internal/class.js"));
|
|
41
|
+
const Prisma = __importStar(require("./internal/prismaNamespace.js"));
|
|
42
|
+
exports.Prisma = Prisma;
|
|
43
|
+
exports.$Enums = __importStar(require("./enums.js"));
|
|
44
|
+
__exportStar(require("./enums.js"), exports);
|
|
45
|
+
exports.PrismaClient = $Class.getPrismaClientClass();
|
|
46
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/generated/prisma/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,4DAA6C;AAC7C,sEAAuD;AAmB9C,wBAAM;AAjBf,qDAAoC;AACpC,6CAA0B;AAcb,QAAA,YAAY,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAA"}
|