@@ -164,32 +164,6 @@ export const Constants = {
164164 isTestConnection : true ,
165165 } ,
166166
167- TEST_CONNECTION_TO_MSSQL : {
168- title : 'MSSQL' ,
169- masterEncryption : false ,
170- type : ConnectionTypesEnum . mssql ,
171- host : appConfig . testDb . mssql . host ,
172- port : appConfig . testDb . mssql . port ,
173- password : appConfig . testDb . mssql . password ,
174- username : appConfig . testDb . mssql . username ,
175- database : appConfig . testDb . mssql . database ,
176- ssh : false ,
177- ssl : false ,
178- isTestConnection : true ,
179- } ,
180-
181- TEST_CONNECTION_TO_ORACLE : {
182- title : 'Oracle' ,
183- type : ConnectionTypesEnum . oracledb ,
184- host : appConfig . testDb . oracle . host ,
185- port : appConfig . testDb . oracle . port ,
186- username : appConfig . testDb . oracle . username ,
187- password : appConfig . testDb . oracle . password ,
188- database : appConfig . testDb . oracle . database ,
189- sid : appConfig . testDb . oracle . sid ,
190- isTestConnection : true ,
191- } ,
192-
193167 TEST_SSH_CONNECTION_TO_MYSQL : {
194168 title : 'MySQL' ,
195169 type : ConnectionTypesEnum . mysql ,
@@ -206,30 +180,6 @@ export const Constants = {
206180 privateSSHKey : appConfig . testDb . mysql . sshKey ,
207181 } ,
208182
209- TEST_CONNECTION_TO_MONGO : {
210- title : 'MongoDB' ,
211- type : ConnectionTypesEnum . mongodb ,
212- host : appConfig . testDb . mongo . host ,
213- port : appConfig . testDb . mongo . port ,
214- username : appConfig . testDb . mongo . username ,
215- password : appConfig . testDb . mongo . password ,
216- database : appConfig . testDb . mongo . database ,
217- authSource : appConfig . testDb . mongo . authSource ,
218- isTestConnection : true ,
219- } ,
220-
221- TEST_CONNECTION_TO_IBMBD2 : {
222- title : 'IBM DB2' ,
223- type : ConnectionTypesEnum . ibmdb2 ,
224- host : appConfig . testDb . ibmdb2 . host ,
225- port : appConfig . testDb . ibmdb2 . port ,
226- username : appConfig . testDb . ibmdb2 . username ,
227- password : appConfig . testDb . ibmdb2 . password ,
228- database : appConfig . testDb . ibmdb2 . database ,
229- schema : appConfig . testDb . ibmdb2 . schema ,
230- isTestConnection : true ,
231- } ,
232-
233183 REMOVED_PASSWORD_VALUE : '***' ,
234184 REMOVED_SENSITIVE_FIELD_IF_CHANGED : '* * * sensitive data, no logs stored * * *' ,
235185 REMOVED_SENSITIVE_FIELD_IF_NOT_CHANGED : '' ,
@@ -242,19 +192,24 @@ export const Constants = {
242192 const testConnections : Array < CreateConnectionDto | null > = Constants . getTestConnectionsFromDSN ( ) || [ ] ;
243193 if ( ! testConnections . length ) {
244194 testConnections . push (
245- Constants . TEST_CONNECTION_TO_ORACLE as CreateConnectionDto ,
246195 Constants . TEST_CONNECTION_TO_POSTGRES as CreateConnectionDto ,
247196 Constants . TEST_SSH_CONNECTION_TO_MYSQL as unknown as CreateConnectionDto ,
248- Constants . TEST_CONNECTION_TO_MSSQL as CreateConnectionDto ,
249- Constants . TEST_CONNECTION_TO_MONGO as CreateConnectionDto ,
250- Constants . TEST_CONNECTION_TO_IBMBD2 as CreateConnectionDto ,
251197 ) ;
252198 }
253199
200+ // Only MySQL and Postgres are provided as test connections for registered users.
201+ const allowedTestConnectionTypes : Array < ConnectionTypesEnum > = [
202+ ConnectionTypesEnum . mysql ,
203+ ConnectionTypesEnum . postgres ,
204+ ] ;
205+
254206 return testConnections . filter ( ( dto ) : dto is CreateConnectionDto => {
255207 if ( ! dto ) {
256208 return false ;
257209 }
210+ if ( ! allowedTestConnectionTypes . includes ( dto . type ) ) {
211+ return false ;
212+ }
258213 const values = Object . values ( dto ) ;
259214 const nullElementIndex = values . indexOf ( null ) ;
260215 return nullElementIndex < 0 ;
0 commit comments