@things-factory/auth-base 10.1.79 → 10.1.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/ai-entry/access-assistant.d.ts +50 -0
- package/dist-server/ai-entry/access-assistant.js +145 -0
- package/dist-server/ai-entry/access-assistant.js.map +1 -0
- package/dist-server/ai-entry/access-entry-targets.d.ts +32 -0
- package/dist-server/ai-entry/access-entry-targets.js +196 -0
- package/dist-server/ai-entry/access-entry-targets.js.map +1 -0
- package/dist-server/ai-entry/entry-target-shape.d.ts +82 -0
- package/dist-server/ai-entry/entry-target-shape.js +3 -0
- package/dist-server/ai-entry/entry-target-shape.js.map +1 -0
- package/dist-server/controllers/access-request.d.ts +57 -0
- package/dist-server/controllers/access-request.js +373 -0
- package/dist-server/controllers/access-request.js.map +1 -0
- package/dist-server/index.d.ts +3 -0
- package/dist-server/index.js +3 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/access-request/access-request-mutation.d.ts +17 -0
- package/dist-server/service/access-request/access-request-mutation.js +65 -0
- package/dist-server/service/access-request/access-request-mutation.js.map +1 -0
- package/dist-server/service/access-request/access-request-query.d.ts +16 -0
- package/dist-server/service/access-request/access-request-query.js +100 -0
- package/dist-server/service/access-request/access-request-query.js.map +1 -0
- package/dist-server/service/access-request/access-request-types.d.ts +32 -0
- package/dist-server/service/access-request/access-request-types.js +115 -0
- package/dist-server/service/access-request/access-request-types.js.map +1 -0
- package/dist-server/service/access-request/access-request.d.ts +33 -0
- package/dist-server/service/access-request/access-request.js +160 -0
- package/dist-server/service/access-request/access-request.js.map +1 -0
- package/dist-server/service/access-request/index.d.ts +5 -0
- package/dist-server/service/access-request/index.js +9 -0
- package/dist-server/service/access-request/index.js.map +1 -0
- package/dist-server/service/index.d.ts +3 -1
- package/dist-server/service/index.js +42 -37
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/open-fields.js +5 -1
- package/dist-server/service/open-fields.js.map +1 -1
- package/dist-server/service/privilege/privilege-directive.js +6 -6
- package/dist-server/service/privilege/privilege-directive.js.map +1 -1
- package/dist-server/service/privilege/privilege-rejection.d.ts +10 -2
- package/dist-server/service/privilege/privilege-rejection.js +23 -10
- package/dist-server/service/privilege/privilege-rejection.js.map +1 -1
- package/dist-server/service/user/user-mutation.js +5 -4
- package/dist-server/service/user/user-mutation.js.map +1 -1
- package/dist-server/service/user/user-query.js +5 -17
- package/dist-server/service/user/user-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/utils/access-request-review.d.ts +69 -0
- package/dist-server/utils/access-request-review.js +119 -0
- package/dist-server/utils/access-request-review.js.map +1 -0
- package/dist-server/utils/assignable-roles.d.ts +23 -0
- package/dist-server/utils/assignable-roles.js +89 -0
- package/dist-server/utils/assignable-roles.js.map +1 -0
- package/dist-server/utils/check-permission.d.ts +29 -2
- package/dist-server/utils/check-permission.js +48 -14
- package/dist-server/utils/check-permission.js.map +1 -1
- package/package.json +4 -4
- package/tests/access-assistant-db.test.ts +155 -0
- package/tests/access-entry-targets-db.test.ts +138 -0
- package/tests/access-request-db.test.ts +273 -0
- package/tests/access-request-pg.test.ts +72 -0
- package/tests/access-request-review.test.ts +155 -0
- package/tests/assignable-roles-db.test.ts +141 -0
- package/tests/permission-gate.test.ts +5 -7
- package/tests/privilege-directive.test.ts +39 -0
- package/tests/privilege-rejection.test.ts +32 -0
- package/tests/refusal-cause.test.ts +80 -0
- package/translations/en.json +28 -1
- package/translations/ja.json +28 -1
- package/translations/ko.json +28 -1
- package/translations/ms.json +28 -1
- package/translations/zh.json +28 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccessRequestQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
7
|
+
const access_request_js_1 = require("../../controllers/access-request.js");
|
|
8
|
+
const access_request_js_2 = require("./access-request.js");
|
|
9
|
+
const access_request_types_js_1 = require("./access-request-types.js");
|
|
10
|
+
/* Reading the requests is reading who asks for what in this domain - the user screens' read privilege. */
|
|
11
|
+
const READ = '@privilege(category: "user", privilege: "query", domainOwnerGranted: true)';
|
|
12
|
+
/* The review and the candidates serve a decision - the deciding declaration. */
|
|
13
|
+
const DECIDE = '@privilege(category: "user", privilege: "mutation", domainOwnerGranted: true)';
|
|
14
|
+
let AccessRequestQuery = class AccessRequestQuery {
|
|
15
|
+
async accessRequests(params, context) {
|
|
16
|
+
const { domain } = context.state;
|
|
17
|
+
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
18
|
+
domain,
|
|
19
|
+
params,
|
|
20
|
+
repository: (0, shell_1.getRepository)(access_request_js_2.AccessRequest),
|
|
21
|
+
alias: 'accessRequest',
|
|
22
|
+
searchables: ['category', 'privilege', 'reason']
|
|
23
|
+
});
|
|
24
|
+
queryBuilder.leftJoinAndSelect('accessRequest.requester', 'requester').leftJoinAndSelect('accessRequest.decidedBy', 'decidedBy').leftJoinAndSelect('accessRequest.grantedRole', 'grantedRole');
|
|
25
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
26
|
+
return { items, total };
|
|
27
|
+
}
|
|
28
|
+
/** Open by design: the caller's own requests - where they see what became of them. */
|
|
29
|
+
async myAccessRequests(context) {
|
|
30
|
+
const { domain, user } = context.state;
|
|
31
|
+
return await (0, shell_1.getRepository)(access_request_js_2.AccessRequest).find({
|
|
32
|
+
where: { domain: { id: domain.id }, requester: { id: user.id } },
|
|
33
|
+
relations: ['grantedRole'],
|
|
34
|
+
order: { createdAt: 'DESC' },
|
|
35
|
+
take: 100
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Open by design: how many people a request would reach - the popup says it before the person sends, so asking reads
|
|
40
|
+
* as what it is. A number, never who.
|
|
41
|
+
*/
|
|
42
|
+
async accessRequestDeciderCount(context) {
|
|
43
|
+
const { domain, user } = context.state;
|
|
44
|
+
return (await (0, access_request_js_1.findDeciderIds)(domain, user.id)).length;
|
|
45
|
+
}
|
|
46
|
+
async rolesGranting(category, privilege, context) {
|
|
47
|
+
return (await (0, access_request_js_1.rolesGranting)(category, privilege, context.state.domain)).map(({ id, name, privilegeCount }) => ({ id, name, privilegeCount }));
|
|
48
|
+
}
|
|
49
|
+
/** The same review the decision runs - the list screen and the AI draft card show this (ADR-0103 decision 4). */
|
|
50
|
+
async reviewAccessDecision(decision, context) {
|
|
51
|
+
return (await (0, access_request_js_1.reviewDecision)(decision, context));
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.AccessRequestQuery = AccessRequestQuery;
|
|
55
|
+
tslib_1.__decorate([
|
|
56
|
+
(0, type_graphql_1.Directive)(READ),
|
|
57
|
+
(0, type_graphql_1.Query)(returns => access_request_types_js_1.AccessRequestList, { description: "To fetch this domain's access requests." }),
|
|
58
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
|
59
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
60
|
+
tslib_1.__metadata("design:type", Function),
|
|
61
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
62
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
63
|
+
], AccessRequestQuery.prototype, "accessRequests", null);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, type_graphql_1.Query)(returns => [access_request_js_2.AccessRequest], { description: "To fetch the caller's own access requests in this domain, newest first." }),
|
|
66
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
67
|
+
tslib_1.__metadata("design:type", Function),
|
|
68
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
69
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
70
|
+
], AccessRequestQuery.prototype, "myAccessRequests", null);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
(0, type_graphql_1.Query)(returns => type_graphql_1.Int, { description: 'To count the people who would be told of an access request from the caller in this domain.' }),
|
|
73
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
74
|
+
tslib_1.__metadata("design:type", Function),
|
|
75
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
76
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
77
|
+
], AccessRequestQuery.prototype, "accessRequestDeciderCount", null);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, type_graphql_1.Directive)(DECIDE),
|
|
80
|
+
(0, type_graphql_1.Query)(returns => [access_request_types_js_1.AccessRoleCandidate], { description: 'To list the roles this domain can assign that grant a privilege, fewest privileges first.' }),
|
|
81
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('category')),
|
|
82
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('privilege')),
|
|
83
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
84
|
+
tslib_1.__metadata("design:type", Function),
|
|
85
|
+
tslib_1.__metadata("design:paramtypes", [String, String, Object]),
|
|
86
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
87
|
+
], AccessRequestQuery.prototype, "rolesGranting", null);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, type_graphql_1.Directive)(DECIDE),
|
|
90
|
+
(0, type_graphql_1.Query)(returns => [access_request_types_js_1.AccessDecisionIssue], { description: 'To review a decision before it is made: what blocks it and what the person deciding should know.' }),
|
|
91
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('decision', type => access_request_types_js_1.AccessDecisionInput)),
|
|
92
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
93
|
+
tslib_1.__metadata("design:type", Function),
|
|
94
|
+
tslib_1.__metadata("design:paramtypes", [access_request_types_js_1.AccessDecisionInput, Object]),
|
|
95
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
96
|
+
], AccessRequestQuery.prototype, "reviewAccessDecision", null);
|
|
97
|
+
exports.AccessRequestQuery = AccessRequestQuery = tslib_1.__decorate([
|
|
98
|
+
(0, type_graphql_1.Resolver)(access_request_js_2.AccessRequest)
|
|
99
|
+
], AccessRequestQuery);
|
|
100
|
+
//# sourceMappingURL=access-request-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-request-query.js","sourceRoot":"","sources":["../../../server/service/access-request/access-request-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8E;AAE9E,iDAA+F;AAE/F,2EAAmG;AACnG,2DAAmD;AACnD,uEAA4H;AAE5H,0GAA0G;AAC1G,MAAM,IAAI,GAAG,4EAA4E,CAAA;AACzF,gFAAgF;AAChF,MAAM,MAAM,GAAG,+EAA+E,CAAA;AAGvF,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,cAAc,CAA0B,MAAiB,EAAS,OAAwB;QAC9F,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,IAAA,qBAAa,EAAC,iCAAa,CAAC;YACxC,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC;SACjD,CAAC,CAAA;QACF,YAAY,CAAC,iBAAiB,CAAC,yBAAyB,EAAE,WAAW,CAAC,CAAC,iBAAiB,CAAC,yBAAyB,EAAE,WAAW,CAAC,CAAC,iBAAiB,CAAC,2BAA2B,EAAE,aAAa,CAAC,CAAA;QAC9L,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAC3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAED,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,kBAAG,GAAE,CAAA;;6CAA3B,6CAAmB;;8DAErG;6BAlDU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,iCAAa,CAAC;GACX,kBAAkB,CAmD9B","sourcesContent":["import { Arg, Args, Ctx, Directive, Int, Query, Resolver } from 'type-graphql'\n\nimport { getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { findDeciderIds, reviewDecision, rolesGranting } from '../../controllers/access-request.js'\nimport { AccessRequest } from './access-request.js'\nimport { AccessDecisionInput, AccessDecisionIssue, AccessRequestList, AccessRoleCandidate } from './access-request-types.js'\n\n/* Reading the requests is reading who asks for what in this domain - the user screens' read privilege. */\nconst READ = '@privilege(category: \"user\", privilege: \"query\", domainOwnerGranted: true)'\n/* The review and the candidates serve a decision - the deciding declaration. */\nconst DECIDE = '@privilege(category: \"user\", privilege: \"mutation\", domainOwnerGranted: true)'\n\n@Resolver(AccessRequest)\nexport class AccessRequestQuery {\n @Directive(READ)\n @Query(returns => AccessRequestList, { description: \"To fetch this domain's access requests.\" })\n async accessRequests(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<AccessRequestList> {\n const { domain } = context.state\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: getRepository(AccessRequest),\n alias: 'accessRequest',\n searchables: ['category', 'privilege', 'reason']\n })\n queryBuilder.leftJoinAndSelect('accessRequest.requester', 'requester').leftJoinAndSelect('accessRequest.decidedBy', 'decidedBy').leftJoinAndSelect('accessRequest.grantedRole', 'grantedRole')\n const [items, total] = await queryBuilder.getManyAndCount()\n return { items, total }\n }\n\n /** Open by design: the caller's own requests - where they see what became of them. */\n @Query(returns => [AccessRequest], { description: \"To fetch the caller's own access requests in this domain, newest first.\" })\n async myAccessRequests(@Ctx() context: ResolverContext): Promise<AccessRequest[]> {\n const { domain, user } = context.state\n return await getRepository(AccessRequest).find({\n where: { domain: { id: domain.id }, requester: { id: user.id } },\n relations: ['grantedRole'],\n order: { createdAt: 'DESC' },\n take: 100\n })\n }\n\n /**\n * Open by design: how many people a request would reach - the popup says it before the person sends, so asking reads\n * as what it is. A number, never who.\n */\n @Query(returns => Int, { description: 'To count the people who would be told of an access request from the caller in this domain.' })\n async accessRequestDeciderCount(@Ctx() context: ResolverContext): Promise<number> {\n const { domain, user } = context.state\n return (await findDeciderIds(domain, user.id)).length\n }\n\n @Directive(DECIDE)\n @Query(returns => [AccessRoleCandidate], { description: 'To list the roles this domain can assign that grant a privilege, fewest privileges first.' })\n async rolesGranting(@Arg('category') category: string, @Arg('privilege') privilege: string, @Ctx() context: ResolverContext): Promise<AccessRoleCandidate[]> {\n return (await rolesGranting(category, privilege, context.state.domain)).map(({ id, name, privilegeCount }) => ({ id, name, privilegeCount }))\n }\n\n /** The same review the decision runs - the list screen and the AI draft card show this (ADR-0103 decision 4). */\n @Directive(DECIDE)\n @Query(returns => [AccessDecisionIssue], { description: 'To review a decision before it is made: what blocks it and what the person deciding should know.' })\n async reviewAccessDecision(@Arg('decision', type => AccessDecisionInput) decision: AccessDecisionInput, @Ctx() context: ResolverContext): Promise<AccessDecisionIssue[]> {\n return (await reviewDecision(decision as any, context)) as AccessDecisionIssue[]\n }\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AccessRequest } from './access-request.js';
|
|
2
|
+
export declare enum AccessDecision {
|
|
3
|
+
GRANT = "GRANT",
|
|
4
|
+
DENY = "DENY"
|
|
5
|
+
}
|
|
6
|
+
export declare class NewAccessRequest {
|
|
7
|
+
category: string;
|
|
8
|
+
privilege: string;
|
|
9
|
+
operationName?: string;
|
|
10
|
+
reason?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class AccessDecisionInput {
|
|
13
|
+
requestId: string;
|
|
14
|
+
decision: AccessDecision;
|
|
15
|
+
roleId?: string;
|
|
16
|
+
reason?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class AccessDecisionIssue {
|
|
19
|
+
code: string;
|
|
20
|
+
blocking: boolean;
|
|
21
|
+
field?: string;
|
|
22
|
+
params?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export declare class AccessRoleCandidate {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
privilegeCount: number;
|
|
28
|
+
}
|
|
29
|
+
export declare class AccessRequestList {
|
|
30
|
+
items: AccessRequest[];
|
|
31
|
+
total: number;
|
|
32
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccessRequestList = exports.AccessRoleCandidate = exports.AccessDecisionIssue = exports.AccessDecisionInput = exports.NewAccessRequest = exports.AccessDecision = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
7
|
+
const access_request_js_1 = require("./access-request.js");
|
|
8
|
+
var AccessDecision;
|
|
9
|
+
(function (AccessDecision) {
|
|
10
|
+
AccessDecision["GRANT"] = "GRANT";
|
|
11
|
+
AccessDecision["DENY"] = "DENY";
|
|
12
|
+
})(AccessDecision || (exports.AccessDecision = AccessDecision = {}));
|
|
13
|
+
(0, type_graphql_1.registerEnumType)(AccessDecision, {
|
|
14
|
+
name: 'AccessDecision',
|
|
15
|
+
description: 'What the person deciding an access request does: put the requester into a role, or deny with a reason.'
|
|
16
|
+
});
|
|
17
|
+
let NewAccessRequest = class NewAccessRequest {
|
|
18
|
+
};
|
|
19
|
+
exports.NewAccessRequest = NewAccessRequest;
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, type_graphql_1.Field)({ description: "The category of the refused privilege, from the refusal's extensions.requires." }),
|
|
22
|
+
tslib_1.__metadata("design:type", String)
|
|
23
|
+
], NewAccessRequest.prototype, "category", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, type_graphql_1.Field)({ description: "The refused privilege, from the refusal's extensions.requires." }),
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
27
|
+
], NewAccessRequest.prototype, "privilege", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The operation that was refused, shown to the person deciding.' }),
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
31
|
+
], NewAccessRequest.prototype, "operationName", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, type_graphql_1.Field)({ nullable: true, description: "The requester's reason." }),
|
|
34
|
+
tslib_1.__metadata("design:type", String)
|
|
35
|
+
], NewAccessRequest.prototype, "reason", void 0);
|
|
36
|
+
exports.NewAccessRequest = NewAccessRequest = tslib_1.__decorate([
|
|
37
|
+
(0, type_graphql_1.InputType)({ description: 'An access request for one privilege in this domain - what a refusal carried, and why it is needed.' })
|
|
38
|
+
], NewAccessRequest);
|
|
39
|
+
let AccessDecisionInput = class AccessDecisionInput {
|
|
40
|
+
};
|
|
41
|
+
exports.AccessDecisionInput = AccessDecisionInput;
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, type_graphql_1.Field)({ description: 'The access request decided.' }),
|
|
44
|
+
tslib_1.__metadata("design:type", String)
|
|
45
|
+
], AccessDecisionInput.prototype, "requestId", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, type_graphql_1.Field)(type => AccessDecision, { description: 'Grant or deny.' }),
|
|
48
|
+
tslib_1.__metadata("design:type", String)
|
|
49
|
+
], AccessDecisionInput.prototype, "decision", void 0);
|
|
50
|
+
tslib_1.__decorate([
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The role to put the requester into - required to grant, one this domain can assign that holds the privilege.' }),
|
|
52
|
+
tslib_1.__metadata("design:type", String)
|
|
53
|
+
], AccessDecisionInput.prototype, "roleId", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Why - required to deny.' }),
|
|
56
|
+
tslib_1.__metadata("design:type", String)
|
|
57
|
+
], AccessDecisionInput.prototype, "reason", void 0);
|
|
58
|
+
exports.AccessDecisionInput = AccessDecisionInput = tslib_1.__decorate([
|
|
59
|
+
(0, type_graphql_1.InputType)({ description: 'A decision on one access request.' })
|
|
60
|
+
], AccessDecisionInput);
|
|
61
|
+
let AccessDecisionIssue = class AccessDecisionIssue {
|
|
62
|
+
};
|
|
63
|
+
exports.AccessDecisionIssue = AccessDecisionIssue;
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, type_graphql_1.Field)({ description: 'What was found, as a code the screen words.' }),
|
|
66
|
+
tslib_1.__metadata("design:type", String)
|
|
67
|
+
], AccessDecisionIssue.prototype, "code", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, type_graphql_1.Field)({ description: 'Whether it keeps the decision from being made.' }),
|
|
70
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
71
|
+
], AccessDecisionIssue.prototype, "blocking", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The part of the decision it is about: request, decision, role or reason.' }),
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
75
|
+
], AccessDecisionIssue.prototype, "field", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'The values the sentence is built from.' }),
|
|
78
|
+
tslib_1.__metadata("design:type", Object)
|
|
79
|
+
], AccessDecisionIssue.prototype, "params", void 0);
|
|
80
|
+
exports.AccessDecisionIssue = AccessDecisionIssue = tslib_1.__decorate([
|
|
81
|
+
(0, type_graphql_1.ObjectType)({ description: 'One finding of the access decision review - blocking ones keep the decision from being made.' })
|
|
82
|
+
], AccessDecisionIssue);
|
|
83
|
+
let AccessRoleCandidate = class AccessRoleCandidate {
|
|
84
|
+
};
|
|
85
|
+
exports.AccessRoleCandidate = AccessRoleCandidate;
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, type_graphql_1.Field)({ description: 'The role id.' }),
|
|
88
|
+
tslib_1.__metadata("design:type", String)
|
|
89
|
+
], AccessRoleCandidate.prototype, "id", void 0);
|
|
90
|
+
tslib_1.__decorate([
|
|
91
|
+
(0, type_graphql_1.Field)({ description: 'The role name.' }),
|
|
92
|
+
tslib_1.__metadata("design:type", String)
|
|
93
|
+
], AccessRoleCandidate.prototype, "name", void 0);
|
|
94
|
+
tslib_1.__decorate([
|
|
95
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'How many privileges the role carries - fewer is closer to what was asked.' }),
|
|
96
|
+
tslib_1.__metadata("design:type", Number)
|
|
97
|
+
], AccessRoleCandidate.prototype, "privilegeCount", void 0);
|
|
98
|
+
exports.AccessRoleCandidate = AccessRoleCandidate = tslib_1.__decorate([
|
|
99
|
+
(0, type_graphql_1.ObjectType)({ description: 'A role this domain can assign that grants the asked privilege.' })
|
|
100
|
+
], AccessRoleCandidate);
|
|
101
|
+
let AccessRequestList = class AccessRequestList {
|
|
102
|
+
};
|
|
103
|
+
exports.AccessRequestList = AccessRequestList;
|
|
104
|
+
tslib_1.__decorate([
|
|
105
|
+
(0, type_graphql_1.Field)(type => [access_request_js_1.AccessRequest], { nullable: true, description: 'The access requests.' }),
|
|
106
|
+
tslib_1.__metadata("design:type", Array)
|
|
107
|
+
], AccessRequestList.prototype, "items", void 0);
|
|
108
|
+
tslib_1.__decorate([
|
|
109
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The total number of access requests.' }),
|
|
110
|
+
tslib_1.__metadata("design:type", Number)
|
|
111
|
+
], AccessRequestList.prototype, "total", void 0);
|
|
112
|
+
exports.AccessRequestList = AccessRequestList = tslib_1.__decorate([
|
|
113
|
+
(0, type_graphql_1.ObjectType)({ description: 'A paginated list of access requests.' })
|
|
114
|
+
], AccessRequestList);
|
|
115
|
+
//# sourceMappingURL=access-request-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-request-types.js","sourceRoot":"","sources":["../../../server/service/access-request/access-request-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAkF;AAClF,iDAAoD;AAEpD,2DAAmD;AAEnD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,IAAA,+BAAgB,EAAC,cAAc,EAAE;IAC/B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,wGAAwG;CACtH,CAAC,CAAA;AAGK,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAY5B,CAAA;AAZY,4CAAgB;AAE3B;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,gFAAgF,EAAE,CAAC;;kDACzF;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,gEAAgE,EAAE,CAAC;;mDACxE;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+DAA+D,EAAE,CAAC;;uDAClF;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;gDACnD;2BAXJ,gBAAgB;IAD5B,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,oGAAoG,EAAE,CAAC;GACpH,gBAAgB,CAY5B;AAGM,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAY/B,CAAA;AAZY,kDAAmB;AAE9B;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;sDACrC;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;;qDACzC;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EA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AAE,gEAAgE,EAAE,CAAC;GACjF,mBAAmB,CAS/B;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAM7B,CAAA;AANY,8CAAiB;AAE5B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,iCAAa,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;;gDAClE;AAGtB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;;gDAC/E;4BALF,iBAAiB;IAD7B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;GACvD,iBAAiB,CAM7B","sourcesContent":["import { Field, InputType, Int, ObjectType, registerEnumType } from 'type-graphql'\nimport { ScalarObject } from '@things-factory/shell'\n\nimport { AccessRequest } from './access-request.js'\n\nexport enum AccessDecision {\n GRANT = 'GRANT',\n DENY = 'DENY'\n}\n\nregisterEnumType(AccessDecision, {\n name: 'AccessDecision',\n description: 'What the person deciding an access request does: put the requester into a role, or deny with a reason.'\n})\n\n@InputType({ description: 'An access request for one privilege in this domain - what a refusal carried, and why it is needed.' })\nexport class NewAccessRequest {\n @Field({ description: \"The category of the refused privilege, from the refusal's extensions.requires.\" })\n category: string\n\n @Field({ description: \"The refused privilege, from the refusal's extensions.requires.\" })\n privilege: string\n\n @Field({ nullable: true, description: 'The operation that was refused, shown to the person deciding.' })\n operationName?: string\n\n @Field({ nullable: true, description: \"The requester's reason.\" })\n reason?: string\n}\n\n@InputType({ description: 'A decision on one access request.' })\nexport class AccessDecisionInput {\n @Field({ description: 'The access request decided.' })\n requestId: string\n\n @Field(type => AccessDecision, { description: 'Grant or deny.' })\n decision: AccessDecision\n\n @Field({ nullable: true, description: 'The role to put the requester into - required to grant, one this domain can assign that holds the privilege.' })\n roleId?: string\n\n @Field({ nullable: true, description: 'Why - required to deny.' })\n reason?: string\n}\n\n@ObjectType({ description: 'One finding of the access decision review - blocking ones keep the decision from being made.' })\nexport class AccessDecisionIssue {\n @Field({ description: 'What was found, as a code the screen words.' })\n code: string\n\n @Field({ description: 'Whether it keeps the decision from being made.' })\n blocking: boolean\n\n @Field({ nullable: true, description: 'The part of the decision it is about: request, decision, role or reason.' })\n field?: string\n\n @Field(type => ScalarObject, { nullable: true, description: 'The values the sentence is built from.' })\n params?: Record<string, unknown>\n}\n\n@ObjectType({ description: 'A role this domain can assign that grants the asked privilege.' })\nexport class AccessRoleCandidate {\n @Field({ description: 'The role id.' })\n id: string\n\n @Field({ description: 'The role name.' })\n name: string\n\n @Field(type => Int, { description: 'How many privileges the role carries - fewer is closer to what was asked.' })\n privilegeCount: number\n}\n\n@ObjectType({ description: 'A paginated list of access requests.' })\nexport class AccessRequestList {\n @Field(type => [AccessRequest], { nullable: true, description: 'The access requests.' })\n items: AccessRequest[]\n\n @Field(type => Int, { nullable: true, description: 'The total number of access requests.' })\n total: number\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { Role } from '../role/role.js';
|
|
3
|
+
import { User } from '../user/user.js';
|
|
4
|
+
export declare enum AccessRequestStatus {
|
|
5
|
+
PENDING = "PENDING",
|
|
6
|
+
GRANTED = "GRANTED",
|
|
7
|
+
DENIED = "DENIED",
|
|
8
|
+
WITHDRAWN = "WITHDRAWN",
|
|
9
|
+
EXPIRED = "EXPIRED"
|
|
10
|
+
}
|
|
11
|
+
export declare class AccessRequest {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
domain: Domain;
|
|
14
|
+
domainId: string;
|
|
15
|
+
requester: User;
|
|
16
|
+
requesterId: string;
|
|
17
|
+
category: string;
|
|
18
|
+
privilege: string;
|
|
19
|
+
operationName?: string;
|
|
20
|
+
reason?: string;
|
|
21
|
+
count: number;
|
|
22
|
+
lastRequestedAt?: Date;
|
|
23
|
+
state: AccessRequestStatus;
|
|
24
|
+
expiresAt?: Date;
|
|
25
|
+
decidedBy?: User;
|
|
26
|
+
decidedById?: string;
|
|
27
|
+
decidedAt?: Date;
|
|
28
|
+
decisionReason?: string;
|
|
29
|
+
grantedRole?: Role;
|
|
30
|
+
grantedRoleId?: string;
|
|
31
|
+
createdAt: Date;
|
|
32
|
+
updatedAt: Date;
|
|
33
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccessRequest = exports.AccessRequestStatus = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const env_1 = require("@things-factory/env");
|
|
8
|
+
const shell_1 = require("@things-factory/shell");
|
|
9
|
+
const role_js_1 = require("../role/role.js");
|
|
10
|
+
const user_js_1 = require("../user/user.js");
|
|
11
|
+
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
12
|
+
const DATABASE_TYPE = ORMCONFIG.type;
|
|
13
|
+
var AccessRequestStatus;
|
|
14
|
+
(function (AccessRequestStatus) {
|
|
15
|
+
AccessRequestStatus["PENDING"] = "PENDING";
|
|
16
|
+
AccessRequestStatus["GRANTED"] = "GRANTED";
|
|
17
|
+
AccessRequestStatus["DENIED"] = "DENIED";
|
|
18
|
+
AccessRequestStatus["WITHDRAWN"] = "WITHDRAWN";
|
|
19
|
+
AccessRequestStatus["EXPIRED"] = "EXPIRED";
|
|
20
|
+
})(AccessRequestStatus || (exports.AccessRequestStatus = AccessRequestStatus = {}));
|
|
21
|
+
(0, type_graphql_1.registerEnumType)(AccessRequestStatus, {
|
|
22
|
+
name: 'AccessRequestStatus',
|
|
23
|
+
description: 'Where an access request stands: waiting, granted, denied, withdrawn by the requester, or expired unanswered.'
|
|
24
|
+
});
|
|
25
|
+
/*
|
|
26
|
+
* A person refused for want of a role asks for the privilege (ADR-0103, docs/design/access-request.md).
|
|
27
|
+
*
|
|
28
|
+
* ── The row is the record ────────────────────────────────────────────────
|
|
29
|
+
* Who asked, for what, why, who decided, which role, why not - all here, and never deleted. A notification
|
|
30
|
+
* is a courtesy on top: it is not stored per person and does nothing where FCM is not set up.
|
|
31
|
+
*
|
|
32
|
+
* ── At most one pending per person and privilege ─────────────────────────
|
|
33
|
+
* Asking again bumps `count` and `lastRequestedAt` instead of adding a row. A partial unique index would say
|
|
34
|
+
* it and is not portable across the databases this framework supports, so it is held where the request is
|
|
35
|
+
* made (as `Invitation` does). The index below is for reading.
|
|
36
|
+
*/
|
|
37
|
+
let AccessRequest = class AccessRequest {
|
|
38
|
+
};
|
|
39
|
+
exports.AccessRequest = AccessRequest;
|
|
40
|
+
tslib_1.__decorate([
|
|
41
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
42
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for the access request.' }),
|
|
43
|
+
tslib_1.__metadata("design:type", String)
|
|
44
|
+
], AccessRequest.prototype, "id", void 0);
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
47
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { description: 'The domain the privilege is asked in.' }),
|
|
48
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
49
|
+
], AccessRequest.prototype, "domain", void 0);
|
|
50
|
+
tslib_1.__decorate([
|
|
51
|
+
(0, typeorm_1.RelationId)((request) => request.domain),
|
|
52
|
+
tslib_1.__metadata("design:type", String)
|
|
53
|
+
], AccessRequest.prototype, "domainId", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.ManyToOne)(type => user_js_1.User),
|
|
56
|
+
(0, type_graphql_1.Field)(type => user_js_1.User, { description: 'The person who asked.' }),
|
|
57
|
+
tslib_1.__metadata("design:type", user_js_1.User)
|
|
58
|
+
], AccessRequest.prototype, "requester", void 0);
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, typeorm_1.RelationId)((request) => request.requester),
|
|
61
|
+
tslib_1.__metadata("design:type", String)
|
|
62
|
+
], AccessRequest.prototype, "requesterId", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, typeorm_1.Column)(),
|
|
65
|
+
(0, type_graphql_1.Field)({ description: 'The category of the privilege asked for, as the refusal carried it.' }),
|
|
66
|
+
tslib_1.__metadata("design:type", String)
|
|
67
|
+
], AccessRequest.prototype, "category", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, typeorm_1.Column)(),
|
|
70
|
+
(0, type_graphql_1.Field)({ description: 'The privilege asked for, as the refusal carried it.' }),
|
|
71
|
+
tslib_1.__metadata("design:type", String)
|
|
72
|
+
], AccessRequest.prototype, "privilege", void 0);
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
75
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The operation that was refused - shown to the person deciding.' }),
|
|
76
|
+
tslib_1.__metadata("design:type", String)
|
|
77
|
+
], AccessRequest.prototype, "operationName", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
80
|
+
(0, type_graphql_1.Field)({ nullable: true, description: "The requester's reason." }),
|
|
81
|
+
tslib_1.__metadata("design:type", String)
|
|
82
|
+
], AccessRequest.prototype, "reason", void 0);
|
|
83
|
+
tslib_1.__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({ type: 'int', default: 1 }),
|
|
85
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'How many times it was asked while pending.' }),
|
|
86
|
+
tslib_1.__metadata("design:type", Number)
|
|
87
|
+
], AccessRequest.prototype, "count", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
90
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was last asked.' }),
|
|
91
|
+
tslib_1.__metadata("design:type", Date
|
|
92
|
+
/* The same column shape as Invitation.status - an enum where the database has one, a string elsewhere. */
|
|
93
|
+
)
|
|
94
|
+
], AccessRequest.prototype, "lastRequestedAt", void 0);
|
|
95
|
+
tslib_1.__decorate([
|
|
96
|
+
(0, typeorm_1.Column)({
|
|
97
|
+
type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
98
|
+
? 'enum'
|
|
99
|
+
: DATABASE_TYPE == 'oracle'
|
|
100
|
+
? 'varchar2'
|
|
101
|
+
: DATABASE_TYPE == 'mssql'
|
|
102
|
+
? 'nvarchar'
|
|
103
|
+
: 'varchar',
|
|
104
|
+
enum: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? AccessRequestStatus : undefined,
|
|
105
|
+
length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 32,
|
|
106
|
+
default: AccessRequestStatus.PENDING
|
|
107
|
+
}),
|
|
108
|
+
(0, type_graphql_1.Field)(type => AccessRequestStatus, { description: 'Where the request stands.' }),
|
|
109
|
+
tslib_1.__metadata("design:type", String)
|
|
110
|
+
], AccessRequest.prototype, "state", void 0);
|
|
111
|
+
tslib_1.__decorate([
|
|
112
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
113
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When a pending request expires unanswered.' }),
|
|
114
|
+
tslib_1.__metadata("design:type", Date)
|
|
115
|
+
], AccessRequest.prototype, "expiresAt", void 0);
|
|
116
|
+
tslib_1.__decorate([
|
|
117
|
+
(0, typeorm_1.ManyToOne)(type => user_js_1.User, { nullable: true }),
|
|
118
|
+
(0, type_graphql_1.Field)(type => user_js_1.User, { nullable: true, description: 'Who decided it.' }),
|
|
119
|
+
tslib_1.__metadata("design:type", user_js_1.User)
|
|
120
|
+
], AccessRequest.prototype, "decidedBy", void 0);
|
|
121
|
+
tslib_1.__decorate([
|
|
122
|
+
(0, typeorm_1.RelationId)((request) => request.decidedBy),
|
|
123
|
+
tslib_1.__metadata("design:type", String)
|
|
124
|
+
], AccessRequest.prototype, "decidedById", void 0);
|
|
125
|
+
tslib_1.__decorate([
|
|
126
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
127
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was decided.' }),
|
|
128
|
+
tslib_1.__metadata("design:type", Date)
|
|
129
|
+
], AccessRequest.prototype, "decidedAt", void 0);
|
|
130
|
+
tslib_1.__decorate([
|
|
131
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
132
|
+
(0, type_graphql_1.Field)({ nullable: true, description: "The decider's reason - required to deny." }),
|
|
133
|
+
tslib_1.__metadata("design:type", String)
|
|
134
|
+
], AccessRequest.prototype, "decisionReason", void 0);
|
|
135
|
+
tslib_1.__decorate([
|
|
136
|
+
(0, typeorm_1.ManyToOne)(type => role_js_1.Role, { nullable: true }),
|
|
137
|
+
(0, type_graphql_1.Field)(type => role_js_1.Role, { nullable: true, description: 'The role the requester was put into.' }),
|
|
138
|
+
tslib_1.__metadata("design:type", role_js_1.Role)
|
|
139
|
+
], AccessRequest.prototype, "grantedRole", void 0);
|
|
140
|
+
tslib_1.__decorate([
|
|
141
|
+
(0, typeorm_1.RelationId)((request) => request.grantedRole),
|
|
142
|
+
tslib_1.__metadata("design:type", String)
|
|
143
|
+
], AccessRequest.prototype, "grantedRoleId", void 0);
|
|
144
|
+
tslib_1.__decorate([
|
|
145
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
146
|
+
(0, type_graphql_1.Field)({ description: 'When it was first asked.' }),
|
|
147
|
+
tslib_1.__metadata("design:type", Date)
|
|
148
|
+
], AccessRequest.prototype, "createdAt", void 0);
|
|
149
|
+
tslib_1.__decorate([
|
|
150
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
151
|
+
(0, type_graphql_1.Field)({ description: 'When it last changed.' }),
|
|
152
|
+
tslib_1.__metadata("design:type", Date)
|
|
153
|
+
], AccessRequest.prototype, "updatedAt", void 0);
|
|
154
|
+
exports.AccessRequest = AccessRequest = tslib_1.__decorate([
|
|
155
|
+
(0, typeorm_1.Entity)(),
|
|
156
|
+
(0, typeorm_1.Index)('ix_access_request_0', (request) => [request.domain, request.state]),
|
|
157
|
+
(0, typeorm_1.Index)('ix_access_request_1', (request) => [request.domain, request.requester, request.category, request.privilege]),
|
|
158
|
+
(0, type_graphql_1.ObjectType)({ description: 'A request by a person refused for want of a role, for one privilege in this domain.' })
|
|
159
|
+
], AccessRequest);
|
|
160
|
+
//# sourceMappingURL=access-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-request.js","sourceRoot":"","sources":["../../../server/service/access-request/access-request.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAA2E;AAE3E,6CAA4C;AAC5C,iDAA8C;AAE9C,6CAAsC;AACtC,6CAAsC;AAEtC,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAEpC,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;IACnB,wCAAiB,CAAA;IACjB,8CAAuB,CAAA;IACvB,0CAAmB,CAAA;AACrB,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B;AAED,IAAA,+BAAgB,EAAC,mBAAmB,EAAE;IACpC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,8GAA8G;CAC5H,CAAC,CAAA;AAEF;;;;;;;;;;;GAWG;AAKI,IAAM,aAAa,GAAnB,MAAM,aAAa;CA8FzB,CAA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AE,0BAA0B,EAAE,CAAC;sCACxC,IAAI;gDAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;sCACrC,IAAI;gDAAA;wBA7FJ,aAAa;IAJzB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,OAAsB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACzF,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,OAAsB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAClI,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qFAAqF,EAAE,CAAC;GACtG,aAAa,CA8FzB","sourcesContent":["import {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\nimport { Field, ID, Int, ObjectType, registerEnumType } from 'type-graphql'\n\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { Role } from '../role/role.js'\nimport { User } from '../user/user.js'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\nexport enum AccessRequestStatus {\n PENDING = 'PENDING',\n GRANTED = 'GRANTED',\n DENIED = 'DENIED',\n WITHDRAWN = 'WITHDRAWN',\n EXPIRED = 'EXPIRED'\n}\n\nregisterEnumType(AccessRequestStatus, {\n name: 'AccessRequestStatus',\n description: 'Where an access request stands: waiting, granted, denied, withdrawn by the requester, or expired unanswered.'\n})\n\n/*\n * A person refused for want of a role asks for the privilege (ADR-0103, docs/design/access-request.md).\n *\n * ── The row is the record ────────────────────────────────────────────────\n * Who asked, for what, why, who decided, which role, why not - all here, and never deleted. A notification\n * is a courtesy on top: it is not stored per person and does nothing where FCM is not set up.\n *\n * ── At most one pending per person and privilege ─────────────────────────\n * Asking again bumps `count` and `lastRequestedAt` instead of adding a row. A partial unique index would say\n * it and is not portable across the databases this framework supports, so it is held where the request is\n * made (as `Invitation` does). The index below is for reading.\n */\n@Entity()\n@Index('ix_access_request_0', (request: AccessRequest) => [request.domain, request.state])\n@Index('ix_access_request_1', (request: AccessRequest) => [request.domain, request.requester, request.category, request.privilege])\n@ObjectType({ description: 'A request by a person refused for want of a role, for one privilege in this domain.' })\nexport class AccessRequest {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the access request.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { description: 'The domain the privilege is asked in.' })\n domain: Domain\n\n @RelationId((request: AccessRequest) => request.domain)\n domainId: string\n\n @ManyToOne(type => User)\n @Field(type => User, { description: 'The person who asked.' })\n requester: User\n\n @RelationId((request: AccessRequest) => request.requester)\n requesterId: string\n\n @Column()\n @Field({ description: 'The category of the privilege asked for, as the refusal carried it.' })\n category: string\n\n @Column()\n @Field({ description: 'The privilege asked for, as the refusal carried it.' })\n privilege: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The operation that was refused - shown to the person deciding.' })\n operationName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"The requester's reason.\" })\n reason?: string\n\n @Column({ type: 'int', default: 1 })\n @Field(type => Int, { description: 'How many times it was asked while pending.' })\n count: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'When it was last asked.' })\n lastRequestedAt?: Date\n\n /* The same column shape as Invitation.status - an enum where the database has one, a string elsewhere. */\n @Column({\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n enum:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? AccessRequestStatus : undefined,\n length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 32,\n default: AccessRequestStatus.PENDING\n })\n @Field(type => AccessRequestStatus, { description: 'Where the request stands.' })\n state: AccessRequestStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'When a pending request expires unanswered.' })\n expiresAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who decided it.' })\n decidedBy?: User\n\n @RelationId((request: AccessRequest) => request.decidedBy)\n decidedById?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'When it was decided.' })\n decidedAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"The decider's reason - required to deny.\" })\n decisionReason?: string\n\n @ManyToOne(type => Role, { nullable: true })\n @Field(type => Role, { nullable: true, description: 'The role the requester was put into.' })\n grantedRole?: Role\n\n @RelationId((request: AccessRequest) => request.grantedRole)\n grantedRoleId?: string\n\n @CreateDateColumn()\n @Field({ description: 'When it was first asked.' })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ description: 'When it last changed.' })\n updatedAt: Date\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AccessRequest } from './access-request.js';
|
|
2
|
+
import { AccessRequestMutation } from './access-request-mutation.js';
|
|
3
|
+
import { AccessRequestQuery } from './access-request-query.js';
|
|
4
|
+
export declare const entities: (typeof AccessRequest)[];
|
|
5
|
+
export declare const resolvers: (typeof AccessRequestQuery | typeof AccessRequestMutation)[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const access_request_js_1 = require("./access-request.js");
|
|
5
|
+
const access_request_mutation_js_1 = require("./access-request-mutation.js");
|
|
6
|
+
const access_request_query_js_1 = require("./access-request-query.js");
|
|
7
|
+
exports.entities = [access_request_js_1.AccessRequest];
|
|
8
|
+
exports.resolvers = [access_request_query_js_1.AccessRequestQuery, access_request_mutation_js_1.AccessRequestMutation];
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/access-request/index.ts"],"names":[],"mappings":";;;AAAA,2DAAmD;AACnD,6EAAoE;AACpE,uEAA8D;AAEjD,QAAA,QAAQ,GAAG,CAAC,iCAAa,CAAC,CAAA;AAC1B,QAAA,SAAS,GAAG,CAAC,4CAAkB,EAAE,kDAAqB,CAAC,CAAA","sourcesContent":["import { AccessRequest } from './access-request.js'\nimport { AccessRequestMutation } from './access-request-mutation.js'\nimport { AccessRequestQuery } from './access-request-query.js'\n\nexport const entities = [AccessRequest]\nexport const resolvers = [AccessRequestQuery, AccessRequestMutation]\n"]}
|
|
@@ -20,6 +20,7 @@ export * from './login-history/login-history.js';
|
|
|
20
20
|
export * from './web-auth-credential/web-auth-credential.js';
|
|
21
21
|
export * from './domain-link/domain-link.js';
|
|
22
22
|
export * from './domain-owner/domain-owner.js';
|
|
23
|
+
export * from './access-request/access-request.js';
|
|
23
24
|
export * from './app-binding/app-binding-types.js';
|
|
24
25
|
export * from './appliance/appliance-types.js';
|
|
25
26
|
export * from './application/application-types.js';
|
|
@@ -30,7 +31,8 @@ export * from './privilege/privilege-types.js';
|
|
|
30
31
|
export * from './role/role-types.js';
|
|
31
32
|
export * from './user/user-types.js';
|
|
32
33
|
export * from './domain-link/domain-link-types.js';
|
|
33
|
-
export
|
|
34
|
+
export * from './access-request/access-request-types.js';
|
|
35
|
+
export declare const entities: (typeof import("./access-request/access-request.js").AccessRequest | typeof import("./role/role.js").Role | typeof import("./privilege/privilege.js").Privilege | typeof import("./user/user.js").User | typeof import("./users-auth-providers/users-auth-providers.js").UsersAuthProviders | typeof import("./auth-provider/auth-provider.js").AuthProvider | typeof import("./application/application.js").Application | typeof import("./appliance/appliance.js").Appliance | typeof import("./partner/partner.js").Partner | typeof import("./granted-role/granted-role.js").GrantedRole | typeof import("./invitation/invitation.js").Invitation | typeof import("./password-history/password-history.js").PasswordHistory | typeof import("./verification-token/verification-token.js").VerificationToken | typeof import("./verification-token/verification-token.js").VerificationTokenType | typeof import("./login-history/login-history.js").LoginHistory | typeof import("./web-auth-credential/web-auth-credential.js").WebAuthCredential | typeof import("./domain-link/domain-link.js").DomainLink | typeof import("./domain-owner/domain-owner.js").DomainOwner)[];
|
|
34
36
|
export declare const schema: {
|
|
35
37
|
typeDefs: {
|
|
36
38
|
privilegeDirectiveTypeDefs: import("graphql").DocumentNode;
|