Skip to content

Commit 2618f34

Browse files
committed
feat: Add isSensitive field for handling of sensitive parameters
1 parent 5529c11 commit 2618f34

10 files changed

+37
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codify-schemas",
3-
"version": "1.0.77",
3+
"version": "1.0.83",
44
"description": "",
55
"type": "module",
66
"main": "dist/index.js",

src/messages/apply-request-data-schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
},
6565
"previousValue": {
6666
"description": "The new value"
67+
},
68+
"isSensitive": {
69+
"description": "Indicates if the parameter is sensitive",
70+
"type": "boolean"
6771
}
6872
},
6973
"required": [

src/messages/apply-request-data-schema.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ describe('Apply request data schema', () => {
3636
operation: ParameterOperation.ADD,
3737
newValue: 'abc',
3838
previousValue: null,
39+
isSensitive: false,
3940
}]
4041
}
4142
} as ApplyRequestData)).to.be.true;

src/messages/get-resource-info-response-data-schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
}
5050
}
5151
},
52+
"sensitiveParameters": {
53+
"type": "array",
54+
"items": {
55+
"type": "string"
56+
}
57+
},
5258
"allowMultiple": {
5359
"type": "boolean"
5460
}

src/messages/get-resource-info-response-data-schema.test.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('Get resources response data schema', () => {
4040
"items": {
4141
"type": "string"
4242
}
43-
}
43+
},
4444
},
4545
dependencies: [
4646
"typeA",
@@ -56,11 +56,7 @@ describe('Get resources response data schema', () => {
5656
requiredParameters: ['plugin']
5757
},
5858
allowMultiple: true,
59-
})).to.be.true;
60-
61-
expect(validate({
62-
type: 'type',
63-
plugin: 'core-plugin',
59+
sensitiveParameters: [],
6460
})).to.be.true;
6561

6662
// For testing the typescript type
@@ -134,10 +130,15 @@ describe('Get resources response data schema', () => {
134130
"items": {
135131
"type": "string"
136132
}
133+
},
134+
"sensitiveProperties": {
135+
"type": "array",
136+
"items": {
137+
"type": "string"
138+
}
137139
}
138140
}
139141
}
140-
141142
})).to.be.false;
142143

143144
expect(validate({

src/messages/initialize-response-data-schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
"items": {
1919
"type": "string"
2020
}
21+
},
22+
"sensitiveParameters": {
23+
"type": "array",
24+
"items": {
25+
"type": "string"
26+
}
2127
}
2228
},
2329
"required": [

src/messages/initialize-response-data-schema.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ describe('Get resources response data schema', () => {
2222
{
2323
type: 'typeB',
2424
dependencies: [],
25+
sensitiveParameters: ['paramA', 'paramB'],
2526
}
2627
]
2728
})).to.be.true;

src/messages/plan-response-data-schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
},
4747
"newValue": {
4848
"description": "The new value"
49+
},
50+
"isSensitive": {
51+
"description": "Indicates if the parameter is sensitive",
52+
"type": "boolean"
4953
}
5054
},
5155
"required": ["name", "operation", "previousValue", "newValue"]

src/messages/plan-response-data-schema.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ describe('Plan response data schema', () => {
2727
name: 'parameter1',
2828
operation: ParameterOperation.ADD,
2929
previousValue: null,
30-
newValue: 'abc'
30+
newValue: 'abc',
31+
isSensitive: false,
3132
}]
3233
} as PlanResponseData)).to.be.true;
3334
})

src/types/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export interface PlanResponseData {
9494
operation: ParameterOperation;
9595
previousValue: unknown | null;
9696
newValue: unknown | null;
97+
isSensitive?: boolean;
9798
}>
9899
}
99100

@@ -116,6 +117,7 @@ export interface GetResourceInfoResponseData {
116117
requiredParameters: string[] | null;
117118
preventImport?: boolean;
118119
},
120+
sensitiveParameters?: string[];
119121
allowMultiple: boolean;
120122
}
121123

@@ -160,13 +162,15 @@ export interface ApplyRequestData {
160162
operation: ParameterOperation;
161163
newValue: unknown | null;
162164
previousValue: unknown | null;
165+
isSensitive?: boolean;
163166
}>
164167
}
165168
}
166169

167170
export interface ResourceDefinition {
168171
type: string;
169172
dependencies: string[];
173+
sensitiveParameters?: string[];
170174
}
171175

172176
export interface InitializeRequestData {

0 commit comments

Comments
 (0)