forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): Use class-validator with XSS check for survey answers (n8n…
…-io#10490) Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
- Loading branch information
Showing
15 changed files
with
274 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import { NoXss } from '@/validators/no-xss.validator'; | ||
import { Expose } from 'class-transformer'; | ||
import { IsString, IsArray, IsOptional, IsEmail, IsEnum } from 'class-validator'; | ||
import type { IPersonalizationSurveyAnswersV4 } from 'n8n-workflow'; | ||
|
||
export class PersonalizationSurveyAnswersV4 implements IPersonalizationSurveyAnswersV4 { | ||
@NoXss() | ||
@Expose() | ||
@IsEnum(['v4']) | ||
version: 'v4'; | ||
|
||
@NoXss() | ||
@Expose() | ||
@IsString() | ||
personalization_survey_submitted_at: string; | ||
|
||
@NoXss() | ||
@Expose() | ||
@IsString() | ||
personalization_survey_n8n_version: string; | ||
|
||
@Expose() | ||
@IsOptional() | ||
@IsArray() | ||
@NoXss({ each: true }) | ||
@IsString({ each: true }) | ||
automationGoalDevops?: string[] | null; | ||
|
||
@NoXss() | ||
@Expose() | ||
@IsOptional() | ||
@IsString() | ||
automationGoalDevopsOther?: string | null; | ||
|
||
@NoXss({ each: true }) | ||
@Expose() | ||
@IsOptional() | ||
@IsArray() | ||
@IsString({ each: true }) | ||
companyIndustryExtended?: string[] | null; | ||
|
||
@NoXss({ each: true }) | ||
@Expose() | ||
@IsOptional() | ||
@IsString({ each: true }) | ||
otherCompanyIndustryExtended?: string[] | null; | ||
|
||
@NoXss() | ||
@Expose() | ||
@IsOptional() | ||
@IsString() | ||
companySize?: string | null; | ||
|
||
@NoXss() | ||
@Expose() | ||
@IsOptional() | ||
@IsString() | ||
companyType?: string | null; | ||
|
||
@NoXss({ each: true }) | ||
@Expose() | ||
@IsOptional() | ||
@IsArray() | ||
@IsString({ each: true }) | ||
automationGoalSm?: string[] | null; | ||
|
||
@NoXss() | ||
@Expose() | ||
@IsOptional() | ||
@IsString() | ||
automationGoalSmOther?: string | null; | ||
|
||
@NoXss({ each: true }) | ||
@Expose() | ||
@IsOptional() | ||
@IsArray() | ||
@IsString({ each: true }) | ||
usageModes?: string[] | null; | ||
|
||
@NoXss() | ||
@Expose() | ||
@IsOptional() | ||
@IsEmail() | ||
email?: string | null; | ||
|
||
@NoXss() | ||
@Expose() | ||
@IsOptional() | ||
@IsString() | ||
role?: string | null; | ||
|
||
@NoXss() | ||
@Expose() | ||
@IsOptional() | ||
@IsString() | ||
roleOther?: string | null; | ||
|
||
@NoXss() | ||
@Expose() | ||
@IsOptional() | ||
@IsString() | ||
reportedSource?: string | null; | ||
|
||
@NoXss() | ||
@Expose() | ||
@IsOptional() | ||
@IsString() | ||
reportedSourceOther?: string | null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.