fix: FieldMetadata default value and options better validation (#2785)

* fix: wip better field metadata validation

* fix: remove files

* fix: default value and options validation

* fix: small fix

* fix: try to limit patch

* fix: tests

* Update server/src/metadata/field-metadata/validators/is-field-metadata-options.validator.ts

Co-authored-by: Weiko <corentin@twenty.com>

* fix: lint

* fix: standard fields update security

---------

Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
Jérémy M
2023-12-06 15:19:23 +01:00
committed by GitHub
parent b09100e3f3
commit 93decaceab
25 changed files with 6369 additions and 492 deletions

View File

@ -4,6 +4,7 @@ import { ValidationPipe } from '@nestjs/common';
import * as bodyParser from 'body-parser';
import { graphqlUploadExpress } from 'graphql-upload';
import bytes from 'bytes';
import { useContainer } from 'class-validator';
import { AppModule } from './app.module';
@ -19,8 +20,16 @@ const bootstrap = async () => {
: ['error', 'warn', 'log'],
});
// Apply class-validator container so that we can use injection in validators
useContainer(app.select(AppModule), { fallbackOnErrors: true });
// Apply validation pipes globally
app.useGlobalPipes(new ValidationPipe());
app.useGlobalPipes(
new ValidationPipe({
// whitelist: true,
transform: true,
}),
);
app.use(bodyParser.json({ limit: settings.storage.maxFileSize }));
app.use(