diff --git a/apps/server/src/modules/tool/common/domain/custom-parameter.do.ts b/apps/server/src/modules/tool/common/domain/custom-parameter.do.ts index fcad4784f43..6e34fabe86c 100644 --- a/apps/server/src/modules/tool/common/domain/custom-parameter.do.ts +++ b/apps/server/src/modules/tool/common/domain/custom-parameter.do.ts @@ -21,6 +21,8 @@ export class CustomParameter { isOptional: boolean; + isProtected: boolean; + constructor(props: CustomParameter) { this.name = props.name; this.displayName = props.displayName; @@ -32,5 +34,6 @@ export class CustomParameter { this.regex = props.regex; this.regexComment = props.regexComment; this.isOptional = props.isOptional; + this.isProtected = props.isProtected; } } diff --git a/apps/server/src/modules/tool/context-external-tool/entity/context-external-tool.entity.spec.ts b/apps/server/src/modules/tool/context-external-tool/entity/context-external-tool.entity.spec.ts index 29f2b3080d1..b41519bbef5 100644 --- a/apps/server/src/modules/tool/context-external-tool/entity/context-external-tool.entity.spec.ts +++ b/apps/server/src/modules/tool/context-external-tool/entity/context-external-tool.entity.spec.ts @@ -43,6 +43,7 @@ describe('ExternalToolEntity', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const externalToolEntity: ExternalToolEntity = externalToolEntityFactory.buildWithId({ name: 'toolName', diff --git a/apps/server/src/modules/tool/external-tool/controller/api-test/tool-configuration.api.spec.ts b/apps/server/src/modules/tool/external-tool/controller/api-test/tool-configuration.api.spec.ts index 1207c326ea8..812836a99da 100644 --- a/apps/server/src/modules/tool/external-tool/controller/api-test/tool-configuration.api.spec.ts +++ b/apps/server/src/modules/tool/external-tool/controller/api-test/tool-configuration.api.spec.ts @@ -203,6 +203,7 @@ describe('ToolConfigurationController (API)', () => { name: contextParameter.name, displayName: contextParameter.displayName, isOptional: contextParameter.isOptional, + isProtected: contextParameter.isProtected, defaultValue: contextParameter.default, description: contextParameter.description, regex: contextParameter.regex, @@ -361,6 +362,7 @@ describe('ToolConfigurationController (API)', () => { name: schoolParameter.name, displayName: schoolParameter.displayName, isOptional: schoolParameter.isOptional, + isProtected: schoolParameter.isProtected, defaultValue: schoolParameter.default, description: schoolParameter.description, regex: schoolParameter.regex, @@ -489,6 +491,7 @@ describe('ToolConfigurationController (API)', () => { name: schoolParameter.name, displayName: schoolParameter.displayName, isOptional: schoolParameter.isOptional, + isProtected: schoolParameter.isProtected, defaultValue: schoolParameter.default, description: schoolParameter.description, regex: schoolParameter.regex, @@ -644,6 +647,7 @@ describe('ToolConfigurationController (API)', () => { name: contextParameter.name, displayName: contextParameter.displayName, isOptional: contextParameter.isOptional, + isProtected: contextParameter.isProtected, defaultValue: contextParameter.default, description: contextParameter.description, regex: contextParameter.regex, diff --git a/apps/server/src/modules/tool/external-tool/controller/api-test/tool.api.spec.ts b/apps/server/src/modules/tool/external-tool/controller/api-test/tool.api.spec.ts index 27f7e7825e4..93da1d956b2 100644 --- a/apps/server/src/modules/tool/external-tool/controller/api-test/tool.api.spec.ts +++ b/apps/server/src/modules/tool/external-tool/controller/api-test/tool.api.spec.ts @@ -74,6 +74,7 @@ describe('ToolController (API)', () => { displayName: 'User Friendly Name', defaultValue: 'abc', isOptional: false, + isProtected: false, type: CustomParameterTypeParams.STRING, regex: 'abc', regexComment: 'Regex accepts "abc" as value.', @@ -137,6 +138,7 @@ describe('ToolController (API)', () => { displayName: 'User Friendly Name', defaultValue: 'abc', isOptional: false, + isProtected: false, type: CustomParameterTypeParams.STRING, regex: 'abc', regexComment: 'Regex accepts "abc" as value.', @@ -367,6 +369,7 @@ describe('ToolController (API)', () => { displayName: 'User Friendly Name', defaultValue: 'abc', isOptional: false, + isProtected: false, type: CustomParameterTypeParams.STRING, regex: 'abc', regexComment: 'Regex accepts "abc" as value.', @@ -433,6 +436,7 @@ describe('ToolController (API)', () => { displayName: 'User Friendly Name', defaultValue: 'abc', isOptional: false, + isProtected: false, type: CustomParameterTypeParams.STRING, regex: 'abc', regexComment: 'Regex accepts "abc" as value.', diff --git a/apps/server/src/modules/tool/external-tool/controller/dto/request/custom-parameter.params.ts b/apps/server/src/modules/tool/external-tool/controller/dto/request/custom-parameter.params.ts index c996183b5ba..2ab070d46a3 100644 --- a/apps/server/src/modules/tool/external-tool/controller/dto/request/custom-parameter.params.ts +++ b/apps/server/src/modules/tool/external-tool/controller/dto/request/custom-parameter.params.ts @@ -52,4 +52,8 @@ export class CustomParameterPostParams { @IsBoolean() @ApiProperty() isOptional!: boolean; + + @IsBoolean() + @ApiProperty() + isProtected!: boolean; } diff --git a/apps/server/src/modules/tool/external-tool/controller/dto/response/custom-parameter.response.ts b/apps/server/src/modules/tool/external-tool/controller/dto/response/custom-parameter.response.ts index 058bbdb5d0d..604d4f9cba7 100644 --- a/apps/server/src/modules/tool/external-tool/controller/dto/response/custom-parameter.response.ts +++ b/apps/server/src/modules/tool/external-tool/controller/dto/response/custom-parameter.response.ts @@ -36,6 +36,9 @@ export class CustomParameterResponse { @ApiProperty() isOptional: boolean; + @ApiProperty() + isProtected: boolean; + constructor(props: CustomParameterResponse) { this.name = props.name; this.displayName = props.displayName; @@ -47,5 +50,6 @@ export class CustomParameterResponse { this.regex = props.regex; this.regexComment = props.regexComment; this.isOptional = props.isOptional; + this.isProtected = props.isProtected; } } diff --git a/apps/server/src/modules/tool/external-tool/entity/custom-parameter/custom-parameter.entity.ts b/apps/server/src/modules/tool/external-tool/entity/custom-parameter/custom-parameter.entity.ts index 3f99cfe52b5..e9d4833d0bc 100644 --- a/apps/server/src/modules/tool/external-tool/entity/custom-parameter/custom-parameter.entity.ts +++ b/apps/server/src/modules/tool/external-tool/entity/custom-parameter/custom-parameter.entity.ts @@ -33,6 +33,9 @@ export class CustomParameterEntity { @Property() isOptional: boolean; + @Property({ default: false }) + isProtected: boolean; + constructor(props: CustomParameterEntity) { this.name = props.name; this.displayName = props.displayName; @@ -44,5 +47,6 @@ export class CustomParameterEntity { this.regex = props.regex; this.regexComment = props.regexComment; this.isOptional = props.isOptional; + this.isProtected = props.isProtected; } } diff --git a/apps/server/src/modules/tool/external-tool/entity/external-tool.entity.spec.ts b/apps/server/src/modules/tool/external-tool/entity/external-tool.entity.spec.ts index 933f007c440..9d037046942 100644 --- a/apps/server/src/modules/tool/external-tool/entity/external-tool.entity.spec.ts +++ b/apps/server/src/modules/tool/external-tool/entity/external-tool.entity.spec.ts @@ -48,6 +48,7 @@ describe('ExternalToolEntity', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const externalToolEntity: ExternalToolEntity = new ExternalToolEntity({ name: 'toolName', diff --git a/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.spec.ts b/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.spec.ts index 72f5d35de5c..cf29d8e874c 100644 --- a/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.spec.ts +++ b/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.spec.ts @@ -71,6 +71,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolCreateParams = new ExternalToolCreateParams(); externalToolCreateParams.name = 'mockName'; @@ -159,6 +160,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolCreateParams = new ExternalToolCreateParams(); externalToolCreateParams.name = 'mockName'; @@ -244,6 +246,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolCreateParams = new ExternalToolCreateParams(); externalToolCreateParams.name = 'mockName'; @@ -312,6 +315,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolUpdateParams = new ExternalToolUpdateParams(); externalToolUpdateParams.id = 'id'; @@ -404,6 +408,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolUpdateParams = new ExternalToolUpdateParams(); externalToolUpdateParams.id = 'id'; @@ -493,6 +498,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolUpdateParams = new ExternalToolUpdateParams(); externalToolUpdateParams.id = 'id'; diff --git a/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.ts b/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.ts index 916e1c734a8..c57e0ee457a 100644 --- a/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.ts +++ b/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.ts @@ -153,6 +153,7 @@ export class ExternalToolRequestMapper { location: locationMapping[customParameterParam.location], type: typeMapping[customParameterParam.type], isOptional: customParameterParam.isOptional, + isProtected: customParameterParam.isProtected, }; }); } diff --git a/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.spec.ts b/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.spec.ts index bdf612f944c..0a491222081 100644 --- a/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.spec.ts +++ b/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.spec.ts @@ -43,6 +43,7 @@ describe('ExternalToolResponseMapper', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const basicToolConfigResponse: BasicToolConfigResponse = new BasicToolConfigResponse({ @@ -143,6 +144,7 @@ describe('ExternalToolResponseMapper', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const externalToolResponse: ExternalToolResponse = new ExternalToolResponse({ @@ -230,6 +232,7 @@ describe('ExternalToolResponseMapper', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const externalToolResponse: ExternalToolResponse = new ExternalToolResponse({ diff --git a/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.ts b/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.ts index eadbc20c50a..7be202132ef 100644 --- a/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.ts +++ b/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.ts @@ -94,6 +94,7 @@ export class ExternalToolResponseMapper { location: locationMapping[customParameterDO.location], type: typeMapping[customParameterDO.type], isOptional: customParameterDO.isOptional, + isProtected: customParameterDO.isProtected, }; }); } diff --git a/apps/server/src/modules/tool/external-tool/service/external-tool-version.service.spec.ts b/apps/server/src/modules/tool/external-tool/service/external-tool-version.service.spec.ts index dabfd70996e..f19eaeabe04 100644 --- a/apps/server/src/modules/tool/external-tool/service/external-tool-version.service.spec.ts +++ b/apps/server/src/modules/tool/external-tool/service/external-tool-version.service.spec.ts @@ -17,6 +17,7 @@ describe('ExternalToolVersionService', () => { displayName: 'displayName', default: 'defaulValueParam1', isOptional: false, + isProtected: false, location: CustomParameterLocation.PATH, regex: '*', regexComment: '', diff --git a/apps/server/src/modules/tool/school-external-tool/entity/school-external-tool.entity.spec.ts b/apps/server/src/modules/tool/school-external-tool/entity/school-external-tool.entity.spec.ts index 17344cd0579..c3b03b2d0cd 100644 --- a/apps/server/src/modules/tool/school-external-tool/entity/school-external-tool.entity.spec.ts +++ b/apps/server/src/modules/tool/school-external-tool/entity/school-external-tool.entity.spec.ts @@ -41,6 +41,7 @@ describe('SchoolExternalToolEntity', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const externalToolEntity: ExternalToolEntity = new ExternalToolEntity({ name: 'toolName', diff --git a/apps/server/src/shared/repo/externaltool/external-tool.repo.integration.spec.ts b/apps/server/src/shared/repo/externaltool/external-tool.repo.integration.spec.ts index 75fa86597fb..e3e2949d5c1 100644 --- a/apps/server/src/shared/repo/externaltool/external-tool.repo.integration.spec.ts +++ b/apps/server/src/shared/repo/externaltool/external-tool.repo.integration.spec.ts @@ -152,6 +152,7 @@ describe('ExternalToolRepo', () => { location: CustomParameterLocation.BODY, regexComment: 'mockComment', isOptional: false, + isProtected: false, }), ], isHidden: true, diff --git a/apps/server/src/shared/repo/externaltool/external-tool.repo.mapper.ts b/apps/server/src/shared/repo/externaltool/external-tool.repo.mapper.ts index a5710bc3a81..7740647ea9f 100644 --- a/apps/server/src/shared/repo/externaltool/external-tool.repo.mapper.ts +++ b/apps/server/src/shared/repo/externaltool/external-tool.repo.mapper.ts @@ -149,6 +149,7 @@ export class ExternalToolRepoMapper { location: param.location, type: param.type, isOptional: param.isOptional, + isProtected: param.isProtected, }) ); } @@ -167,6 +168,7 @@ export class ExternalToolRepoMapper { location: param.location, type: param.type, isOptional: param.isOptional, + isProtected: param.isProtected, }) ); } diff --git a/apps/server/src/shared/testing/factory/domainobject/tool/external-tool.factory.ts b/apps/server/src/shared/testing/factory/domainobject/tool/external-tool.factory.ts index 7815d863a69..d5ec2ee7371 100644 --- a/apps/server/src/shared/testing/factory/domainobject/tool/external-tool.factory.ts +++ b/apps/server/src/shared/testing/factory/domainobject/tool/external-tool.factory.ts @@ -79,6 +79,7 @@ export const customParameterFactory = CustomParameterFactory.define(CustomParame scope: CustomParameterScope.SCHOOL, location: CustomParameterLocation.BODY, isOptional: false, + isProtected: false, }; }); diff --git a/apps/server/src/shared/testing/factory/external-tool-entity.factory.ts b/apps/server/src/shared/testing/factory/external-tool-entity.factory.ts index 39ff2662cf7..8f7c22247fd 100644 --- a/apps/server/src/shared/testing/factory/external-tool-entity.factory.ts +++ b/apps/server/src/shared/testing/factory/external-tool-entity.factory.ts @@ -85,6 +85,7 @@ export const customParameterEntityFactory = BaseFactory.define