codify-plugin-lib 1.0.179 → 1.0.180
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/plugin/plugin.js
CHANGED
|
@@ -30,13 +30,22 @@ export class Plugin {
|
|
|
30
30
|
}
|
|
31
31
|
return {
|
|
32
32
|
resourceDefinitions: [...this.resourceControllers.values()]
|
|
33
|
-
.map((r) =>
|
|
34
|
-
|
|
35
|
-
type: r.typeId,
|
|
36
|
-
sensitiveParameters: Object.entries(r.settings.parameterSettings ?? {})
|
|
33
|
+
.map((r) => {
|
|
34
|
+
const sensitiveParameters = Object.entries(r.settings.parameterSettings ?? {})
|
|
37
35
|
.filter(([, v]) => v?.isSensitive)
|
|
38
|
-
.map(([k]) => k)
|
|
39
|
-
|
|
36
|
+
.map(([k]) => k);
|
|
37
|
+
// Here we add '*' if the resource is sensitive but no sensitive parameters are found. This works because the import
|
|
38
|
+
// sensitivity check only checks for the existance of a sensitive parameter whereas the parameter blocking one blocks
|
|
39
|
+
// on a specific sensitive parameter.
|
|
40
|
+
if (r.settings.isSensitive && sensitiveParameters.length === 0) {
|
|
41
|
+
sensitiveParameters.push('*');
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
dependencies: r.dependencies,
|
|
45
|
+
type: r.typeId,
|
|
46
|
+
sensitiveParameters,
|
|
47
|
+
};
|
|
48
|
+
})
|
|
40
49
|
};
|
|
41
50
|
}
|
|
42
51
|
getResourceInfo(data) {
|
|
@@ -51,9 +60,15 @@ export class Plugin {
|
|
|
51
60
|
?? undefined);
|
|
52
61
|
const allowMultiple = resource.settings.allowMultiple !== undefined
|
|
53
62
|
&& resource.settings.allowMultiple !== false;
|
|
63
|
+
// Here we add '*' if the resource is sensitive but no sensitive parameters are found. This works because the import
|
|
64
|
+
// sensitivity check only checks for the existance of a sensitive parameter whereas the parameter blocking one blocks
|
|
65
|
+
// on a specific sensitive parameter.
|
|
54
66
|
const sensitiveParameters = Object.entries(resource.settings.parameterSettings ?? {})
|
|
55
67
|
.filter(([, v]) => v?.isSensitive)
|
|
56
68
|
.map(([k]) => k);
|
|
69
|
+
if (resource.settings.isSensitive && sensitiveParameters.length === 0) {
|
|
70
|
+
sensitiveParameters.push('*');
|
|
71
|
+
}
|
|
57
72
|
return {
|
|
58
73
|
plugin: this.name,
|
|
59
74
|
type: data.type,
|
|
@@ -18,6 +18,11 @@ export interface ResourceSettings<T extends StringIndexedObject> {
|
|
|
18
18
|
* Schema to validate user configs with. Must be in the format JSON Schema draft07
|
|
19
19
|
*/
|
|
20
20
|
schema?: Partial<JSONSchemaType<T | any>>;
|
|
21
|
+
/**
|
|
22
|
+
* Mark the resource as sensitive. Defaults to false. This prevents the resource from automatically being imported by init and import.
|
|
23
|
+
* This differs from the parameter level sensitivity which also prevents the parameter value from being displayed in the plan.
|
|
24
|
+
*/
|
|
25
|
+
isSensitive?: boolean;
|
|
21
26
|
/**
|
|
22
27
|
* Allow multiple of the same resource to unique. Set truthy if
|
|
23
28
|
* multiples are allowed, for example for applications, there can be multiple copy of the same application installed
|
package/package.json
CHANGED
package/src/plugin/plugin.ts
CHANGED
|
@@ -59,13 +59,24 @@ export class Plugin {
|
|
|
59
59
|
|
|
60
60
|
return {
|
|
61
61
|
resourceDefinitions: [...this.resourceControllers.values()]
|
|
62
|
-
.map((r) =>
|
|
63
|
-
|
|
64
|
-
type: r.typeId,
|
|
65
|
-
sensitiveParameters: Object.entries(r.settings.parameterSettings ?? {})
|
|
62
|
+
.map((r) => {
|
|
63
|
+
const sensitiveParameters = Object.entries(r.settings.parameterSettings ?? {})
|
|
66
64
|
.filter(([, v]) => v?.isSensitive)
|
|
67
|
-
.map(([k]) => k)
|
|
68
|
-
|
|
65
|
+
.map(([k]) => k);
|
|
66
|
+
|
|
67
|
+
// Here we add '*' if the resource is sensitive but no sensitive parameters are found. This works because the import
|
|
68
|
+
// sensitivity check only checks for the existance of a sensitive parameter whereas the parameter blocking one blocks
|
|
69
|
+
// on a specific sensitive parameter.
|
|
70
|
+
if (r.settings.isSensitive && sensitiveParameters.length === 0) {
|
|
71
|
+
sensitiveParameters.push('*');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
dependencies: r.dependencies,
|
|
76
|
+
type: r.typeId,
|
|
77
|
+
sensitiveParameters,
|
|
78
|
+
}
|
|
79
|
+
})
|
|
69
80
|
}
|
|
70
81
|
}
|
|
71
82
|
|
|
@@ -87,10 +98,17 @@ export class Plugin {
|
|
|
87
98
|
const allowMultiple = resource.settings.allowMultiple !== undefined
|
|
88
99
|
&& resource.settings.allowMultiple !== false;
|
|
89
100
|
|
|
101
|
+
// Here we add '*' if the resource is sensitive but no sensitive parameters are found. This works because the import
|
|
102
|
+
// sensitivity check only checks for the existance of a sensitive parameter whereas the parameter blocking one blocks
|
|
103
|
+
// on a specific sensitive parameter.
|
|
90
104
|
const sensitiveParameters = Object.entries(resource.settings.parameterSettings ?? {})
|
|
91
105
|
.filter(([, v]) => v?.isSensitive)
|
|
92
106
|
.map(([k]) => k);
|
|
93
107
|
|
|
108
|
+
if (resource.settings.isSensitive && sensitiveParameters.length === 0) {
|
|
109
|
+
sensitiveParameters.push('*');
|
|
110
|
+
}
|
|
111
|
+
|
|
94
112
|
return {
|
|
95
113
|
plugin: this.name,
|
|
96
114
|
type: data.type,
|
|
@@ -27,6 +27,12 @@ export interface ResourceSettings<T extends StringIndexedObject> {
|
|
|
27
27
|
*/
|
|
28
28
|
schema?: Partial<JSONSchemaType<T | any>>;
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Mark the resource as sensitive. Defaults to false. This prevents the resource from automatically being imported by init and import.
|
|
32
|
+
* This differs from the parameter level sensitivity which also prevents the parameter value from being displayed in the plan.
|
|
33
|
+
*/
|
|
34
|
+
isSensitive?: boolean;
|
|
35
|
+
|
|
30
36
|
/**
|
|
31
37
|
* Allow multiple of the same resource to unique. Set truthy if
|
|
32
38
|
* multiples are allowed, for example for applications, there can be multiple copy of the same application installed
|