@drodil/backstage-plugin-qeta-node 3.18.2 → 3.20.2
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/conditionExports.cjs.js +68 -0
- package/dist/conditionExports.cjs.js.map +1 -0
- package/dist/index.cjs.js +48 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +285 -2
- package/dist/permissionRules.cjs.js +301 -0
- package/dist/permissionRules.cjs.js.map +1 -0
- package/package.json +4 -2
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var pluginPermissionNode = require('@backstage/plugin-permission-node');
|
|
4
|
+
var permissionRules = require('./permissionRules.cjs.js');
|
|
5
|
+
var backstagePluginQetaCommon = require('@drodil/backstage-plugin-qeta-common');
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
conditions: qConditions,
|
|
9
|
+
createConditionalDecision: createPostDecision
|
|
10
|
+
} = pluginPermissionNode.createConditionExports({
|
|
11
|
+
pluginId: "qeta",
|
|
12
|
+
resourceType: backstagePluginQetaCommon.POST_RESOURCE_TYPE,
|
|
13
|
+
rules: permissionRules.postRules
|
|
14
|
+
});
|
|
15
|
+
const questionConditions = qConditions;
|
|
16
|
+
const createPostConditionalDecision = createPostDecision;
|
|
17
|
+
const {
|
|
18
|
+
conditions: aConditions,
|
|
19
|
+
createConditionalDecision: createAnswerDecision
|
|
20
|
+
} = pluginPermissionNode.createConditionExports({
|
|
21
|
+
pluginId: "qeta",
|
|
22
|
+
resourceType: backstagePluginQetaCommon.ANSWER_RESOURCE_TYPE,
|
|
23
|
+
rules: permissionRules.answerRules
|
|
24
|
+
});
|
|
25
|
+
const answerConditions = aConditions;
|
|
26
|
+
const createAnswerConditionalDecision = createAnswerDecision;
|
|
27
|
+
const {
|
|
28
|
+
conditions: cConditions,
|
|
29
|
+
createConditionalDecision: createCommentDecision
|
|
30
|
+
} = pluginPermissionNode.createConditionExports({
|
|
31
|
+
pluginId: "qeta",
|
|
32
|
+
resourceType: backstagePluginQetaCommon.COMMENT_RESOURCE_TYPE,
|
|
33
|
+
rules: permissionRules.commentRules
|
|
34
|
+
});
|
|
35
|
+
const commentConditions = cConditions;
|
|
36
|
+
const createCommentConditionalDecision = createCommentDecision;
|
|
37
|
+
const {
|
|
38
|
+
conditions: tConditions,
|
|
39
|
+
createConditionalDecision: createTagDecision
|
|
40
|
+
} = pluginPermissionNode.createConditionExports({
|
|
41
|
+
pluginId: "qeta",
|
|
42
|
+
resourceType: backstagePluginQetaCommon.TAG_RESOURCE_TYPE,
|
|
43
|
+
rules: permissionRules.tagRules
|
|
44
|
+
});
|
|
45
|
+
const tagConditions = tConditions;
|
|
46
|
+
const createTagConditionalDecision = createTagDecision;
|
|
47
|
+
const {
|
|
48
|
+
conditions: colConditions,
|
|
49
|
+
createConditionalDecision: createCollectionDecision
|
|
50
|
+
} = pluginPermissionNode.createConditionExports({
|
|
51
|
+
pluginId: "qeta",
|
|
52
|
+
resourceType: backstagePluginQetaCommon.COLLECTION_RESOUCE_TYPE,
|
|
53
|
+
rules: permissionRules.collectionRules
|
|
54
|
+
});
|
|
55
|
+
const collectionConditions = colConditions;
|
|
56
|
+
const createCollectionConditionalDecision = createCollectionDecision;
|
|
57
|
+
|
|
58
|
+
exports.answerConditions = answerConditions;
|
|
59
|
+
exports.collectionConditions = collectionConditions;
|
|
60
|
+
exports.commentConditions = commentConditions;
|
|
61
|
+
exports.createAnswerConditionalDecision = createAnswerConditionalDecision;
|
|
62
|
+
exports.createCollectionConditionalDecision = createCollectionConditionalDecision;
|
|
63
|
+
exports.createCommentConditionalDecision = createCommentConditionalDecision;
|
|
64
|
+
exports.createPostConditionalDecision = createPostConditionalDecision;
|
|
65
|
+
exports.createTagConditionalDecision = createTagConditionalDecision;
|
|
66
|
+
exports.questionConditions = questionConditions;
|
|
67
|
+
exports.tagConditions = tagConditions;
|
|
68
|
+
//# sourceMappingURL=conditionExports.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionExports.cjs.js","sources":["../src/conditionExports.ts"],"sourcesContent":["import { createConditionExports } from '@backstage/plugin-permission-node';\nimport {\n answerRules,\n collectionRules,\n commentRules,\n postRules,\n tagRules,\n} from './permissionRules';\nimport {\n ANSWER_RESOURCE_TYPE,\n COLLECTION_RESOUCE_TYPE,\n COMMENT_RESOURCE_TYPE,\n POST_RESOURCE_TYPE,\n TAG_RESOURCE_TYPE,\n} from '@drodil/backstage-plugin-qeta-common';\n\nconst {\n conditions: qConditions,\n createConditionalDecision: createPostDecision,\n} = createConditionExports({\n pluginId: 'qeta',\n resourceType: POST_RESOURCE_TYPE,\n rules: postRules,\n});\n\nexport const questionConditions = qConditions;\n\nexport const createPostConditionalDecision = createPostDecision;\n\nconst {\n conditions: aConditions,\n createConditionalDecision: createAnswerDecision,\n} = createConditionExports({\n pluginId: 'qeta',\n resourceType: ANSWER_RESOURCE_TYPE,\n rules: answerRules,\n});\n\nexport const answerConditions = aConditions;\n\nexport const createAnswerConditionalDecision = createAnswerDecision;\n\nconst {\n conditions: cConditions,\n createConditionalDecision: createCommentDecision,\n} = createConditionExports({\n pluginId: 'qeta',\n resourceType: COMMENT_RESOURCE_TYPE,\n rules: commentRules,\n});\n\nexport const commentConditions = cConditions;\n\nexport const createCommentConditionalDecision = createCommentDecision;\n\nconst {\n conditions: tConditions,\n createConditionalDecision: createTagDecision,\n} = createConditionExports({\n pluginId: 'qeta',\n resourceType: TAG_RESOURCE_TYPE,\n rules: tagRules,\n});\n\nexport const tagConditions = tConditions;\n\nexport const createTagConditionalDecision = createTagDecision;\n\nconst {\n conditions: colConditions,\n createConditionalDecision: createCollectionDecision,\n} = createConditionExports({\n pluginId: 'qeta',\n resourceType: COLLECTION_RESOUCE_TYPE,\n rules: collectionRules,\n});\n\nexport const collectionConditions = colConditions;\n\nexport const createCollectionConditionalDecision = createCollectionDecision;\n"],"names":["createConditionExports","POST_RESOURCE_T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,yBAA2B,EAAA;AAC7B,CAAA,GAAIR,2CAAuB,CAAA;AAAA,EACzB,QAAU,EAAA,MAAA;AAAA,EACV,YAAc,EAAAS,iDAAA;AAAA,EACd,KAAO,EAAAC;AACT,CAAC,CAAA;AAEM,MAAM,oBAAuB,GAAA;AAE7B,MAAM,mCAAsC,GAAA;;;;;;;;;;;;;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,9 +1,57 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var extensions = require('./extensions.cjs.js');
|
|
4
|
+
var permissionRules = require('./permissionRules.cjs.js');
|
|
5
|
+
var conditionExports = require('./conditionExports.cjs.js');
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
exports.qetaAIExtensionPoint = extensions.qetaAIExtensionPoint;
|
|
8
10
|
exports.qetaTagDatabaseExtensionPoint = extensions.qetaTagDatabaseExtensionPoint;
|
|
11
|
+
exports.answerAuthorConditionFactory = permissionRules.answerAuthorConditionFactory;
|
|
12
|
+
exports.answerQuestionEntitiesConditionFactory = permissionRules.answerQuestionEntitiesConditionFactory;
|
|
13
|
+
exports.answerQuestionHasEntityRefs = permissionRules.answerQuestionHasEntityRefs;
|
|
14
|
+
exports.answerQuestionHasTags = permissionRules.answerQuestionHasTags;
|
|
15
|
+
exports.answerQuestionTagsConditionFactory = permissionRules.answerQuestionTagsConditionFactory;
|
|
16
|
+
exports.answerRules = permissionRules.answerRules;
|
|
17
|
+
exports.collectionHasEntities = permissionRules.collectionHasEntities;
|
|
18
|
+
exports.collectionHasEntitiesConditionFactory = permissionRules.collectionHasEntitiesConditionFactory;
|
|
19
|
+
exports.collectionHasTags = permissionRules.collectionHasTags;
|
|
20
|
+
exports.collectionHasTagsConditionFactory = permissionRules.collectionHasTagsConditionFactory;
|
|
21
|
+
exports.collectionOwnerConditionFactory = permissionRules.collectionOwnerConditionFactory;
|
|
22
|
+
exports.collectionRules = permissionRules.collectionRules;
|
|
23
|
+
exports.commentAuthorConditionFactory = permissionRules.commentAuthorConditionFactory;
|
|
24
|
+
exports.commentRules = permissionRules.commentRules;
|
|
25
|
+
exports.createAnswerPermissionRule = permissionRules.createAnswerPermissionRule;
|
|
26
|
+
exports.createCollectionPermissionRule = permissionRules.createCollectionPermissionRule;
|
|
27
|
+
exports.createCommentPermissionRule = permissionRules.createCommentPermissionRule;
|
|
28
|
+
exports.createPostPermissionRule = permissionRules.createPostPermissionRule;
|
|
29
|
+
exports.createTagPermissionRule = permissionRules.createTagPermissionRule;
|
|
30
|
+
exports.isAnswerAuthor = permissionRules.isAnswerAuthor;
|
|
31
|
+
exports.isCollectionOwner = permissionRules.isCollectionOwner;
|
|
32
|
+
exports.isCommentAuthor = permissionRules.isCommentAuthor;
|
|
33
|
+
exports.isPostAuthor = permissionRules.isPostAuthor;
|
|
34
|
+
exports.isTag = permissionRules.isTag;
|
|
35
|
+
exports.permissionRules = permissionRules.permissionRules;
|
|
36
|
+
exports.postAuthorConditionFactory = permissionRules.postAuthorConditionFactory;
|
|
37
|
+
exports.postHasEntities = permissionRules.postHasEntities;
|
|
38
|
+
exports.postHasEntitiesConditionFactory = permissionRules.postHasEntitiesConditionFactory;
|
|
39
|
+
exports.postHasTags = permissionRules.postHasTags;
|
|
40
|
+
exports.postHasTagsConditionFactory = permissionRules.postHasTagsConditionFactory;
|
|
41
|
+
exports.postHasType = permissionRules.postHasType;
|
|
42
|
+
exports.postHasTypeConditionFactory = permissionRules.postHasTypeConditionFactory;
|
|
43
|
+
exports.postRules = permissionRules.postRules;
|
|
44
|
+
exports.rules = permissionRules.rules;
|
|
45
|
+
exports.tagConditionFactory = permissionRules.tagConditionFactory;
|
|
46
|
+
exports.tagRules = permissionRules.tagRules;
|
|
47
|
+
exports.answerConditions = conditionExports.answerConditions;
|
|
48
|
+
exports.collectionConditions = conditionExports.collectionConditions;
|
|
49
|
+
exports.commentConditions = conditionExports.commentConditions;
|
|
50
|
+
exports.createAnswerConditionalDecision = conditionExports.createAnswerConditionalDecision;
|
|
51
|
+
exports.createCollectionConditionalDecision = conditionExports.createCollectionConditionalDecision;
|
|
52
|
+
exports.createCommentConditionalDecision = conditionExports.createCommentConditionalDecision;
|
|
53
|
+
exports.createPostConditionalDecision = conditionExports.createPostConditionalDecision;
|
|
54
|
+
exports.createTagConditionalDecision = conditionExports.createTagConditionalDecision;
|
|
55
|
+
exports.questionConditions = conditionExports.questionConditions;
|
|
56
|
+
exports.tagConditions = conditionExports.tagConditions;
|
|
9
57
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
2
2
|
import { BackstageCredentials, BackstageUserPrincipal } from '@backstage/backend-plugin-api';
|
|
3
|
-
import
|
|
3
|
+
import * as _drodil_backstage_plugin_qeta_common from '@drodil/backstage-plugin-qeta-common';
|
|
4
|
+
import { Question, AIResponse, Article, Post, PostFilter, Answer, AnswerFilter, Comment, CommentFilter, TagResponse, TagFilter, Collection, CollectionFilter } from '@drodil/backstage-plugin-qeta-common';
|
|
5
|
+
import * as _backstage_plugin_permission_node from '@backstage/plugin-permission-node';
|
|
6
|
+
import * as _backstage_plugin_permission_common_index from '@backstage/plugin-permission-common/index';
|
|
4
7
|
|
|
5
8
|
interface AIHandler {
|
|
6
9
|
/**
|
|
@@ -59,4 +62,284 @@ interface QetaTagDatabaseExtensionPoint {
|
|
|
59
62
|
declare const qetaAIExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<QetaAIExtensionPoint>;
|
|
60
63
|
declare const qetaTagDatabaseExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<QetaTagDatabaseExtensionPoint>;
|
|
61
64
|
|
|
62
|
-
|
|
65
|
+
declare const createPostPermissionRule: <TParams extends _backstage_plugin_permission_common_index.PermissionRuleParams = undefined>(rule: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", TParams>) => _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", TParams>;
|
|
66
|
+
declare const isPostAuthor: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
67
|
+
userRef?: string | undefined;
|
|
68
|
+
claims?: string[] | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
declare const postAuthorConditionFactory: (params: {
|
|
71
|
+
userRef?: string | undefined;
|
|
72
|
+
claims?: string[] | undefined;
|
|
73
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"post", {
|
|
74
|
+
userRef?: string | undefined;
|
|
75
|
+
claims?: string[] | undefined;
|
|
76
|
+
}>;
|
|
77
|
+
declare const postHasTags: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
78
|
+
tags: string[];
|
|
79
|
+
}>;
|
|
80
|
+
declare const postHasTagsConditionFactory: (params: {
|
|
81
|
+
tags: string[];
|
|
82
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"post", {
|
|
83
|
+
tags: string[];
|
|
84
|
+
}>;
|
|
85
|
+
declare const postHasEntities: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
86
|
+
entityRefs: string[];
|
|
87
|
+
}>;
|
|
88
|
+
declare const postHasEntitiesConditionFactory: (params: {
|
|
89
|
+
entityRefs: string[];
|
|
90
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"post", {
|
|
91
|
+
entityRefs: string[];
|
|
92
|
+
}>;
|
|
93
|
+
declare const postHasType: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
94
|
+
type: string;
|
|
95
|
+
}>;
|
|
96
|
+
declare const postHasTypeConditionFactory: (params: {
|
|
97
|
+
type: string;
|
|
98
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"post", {
|
|
99
|
+
type: string;
|
|
100
|
+
}>;
|
|
101
|
+
declare const postRules: {
|
|
102
|
+
isPostAuthor: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
103
|
+
userRef?: string | undefined;
|
|
104
|
+
claims?: string[] | undefined;
|
|
105
|
+
}>;
|
|
106
|
+
postHasTags: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
107
|
+
tags: string[];
|
|
108
|
+
}>;
|
|
109
|
+
postHasEntities: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
110
|
+
entityRefs: string[];
|
|
111
|
+
}>;
|
|
112
|
+
postHasType: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
113
|
+
type: string;
|
|
114
|
+
}>;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* @deprecated use `postRules` instead
|
|
118
|
+
*/
|
|
119
|
+
declare const permissionRules: {
|
|
120
|
+
isPostAuthor: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
121
|
+
userRef?: string | undefined;
|
|
122
|
+
claims?: string[] | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
postHasTags: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
125
|
+
tags: string[];
|
|
126
|
+
}>;
|
|
127
|
+
postHasEntities: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
128
|
+
entityRefs: string[];
|
|
129
|
+
}>;
|
|
130
|
+
postHasType: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
131
|
+
type: string;
|
|
132
|
+
}>;
|
|
133
|
+
};
|
|
134
|
+
declare const createAnswerPermissionRule: <TParams extends _backstage_plugin_permission_common_index.PermissionRuleParams = undefined>(rule: _backstage_plugin_permission_node.PermissionRule<Answer, AnswerFilter, "answer", TParams>) => _backstage_plugin_permission_node.PermissionRule<Answer, AnswerFilter, "answer", TParams>;
|
|
135
|
+
declare const isAnswerAuthor: _backstage_plugin_permission_node.PermissionRule<Answer, AnswerFilter, "answer", {
|
|
136
|
+
userRef?: string | undefined;
|
|
137
|
+
claims?: string[] | undefined;
|
|
138
|
+
}>;
|
|
139
|
+
declare const answerAuthorConditionFactory: (params: {
|
|
140
|
+
userRef?: string | undefined;
|
|
141
|
+
claims?: string[] | undefined;
|
|
142
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"answer", {
|
|
143
|
+
userRef?: string | undefined;
|
|
144
|
+
claims?: string[] | undefined;
|
|
145
|
+
}>;
|
|
146
|
+
declare const answerQuestionHasTags: _backstage_plugin_permission_node.PermissionRule<Answer, AnswerFilter, "answer", {
|
|
147
|
+
tags: string[];
|
|
148
|
+
}>;
|
|
149
|
+
declare const answerQuestionTagsConditionFactory: (params: {
|
|
150
|
+
tags: string[];
|
|
151
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"answer", {
|
|
152
|
+
tags: string[];
|
|
153
|
+
}>;
|
|
154
|
+
declare const answerQuestionHasEntityRefs: _backstage_plugin_permission_node.PermissionRule<Answer, AnswerFilter, "answer", {
|
|
155
|
+
entityRefs: string[];
|
|
156
|
+
}>;
|
|
157
|
+
declare const answerQuestionEntitiesConditionFactory: (params: {
|
|
158
|
+
entityRefs: string[];
|
|
159
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"answer", {
|
|
160
|
+
entityRefs: string[];
|
|
161
|
+
}>;
|
|
162
|
+
declare const answerRules: {
|
|
163
|
+
isAnswerAuthor: _backstage_plugin_permission_node.PermissionRule<Answer, AnswerFilter, "answer", {
|
|
164
|
+
userRef?: string | undefined;
|
|
165
|
+
claims?: string[] | undefined;
|
|
166
|
+
}>;
|
|
167
|
+
answerQuestionHasTags: _backstage_plugin_permission_node.PermissionRule<Answer, AnswerFilter, "answer", {
|
|
168
|
+
tags: string[];
|
|
169
|
+
}>;
|
|
170
|
+
answerQuestionHasEntityRefs: _backstage_plugin_permission_node.PermissionRule<Answer, AnswerFilter, "answer", {
|
|
171
|
+
entityRefs: string[];
|
|
172
|
+
}>;
|
|
173
|
+
};
|
|
174
|
+
declare const createCommentPermissionRule: <TParams extends _backstage_plugin_permission_common_index.PermissionRuleParams = undefined>(rule: _backstage_plugin_permission_node.PermissionRule<Comment, CommentFilter, "comment", TParams>) => _backstage_plugin_permission_node.PermissionRule<Comment, CommentFilter, "comment", TParams>;
|
|
175
|
+
declare const isCommentAuthor: _backstage_plugin_permission_node.PermissionRule<Comment, CommentFilter, "comment", {
|
|
176
|
+
userRef?: string | undefined;
|
|
177
|
+
claims?: string[] | undefined;
|
|
178
|
+
}>;
|
|
179
|
+
declare const commentAuthorConditionFactory: (params: {
|
|
180
|
+
userRef?: string | undefined;
|
|
181
|
+
claims?: string[] | undefined;
|
|
182
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"comment", {
|
|
183
|
+
userRef?: string | undefined;
|
|
184
|
+
claims?: string[] | undefined;
|
|
185
|
+
}>;
|
|
186
|
+
declare const commentRules: {
|
|
187
|
+
isCommentAuthor: _backstage_plugin_permission_node.PermissionRule<Comment, CommentFilter, "comment", {
|
|
188
|
+
userRef?: string | undefined;
|
|
189
|
+
claims?: string[] | undefined;
|
|
190
|
+
}>;
|
|
191
|
+
};
|
|
192
|
+
declare const createTagPermissionRule: <TParams extends _backstage_plugin_permission_common_index.PermissionRuleParams = undefined>(rule: _backstage_plugin_permission_node.PermissionRule<TagResponse, TagFilter, "tag", TParams>) => _backstage_plugin_permission_node.PermissionRule<TagResponse, TagFilter, "tag", TParams>;
|
|
193
|
+
declare const isTag: _backstage_plugin_permission_node.PermissionRule<TagResponse, TagFilter, "tag", {
|
|
194
|
+
tag: string;
|
|
195
|
+
}>;
|
|
196
|
+
declare const tagConditionFactory: (params: {
|
|
197
|
+
tag: string;
|
|
198
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"tag", {
|
|
199
|
+
tag: string;
|
|
200
|
+
}>;
|
|
201
|
+
declare const tagRules: {
|
|
202
|
+
isTag: _backstage_plugin_permission_node.PermissionRule<TagResponse, TagFilter, "tag", {
|
|
203
|
+
tag: string;
|
|
204
|
+
}>;
|
|
205
|
+
};
|
|
206
|
+
declare const createCollectionPermissionRule: <TParams extends _backstage_plugin_permission_common_index.PermissionRuleParams = undefined>(rule: _backstage_plugin_permission_node.PermissionRule<Collection, CollectionFilter, "collection", TParams>) => _backstage_plugin_permission_node.PermissionRule<Collection, CollectionFilter, "collection", TParams>;
|
|
207
|
+
declare const isCollectionOwner: _backstage_plugin_permission_node.PermissionRule<Collection, CollectionFilter, "collection", {
|
|
208
|
+
userRef?: string | undefined;
|
|
209
|
+
claims?: string[] | undefined;
|
|
210
|
+
}>;
|
|
211
|
+
declare const collectionOwnerConditionFactory: (params: {
|
|
212
|
+
userRef?: string | undefined;
|
|
213
|
+
claims?: string[] | undefined;
|
|
214
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"collection", {
|
|
215
|
+
userRef?: string | undefined;
|
|
216
|
+
claims?: string[] | undefined;
|
|
217
|
+
}>;
|
|
218
|
+
declare const collectionHasTags: _backstage_plugin_permission_node.PermissionRule<Collection, CollectionFilter, "collection", {
|
|
219
|
+
tags: string[];
|
|
220
|
+
}>;
|
|
221
|
+
declare const collectionHasTagsConditionFactory: (params: {
|
|
222
|
+
tags: string[];
|
|
223
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"collection", {
|
|
224
|
+
tags: string[];
|
|
225
|
+
}>;
|
|
226
|
+
declare const collectionHasEntities: _backstage_plugin_permission_node.PermissionRule<Collection, CollectionFilter, "collection", {
|
|
227
|
+
entityRefs: string[];
|
|
228
|
+
}>;
|
|
229
|
+
declare const collectionHasEntitiesConditionFactory: (params: {
|
|
230
|
+
entityRefs: string[];
|
|
231
|
+
}) => _backstage_plugin_permission_common_index.PermissionCondition<"collection", {
|
|
232
|
+
entityRefs: string[];
|
|
233
|
+
}>;
|
|
234
|
+
declare const collectionRules: {
|
|
235
|
+
isCollectionOwner: _backstage_plugin_permission_node.PermissionRule<Collection, CollectionFilter, "collection", {
|
|
236
|
+
userRef?: string | undefined;
|
|
237
|
+
claims?: string[] | undefined;
|
|
238
|
+
}>;
|
|
239
|
+
collectionHasTags: _backstage_plugin_permission_node.PermissionRule<Collection, CollectionFilter, "collection", {
|
|
240
|
+
tags: string[];
|
|
241
|
+
}>;
|
|
242
|
+
collectionHasEntities: _backstage_plugin_permission_node.PermissionRule<Collection, CollectionFilter, "collection", {
|
|
243
|
+
entityRefs: string[];
|
|
244
|
+
}>;
|
|
245
|
+
};
|
|
246
|
+
declare const rules: {
|
|
247
|
+
isCollectionOwner: _backstage_plugin_permission_node.PermissionRule<Collection, CollectionFilter, "collection", {
|
|
248
|
+
userRef?: string | undefined;
|
|
249
|
+
claims?: string[] | undefined;
|
|
250
|
+
}>;
|
|
251
|
+
collectionHasTags: _backstage_plugin_permission_node.PermissionRule<Collection, CollectionFilter, "collection", {
|
|
252
|
+
tags: string[];
|
|
253
|
+
}>;
|
|
254
|
+
collectionHasEntities: _backstage_plugin_permission_node.PermissionRule<Collection, CollectionFilter, "collection", {
|
|
255
|
+
entityRefs: string[];
|
|
256
|
+
}>;
|
|
257
|
+
isTag: _backstage_plugin_permission_node.PermissionRule<TagResponse, TagFilter, "tag", {
|
|
258
|
+
tag: string;
|
|
259
|
+
}>;
|
|
260
|
+
isPostAuthor: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
261
|
+
userRef?: string | undefined;
|
|
262
|
+
claims?: string[] | undefined;
|
|
263
|
+
}>;
|
|
264
|
+
postHasTags: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
265
|
+
tags: string[];
|
|
266
|
+
}>;
|
|
267
|
+
postHasEntities: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
268
|
+
entityRefs: string[];
|
|
269
|
+
}>;
|
|
270
|
+
postHasType: _backstage_plugin_permission_node.PermissionRule<Post, PostFilter, "post", {
|
|
271
|
+
type: string;
|
|
272
|
+
}>;
|
|
273
|
+
isAnswerAuthor: _backstage_plugin_permission_node.PermissionRule<Answer, AnswerFilter, "answer", {
|
|
274
|
+
userRef?: string | undefined;
|
|
275
|
+
claims?: string[] | undefined;
|
|
276
|
+
}>;
|
|
277
|
+
answerQuestionHasTags: _backstage_plugin_permission_node.PermissionRule<Answer, AnswerFilter, "answer", {
|
|
278
|
+
tags: string[];
|
|
279
|
+
}>;
|
|
280
|
+
answerQuestionHasEntityRefs: _backstage_plugin_permission_node.PermissionRule<Answer, AnswerFilter, "answer", {
|
|
281
|
+
entityRefs: string[];
|
|
282
|
+
}>;
|
|
283
|
+
isCommentAuthor: _backstage_plugin_permission_node.PermissionRule<Comment, CommentFilter, "comment", {
|
|
284
|
+
userRef?: string | undefined;
|
|
285
|
+
claims?: string[] | undefined;
|
|
286
|
+
}>;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
declare const questionConditions: _backstage_plugin_permission_node.Conditions<{
|
|
290
|
+
isPostAuthor: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.Post, _drodil_backstage_plugin_qeta_common.PostFilter, "post", {
|
|
291
|
+
userRef?: string | undefined;
|
|
292
|
+
claims?: string[] | undefined;
|
|
293
|
+
}>;
|
|
294
|
+
postHasTags: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.Post, _drodil_backstage_plugin_qeta_common.PostFilter, "post", {
|
|
295
|
+
tags: string[];
|
|
296
|
+
}>;
|
|
297
|
+
postHasEntities: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.Post, _drodil_backstage_plugin_qeta_common.PostFilter, "post", {
|
|
298
|
+
entityRefs: string[];
|
|
299
|
+
}>;
|
|
300
|
+
postHasType: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.Post, _drodil_backstage_plugin_qeta_common.PostFilter, "post", {
|
|
301
|
+
type: string;
|
|
302
|
+
}>;
|
|
303
|
+
}>;
|
|
304
|
+
declare const createPostConditionalDecision: (permission: _backstage_plugin_permission_common_index.ResourcePermission<"post">, conditions: _backstage_plugin_permission_common_index.PermissionCriteria<_backstage_plugin_permission_common_index.PermissionCondition<"post">>) => _backstage_plugin_permission_common_index.ConditionalPolicyDecision;
|
|
305
|
+
declare const answerConditions: _backstage_plugin_permission_node.Conditions<{
|
|
306
|
+
isAnswerAuthor: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.Answer, _drodil_backstage_plugin_qeta_common.AnswerFilter, "answer", {
|
|
307
|
+
userRef?: string | undefined;
|
|
308
|
+
claims?: string[] | undefined;
|
|
309
|
+
}>;
|
|
310
|
+
answerQuestionHasTags: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.Answer, _drodil_backstage_plugin_qeta_common.AnswerFilter, "answer", {
|
|
311
|
+
tags: string[];
|
|
312
|
+
}>;
|
|
313
|
+
answerQuestionHasEntityRefs: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.Answer, _drodil_backstage_plugin_qeta_common.AnswerFilter, "answer", {
|
|
314
|
+
entityRefs: string[];
|
|
315
|
+
}>;
|
|
316
|
+
}>;
|
|
317
|
+
declare const createAnswerConditionalDecision: (permission: _backstage_plugin_permission_common_index.ResourcePermission<"answer">, conditions: _backstage_plugin_permission_common_index.PermissionCriteria<_backstage_plugin_permission_common_index.PermissionCondition<"answer">>) => _backstage_plugin_permission_common_index.ConditionalPolicyDecision;
|
|
318
|
+
declare const commentConditions: _backstage_plugin_permission_node.Conditions<{
|
|
319
|
+
isCommentAuthor: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.Comment, _drodil_backstage_plugin_qeta_common.CommentFilter, "comment", {
|
|
320
|
+
userRef?: string | undefined;
|
|
321
|
+
claims?: string[] | undefined;
|
|
322
|
+
}>;
|
|
323
|
+
}>;
|
|
324
|
+
declare const createCommentConditionalDecision: (permission: _backstage_plugin_permission_common_index.ResourcePermission<"comment">, conditions: _backstage_plugin_permission_common_index.PermissionCriteria<_backstage_plugin_permission_common_index.PermissionCondition<"comment">>) => _backstage_plugin_permission_common_index.ConditionalPolicyDecision;
|
|
325
|
+
declare const tagConditions: _backstage_plugin_permission_node.Conditions<{
|
|
326
|
+
isTag: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.TagResponse, _drodil_backstage_plugin_qeta_common.TagFilter, "tag", {
|
|
327
|
+
tag: string;
|
|
328
|
+
}>;
|
|
329
|
+
}>;
|
|
330
|
+
declare const createTagConditionalDecision: (permission: _backstage_plugin_permission_common_index.ResourcePermission<"tag">, conditions: _backstage_plugin_permission_common_index.PermissionCriteria<_backstage_plugin_permission_common_index.PermissionCondition<"tag">>) => _backstage_plugin_permission_common_index.ConditionalPolicyDecision;
|
|
331
|
+
declare const collectionConditions: _backstage_plugin_permission_node.Conditions<{
|
|
332
|
+
isCollectionOwner: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.Collection, _drodil_backstage_plugin_qeta_common.CollectionFilter, "collection", {
|
|
333
|
+
userRef?: string | undefined;
|
|
334
|
+
claims?: string[] | undefined;
|
|
335
|
+
}>;
|
|
336
|
+
collectionHasTags: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.Collection, _drodil_backstage_plugin_qeta_common.CollectionFilter, "collection", {
|
|
337
|
+
tags: string[];
|
|
338
|
+
}>;
|
|
339
|
+
collectionHasEntities: _backstage_plugin_permission_node.PermissionRule<_drodil_backstage_plugin_qeta_common.Collection, _drodil_backstage_plugin_qeta_common.CollectionFilter, "collection", {
|
|
340
|
+
entityRefs: string[];
|
|
341
|
+
}>;
|
|
342
|
+
}>;
|
|
343
|
+
declare const createCollectionConditionalDecision: (permission: _backstage_plugin_permission_common_index.ResourcePermission<"collection">, conditions: _backstage_plugin_permission_common_index.PermissionCriteria<_backstage_plugin_permission_common_index.PermissionCondition<"collection">>) => _backstage_plugin_permission_common_index.ConditionalPolicyDecision;
|
|
344
|
+
|
|
345
|
+
export { type AIHandler, type QetaAIExtensionPoint, type QetaTagDatabaseExtensionPoint, type TagDatabase, answerAuthorConditionFactory, answerConditions, answerQuestionEntitiesConditionFactory, answerQuestionHasEntityRefs, answerQuestionHasTags, answerQuestionTagsConditionFactory, answerRules, collectionConditions, collectionHasEntities, collectionHasEntitiesConditionFactory, collectionHasTags, collectionHasTagsConditionFactory, collectionOwnerConditionFactory, collectionRules, commentAuthorConditionFactory, commentConditions, commentRules, createAnswerConditionalDecision, createAnswerPermissionRule, createCollectionConditionalDecision, createCollectionPermissionRule, createCommentConditionalDecision, createCommentPermissionRule, createPostConditionalDecision, createPostPermissionRule, createTagConditionalDecision, createTagPermissionRule, isAnswerAuthor, isCollectionOwner, isCommentAuthor, isPostAuthor, isTag, permissionRules, postAuthorConditionFactory, postHasEntities, postHasEntitiesConditionFactory, postHasTags, postHasTagsConditionFactory, postHasType, postHasTypeConditionFactory, postRules, qetaAIExtensionPoint, qetaTagDatabaseExtensionPoint, questionConditions, rules, tagConditionFactory, tagConditions, tagRules };
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var pluginPermissionNode = require('@backstage/plugin-permission-node');
|
|
4
|
+
var zod = require('zod');
|
|
5
|
+
var backstagePluginQetaCommon = require('@drodil/backstage-plugin-qeta-common');
|
|
6
|
+
|
|
7
|
+
const createPostPermissionRule = pluginPermissionNode.makeCreatePermissionRule();
|
|
8
|
+
const isPostAuthor = createPostPermissionRule({
|
|
9
|
+
name: "IS_AUTHOR",
|
|
10
|
+
description: "Should allow only if the post is created by the user",
|
|
11
|
+
resourceType: backstagePluginQetaCommon.POST_RESOURCE_TYPE,
|
|
12
|
+
paramsSchema: zod.z.object({
|
|
13
|
+
userRef: zod.z.string().describe("User ID to match on the author").optional(),
|
|
14
|
+
claims: zod.z.array(zod.z.string()).optional().describe("List of claims to match at least one on within author")
|
|
15
|
+
}),
|
|
16
|
+
apply: (resource, { userRef, claims = [] }) => {
|
|
17
|
+
return resource?.author === userRef || claims.includes(resource?.author);
|
|
18
|
+
},
|
|
19
|
+
toQuery: ({ userRef, claims = [] }) => {
|
|
20
|
+
return {
|
|
21
|
+
property: "posts.author",
|
|
22
|
+
values: [userRef, ...claims].filter(Boolean)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const postAuthorConditionFactory = pluginPermissionNode.createConditionFactory(isPostAuthor);
|
|
27
|
+
const postHasTags = createPostPermissionRule({
|
|
28
|
+
name: "HAS_TAGS",
|
|
29
|
+
description: "Should allow only if the post has all the specific tags",
|
|
30
|
+
resourceType: backstagePluginQetaCommon.POST_RESOURCE_TYPE,
|
|
31
|
+
paramsSchema: zod.z.object({
|
|
32
|
+
tags: zod.z.array(zod.z.string()).describe("Tag to match the post")
|
|
33
|
+
}),
|
|
34
|
+
apply: (resource, { tags }) => {
|
|
35
|
+
return tags.every((t) => resource?.tags?.includes(t));
|
|
36
|
+
},
|
|
37
|
+
toQuery: ({ tags }) => {
|
|
38
|
+
return {
|
|
39
|
+
property: "tags",
|
|
40
|
+
values: tags
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const postHasTagsConditionFactory = pluginPermissionNode.createConditionFactory(postHasTags);
|
|
45
|
+
const postHasEntities = createPostPermissionRule({
|
|
46
|
+
name: "HAS_ENTITIES",
|
|
47
|
+
description: "Should allow only if the post has all the specific entities",
|
|
48
|
+
resourceType: backstagePluginQetaCommon.POST_RESOURCE_TYPE,
|
|
49
|
+
paramsSchema: zod.z.object({
|
|
50
|
+
entityRefs: zod.z.array(zod.z.string()).describe("Entity refs to match the post")
|
|
51
|
+
}),
|
|
52
|
+
apply: (resource, { entityRefs }) => {
|
|
53
|
+
return entityRefs.every((t) => resource?.entities?.includes(t));
|
|
54
|
+
},
|
|
55
|
+
toQuery: ({ entityRefs }) => {
|
|
56
|
+
return {
|
|
57
|
+
property: "entityRefs",
|
|
58
|
+
values: entityRefs
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const postHasEntitiesConditionFactory = pluginPermissionNode.createConditionFactory(postHasEntities);
|
|
63
|
+
const postHasType = createPostPermissionRule({
|
|
64
|
+
name: "HAS_TYPE",
|
|
65
|
+
description: "Should allow only if the post has the specific type",
|
|
66
|
+
resourceType: backstagePluginQetaCommon.POST_RESOURCE_TYPE,
|
|
67
|
+
paramsSchema: zod.z.object({
|
|
68
|
+
type: zod.z.string().describe("Type to match the post")
|
|
69
|
+
}),
|
|
70
|
+
apply: (resource, { type }) => {
|
|
71
|
+
return resource?.type === type;
|
|
72
|
+
},
|
|
73
|
+
toQuery: ({ type }) => {
|
|
74
|
+
return {
|
|
75
|
+
property: "posts.type",
|
|
76
|
+
values: [type]
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const postHasTypeConditionFactory = pluginPermissionNode.createConditionFactory(postHasType);
|
|
81
|
+
const postRules = {
|
|
82
|
+
isPostAuthor,
|
|
83
|
+
postHasTags,
|
|
84
|
+
postHasEntities,
|
|
85
|
+
postHasType
|
|
86
|
+
};
|
|
87
|
+
const permissionRules = postRules;
|
|
88
|
+
const createAnswerPermissionRule = pluginPermissionNode.makeCreatePermissionRule();
|
|
89
|
+
const isAnswerAuthor = createAnswerPermissionRule({
|
|
90
|
+
name: "IS_AUTHOR",
|
|
91
|
+
description: "Should allow only if the answer is created by the user",
|
|
92
|
+
resourceType: backstagePluginQetaCommon.ANSWER_RESOURCE_TYPE,
|
|
93
|
+
paramsSchema: zod.z.object({
|
|
94
|
+
userRef: zod.z.string().describe("User ID to match on the author").optional(),
|
|
95
|
+
claims: zod.z.array(zod.z.string()).optional().describe("List of claims to match at least one on within author")
|
|
96
|
+
}),
|
|
97
|
+
apply: (resource, { userRef, claims = [] }) => {
|
|
98
|
+
return resource?.author === userRef || claims.includes(resource?.author);
|
|
99
|
+
},
|
|
100
|
+
toQuery: ({ userRef, claims = [] }) => {
|
|
101
|
+
return {
|
|
102
|
+
property: "answers.author",
|
|
103
|
+
values: [userRef, ...claims].filter(Boolean)
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
const answerAuthorConditionFactory = pluginPermissionNode.createConditionFactory(isAnswerAuthor);
|
|
108
|
+
const answerQuestionHasTags = createAnswerPermissionRule({
|
|
109
|
+
name: "HAS_TAGS",
|
|
110
|
+
description: "Should allow only if the answers question has all the specific tags",
|
|
111
|
+
resourceType: backstagePluginQetaCommon.ANSWER_RESOURCE_TYPE,
|
|
112
|
+
paramsSchema: zod.z.object({
|
|
113
|
+
tags: zod.z.array(zod.z.string()).describe("Tag to match the question")
|
|
114
|
+
}),
|
|
115
|
+
apply: (resource, { tags }) => {
|
|
116
|
+
return tags.every((t) => resource?.post?.tags?.includes(t));
|
|
117
|
+
},
|
|
118
|
+
toQuery: ({ tags }) => {
|
|
119
|
+
return {
|
|
120
|
+
property: "tags",
|
|
121
|
+
values: tags
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
const answerQuestionTagsConditionFactory = pluginPermissionNode.createConditionFactory(
|
|
126
|
+
answerQuestionHasTags
|
|
127
|
+
);
|
|
128
|
+
const answerQuestionHasEntityRefs = createAnswerPermissionRule({
|
|
129
|
+
name: "HAS_ENTITIES",
|
|
130
|
+
description: "Should allow only if the answers question has all the specific entities",
|
|
131
|
+
resourceType: backstagePluginQetaCommon.ANSWER_RESOURCE_TYPE,
|
|
132
|
+
paramsSchema: zod.z.object({
|
|
133
|
+
entityRefs: zod.z.array(zod.z.string()).describe("Tag to match the question")
|
|
134
|
+
}),
|
|
135
|
+
apply: (resource, { entityRefs }) => {
|
|
136
|
+
return entityRefs.every((t) => resource?.post?.entities?.includes(t));
|
|
137
|
+
},
|
|
138
|
+
toQuery: ({ entityRefs }) => {
|
|
139
|
+
return {
|
|
140
|
+
property: "entityRefs",
|
|
141
|
+
values: entityRefs
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
const answerQuestionEntitiesConditionFactory = pluginPermissionNode.createConditionFactory(
|
|
146
|
+
answerQuestionHasEntityRefs
|
|
147
|
+
);
|
|
148
|
+
const answerRules = {
|
|
149
|
+
isAnswerAuthor,
|
|
150
|
+
answerQuestionHasTags,
|
|
151
|
+
answerQuestionHasEntityRefs
|
|
152
|
+
};
|
|
153
|
+
const createCommentPermissionRule = pluginPermissionNode.makeCreatePermissionRule();
|
|
154
|
+
const isCommentAuthor = createCommentPermissionRule({
|
|
155
|
+
name: "IS_AUTHOR",
|
|
156
|
+
description: "Should allow only if the comment is created by the user",
|
|
157
|
+
resourceType: backstagePluginQetaCommon.COMMENT_RESOURCE_TYPE,
|
|
158
|
+
paramsSchema: zod.z.object({
|
|
159
|
+
userRef: zod.z.string().describe("User ID to match on the author").optional(),
|
|
160
|
+
claims: zod.z.array(zod.z.string()).optional().describe("List of claims to match at least one on within author")
|
|
161
|
+
}),
|
|
162
|
+
apply: (resource, { userRef, claims = [] }) => {
|
|
163
|
+
return resource?.author === userRef || claims.includes(resource?.author);
|
|
164
|
+
},
|
|
165
|
+
toQuery: ({ userRef, claims = [] }) => {
|
|
166
|
+
return {
|
|
167
|
+
property: "comments.author",
|
|
168
|
+
values: [userRef, ...claims].filter(Boolean)
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const commentAuthorConditionFactory = pluginPermissionNode.createConditionFactory(isCommentAuthor);
|
|
173
|
+
const commentRules = { isCommentAuthor };
|
|
174
|
+
const createTagPermissionRule = pluginPermissionNode.makeCreatePermissionRule();
|
|
175
|
+
const isTag = createTagPermissionRule({
|
|
176
|
+
name: "IS_TAG",
|
|
177
|
+
description: "Should allow only if the tag exists",
|
|
178
|
+
resourceType: backstagePluginQetaCommon.TAG_RESOURCE_TYPE,
|
|
179
|
+
paramsSchema: zod.z.object({
|
|
180
|
+
tag: zod.z.string().describe("Tag to match the post")
|
|
181
|
+
}),
|
|
182
|
+
apply: (resource, { tag }) => {
|
|
183
|
+
return resource?.tag === tag;
|
|
184
|
+
},
|
|
185
|
+
toQuery: ({ tag }) => {
|
|
186
|
+
return {
|
|
187
|
+
property: "tags.tag",
|
|
188
|
+
values: [tag]
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
const tagConditionFactory = pluginPermissionNode.createConditionFactory(isTag);
|
|
193
|
+
const tagRules = { isTag };
|
|
194
|
+
const createCollectionPermissionRule = pluginPermissionNode.makeCreatePermissionRule();
|
|
195
|
+
const isCollectionOwner = createCollectionPermissionRule({
|
|
196
|
+
name: "IS_OWNER",
|
|
197
|
+
description: "Should allow only if the collection is owned by the user",
|
|
198
|
+
resourceType: backstagePluginQetaCommon.COLLECTION_RESOUCE_TYPE,
|
|
199
|
+
paramsSchema: zod.z.object({
|
|
200
|
+
userRef: zod.z.string().describe("User reference to match on the owner").optional(),
|
|
201
|
+
claims: zod.z.array(zod.z.string()).optional().describe("List of claims to match at least one on within owner")
|
|
202
|
+
}),
|
|
203
|
+
apply: (resource, { userRef, claims = [] }) => {
|
|
204
|
+
return resource?.owner === userRef || claims.includes(resource?.owner);
|
|
205
|
+
},
|
|
206
|
+
toQuery: ({ userRef, claims = [] }) => {
|
|
207
|
+
return {
|
|
208
|
+
property: "collections.owner",
|
|
209
|
+
values: [userRef, ...claims].filter(Boolean)
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
const collectionOwnerConditionFactory = pluginPermissionNode.createConditionFactory(isCollectionOwner);
|
|
214
|
+
const collectionHasTags = createCollectionPermissionRule({
|
|
215
|
+
name: "HAS_TAGS",
|
|
216
|
+
description: "Should allow only if the posts in the collection have the specific tags",
|
|
217
|
+
resourceType: backstagePluginQetaCommon.COLLECTION_RESOUCE_TYPE,
|
|
218
|
+
paramsSchema: zod.z.object({
|
|
219
|
+
tags: zod.z.array(zod.z.string()).describe("Tag to match the collection")
|
|
220
|
+
}),
|
|
221
|
+
apply: (resource, { tags }) => {
|
|
222
|
+
return tags.every((t) => resource?.tags?.includes(t));
|
|
223
|
+
},
|
|
224
|
+
toQuery: ({ tags }) => {
|
|
225
|
+
return {
|
|
226
|
+
property: "tags",
|
|
227
|
+
values: tags
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
const collectionHasTagsConditionFactory = pluginPermissionNode.createConditionFactory(collectionHasTags);
|
|
232
|
+
const collectionHasEntities = createCollectionPermissionRule({
|
|
233
|
+
name: "HAS_ENTITIES",
|
|
234
|
+
description: "Should allow only if the posts in the collection have the specific entities",
|
|
235
|
+
resourceType: backstagePluginQetaCommon.COLLECTION_RESOUCE_TYPE,
|
|
236
|
+
paramsSchema: zod.z.object({
|
|
237
|
+
entityRefs: zod.z.array(zod.z.string()).describe("Entity refs to match the collection")
|
|
238
|
+
}),
|
|
239
|
+
apply: (resource, { entityRefs }) => {
|
|
240
|
+
return entityRefs.every((t) => resource?.entities?.includes(t));
|
|
241
|
+
},
|
|
242
|
+
toQuery: ({ entityRefs }) => {
|
|
243
|
+
return {
|
|
244
|
+
property: "entityRefs",
|
|
245
|
+
values: entityRefs
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
const collectionHasEntitiesConditionFactory = pluginPermissionNode.createConditionFactory(
|
|
250
|
+
collectionHasEntities
|
|
251
|
+
);
|
|
252
|
+
const collectionRules = {
|
|
253
|
+
isCollectionOwner,
|
|
254
|
+
collectionHasTags,
|
|
255
|
+
collectionHasEntities
|
|
256
|
+
};
|
|
257
|
+
const rules = {
|
|
258
|
+
...commentRules,
|
|
259
|
+
...answerRules,
|
|
260
|
+
...postRules,
|
|
261
|
+
...tagRules,
|
|
262
|
+
...collectionRules
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
exports.answerAuthorConditionFactory = answerAuthorConditionFactory;
|
|
266
|
+
exports.answerQuestionEntitiesConditionFactory = answerQuestionEntitiesConditionFactory;
|
|
267
|
+
exports.answerQuestionHasEntityRefs = answerQuestionHasEntityRefs;
|
|
268
|
+
exports.answerQuestionHasTags = answerQuestionHasTags;
|
|
269
|
+
exports.answerQuestionTagsConditionFactory = answerQuestionTagsConditionFactory;
|
|
270
|
+
exports.answerRules = answerRules;
|
|
271
|
+
exports.collectionHasEntities = collectionHasEntities;
|
|
272
|
+
exports.collectionHasEntitiesConditionFactory = collectionHasEntitiesConditionFactory;
|
|
273
|
+
exports.collectionHasTags = collectionHasTags;
|
|
274
|
+
exports.collectionHasTagsConditionFactory = collectionHasTagsConditionFactory;
|
|
275
|
+
exports.collectionOwnerConditionFactory = collectionOwnerConditionFactory;
|
|
276
|
+
exports.collectionRules = collectionRules;
|
|
277
|
+
exports.commentAuthorConditionFactory = commentAuthorConditionFactory;
|
|
278
|
+
exports.commentRules = commentRules;
|
|
279
|
+
exports.createAnswerPermissionRule = createAnswerPermissionRule;
|
|
280
|
+
exports.createCollectionPermissionRule = createCollectionPermissionRule;
|
|
281
|
+
exports.createCommentPermissionRule = createCommentPermissionRule;
|
|
282
|
+
exports.createPostPermissionRule = createPostPermissionRule;
|
|
283
|
+
exports.createTagPermissionRule = createTagPermissionRule;
|
|
284
|
+
exports.isAnswerAuthor = isAnswerAuthor;
|
|
285
|
+
exports.isCollectionOwner = isCollectionOwner;
|
|
286
|
+
exports.isCommentAuthor = isCommentAuthor;
|
|
287
|
+
exports.isPostAuthor = isPostAuthor;
|
|
288
|
+
exports.isTag = isTag;
|
|
289
|
+
exports.permissionRules = permissionRules;
|
|
290
|
+
exports.postAuthorConditionFactory = postAuthorConditionFactory;
|
|
291
|
+
exports.postHasEntities = postHasEntities;
|
|
292
|
+
exports.postHasEntitiesConditionFactory = postHasEntitiesConditionFactory;
|
|
293
|
+
exports.postHasTags = postHasTags;
|
|
294
|
+
exports.postHasTagsConditionFactory = postHasTagsConditionFactory;
|
|
295
|
+
exports.postHasType = postHasType;
|
|
296
|
+
exports.postHasTypeConditionFactory = postHasTypeConditionFactory;
|
|
297
|
+
exports.postRules = postRules;
|
|
298
|
+
exports.rules = rules;
|
|
299
|
+
exports.tagConditionFactory = tagConditionFactory;
|
|
300
|
+
exports.tagRules = tagRules;
|
|
301
|
+
//# sourceMappingURL=permissionRules.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissionRules.cjs.js","sources":["../src/permissionRules.ts"],"sourcesContent":["import {\n createConditionFactory,\n makeCreatePermissionRule,\n} from '@backstage/plugin-permission-node';\nimport { z } from 'zod';\nimport {\n Answer,\n ANSWER_RESOURCE_TYPE,\n AnswerFilter,\n Collection,\n COLLECTION_RESOUCE_TYPE,\n CollectionFilter,\n Comment,\n COMMENT_RESOURCE_TYPE,\n CommentFilter,\n Post,\n POST_RESOURCE_TYPE,\n PostFilter,\n TAG_RESOURCE_TYPE,\n TagFilter,\n TagResponse,\n} from '@drodil/backstage-plugin-qeta-common';\n\nexport const createPostPermissionRule = makeCreatePermissionRule<\n Post,\n PostFilter,\n typeof POST_RESOURCE_TYPE\n>();\n\nexport const isPostAuthor = createPostPermissionRule({\n name: 'IS_AUTHOR',\n description: 'Should allow only if the post is created by the user',\n resourceType: POST_RESOURCE_TYPE,\n paramsSchema: z.object({\n userRef: z.string().describe('User ID to match on the author').optional(),\n claims: z\n .array(z.string())\n .optional()\n .describe('List of claims to match at least one on within author'),\n }),\n apply: (resource: Post, { userRef, claims = [] }) => {\n return resource?.author === userRef || claims.includes(resource?.author);\n },\n toQuery: ({ userRef, claims = [] }) => {\n return {\n property: 'posts.author',\n values: [userRef, ...claims].filter(Boolean),\n };\n },\n});\n\nexport const postAuthorConditionFactory = createConditionFactory(isPostAuthor);\n\nexport const postHasTags = createPostPermissionRule({\n name: 'HAS_TAGS',\n description: 'Should allow only if the post has all the specific tags',\n resourceType: POST_RESOURCE_TYPE,\n paramsSchema: z.object({\n tags: z.array(z.string()).describe('Tag to match the post'),\n }),\n apply: (resource: Post, { tags }) => {\n return tags.every(t => resource?.tags?.includes(t));\n },\n toQuery: ({ tags }) => {\n return {\n property: 'tags',\n values: tags,\n };\n },\n});\n\nexport const postHasTagsConditionFactory = createConditionFactory(postHasTags);\n\nexport const postHasEntities = createPostPermissionRule({\n name: 'HAS_ENTITIES',\n description: 'Should allow only if the post has all the specific entities',\n resourceType: POST_RESOURCE_TYPE,\n paramsSchema: z.object({\n entityRefs: z.array(z.string()).describe('Entity refs to match the post'),\n }),\n apply: (resource: Post, { entityRefs }) => {\n return entityRefs.every(t => resource?.entities?.includes(t));\n },\n toQuery: ({ entityRefs }) => {\n return {\n property: 'entityRefs',\n values: entityRefs,\n };\n },\n});\n\nexport const postHasEntitiesConditionFactory =\n createConditionFactory(postHasEntities);\n\nexport const postHasType = createPostPermissionRule({\n name: 'HAS_TYPE',\n description: 'Should allow only if the post has the specific type',\n resourceType: POST_RESOURCE_TYPE,\n paramsSchema: z.object({\n type: z.string().describe('Type to match the post'),\n }),\n apply: (resource: Post, { type }) => {\n return resource?.type === type;\n },\n toQuery: ({ type }) => {\n return {\n property: 'posts.type',\n values: [type],\n };\n },\n});\n\nexport const postHasTypeConditionFactory = createConditionFactory(postHasType);\n\nexport const postRules = {\n isPostAuthor,\n postHasTags,\n postHasEntities,\n postHasType,\n};\n\n/**\n * @deprecated use `postRules` instead\n */\nexport const permissionRules = postRules;\n\nexport const createAnswerPermissionRule = makeCreatePermissionRule<\n Answer,\n AnswerFilter,\n typeof ANSWER_RESOURCE_TYPE\n>();\n\nexport const isAnswerAuthor = createAnswerPermissionRule({\n name: 'IS_AUTHOR',\n description: 'Should allow only if the answer is created by the user',\n resourceType: ANSWER_RESOURCE_TYPE,\n paramsSchema: z.object({\n userRef: z.string().describe('User ID to match on the author').optional(),\n claims: z\n .array(z.string())\n .optional()\n .describe('List of claims to match at least one on within author'),\n }),\n apply: (resource: Answer, { userRef, claims = [] }) => {\n return resource?.author === userRef || claims.includes(resource?.author);\n },\n toQuery: ({ userRef, claims = [] }) => {\n return {\n property: 'answers.author',\n values: [userRef, ...claims].filter(Boolean),\n };\n },\n});\n\nexport const answerAuthorConditionFactory =\n createConditionFactory(isAnswerAuthor);\n\nexport const answerQuestionHasTags = createAnswerPermissionRule({\n name: 'HAS_TAGS',\n description:\n 'Should allow only if the answers question has all the specific tags',\n resourceType: ANSWER_RESOURCE_TYPE,\n paramsSchema: z.object({\n tags: z.array(z.string()).describe('Tag to match the question'),\n }),\n apply: (resource: Answer, { tags }) => {\n return tags.every(t => resource?.post?.tags?.includes(t));\n },\n toQuery: ({ tags }) => {\n return {\n property: 'tags',\n values: tags,\n };\n },\n});\n\nexport const answerQuestionTagsConditionFactory = createConditionFactory(\n answerQuestionHasTags,\n);\n\nexport const answerQuestionHasEntityRefs = createAnswerPermissionRule({\n name: 'HAS_ENTITIES',\n description:\n 'Should allow only if the answers question has all the specific entities',\n resourceType: ANSWER_RESOURCE_TYPE,\n paramsSchema: z.object({\n entityRefs: z.array(z.string()).describe('Tag to match the question'),\n }),\n apply: (resource: Answer, { entityRefs }) => {\n return entityRefs.every(t => resource?.post?.entities?.includes(t));\n },\n toQuery: ({ entityRefs }) => {\n return {\n property: 'entityRefs',\n values: entityRefs,\n };\n },\n});\n\nexport const answerQuestionEntitiesConditionFactory = createConditionFactory(\n answerQuestionHasEntityRefs,\n);\n\nexport const answerRules = {\n isAnswerAuthor,\n answerQuestionHasTags,\n answerQuestionHasEntityRefs,\n};\n\nexport const createCommentPermissionRule = makeCreatePermissionRule<\n Comment,\n CommentFilter,\n typeof COMMENT_RESOURCE_TYPE\n>();\n\nexport const isCommentAuthor = createCommentPermissionRule({\n name: 'IS_AUTHOR',\n description: 'Should allow only if the comment is created by the user',\n resourceType: COMMENT_RESOURCE_TYPE,\n paramsSchema: z.object({\n userRef: z.string().describe('User ID to match on the author').optional(),\n claims: z\n .array(z.string())\n .optional()\n .describe('List of claims to match at least one on within author'),\n }),\n apply: (resource: Comment, { userRef, claims = [] }) => {\n return resource?.author === userRef || claims.includes(resource?.author);\n },\n toQuery: ({ userRef, claims = [] }) => {\n return {\n property: 'comments.author',\n values: [userRef, ...claims].filter(Boolean),\n };\n },\n});\n\nexport const commentAuthorConditionFactory =\n createConditionFactory(isCommentAuthor);\n\nexport const commentRules = { isCommentAuthor };\n\nexport const createTagPermissionRule = makeCreatePermissionRule<\n TagResponse,\n TagFilter,\n typeof TAG_RESOURCE_TYPE\n>();\nexport const isTag = createTagPermissionRule({\n name: 'IS_TAG',\n description: 'Should allow only if the tag exists',\n resourceType: TAG_RESOURCE_TYPE,\n paramsSchema: z.object({\n tag: z.string().describe('Tag to match the post'),\n }),\n apply: (resource: TagResponse, { tag }) => {\n return resource?.tag === tag;\n },\n toQuery: ({ tag }) => {\n return {\n property: 'tags.tag',\n values: [tag],\n };\n },\n});\n\nexport const tagConditionFactory = createConditionFactory(isTag);\n\nexport const tagRules = { isTag };\n\nexport const createCollectionPermissionRule = makeCreatePermissionRule<\n Collection,\n CollectionFilter,\n typeof COLLECTION_RESOUCE_TYPE\n>();\n\nexport const isCollectionOwner = createCollectionPermissionRule({\n name: 'IS_OWNER',\n description: 'Should allow only if the collection is owned by the user',\n resourceType: COLLECTION_RESOUCE_TYPE,\n paramsSchema: z.object({\n userRef: z\n .string()\n .describe('User reference to match on the owner')\n .optional(),\n claims: z\n .array(z.string())\n .optional()\n .describe('List of claims to match at least one on within owner'),\n }),\n apply: (resource: Collection, { userRef, claims = [] }) => {\n return resource?.owner === userRef || claims.includes(resource?.owner);\n },\n toQuery: ({ userRef, claims = [] }) => {\n return {\n property: 'collections.owner',\n values: [userRef, ...claims].filter(Boolean),\n };\n },\n});\n\nexport const collectionOwnerConditionFactory =\n createConditionFactory(isCollectionOwner);\n\nexport const collectionHasTags = createCollectionPermissionRule({\n name: 'HAS_TAGS',\n description:\n 'Should allow only if the posts in the collection have the specific tags',\n resourceType: COLLECTION_RESOUCE_TYPE,\n paramsSchema: z.object({\n tags: z.array(z.string()).describe('Tag to match the collection'),\n }),\n apply: (resource: Collection, { tags }) => {\n return tags.every(t => resource?.tags?.includes(t));\n },\n toQuery: ({ tags }) => {\n return {\n property: 'tags',\n values: tags,\n };\n },\n});\n\nexport const collectionHasTagsConditionFactory =\n createConditionFactory(collectionHasTags);\n\nexport const collectionHasEntities = createCollectionPermissionRule({\n name: 'HAS_ENTITIES',\n description:\n 'Should allow only if the posts in the collection have the specific entities',\n resourceType: COLLECTION_RESOUCE_TYPE,\n paramsSchema: z.object({\n entityRefs: z\n .array(z.string())\n .describe('Entity refs to match the collection'),\n }),\n apply: (resource: Collection, { entityRefs }) => {\n return entityRefs.every(t => resource?.entities?.includes(t));\n },\n toQuery: ({ entityRefs }) => {\n return {\n property: 'entityRefs',\n values: entityRefs,\n };\n },\n});\n\nexport const collectionHasEntitiesConditionFactory = createConditionFactory(\n collectionHasEntities,\n);\n\nexport const collectionRules = {\n isCollectionOwner,\n collectionHasTags,\n collectionHasEntities,\n};\n\nexport const rules = {\n ...commentRules,\n ...answerRules,\n ...postRules,\n ...tagRules,\n ...collectionRules,\n};\n"],"names":["makeCreatePermissionRule","POST_RESOURCE_TYPE","z","createConditionFactory","ANSWER_RESOURCE_TYPE","COMMENT_RESOURCE_TYPE","TAG_RESOURCE_TYPE","COLLECTION_RESOUCE_TYPE"],"mappings":";;;;;;AAuBO,MAAM,2BAA2BA,6CAItC;AAEK,MAAM,eAAe,wBAAyB,CAAA;AAAA,EACnD,IAAM,EAAA,WAAA;AAAA,EACN,WAAa,EAAA,sDAAA;AAAA,EACb,YAAc,EAAAC,4CAAA;AAAA,EACd,YAAA,EAAcC,MAAE,MAAO,CAAA;AAAA,IACrB,SAASA,KAAE,CAAA,MAAA,GAAS,QAAS,CAAA,gCAAgC,EAAE,QAAS,EAAA;AAAA,IACxE,MAAA,EAAQA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,GAAA;AAAA,EACnB,GAAG,YAAA;AAAA,EACH,GAAG,WAAA;AAAA,EACH,GAAG,SAAA;AAAA,EACH,GAAG,QAAA;AAAA,EACH,GAAG;AACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"backstage.io",
|
|
8
8
|
"node"
|
|
9
9
|
],
|
|
10
|
-
"version": "3.
|
|
10
|
+
"version": "3.20.2",
|
|
11
11
|
"main": "dist/index.cjs.js",
|
|
12
12
|
"types": "dist/index.d.ts",
|
|
13
13
|
"prepublishOnly": "yarn tsc && yarn build",
|
|
@@ -54,7 +54,9 @@
|
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@backstage/backend-plugin-api": "^1.1.1",
|
|
57
|
-
"@
|
|
57
|
+
"@backstage/plugin-permission-node": "^0.8.7",
|
|
58
|
+
"@drodil/backstage-plugin-qeta-common": "^3.20.2",
|
|
59
|
+
"zod": "^3.22.4"
|
|
58
60
|
},
|
|
59
61
|
"typesVersions": {
|
|
60
62
|
"*": {
|