@things-factory/auth-base 10.1.79 → 10.1.106
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/controllers/access-request.d.ts +53 -0
- package/dist-server/controllers/access-request.js +333 -0
- package/dist-server/controllers/access-request.js.map +1 -0
- 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 +11 -0
- package/dist-server/service/access-request/access-request-query.js +85 -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 +4 -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 +8 -2
- package/dist-server/service/privilege/privilege-rejection.js +27 -6
- 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-request-db.test.ts +236 -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 +21 -0
- package/tests/privilege-rejection.test.ts +32 -0
- package/tests/refusal-cause.test.ts +80 -0
- package/translations/en.json +26 -1
- package/translations/ja.json +26 -1
- package/translations/ko.json +26 -1
- package/translations/ms.json +26 -1
- package/translations/zh.json +26 -1
|
@@ -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;I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AAE,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,CAAA;AA9FY,sCAAa;AAGf;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;;yCAC7D;AAInB;IAFC,IAAA,mBAAS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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("./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("./privilege/privilege.js").Privilege | typeof import("./role/role.js").Role | typeof import("./user/user.js").User | 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;
|
|
@@ -3,27 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.schema = exports.entities = exports.privilegeOfField = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/* IMPORT ENTITIES AND RESOLVERS */
|
|
6
|
-
const index_js_1 = require("./
|
|
7
|
-
const index_js_2 = require("./auth-
|
|
8
|
-
const index_js_3 = require("./
|
|
9
|
-
const index_js_4 = require("./
|
|
10
|
-
const index_js_5 = require("./
|
|
11
|
-
const index_js_6 = require("./
|
|
12
|
-
const index_js_7 = require("./
|
|
13
|
-
const index_js_8 = require("./
|
|
14
|
-
const index_js_9 = require("./
|
|
15
|
-
const index_js_10 = require("./
|
|
16
|
-
const index_js_11 = require("./
|
|
17
|
-
const index_js_12 = require("./
|
|
6
|
+
const index_js_1 = require("./access-request/index.js");
|
|
7
|
+
const index_js_2 = require("./users-auth-providers/index.js");
|
|
8
|
+
const index_js_3 = require("./auth-provider/index.js");
|
|
9
|
+
const index_js_4 = require("./app-binding/index.js");
|
|
10
|
+
const index_js_5 = require("./appliance/index.js");
|
|
11
|
+
const index_js_6 = require("./application/index.js");
|
|
12
|
+
const index_js_7 = require("./domain-generator/index.js");
|
|
13
|
+
const index_js_8 = require("./granted-role/index.js");
|
|
14
|
+
const index_js_9 = require("./invitation/index.js");
|
|
15
|
+
const index_js_10 = require("./login-history/index.js");
|
|
16
|
+
const index_js_11 = require("./partner/index.js");
|
|
17
|
+
const index_js_12 = require("./password-history/index.js");
|
|
18
|
+
const index_js_13 = require("./privilege/index.js");
|
|
18
19
|
const privilege_directive_js_1 = require("./privilege/privilege-directive.js");
|
|
19
20
|
const open_fields_js_1 = require("./open-fields.js");
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
21
|
+
const index_js_14 = require("./role/index.js");
|
|
22
|
+
const index_js_15 = require("./role-template/index.js");
|
|
23
|
+
const index_js_16 = require("./user/index.js");
|
|
24
|
+
const index_js_17 = require("./verification-token/index.js");
|
|
25
|
+
const index_js_18 = require("./web-auth-credential/index.js");
|
|
26
|
+
const index_js_19 = require("./domain-link/index.js");
|
|
27
|
+
const index_js_20 = require("./domain-owner/index.js");
|
|
27
28
|
/* EXPORT ENTITY TYPES */
|
|
28
29
|
tslib_1.__exportStar(require("./users-auth-providers/users-auth-providers.js"), exports);
|
|
29
30
|
tslib_1.__exportStar(require("./auth-provider/auth-provider.js"), exports);
|
|
@@ -48,6 +49,7 @@ tslib_1.__exportStar(require("./login-history/login-history.js"), exports);
|
|
|
48
49
|
tslib_1.__exportStar(require("./web-auth-credential/web-auth-credential.js"), exports);
|
|
49
50
|
tslib_1.__exportStar(require("./domain-link/domain-link.js"), exports);
|
|
50
51
|
tslib_1.__exportStar(require("./domain-owner/domain-owner.js"), exports);
|
|
52
|
+
tslib_1.__exportStar(require("./access-request/access-request.js"), exports);
|
|
51
53
|
/* EXPORT TYPES */
|
|
52
54
|
tslib_1.__exportStar(require("./app-binding/app-binding-types.js"), exports);
|
|
53
55
|
tslib_1.__exportStar(require("./appliance/appliance-types.js"), exports);
|
|
@@ -59,24 +61,26 @@ tslib_1.__exportStar(require("./privilege/privilege-types.js"), exports);
|
|
|
59
61
|
tslib_1.__exportStar(require("./role/role-types.js"), exports);
|
|
60
62
|
tslib_1.__exportStar(require("./user/user-types.js"), exports);
|
|
61
63
|
tslib_1.__exportStar(require("./domain-link/domain-link-types.js"), exports);
|
|
64
|
+
tslib_1.__exportStar(require("./access-request/access-request-types.js"), exports);
|
|
62
65
|
exports.entities = [
|
|
63
66
|
/* ENTITIES */
|
|
64
|
-
...index_js_1.entities,
|
|
65
67
|
...index_js_2.entities,
|
|
68
|
+
...index_js_3.entities,
|
|
69
|
+
...index_js_6.entities,
|
|
66
70
|
...index_js_5.entities,
|
|
67
|
-
...index_js_4.entities,
|
|
68
|
-
...index_js_12.entities,
|
|
69
71
|
...index_js_13.entities,
|
|
70
|
-
...
|
|
71
|
-
...index_js_10.entities,
|
|
72
|
-
...index_js_7.entities,
|
|
73
|
-
...index_js_8.entities,
|
|
74
|
-
...index_js_11.entities,
|
|
72
|
+
...index_js_14.entities,
|
|
75
73
|
...index_js_16.entities,
|
|
74
|
+
...index_js_11.entities,
|
|
75
|
+
...index_js_8.entities,
|
|
76
76
|
...index_js_9.entities,
|
|
77
|
+
...index_js_12.entities,
|
|
77
78
|
...index_js_17.entities,
|
|
79
|
+
...index_js_10.entities,
|
|
78
80
|
...index_js_18.entities,
|
|
79
|
-
...index_js_19.entities
|
|
81
|
+
...index_js_19.entities,
|
|
82
|
+
...index_js_20.entities,
|
|
83
|
+
...index_js_1.entities
|
|
80
84
|
];
|
|
81
85
|
exports.schema = {
|
|
82
86
|
typeDefs: {
|
|
@@ -86,22 +90,23 @@ exports.schema = {
|
|
|
86
90
|
openFields: open_fields_js_1.openFields,
|
|
87
91
|
resolverClasses: [
|
|
88
92
|
/* RESOLVER CLASSES */
|
|
89
|
-
...index_js_1.resolvers,
|
|
90
93
|
...index_js_2.resolvers,
|
|
94
|
+
...index_js_3.resolvers,
|
|
95
|
+
...index_js_6.resolvers,
|
|
91
96
|
...index_js_5.resolvers,
|
|
92
|
-
...index_js_4.resolvers,
|
|
93
|
-
...index_js_12.resolvers,
|
|
94
97
|
...index_js_13.resolvers,
|
|
95
98
|
...index_js_14.resolvers,
|
|
96
99
|
...index_js_15.resolvers,
|
|
97
|
-
...
|
|
98
|
-
...
|
|
100
|
+
...index_js_16.resolvers,
|
|
101
|
+
...index_js_11.resolvers,
|
|
99
102
|
...index_js_8.resolvers,
|
|
100
|
-
...index_js_3.resolvers,
|
|
101
|
-
...index_js_6.resolvers,
|
|
102
103
|
...index_js_9.resolvers,
|
|
103
|
-
...
|
|
104
|
-
...
|
|
104
|
+
...index_js_4.resolvers,
|
|
105
|
+
...index_js_7.resolvers,
|
|
106
|
+
...index_js_10.resolvers,
|
|
107
|
+
...index_js_19.resolvers,
|
|
108
|
+
...index_js_20.resolvers,
|
|
109
|
+
...index_js_1.resolvers
|
|
105
110
|
],
|
|
106
111
|
directives: {
|
|
107
112
|
privilege: privilege_directive_js_1.privilegeDirectiveResolver
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,mCAAmC;AACnC,8DAGwC;AACxC,uDAA+G;AAC/G,qDAAwE;AACxE,mDAAqG;AACrG,qDAA2G;AAC3G,0DAAkF;AAClF,sDAA2G;AAC3G,oDAAuG;AACvG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,mCAAmC;AACnC,wDAAkH;AAClH,8DAGwC;AACxC,uDAA+G;AAC/G,qDAAwE;AACxE,mDAAqG;AACrG,qDAA2G;AAC3G,0DAAkF;AAClF,sDAA2G;AAC3G,oDAAuG;AACvG,wDAA8G;AAC9G,kDAA+F;AAC/F,2DAAiF;AACjF,oDAAqG;AACrG,+EAA2G;AAC3G,qDAA6C;AAC7C,+CAAsF;AACtF,wDAA6E;AAC7E,+CAAsF;AACtF,6DAAqF;AACrF,8DAAsF;AACtF,sDAAwG;AACxG,uDAA4G;AAE5G,yBAAyB;AACzB,yFAA8D;AAC9D,2EAAgD;AAChD,uEAA4C;AAC5C,mEAAwC;AACxC,mEAAwC;AACxC,yDAA8B;AAC9B,wEAA6C;AAC7C,gHAAgH;AACh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,oBAAuB;QAC1B,GAAG,qBAAoB;QACvB,GAAG,qBAAkB;QACrB,GAAG,qBAAoB;QACvB,GAAG,oBAAsB;KAC1B;IACD,UAAU,EAAE;QACV,SAAS,EAAE,mDAA0B;KACtC;CACF,CAAA","sourcesContent":["/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as AccessRequestEntities, resolvers as AccessRequestResolvers } from './access-request/index.js'\nimport {\n entities as UsersAuthProvidersEntities,\n resolvers as UsersAuthProvidersResolvers\n} from './users-auth-providers/index.js'\nimport { entities as AuthProviderEntities, resolvers as AuthProviderResolvers } from './auth-provider/index.js'\nimport { resolvers as AppbindingResolver } from './app-binding/index.js'\nimport { entities as ApplianceEntities, resolvers as ApplianceResolvers } from './appliance/index.js'\nimport { entities as ApplicationEntities, resolvers as ApplicationResolvers } from './application/index.js'\nimport { resolvers as DomainGeneratorResolver } from './domain-generator/index.js'\nimport { entities as GrantedRoleEntities, resolvers as GrantedRoleResolver } from './granted-role/index.js'\nimport { entities as InvitationEntities, resolvers as InvitationResolver } from './invitation/index.js'\nimport { entities as LoginHistoryEntities, resolvers as LoginHistoryResolver } from './login-history/index.js'\nimport { entities as PartnerEntities, resolvers as PartnerResolvers } from './partner/index.js'\nimport { entities as PasswordHistoryEntities } from './password-history/index.js'\nimport { entities as PrivilegeEntities, resolvers as PrivilegeResolvers } from './privilege/index.js'\nimport { privilegeDirectiveResolver, privilegeDirectiveTypeDefs } from './privilege/privilege-directive.js'\nimport { openFields } from './open-fields.js'\nimport { entities as RoleEntities, resolvers as RoleResolvers } from './role/index.js'\nimport { resolvers as RoleTemplateResolvers } from './role-template/index.js'\nimport { entities as UserEntities, resolvers as UserResolvers } from './user/index.js'\nimport { entities as VerificationTokenEntities } from './verification-token/index.js'\nimport { entities as WebAuthCredentialEntities } from './web-auth-credential/index.js'\nimport { entities as DomainLinkEntities, resolvers as DomainLinkResolver } from './domain-link/index.js'\nimport { entities as DomainOwnerEntities, resolvers as DomainOwnerResolvers } from './domain-owner/index.js'\n\n/* EXPORT ENTITY TYPES */\nexport * from './users-auth-providers/users-auth-providers.js'\nexport * from './auth-provider/auth-provider.js'\nexport * from './application/application.js'\nexport * from './appliance/appliance.js'\nexport * from './privilege/privilege.js'\nexport * from './role/role.js'\nexport * from './privilege/privilege-axis.js'\n/* What a field asks for, by name — for another entrance to the same door (operato-twin ADR-0072 decision 5). */\nexport { privilegeOfField, type FieldGate } from './privilege/privilege-directive.js'\n/* How a module declares the fields it leaves open — see `privilege/open-field-rule.ts`. */\nexport { type OpenFieldsDeclaration } from './privilege/open-field-rule.js'\nexport * from './role-template/role-template.js'\nexport * from './role-template/role-template-types.js'\nexport * from './user/user.js'\nexport * from './partner/partner.js'\nexport * from './granted-role/granted-role.js'\nexport * from './invitation/invitation.js'\nexport * from './app-binding/app-binding.js'\nexport * from './password-history/password-history.js'\nexport * from './verification-token/verification-token.js'\nexport * from './login-history/login-history.js'\nexport * from './web-auth-credential/web-auth-credential.js'\nexport * from './domain-link/domain-link.js'\nexport * from './domain-owner/domain-owner.js'\nexport * from './access-request/access-request.js'\n\n/* EXPORT TYPES */\nexport * from './app-binding/app-binding-types.js'\nexport * from './appliance/appliance-types.js'\nexport * from './application/application-types.js'\nexport * from './domain-generator/domain-generator-types.js'\nexport * from './invitation/invitation-types.js'\nexport * from './partner/partner-types.js'\nexport * from './privilege/privilege-types.js'\nexport * from './role/role-types.js'\nexport * from './user/user-types.js'\nexport * from './domain-link/domain-link-types.js'\nexport * from './access-request/access-request-types.js'\n\nexport const entities = [\n /* ENTITIES */\n ...UsersAuthProvidersEntities,\n ...AuthProviderEntities,\n ...ApplicationEntities,\n ...ApplianceEntities,\n ...PrivilegeEntities,\n ...RoleEntities,\n ...UserEntities,\n ...PartnerEntities,\n ...GrantedRoleEntities,\n ...InvitationEntities,\n ...PasswordHistoryEntities,\n ...VerificationTokenEntities,\n ...LoginHistoryEntities,\n ...WebAuthCredentialEntities,\n ...DomainLinkEntities,\n ...DomainOwnerEntities,\n ...AccessRequestEntities\n]\n\nexport const schema = {\n typeDefs: {\n privilegeDirectiveTypeDefs\n },\n\n /* The fields that carry no @privilege, and why — `open-fields.ts`, read by the directive. */\n openFields,\n\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...UsersAuthProvidersResolvers,\n ...AuthProviderResolvers,\n ...ApplicationResolvers,\n ...ApplianceResolvers,\n ...PrivilegeResolvers,\n ...RoleResolvers,\n ...RoleTemplateResolvers,\n ...UserResolvers,\n ...PartnerResolvers,\n ...GrantedRoleResolver,\n ...InvitationResolver,\n ...AppbindingResolver,\n ...DomainGeneratorResolver,\n ...LoginHistoryResolver,\n ...DomainLinkResolver,\n ...DomainOwnerResolvers,\n ...AccessRequestResolvers\n ],\n directives: {\n privilege: privilegeDirectiveResolver\n }\n}\n"]}
|
|
@@ -18,7 +18,10 @@ exports.openFields = {
|
|
|
18
18
|
'Query.checkResettablePasswordToDefault': "about the caller's own password",
|
|
19
19
|
'Query.checkDefaultPassword': 'whether the caller is still on the default password',
|
|
20
20
|
'Query.passwordRule': "the installation's password policy. The change-password screen needs it before the caller has any privilege — and after a forced reset they may have none",
|
|
21
|
-
'Query.authProviderTypes': "which provider types this build supports. A catalogue, not a tenant's configuration"
|
|
21
|
+
'Query.authProviderTypes': "which provider types this build supports. A catalogue, not a tenant's configuration",
|
|
22
|
+
'Query.myAccessRequests': "the caller's own access requests",
|
|
23
|
+
'Mutation.requestAccess': 'asked by someone refused for want of a role - a gate here would need the privilege being asked for. The door asks only for the caller and judges again that a role would open it (ADR-0103)',
|
|
24
|
+
'Mutation.withdrawAccessRequest': "withdraws the caller's own pending request and nobody else's"
|
|
22
25
|
}
|
|
23
26
|
};
|
|
24
27
|
//# sourceMappingURL=open-fields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-fields.js","sourceRoot":"","sources":["../../server/service/open-fields.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACU,QAAA,UAAU,GAA0B;IAC/C,QAAQ,EAAE;QACR,wBAAwB,EAAE,2BAA2B;QACrD,eAAe,EAAE,wBAAwB;QACzC,oBAAoB,EAAE,0EAA0E;QAChG,4BAA4B,EAAE,sCAAsC;QACpE,8BAA8B,EAAE,2CAA2C;QAC3E,wCAAwC,EAAE,iCAAiC;QAC3E,4BAA4B,EAAE,qDAAqD;QACnF,oBAAoB,EAClB,2JAA2J;QAC7J,yBAAyB,EAAE,qFAAqF;
|
|
1
|
+
{"version":3,"file":"open-fields.js","sourceRoot":"","sources":["../../server/service/open-fields.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACU,QAAA,UAAU,GAA0B;IAC/C,QAAQ,EAAE;QACR,wBAAwB,EAAE,2BAA2B;QACrD,eAAe,EAAE,wBAAwB;QACzC,oBAAoB,EAAE,0EAA0E;QAChG,4BAA4B,EAAE,sCAAsC;QACpE,8BAA8B,EAAE,2CAA2C;QAC3E,wCAAwC,EAAE,iCAAiC;QAC3E,4BAA4B,EAAE,qDAAqD;QACnF,oBAAoB,EAClB,2JAA2J;QAC7J,yBAAyB,EAAE,qFAAqF;QAChH,wBAAwB,EAAE,kCAAkC;QAC5D,wBAAwB,EACtB,6LAA6L;QAC/L,gCAAgC,EAAE,8DAA8D;KACjG;CACF,CAAA","sourcesContent":["import type { OpenFieldsDeclaration } from './privilege/open-field-rule.js'\n\n/**\n * auth-base's root fields that declare no `@privilege` — every one of them, and why.\n *\n * There is no `notYetDeclared` here. The twelve that were open without a reason were closed on\n * 2026-09-20 (`c02ee9bdc1`); what is left answers about the caller, or about the installation\n * rather than anybody's data. An addition to this list needs its reason written first.\n */\nexport const openFields: OpenFieldsDeclaration = {\n byDesign: {\n 'Query.myLoginHistories': \"the caller's own sign-ins\",\n 'Query.myRoles': \"the caller's own roles\",\n 'Query.hasPrivilege': 'whether the caller has one — a gate here would need the answer to itself',\n 'Query.domainsWithPrivilege': 'the domains where the caller has one',\n 'Query.checkUserBelongsDomain': 'whether the caller belongs to this domain',\n 'Query.checkResettablePasswordToDefault': \"about the caller's own password\",\n 'Query.checkDefaultPassword': 'whether the caller is still on the default password',\n 'Query.passwordRule':\n \"the installation's password policy. The change-password screen needs it before the caller has any privilege — and after a forced reset they may have none\",\n 'Query.authProviderTypes': \"which provider types this build supports. A catalogue, not a tenant's configuration\",\n 'Query.myAccessRequests': \"the caller's own access requests\",\n 'Mutation.requestAccess':\n 'asked by someone refused for want of a role - a gate here would need the privilege being asked for. The door asks only for the caller and judges again that a role would open it (ADR-0103)',\n 'Mutation.withdrawAccessRequest': \"withdraws the caller's own pending request and nobody else's\"\n }\n}\n"]}
|