ddd-ts-kit 0.96.0 → 0.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.fr.md +5 -3
- package/README.md +4 -2
- package/dist/check/authz/operator-tuples.d.ts +16 -0
- package/dist/check/authz/operator-tuples.d.ts.map +1 -0
- package/dist/check/authz/operator-tuples.js +29 -0
- package/dist/check/authz/operator-tuples.js.map +1 -0
- package/dist/check/authz/own-authorizer.d.ts +9 -0
- package/dist/check/authz/own-authorizer.d.ts.map +1 -0
- package/dist/check/authz/own-authorizer.js +15 -0
- package/dist/check/authz/own-authorizer.js.map +1 -0
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +4 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/explain/authz-docs.d.ts.map +1 -1
- package/dist/check/explain/authz-docs.js +12 -1
- package/dist/check/explain/authz-docs.js.map +1 -1
- package/dist/check/explain/scheduling-docs.d.ts.map +1 -1
- package/dist/check/explain/scheduling-docs.js +22 -0
- package/dist/check/explain/scheduling-docs.js.map +1 -1
- package/dist/check/fixtures/authz-granted-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-granted-fixtures.js +69 -0
- package/dist/check/fixtures/authz-granted-fixtures.js.map +1 -1
- package/dist/check/fixtures/authz-resource-modelled-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-resource-modelled-fixtures.js +5 -0
- package/dist/check/fixtures/authz-resource-modelled-fixtures.js.map +1 -1
- package/dist/check/fixtures/authz-system-actor-granted-fixtures.d.ts +3 -0
- package/dist/check/fixtures/authz-system-actor-granted-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/authz-system-actor-granted-fixtures.js +89 -0
- package/dist/check/fixtures/authz-system-actor-granted-fixtures.js.map +1 -0
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +2 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/scheduling-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/scheduling-fixtures.js +47 -1
- package/dist/check/fixtures/scheduling-fixtures.js.map +1 -1
- package/dist/check/rules/authz-granted.d.ts +19 -6
- package/dist/check/rules/authz-granted.d.ts.map +1 -1
- package/dist/check/rules/authz-granted.js +59 -7
- package/dist/check/rules/authz-granted.js.map +1 -1
- package/dist/check/rules/authz-system-actor-granted.d.ts +15 -0
- package/dist/check/rules/authz-system-actor-granted.d.ts.map +1 -0
- package/dist/check/rules/authz-system-actor-granted.js +91 -0
- package/dist/check/rules/authz-system-actor-granted.js.map +1 -0
- package/dist/check/rules/scheduling-job-registered.d.ts +12 -0
- package/dist/check/rules/scheduling-job-registered.d.ts.map +1 -0
- package/dist/check/rules/scheduling-job-registered.js +40 -0
- package/dist/check/rules/scheduling-job-registered.js.map +1 -0
- package/dist/check/scheduling/job-classes.d.ts +13 -0
- package/dist/check/scheduling/job-classes.d.ts.map +1 -0
- package/dist/check/scheduling/job-classes.js +32 -0
- package/dist/check/scheduling/job-classes.js.map +1 -0
- package/dist/commands/generate.js +1 -1
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/prisma-generate.d.ts.map +1 -1
- package/dist/commands/prisma-generate.js +2 -1
- package/dist/commands/prisma-generate.js.map +1 -1
- package/dist/commands/typeorm-generate.d.ts.map +1 -1
- package/dist/commands/typeorm-generate.js +2 -1
- package/dist/commands/typeorm-generate.js.map +1 -1
- package/dist/generate/kinds/extend-event-sourced-aggregate.js +2 -2
- package/dist/generate/kinds/extend-event-sourced-aggregate.js.map +1 -1
- package/dist/generate/kinds/integration-handler-kind.d.ts.map +1 -1
- package/dist/generate/kinds/integration-handler-kind.js +1 -13
- package/dist/generate/kinds/integration-handler-kind.js.map +1 -1
- package/dist/generate/kinds/job/grant-system-actor.js +4 -2
- package/dist/generate/kinds/job/grant-system-actor.js.map +1 -1
- package/dist/generate/kinds/projection-kind.d.ts.map +1 -1
- package/dist/generate/kinds/projection-kind.js +15 -10
- package/dist/generate/kinds/projection-kind.js.map +1 -1
- package/dist/generate/kinds/subscription-vars.d.ts +8 -0
- package/dist/generate/kinds/subscription-vars.d.ts.map +1 -0
- package/dist/generate/kinds/subscription-vars.js +14 -0
- package/dist/generate/kinds/subscription-vars.js.map +1 -0
- package/dist/generate/refuse-shared-writes.d.ts +1 -1
- package/dist/generate/refuse-shared-writes.d.ts.map +1 -1
- package/dist/generate/refuse-shared-writes.js +25 -2
- package/dist/generate/refuse-shared-writes.js.map +1 -1
- package/dist/init/first-install-note.d.ts.map +1 -1
- package/dist/init/first-install-note.js +1 -0
- package/dist/init/first-install-note.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/migration/ensure-database-reachable.d.ts +13 -0
- package/dist/migration/ensure-database-reachable.d.ts.map +1 -0
- package/dist/migration/ensure-database-reachable.js +51 -0
- package/dist/migration/ensure-database-reachable.js.map +1 -0
- package/dist/migration/index.d.ts +1 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +1 -0
- package/dist/migration/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/add-worktree.d.ts +5 -1
- package/dist/worker/add-worktree.d.ts.map +1 -1
- package/dist/worker/add-worktree.js +6 -2
- package/dist/worker/add-worktree.js.map +1 -1
- package/package.json +4 -4
- package/templates/aggregate/event-sourced.events.mapper.ts.tpl +2 -2
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/projection/projection.manual.ts.tpl +8 -0
- package/templates/projection/wiring.manual.tpl +22 -0
- package/templates/projection/wiring.tsyringe.tpl +4 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { CONFIG_FILE } from '../../config/index.js';
|
|
2
|
+
import { config } from './config.js';
|
|
3
|
+
import { PATHS } from './paths.js';
|
|
4
|
+
import { project } from './project.js';
|
|
5
|
+
import { SAMPLES } from './samples.js';
|
|
6
|
+
import { source } from './source.js';
|
|
7
|
+
const { BILLING, EVENT_HANDLER, EVENT_HANDLER_SPEC } = PATHS;
|
|
8
|
+
const RELATE = 'src/platform/auth/relationships/relate-system-actors.ts';
|
|
9
|
+
const ISSUE_COMMAND = `${BILLING}/application/commands/issue-invoice/issue-invoice.command.ts`;
|
|
10
|
+
const REBAC = { [CONFIG_FILE]: config({ stack: { authz: 'rebac' } }) };
|
|
11
|
+
const rule = 'authz/system-actor-granted';
|
|
12
|
+
export const AUTHZ_SYSTEM_ACTOR_GRANTED_FIXTURES = [
|
|
13
|
+
{
|
|
14
|
+
ruleId: rule,
|
|
15
|
+
name: 'a handler whose system actor is related to its context',
|
|
16
|
+
expect: 'pass',
|
|
17
|
+
files: acting(handler("systemActor('billing.invoice-issued')"), relationships('system:system:billing.invoice-issued')),
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
ruleId: rule,
|
|
21
|
+
name: 'a handler named by its class, related under that name',
|
|
22
|
+
expect: 'pass',
|
|
23
|
+
files: acting(handler('systemActor(InvoiceIssuedEventHandler.name)'), relationships('system:system:InvoiceIssuedEventHandler')),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
ruleId: rule,
|
|
27
|
+
name: 'a handler that sends a public command needs no grant',
|
|
28
|
+
expect: 'pass',
|
|
29
|
+
files: acting(handler("systemActor('billing.invoice-issued')"), relationships(), { isPublic: true }),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
ruleId: rule,
|
|
33
|
+
name: 'a system actor whose name the checker cannot read',
|
|
34
|
+
expect: 'pass',
|
|
35
|
+
files: acting(handler('systemActor(actorName)'), relationships()),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
ruleId: rule,
|
|
39
|
+
name: 'a handler without a grant, in a project with an authorizer of its own',
|
|
40
|
+
expect: 'pass',
|
|
41
|
+
files: {
|
|
42
|
+
...acting(handler("systemActor('billing.invoice-issued')"), relationships()),
|
|
43
|
+
'src/platform/auth/authorization/create-authorizer.ts': source("import { MyAuthorizer } from '@/platform/auth/authorization/my.authorizer.js';", '', 'export const createAuthorizer = () => new MyAuthorizer();'),
|
|
44
|
+
'src/platform/auth/authorization/my.authorizer.ts': 'export class MyAuthorizer {}\n',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
ruleId: rule,
|
|
49
|
+
name: 'a handler without a grant, in a project whose rights are roles',
|
|
50
|
+
expect: 'pass',
|
|
51
|
+
files: {
|
|
52
|
+
...acting(handler("systemActor('billing.invoice-issued')"), relationships()),
|
|
53
|
+
[CONFIG_FILE]: config({ stack: { authz: 'rbac' } }),
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
ruleId: rule,
|
|
58
|
+
name: 'a handler whose system actor no relationship names',
|
|
59
|
+
expect: { file: EVENT_HANDLER },
|
|
60
|
+
files: acting(handler("systemActor('billing.invoice-issued')"), relationships()),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
ruleId: rule,
|
|
64
|
+
name: 'a handler whose actor is named without its type, which the authorizer never matches',
|
|
65
|
+
expect: { file: EVENT_HANDLER },
|
|
66
|
+
files: acting(handler("systemActor('billing.invoice-issued')"), relationships('system:billing.invoice-issued')),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
ruleId: rule,
|
|
70
|
+
name: 'a handler whose system actor is named by another actor only',
|
|
71
|
+
expect: { file: EVENT_HANDLER },
|
|
72
|
+
files: acting(handler('systemActor(InvoiceIssuedEventHandler.name)'), relationships('system:system:InvoiceIssued')),
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
function acting(handlerSource, relate, { isPublic = false } = {}) {
|
|
76
|
+
return project({
|
|
77
|
+
[EVENT_HANDLER]: handlerSource,
|
|
78
|
+
[EVENT_HANDLER_SPEC]: SAMPLES.SPEC,
|
|
79
|
+
[RELATE]: relate,
|
|
80
|
+
[ISSUE_COMMAND]: source("import { AuthorizedCommand } from '@ddd-ts-kit/kernel';", "import { Public, Requires } from '@ddd-ts-kit/kernel/declarations';", "import { billingPermissions } from '@/contexts/billing/billing.permissions.js';", '', isPublic ? '@Public()' : "@Requires(billingPermissions['invoice.issue'])", 'export class IssueInvoiceCommand extends AuthorizedCommand<void> {}'),
|
|
81
|
+
}, REBAC);
|
|
82
|
+
}
|
|
83
|
+
function handler(actor) {
|
|
84
|
+
return source("import { systemActor, type CommandBus } from '@ddd-ts-kit/kernel';", "import { IssueInvoiceCommand } from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.command.js';", '', 'export class InvoiceIssuedEventHandler {', ' constructor(private readonly commands: CommandBus) {}', '', ' async handle(): Promise<void> {', ` await this.commands.execute(new IssueInvoiceCommand(${actor}));`, ' }', '}');
|
|
85
|
+
}
|
|
86
|
+
function relationships(...subjects) {
|
|
87
|
+
return source("import type { RelationTuple } from '@ddd-ts-kit/auth/rebac';", '', 'const systemRelationships: readonly RelationTuple[] = [', ...subjects.map((subject) => ` { object: 'context:billing', relation: 'operator', subject: '${subject}' },`), '];', '', 'export const grants = systemRelationships;');
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=authz-system-actor-granted-fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authz-system-actor-granted-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/authz-system-actor-granted-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,GAAG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QAChB,CAAC,aAAa,CAAC,EAAE,MAAM,CACrB,yDAAyD,EACzD,qEAAqE,EACrE,iFAAiF,EACjF,EAAE,EACF,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,gDAAgD,EACzE,qEAAqE,CACtE;KACF,EACD,KAAK,CACN,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,KAAa;IAC5B,OAAO,MAAM,CACX,oEAAoE,EACpE,uHAAuH,EACvH,EAAE,EACF,0CAA0C,EAC1C,yDAAyD,EACzD,EAAE,EACF,mCAAmC,EACnC,2DAA2D,KAAK,KAAK,EACrE,KAAK,EACL,GAAG,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,GAAG,QAA2B;IACnD,OAAO,MAAM,CACX,8DAA8D,EAC9D,EAAE,EACF,yDAAyD,EACzD,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,kEAAkE,OAAO,MAAM,CAAC,EAC7G,IAAI,EACJ,EAAE,EACF,4CAA4C,CAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/fixtures.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/fixtures.ts"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,OAAO,EAyDtC,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { AUTHZ_DECLARED_FIXTURES } from './authz-declared-fixtures.js';
|
|
|
4
4
|
import { AUTHZ_FIXTURES } from './authz-fixtures.js';
|
|
5
5
|
import { AUTHZ_GRANTED_FIXTURES } from './authz-granted-fixtures.js';
|
|
6
6
|
import { AUTHZ_POLICY_FIXTURES } from './authz-policy-fixtures.js';
|
|
7
|
+
import { AUTHZ_SYSTEM_ACTOR_GRANTED_FIXTURES } from './authz-system-actor-granted-fixtures.js';
|
|
7
8
|
import { AUTHZ_SCOPE_NARROWS_FIXTURES } from './authz-scope-narrows-fixtures.js';
|
|
8
9
|
import { AUTHZ_RESOURCE_MODELLED_FIXTURES } from './authz-resource-modelled-fixtures.js';
|
|
9
10
|
import { CLEAN_FIXTURES } from './clean-fixtures.js';
|
|
@@ -66,6 +67,7 @@ export const FIXTURES = [
|
|
|
66
67
|
...AUTHZ_GRANTED_FIXTURES,
|
|
67
68
|
...AUTHZ_SCOPE_NARROWS_FIXTURES,
|
|
68
69
|
...AUTHZ_RESOURCE_MODELLED_FIXTURES,
|
|
70
|
+
...AUTHZ_SYSTEM_ACTOR_GRANTED_FIXTURES,
|
|
69
71
|
...CLEAN_FIXTURES,
|
|
70
72
|
...COMPOSITION_FIXTURES,
|
|
71
73
|
...CONFIG_FIXTURES,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CA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AG,cAAc;IACjB,GAAG,qBAAqB;IACxB,GAAG,sBAAsB;IACzB,GAAG,4BAA4B;IAC/B,GAAG,gCAAgC;IACnC,GAAG,cAAc;IACjB,GAAG,oBAAoB;IACvB,GAAG,eAAe;IAClB,GAAG,8BAA8B;IACjC,GAAG,iBAAiB;IACpB,GAAG,gBAAgB;IACnB,GAAG,iBAAiB;IACpB,GAAG,eAAe;IAClB,GAAG,iBAAiB;IACpB,GAAG,qBAAqB;IACxB,GAAG,qBAAqB;IACxB,GAAG,6BAA6B;IAChC,GAAG,sBAAsB;IACzB,GAAG,eAAe;IAClB,GAAG,sBAAsB;IACzB,GAAG,eAAe;IAClB,GAAG,sBAAsB;IACzB,GAAG,uBAAuB;IAC1B,GAAG,eAAe;IAClB,GAAG,kBAAkB;IACrB,GAAG,oBAAoB;IACvB,GAAG,cAAc;IACjB,GAAG,mBAAmB;IACtB,GAAG,gBAAgB;IACnB,GAAG,iBAAiB;IACpB,GAAG,mBAAmB;IACtB,GAAG,uBAAuB;IAC1B,GAAG,cAAc;IACjB,GAAG,eAAe;IAClB,GAAG,kBAAkB;IACrB,GAAG,eAAe;IAClB,GAAG,eAAe;IAClB,GAAG,sBAAsB;IACzB,GAAG,eAAe;IAClB,GAAG,oBAAoB;IACvB,GAAG,cAAc;IACjB,GAAG,eAAe;IAClB,GAAG,mBAAmB;IACtB,GAAG,iBAAiB;IACpB,GAAG,aAAa;IAChB,GAAG,yBAAyB;IAC5B,GAAG,gBAAgB;IACnB,GAAG,gBAAgB;IACnB,GAAG,aAAa;IAChB,GAAG,gBAAgB;IACnB,GAAG,aAAa;IAChB,GAAG,0BAA0B;IAC7B,GAAG,uBAAuB;CAC3B,CAAC"}
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,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B,GAAG,sBAAsB;IACzB,GAAG,eAAe;IAClB,GAAG,oBAAoB;IACvB,GAAG,cAAc;IACjB,GAAG,eAAe;IAClB,GAAG,mBAAmB;IACtB,GAAG,iBAAiB;IACpB,GAAG,aAAa;IAChB,GAAG,yBAAyB;IAC5B,GAAG,gBAAgB;IACnB,GAAG,gBAAgB;IACnB,GAAG,aAAa;IAChB,GAAG,gBAAgB;IACnB,GAAG,aAAa;IAChB,GAAG,0BAA0B;IAC7B,GAAG,uBAAuB;CAC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/scheduling-fixtures.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduling-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/scheduling-fixtures.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiSzC,eAAO,MAAM,mBAAmB,EAAE,SAAS,OAAO,EAKjD,CAAC"}
|
|
@@ -187,7 +187,53 @@ const TENANCY_DECLARED = [
|
|
|
187
187
|
files: declaredProject({ [JOB]: tenantJob("{ every: '15m', tenancy }"), [JOB_SPEC]: SPEC }, TENANT_CONFIG),
|
|
188
188
|
},
|
|
189
189
|
];
|
|
190
|
-
|
|
190
|
+
const REGISTERED = 'scheduling/job-registered';
|
|
191
|
+
const BACKGROUND_JOB = `${BILLING}/application/background/purge-drafts.background-job.ts`;
|
|
192
|
+
const BACKGROUND_JOB_SPEC = `${BILLING}/test/unit/purge-drafts.background-job.spec.ts`;
|
|
193
|
+
const PURGE_JOB = source("import type { BackgroundJob, BackgroundJobExecution, CommandBus } from '@ddd-ts-kit/kernel';", '', 'export class PurgeDraftsBackgroundJob implements BackgroundJob<Record<string, never>> {', " static readonly jobName = 'billing.purge-drafts';", '', ' constructor(private readonly commands: CommandBus) {}', '', ' async run(payload: Record<string, never>, execution: BackgroundJobExecution): Promise<void> {}', '}');
|
|
194
|
+
const REGISTERING_PURGE = source("import { PurgeDraftsBackgroundJob } from '@/contexts/billing/application/background/purge-drafts.background-job.js';", '', 'export function billingModule(platform: Platform): void {', ' platform.backgroundJobs.register(PurgeDraftsBackgroundJob, [platform.commands]);', '}');
|
|
195
|
+
const JOB_REGISTERED = [
|
|
196
|
+
{
|
|
197
|
+
ruleId: REGISTERED,
|
|
198
|
+
name: 'a declared job that carries @Scheduled',
|
|
199
|
+
expect: 'pass',
|
|
200
|
+
files: declaredProject({ [JOB]: DECLARED.job, [JOB_SPEC]: SPEC }),
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
ruleId: REGISTERED,
|
|
204
|
+
name: 'explicit style: a job the module file registers',
|
|
205
|
+
expect: 'pass',
|
|
206
|
+
files: project({
|
|
207
|
+
[JOB]: PLAIN_JOB,
|
|
208
|
+
[JOB_SPEC]: SPEC,
|
|
209
|
+
[MODULE]: moduleRegistering('@/contexts/billing/application/scheduling/send-reminders.job.js', 'billing.send-reminders'),
|
|
210
|
+
}),
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
ruleId: REGISTERED,
|
|
214
|
+
name: 'explicit style: a background job the module file registers',
|
|
215
|
+
expect: 'pass',
|
|
216
|
+
files: project({ [BACKGROUND_JOB]: PURGE_JOB, [BACKGROUND_JOB_SPEC]: SPEC, [MODULE]: REGISTERING_PURGE }),
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
ruleId: REGISTERED,
|
|
220
|
+
name: 'explicit style: a job written and registered by no module file',
|
|
221
|
+
expect: { file: JOB },
|
|
222
|
+
files: project({ [JOB]: PLAIN_JOB, [JOB_SPEC]: SPEC }),
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
ruleId: REGISTERED,
|
|
226
|
+
name: 'explicit style: a background job no module file registers',
|
|
227
|
+
expect: { file: BACKGROUND_JOB },
|
|
228
|
+
files: project({ [BACKGROUND_JOB]: PURGE_JOB, [BACKGROUND_JOB_SPEC]: SPEC }),
|
|
229
|
+
},
|
|
230
|
+
];
|
|
231
|
+
export const SCHEDULING_FIXTURES = [
|
|
232
|
+
...TRIGGERS_USE_CASE,
|
|
233
|
+
...JOB_NAME,
|
|
234
|
+
...TENANCY_DECLARED,
|
|
235
|
+
...JOB_REGISTERED,
|
|
236
|
+
];
|
|
191
237
|
function moduleRegistering(jobFile, name) {
|
|
192
238
|
return source("import { defineModule } from '@ddd-ts-kit/di';", "import { CommandBus } from '@ddd-ts-kit/kernel';", `import { SendRemindersJob } from '${jobFile}';`, '', "export const billingModule = defineModule('billing', (builder) => {", ` builder.job('${name}', { every: '15m' }).handledBy(SendRemindersJob, [CommandBus]);`, '});');
|
|
193
239
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/scheduling-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;AACjD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AAEzB,MAAM,UAAU,GAAG,GAAG,OAAO,iDAAiD,CAAC;AAC/E,MAAM,eAAe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AE;QACrB,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;KACvD;IACD;QACE,MAAM,EAAE,UAAU;QAClB,IAAI,EAAE,2DAA2D;QACjE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;QAChC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE,IAAI,EAAE,CAAC;KAC7E;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAuB;IACrD,GAAG,iBAAiB;IACpB,GAAG,QAAQ;IACX,GAAG,gBAAgB;IACnB,GAAG,cAAc;CAClB,CAAC;AAEF,SAAS,iBAAiB,CAAC,OAAe,EAAE,IAAY;IACtD,OAAO,MAAM,CACX,gDAAgD,EAChD,kDAAkD,EAClD,qCAAqC,OAAO,IAAI,EAChD,EAAE,EACF,qEAAqE,EACrE,kBAAkB,IAAI,iEAAiE,EACvF,KAAK,CACN,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,OAAe;IAChC,OAAO,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import type { Rule } from '../model/rule.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
3
|
+
* Every permission a context declares is granted to someone, where the rights are roles or
|
|
4
|
+
* relationships.
|
|
5
|
+
*
|
|
6
|
+
* Roles: granted by name, to a role or to every signed-in person: by the entry of its set, by its
|
|
7
|
+
* id or by the wildcard of its context. The bare `'*'` of the super-admin does not count: a
|
|
8
|
+
* permission only it reaches is a use case nobody else may run, and nothing says whether that was
|
|
9
|
+
* meant. Silent when the platform holds no roles file.
|
|
10
|
+
*
|
|
11
|
+
* Relationships: a permission the schema leaves on the context is held by the operators of the
|
|
12
|
+
* context, and nobody is an operator until a relationship says so. It is granted when every
|
|
13
|
+
* signed-in person holds it, or when a source outside the tests writes an `operator`
|
|
14
|
+
* relationship on its context, for a person or for a system actor. A permission derived on an element is held through relations the
|
|
15
|
+
* use cases write at run time, which the tree does not show: not judged. Silent when the
|
|
16
|
+
* project decides with an authorizer of its own (`createAuthorizer` imports one from the project),
|
|
17
|
+
* when the checker cannot read the schema, and when an operator tuple names a context it cannot
|
|
18
|
+
* read, and when no source makes a person operator of any context: such a project provisions its
|
|
19
|
+
* operators out of the tree (a seed, an administration tool) and nothing here says otherwise.
|
|
20
|
+
*
|
|
21
|
+
* Silent when the rights are attributes or an authorizer of the project's own.
|
|
9
22
|
*/
|
|
10
23
|
export declare const authzGranted: Rule;
|
|
11
24
|
//# sourceMappingURL=authz-granted.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-granted.d.ts","sourceRoot":"","sources":["../../../src/check/rules/authz-granted.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authz-granted.d.ts","sourceRoot":"","sources":["../../../src/check/rules/authz-granted.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,YAAY,EAAE,IAwB1B,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { isGranted } from '../authz/is-granted.js';
|
|
2
|
+
import { modelledPermissions } from '../authz/modelled-permissions.js';
|
|
3
|
+
import { operatorTuples } from '../authz/operator-tuples.js';
|
|
4
|
+
import { ownAuthorizer } from '../authz/own-authorizer.js';
|
|
2
5
|
import { permissionSets } from '../authz/permission-sets.js';
|
|
3
6
|
import { signedInGrants } from '../authz/signed-in-grants.js';
|
|
4
7
|
import { reporter } from '../support/reporter.js';
|
|
@@ -6,18 +9,34 @@ import { toViolations } from '../support/to-violations.js';
|
|
|
6
9
|
import { platformFileIn } from '../../platform-layout/index.js';
|
|
7
10
|
import { isInProject } from '../authz/is-in-project.js';
|
|
8
11
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* Every permission a context declares is granted to someone, where the rights are roles or
|
|
13
|
+
* relationships.
|
|
14
|
+
*
|
|
15
|
+
* Roles: granted by name, to a role or to every signed-in person: by the entry of its set, by its
|
|
16
|
+
* id or by the wildcard of its context. The bare `'*'` of the super-admin does not count: a
|
|
17
|
+
* permission only it reaches is a use case nobody else may run, and nothing says whether that was
|
|
18
|
+
* meant. Silent when the platform holds no roles file.
|
|
19
|
+
*
|
|
20
|
+
* Relationships: a permission the schema leaves on the context is held by the operators of the
|
|
21
|
+
* context, and nobody is an operator until a relationship says so. It is granted when every
|
|
22
|
+
* signed-in person holds it, or when a source outside the tests writes an `operator`
|
|
23
|
+
* relationship on its context, for a person or for a system actor. A permission derived on an element is held through relations the
|
|
24
|
+
* use cases write at run time, which the tree does not show: not judged. Silent when the
|
|
25
|
+
* project decides with an authorizer of its own (`createAuthorizer` imports one from the project),
|
|
26
|
+
* when the checker cannot read the schema, and when an operator tuple names a context it cannot
|
|
27
|
+
* read, and when no source makes a person operator of any context: such a project provisions its
|
|
28
|
+
* operators out of the tree (a seed, an administration tool) and nothing here says otherwise.
|
|
29
|
+
*
|
|
30
|
+
* Silent when the rights are attributes or an authorizer of the project's own.
|
|
15
31
|
*/
|
|
16
32
|
export const authzGranted = {
|
|
17
33
|
id: 'authz/granted',
|
|
18
|
-
description: '
|
|
34
|
+
description: 'Every permission a context declares is granted: by name to a role or to every signed-in person, not only through the super-admin wildcard (roles), or held by operators some source makes (relationships).',
|
|
19
35
|
scope: 'project',
|
|
20
36
|
run(project) {
|
|
37
|
+
if (project.config.stack.authz === 'rebac') {
|
|
38
|
+
return ownAuthorizer(project) ? [] : unheldByOperators(project);
|
|
39
|
+
}
|
|
21
40
|
const { roles, signedIn } = grantFiles(project);
|
|
22
41
|
if (project.config.stack.authz !== 'rbac' || roles === undefined) {
|
|
23
42
|
return [];
|
|
@@ -45,4 +64,37 @@ function ungranted(file, grants) {
|
|
|
45
64
|
fix: `Grant ${declared.set}['${value}'] to the roles that hold it in ${grants[0]?.path ?? 'the roles of the platform'} (for example \`[Role.Member]: [${declared.set}['${value}']]\`), or generate the use case with --grant <role>. A permission meant for administrators only is granted to Role.Admin by name.`,
|
|
46
65
|
})));
|
|
47
66
|
}
|
|
67
|
+
/** Under relationships: a permission left on the context, held by no signed-in person, in a context nobody is made operator of. */
|
|
68
|
+
function unheldByOperators(project) {
|
|
69
|
+
const schemaFile = schemaOf(project);
|
|
70
|
+
const signedIn = signedInGrants(project);
|
|
71
|
+
const sources = project.files.filter((file) => !file.isTest && file.location.area === 'context');
|
|
72
|
+
const sets = sources.flatMap(permissionSets);
|
|
73
|
+
if (schemaFile === undefined || sets.length === 0) {
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
const schema = modelledPermissions(schemaFile, sets);
|
|
77
|
+
const operators = operatorTuples(project);
|
|
78
|
+
if (schema.unread.length > 0 || operators.unreadable || !operators.provisioned) {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
const report = reporter(project, 'authz/granted');
|
|
82
|
+
const held = (declared, value) => !schema.contextHolds(`${declared.context}:${value}`) ||
|
|
83
|
+
(signedIn !== undefined && isGranted(signedIn.scan, declared, value)) ||
|
|
84
|
+
operators.contexts.has(declared.context);
|
|
85
|
+
return sources.flatMap((file) => toViolations(report, file.path, permissionSets(file).flatMap((declared) => declared.keys
|
|
86
|
+
.filter(({ value }) => !held(declared, value))
|
|
87
|
+
.map(({ value, line }) => heldByNobody(declared, value, line)))));
|
|
88
|
+
}
|
|
89
|
+
function schemaOf(project) {
|
|
90
|
+
const path = platformFileIn(project.config, 'auth/relationships/relationship-schema.ts', (candidate) => isInProject(project, candidate));
|
|
91
|
+
return project.files.find((file) => file.path === path);
|
|
92
|
+
}
|
|
93
|
+
function heldByNobody(declared, value, line) {
|
|
94
|
+
return {
|
|
95
|
+
line,
|
|
96
|
+
message: `${declared.context}:${value} is held by the operators of ${declared.context}, and no source makes anybody an operator of it: nobody can run this use case.`,
|
|
97
|
+
fix: `Make somebody operator of the context where the application starts or is provisioned (\`{ object: 'context:${declared.context}', relation: 'operator', subject: 'user:<id>' }\`, written with relationTuples.write), or derive ${declared.set}['${value}'] on the element it is about, or add it to the signed-in grants of the platform when every signed-in person may run it.`,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
48
100
|
//# sourceMappingURL=authz-granted.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-granted.js","sourceRoot":"","sources":["../../../src/check/rules/authz-granted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"authz-granted.js","sourceRoot":"","sources":["../../../src/check/rules/authz-granted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAsB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAM3D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;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,IAAI,EACT,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CACxC,QAAQ,CAAC,IAAI;SACV,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;SAC7C,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CACjE,CACF,CACF,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,OAAgB;IAChC,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,2CAA2C,EAAE,CAAC,SAAS,EAAE,EAAE,CACrG,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,CAChC,CAAC;IAEF,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,YAAY,CAAC,QAAuB,EAAE,KAAa,EAAE,IAAY;IACxE,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,IAAI,KAAK,gCAAgC,QAAQ,CAAC,OAAO,gFAAgF;QACrK,GAAG,EAAE,8GAA8G,QAAQ,CAAC,OAAO,oGAAoG,QAAQ,CAAC,GAAG,KAAK,KAAK,0HAA0H;KACxX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Rule } from '../model/rule.js';
|
|
2
|
+
/**
|
|
3
|
+
* Under relationships, the application acts on its own behalf as a system actor (a job, an event
|
|
4
|
+
* handler, a process, a consumer), and nothing is permitted to it until a relationship says so:
|
|
5
|
+
* the command it sends is refused at run time with FORBIDDEN, which a spec on a fake authorizer
|
|
6
|
+
* never shows. Judged on every `systemActor(<name>)` of a context outside the tests whose name the
|
|
7
|
+
* checker reads (a string literal or `<Class>.name`) and whose file sends at least one command or
|
|
8
|
+
* query that is not public: the platform file `relate-system-actors.ts` (or any file of
|
|
9
|
+
* `auth/relationships/`) must name the subject `system:system:<name>` (the authorizer reads an actor
|
|
10
|
+
* as `<type>:<id>`, and the id of a system actor is `system:<name>`). Under roles or attributes the right is the
|
|
11
|
+
* permission of the system role or of an attribute rule, not a relationship per actor: not judged.
|
|
12
|
+
* Nor is a project with an authorizer of its own, which may let a system actor operate its context.
|
|
13
|
+
*/
|
|
14
|
+
export declare const authzSystemActorGranted: Rule;
|
|
15
|
+
//# sourceMappingURL=authz-system-actor-granted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authz-system-actor-granted.d.ts","sourceRoot":"","sources":["../../../src/check/rules/authz-system-actor-granted.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAY1C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,EAAE,IAyBrC,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { classesOf } from '../declarations/classes-of.js';
|
|
2
|
+
import { wholeLiteral } from '../declarations/whole-literal.js';
|
|
3
|
+
import { isInProject } from '../authz/is-in-project.js';
|
|
4
|
+
import { ownAuthorizer } from '../authz/own-authorizer.js';
|
|
5
|
+
import { perFile } from '../support/per-file.js';
|
|
6
|
+
import { sourceDeclaring } from '../support/source-declaring.js';
|
|
7
|
+
import { callArguments } from '../text/call-arguments.js';
|
|
8
|
+
import { escapeRegExp } from '../text/escape-reg-exp.js';
|
|
9
|
+
import { platformFileIn } from '../../platform-layout/index.js';
|
|
10
|
+
const SYSTEM_ACTOR = /(?<![\w$.])systemActor\s*\(/g;
|
|
11
|
+
const SENT = /\bnew\s+([A-Z][\w$]*(?:Command|Query))\s*\(/g;
|
|
12
|
+
const OWN_NAME = /^([A-Z][\w$]*)\.name$/;
|
|
13
|
+
/**
|
|
14
|
+
* Under relationships, the application acts on its own behalf as a system actor (a job, an event
|
|
15
|
+
* handler, a process, a consumer), and nothing is permitted to it until a relationship says so:
|
|
16
|
+
* the command it sends is refused at run time with FORBIDDEN, which a spec on a fake authorizer
|
|
17
|
+
* never shows. Judged on every `systemActor(<name>)` of a context outside the tests whose name the
|
|
18
|
+
* checker reads (a string literal or `<Class>.name`) and whose file sends at least one command or
|
|
19
|
+
* query that is not public: the platform file `relate-system-actors.ts` (or any file of
|
|
20
|
+
* `auth/relationships/`) must name the subject `system:system:<name>` (the authorizer reads an actor
|
|
21
|
+
* as `<type>:<id>`, and the id of a system actor is `system:<name>`). Under roles or attributes the right is the
|
|
22
|
+
* permission of the system role or of an attribute rule, not a relationship per actor: not judged.
|
|
23
|
+
* Nor is a project with an authorizer of its own, which may let a system actor operate its context.
|
|
24
|
+
*/
|
|
25
|
+
export const authzSystemActorGranted = {
|
|
26
|
+
id: 'authz/system-actor-granted',
|
|
27
|
+
description: 'Under relationships, every system actor a context acts as is named by a relationship of the platform when it sends a protected command or query.',
|
|
28
|
+
scope: 'project',
|
|
29
|
+
run(project) {
|
|
30
|
+
if (project.config.stack.authz !== 'rebac' || ownAuthorizer(project)) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
const relationships = platformFileIn(project.config, 'auth/relationships/relate-system-actors.ts', (path) => isInProject(project, path));
|
|
34
|
+
if (!isInProject(project, relationships)) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
const folder = `${relationships.slice(0, relationships.lastIndexOf('/'))}/`;
|
|
38
|
+
const files = project.files.filter((file) => !file.isTest && file.path.startsWith(folder));
|
|
39
|
+
return perFile(project, this.id, (file) => file.isTest || file.location.area !== 'context' ? [] : ungranted(project, file, { files, path: relationships }));
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
function ungranted(project, file, granting) {
|
|
43
|
+
const sent = [...file.scan.code.matchAll(SENT)].map((match) => match[1] ?? '');
|
|
44
|
+
if (sent.length === 0 || sent.every((message) => isPublic(project, file, message))) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
return [...file.scan.code.matchAll(SYSTEM_ACTOR)].flatMap((call) => {
|
|
48
|
+
const name = actorNamed(file, call.index + call[0].length - 1);
|
|
49
|
+
if (name === undefined || granting.files.some((grant) => names(grant, `system:system:${name}`))) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
const misnamed = granting.files.some((grant) => names(grant, `system:${name}`));
|
|
53
|
+
return [
|
|
54
|
+
{
|
|
55
|
+
line: file.scan.lineAt(call.index),
|
|
56
|
+
message: misnamed
|
|
57
|
+
? `The relationships of the platform name system:${name} without the type of the actor: the authorizer reads a system actor as the subject system:system:${name}, so the grant never matches and the application refuses the command with FORBIDDEN.`
|
|
58
|
+
: `The system actor system:${name} sends a protected message and no relationship of the platform names it: the application refuses it with FORBIDDEN when it runs.`,
|
|
59
|
+
fix: `Add \`{ object: 'context:<context>', relation: 'operator', subject: 'system:system:${name}' }\` to the systemRelationships of ${granting.path} (the subject is the type of the actor, \`system\`, then its id, \`system:${name}\`), or derive the permission on an element the actor is related to: \`generate job\` writes this line for a job, a handler by hand needs it.`,
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/** The name given to `systemActor(..)`: a string literal, or the name of a class of the file. */
|
|
65
|
+
function actorNamed(file, open) {
|
|
66
|
+
const argument = callArguments(file.scan.code, open)[0];
|
|
67
|
+
if (argument === undefined) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
const literal = wholeLiteral(file.scan, argument);
|
|
71
|
+
if (literal !== undefined) {
|
|
72
|
+
return literal;
|
|
73
|
+
}
|
|
74
|
+
const own = OWN_NAME.exec(argument.code.replace(/\s+/g, ''))?.[1];
|
|
75
|
+
return own !== undefined && classesOf(file.scan).some(({ name }) => name === own) ? own : undefined;
|
|
76
|
+
}
|
|
77
|
+
/** The file writes `subject` as a whole token, not as the start of a longer name. */
|
|
78
|
+
function names(file, subject) {
|
|
79
|
+
return new RegExp(`(?<![\\w$.:-])${escapeRegExp(subject)}(?![\\w$.-])`).test(file.text);
|
|
80
|
+
}
|
|
81
|
+
/** A message anybody may send: `@Public()` on its class, `.public()` after its registration, or `publicUseCase(..)`. */
|
|
82
|
+
function isPublic(project, file, message) {
|
|
83
|
+
const name = escapeRegExp(message);
|
|
84
|
+
const declared = classesOf(sourceDeclaring(project, file, message).scan).find((candidate) => candidate.name === message);
|
|
85
|
+
if (declared?.decorations.some(({ name: decorator }) => decorator === 'Public') === true) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
const registered = new RegExp(`\\.\\s*(?:command|query)\\s*\\(\\s*${name}\\s*\\)\\s*\\.\\s*public\\s*\\(|publicUseCase\\s*\\(\\s*${name}\\b`);
|
|
89
|
+
return project.files.some((candidate) => !candidate.isTest && registered.test(candidate.scan.code));
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=authz-system-actor-granted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authz-system-actor-granted.js","sourceRoot":"","sources":["../../../src/check/rules/authz-system-actor-granted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,cAA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,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1F,CAAC;AAED,wHAAwH;AACxH,SAAS,QAAQ,CAAC,OAAgB,EAAE,IAAgB,EAAE,OAAe;IACnE,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAEnC,MAAM,QAAQ,GAAG,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAC3E,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,OAAO,CAC1C,CAAC;IAEF,IAAI,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;QACzF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,MAAM,CAC3B,sCAAsC,IAAI,2DAA2D,IAAI,KAAK,CAC/G,CAAC;IAEF,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACtG,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Rule } from '../model/rule.js';
|
|
2
|
+
/**
|
|
3
|
+
* A job class nobody registers never runs: the scheduler runs what the module files register, and
|
|
4
|
+
* a class in `application/scheduling/` or `application/background/` that no registration names is
|
|
5
|
+
* dead code that every spec and every other rule passes. Judged on the exported class of each job
|
|
6
|
+
* file and background job file, in the explicit style: some other file outside the tests names it
|
|
7
|
+
* in `.handledBy(`, in `.register(` or builds it with `new`. The declared style registers a class
|
|
8
|
+
* by its decorator, which `declarations/role-declared` requires. A class the project registers
|
|
9
|
+
* by a loop, a list or any form the checker does not read is reported too: write the plain forms.
|
|
10
|
+
*/
|
|
11
|
+
export declare const schedulingJobRegistered: Rule;
|
|
12
|
+
//# sourceMappingURL=scheduling-job-registered.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduling-job-registered.d.ts","sourceRoot":"","sources":["../../../src/check/rules/scheduling-job-registered.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAM1C;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,EAAE,IAuBrC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jobClasses } from '../scheduling/job-classes.js';
|
|
2
|
+
import { escapeRegExp } from '../text/escape-reg-exp.js';
|
|
3
|
+
import { isDeclaredStyle } from '../support/is-declared-style.js';
|
|
4
|
+
import { reporter } from '../support/reporter.js';
|
|
5
|
+
/**
|
|
6
|
+
* A job class nobody registers never runs: the scheduler runs what the module files register, and
|
|
7
|
+
* a class in `application/scheduling/` or `application/background/` that no registration names is
|
|
8
|
+
* dead code that every spec and every other rule passes. Judged on the exported class of each job
|
|
9
|
+
* file and background job file, in the explicit style: some other file outside the tests names it
|
|
10
|
+
* in `.handledBy(`, in `.register(` or builds it with `new`. The declared style registers a class
|
|
11
|
+
* by its decorator, which `declarations/role-declared` requires. A class the project registers
|
|
12
|
+
* by a loop, a list or any form the checker does not read is reported too: write the plain forms.
|
|
13
|
+
*/
|
|
14
|
+
export const schedulingJobRegistered = {
|
|
15
|
+
id: 'scheduling/job-registered',
|
|
16
|
+
description: 'Every job (application/scheduling/*.job.ts) and background job (application/background/*.background-job.ts) is registered by a module file, in the explicit style.',
|
|
17
|
+
scope: 'project',
|
|
18
|
+
run(project) {
|
|
19
|
+
// In the declared style a class without its decorator is reported by declarations/role-declared.
|
|
20
|
+
if (isDeclaredStyle(project)) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
const report = reporter(project, this.id);
|
|
24
|
+
return jobClasses(project)
|
|
25
|
+
.filter((job) => !isRegistered(project, job))
|
|
26
|
+
.map((job) => report({ file: job.file.path, line: job.line }, `${job.name} is not registered: the application never runs this ${job.kind}.`, registrationFix(job)));
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
function isRegistered(project, job) {
|
|
30
|
+
const name = escapeRegExp(job.name);
|
|
31
|
+
const registration = new RegExp(`(?:\\.\\s*(?:handledBy|register)\\s*\\(\\s*|\\bnew\\s+)${name}\\b`);
|
|
32
|
+
return project.files.some((file) => file !== job.file && !file.isTest && registration.test(file.scan.code));
|
|
33
|
+
}
|
|
34
|
+
function registrationFix(job) {
|
|
35
|
+
if (job.kind === 'job') {
|
|
36
|
+
return `Register ${job.name} in the module file of its context: \`platform.jobs.register({ name, schedule, run })\` in registerJobs (explicit style), or \`builder.job('<context>.<name>', { every: .. }).handledBy(${job.name}, [CommandBus])\` in the module of the dependency injection. Generating the job writes this registration; a job written by hand needs it.`;
|
|
37
|
+
}
|
|
38
|
+
return `Register ${job.name} in the module file of its context: \`platform.backgroundJobs.register(${job.name}, [platform.commands])\` in registerJobs (explicit style), or \`builder.backgroundJob(${job.name}.jobName).handledBy(${job.name}, [CommandBus])\` in the module of the dependency injection.`;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=scheduling-job-registered.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduling-job-registered.js","sourceRoot":"","sources":["../../../src/check/rules/scheduling-job-registered.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAS;IAC3C,EAAE,EAAE,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AI,2IAA2I,CAAC;IAC5W,CAAC;IAED,OAAO,YAAY,GAAG,CAAC,IAAI,0EAA0E,GAAG,CAAC,IAAI,yFAAyF,GAAG,CAAC,IAAI,uBAAuB,GAAG,CAAC,IAAI,8DAA8D,CAAC;AAC9S,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Project } from '../model/project.js';
|
|
2
|
+
import type { SourceFile } from '../model/source-file.js';
|
|
3
|
+
/** A class the application runs on a schedule or in the background, as the file of a context holds it. */
|
|
4
|
+
export interface JobClass {
|
|
5
|
+
readonly file: SourceFile;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly line: number;
|
|
8
|
+
/** What the job is called in prose, for messages. */
|
|
9
|
+
readonly kind: 'job' | 'background job';
|
|
10
|
+
}
|
|
11
|
+
/** The exported class of every job file and every background job file of the project. */
|
|
12
|
+
export declare function jobClasses(project: Project): JobClass[];
|
|
13
|
+
//# sourceMappingURL=job-classes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-classes.d.ts","sourceRoot":"","sources":["../../../src/check/scheduling/job-classes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,0GAA0G;AAC1G,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,gBAAgB,CAAC;CACzC;AAED,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,EAAE,CAuBvD"}
|