Allow empty values for secrets

This commit is contained in:
Tuan Dang
2023-01-27 22:07:56 +07:00
parent d09b406c4e
commit 13acb19e9f
3 changed files with 20 additions and 15 deletions
+4 -1
View File
@@ -1,5 +1,4 @@
import mongoose from 'mongoose';
import { ISecret, Secret } from '../models';
import { EESecretService } from '../ee/services';
import { getLogger } from '../utils/logger';
@@ -16,6 +15,10 @@ const initDatabaseHelper = async ({
}) => {
try {
await mongoose.connect(mongoURL);
// allow empty strings to pass the required validator
mongoose.Schema.Types.String.checkRequired(v => typeof v === 'string');
getLogger("database").info("Database connection established");
await EESecretService.initSecretVersioning();