Commit Graph

98 Commits

Author SHA1 Message Date
Trisha Anand
9dfe66d45c
[Bug] Mongo Plugin : Handle socket exception when the connection is dropped by Mongo database (#5499) 2021-07-01 17:23:24 +05:30
Trisha Anand
02e5445731
[Mongo Plugin] Raw is now a command option instead of Form vs Raw (#5446)
* Raw is now a command option instead of Form vs Raw

* Added database migration for migration raw input type to be of raw command type

* Fixed test case failure

* Minor cleanup
2021-06-29 11:13:17 +05:30
Nidhi
57adbd7777
Schema info in templates query (#5244) 2021-06-18 11:31:17 +05:30
Trisha Anand
388418cec5
Merge the two update commands into a single update command in Mongo Form (#5171)
* Update commands have been merged into a single update command for both single and multi updates

* Added migrations to migrate any update one mongo form command to new update command

* Incorporated review comments
2021-06-18 11:04:39 +05:30
Trisha Anand
77e965523c
[Feature] Smart Substitution for JSON fields in Mongo Form (#5136)
* Reduced verbosity of the command names for Insert, Find and Delete

* WIP : Smart substitution untested changes for mongo form

* Tested code for smart substitution working for mongo form fields

* Added test case for assert for smart substitution
2021-06-16 13:31:00 +05:30
Trisha Anand
06cafb6066
Getting Prepared Statement for Postgres, MySQL, and MS-SQL and Smart Substitution for Rest API plugins out of beta (#5019)
* Correcting text for Mongo Form Insert command

* Getting Prepared Statement for Postgres, MySQL, and MS-SQL and Smart Substitution for Rest API plugins out of beta

* Fixed failing test case

* Fixed Ms-sql plugin test failure
2021-06-10 13:55:56 +05:30
Abhijeet
0246563bd2
Bugfix for applications with MongoDB datasources authenticated with SRV string (#4944)
* Avoid updating authenticationDTO for mongo-plugin with SRV if the authentication object is already present
2021-06-10 10:52:23 +05:30
Trisha Anand
1bb54b0c7c
[Bug Fix] : Mongo Form Find - Projection field is parsed correctly (#4976)
* Parsing the field projection in Mongo Form

* Added test case to assert Projection field working.
2021-06-08 19:27:55 +05:30
Trisha Anand
d5e5be5d6a
[Feature] Mongo Form (#4378) 2021-05-19 11:05:24 +05:30
Sumit Kumar
247e5d7ea4
Feature: return prepared stmt / smart substitution params under request params section for debugging (#4421)
- return prepared stmt / smart substitution params under request params section for debugging
2021-05-17 08:59:17 +05:30
Sumit Kumar
e74d99b794
fix NPE (#4448)
fix NPE
2021-05-13 11:59:43 +05:30
Sumit Kumar
0ec3604eac
Feature: connect to mongo db via connection string URI (#4131)
allow user to connect using a mongo connection string URI directly.
2021-05-10 10:35:45 +05:30
Sumit Kumar
52bfd25824
Feature: return request parameters with type for debug tab (#4078)
- return request parameters with type for debug tab.
- request params are stored in a RequestParamDTO object.
- a configProperty -> label map is cached in pluginService, which returns the param label as per the configProperty it is mapped to via editor.json file.
- This feature currently only works with prepared statements disabled.
2021-04-30 16:26:51 +05:30
Sumit Kumar
275843e61a
Fix: Return helpful error message when get structure fails for mongo db due to lack of read permission. (#4077)
- return helpful error message when get structure fails for mongo db due to lack of read permission. The message returned is: Appsmith has failed to get database structure. Please provide read permission on the database to fix this.
- any get structure error is also generically being caught by the getStrucuture method in DatasourceStructureSolution.java
- error msg and status code is now returned as part of DatasourceStructure object.
- ErrorDTO is used to store error info.
- ErrorDTO definition is moved to appsmith-interfaces package so that it can be used all packages.
- Other changes:
  - stop logging PLUGIN_GET_STRUCTURE_ERROR externally, as this error is mostly triggered by credentials error or -lack of read permission.
  - start logging PLUGIN_GET_STRUCTURE_TIMEOUT_ERROR externally, because this is not a user error.
2021-04-26 11:18:08 +05:30
Shrikant Sharat Kandula
2971324be6
Fix unable to connect to MongoDB without username (#4130) 2021-04-23 18:21:36 +05:30
Trisha Anand
dd00f51808
Type Migration for Plugins Part 2 : Migration of existing actions + revert hotfix for editor.json (#4085)
* WIP :  Migration of data type for smart substitution configuration

* Fixed the migration code. Also reverted editor.jsons  back to equality check after migrations of existing actions

* Only fetching actions for plugins which belong to supported plugins.

* Setting a default value of "false" for all the actions which don't have a valid configuration for smart substitution.

* Minor code formatting

* Minor language change in comment

* Removed debug logs
2021-04-22 12:07:25 +05:30
Trisha Anand
30a82c2d24
Hotfix for broken release. Would do a proper fix on release tomorrow with migration (#4075) 2021-04-20 18:54:34 +05:30
Trisha Anand
eeaa26a7cc
Type migration from String to Object for plugin specified templates to preserve boolean and any other future data types (#4053)
* WIP : Type migration from String to Object for value

* Migrating config from string to boolean for prepared statement.
Handled error for already stored actions where PS config is stored as String and not Boolean.
2021-04-20 16:09:48 +05:30
Trisha Anand
9b49308abe
Adding dependency relationship to plugins (#3997)
* Added dependencies to be added to dependencyMap on client to Postgres, MSSQL, MySQL and Mongo plugins

* Added Dependency config for API

* Fixed the test case
2021-04-15 11:36:41 +05:30
Sumit Kumar
9c8bce0415
Feature: return data types of returned data on query execution for better data display (#3914)
- Return data type list along with action execution result so that the data can be displayed in the correct format.
- Handles these three data types for now : table, json, raw.
  - If a plugin has already assigned the data type, then common handler is not used.
  - Mongo plugin assigns the data types in the plugin specific flow i.e. does not use the common data type parse / assign method.
- To address review comments:
  - added a new enum ActionResultDataType for data types. It is consumed by ParsedDataType. A list of ParsedDataType is returned by ActionExecutionResult
  - parsed data in parallel using streams.parallel().
2021-04-09 10:58:37 +05:30
Sumit Kumar
41e44eed30
Feature: add title to action execution errors to improve user experience (#3872)
- add title to action execution errors to improve user experience
    - all errors in AppsmithPluginErrors
    - action execution related errors in AppsmithError : NO_CONFIGURATION_FOUND_IN_DATASOURCE, INVALID_ACTION, INVALID_DATASOURCE, INVALID_DATASOURCE_CONFIGURATION - as these are the likely errors in an action execution flow (excluding plugin specific flow) that might result from faulty action / datasource configuration by a user.
    - title is returned as part of ActionExecutionResult.
    - title is set in ActionExecutionResult on failure during action execution.
    - In response to review comment - added a new BaseException class, so that both AppsmithException and AppsmithPluginException extend this base class. Also, refactored code to introduce setErrorInfo() function in ActionExecutionResult class to set its attributes.
- Some unrelated cleanup:
    - catch PoolInitializationException for Postgres plugin and return AppsmithPuginException
    - catch MongoTimeoutException and return AppsmithPluginException
2021-04-08 09:49:05 +05:30
Hetu Nandu
28995e5b53
Fix PS and smart substitute true false value (#3896) 2021-04-07 16:06:17 +05:30
Hetu Nandu
5a1584377b
Update editor.json for Postgres, Mongo, MySQL, MS-SQL adding evaluation type (#3884)
Co-authored-by: Trisha Anand <trisha@appsmith.com>
2021-04-06 18:27:51 +05:30
Trisha Anand
4a087b172c
Feature : BSON Smart Substitution in Mongo Plugin (#3804)
* Feature : JSON Smart Substitution in Mongo Plugin

* Added BSON data type for Mongo substitution. Added test case

* Minor comment added

* Minor variable re-naming and correcting failing test cases.

* REST API : Escaping special characters in string before smart substitution

* Incorporated review comment
2021-04-05 17:12:29 +05:30
Sumit Kumar
00bcac7591
add support for 'prefer' ssl mode in postgresql. (#3848)
- add support for 'Prefer' ssl option for postgres plugin.
2021-04-05 15:51:17 +05:30
Nidhi
683176fc48
Increased default limit for webclient payload (#3718)
* Increased default limit for webclient payload
2021-03-26 21:34:10 +05:30
Sumit Kumar
38c5639542
Provide non client certificate based SSL support for Mysql, Mongo, Postgres plugins. (#3518)
- Provide non client certificate based SSL support for Mysql, Mongo, Postgres plugins.
- Added a new option default, apart from the the SSL mode types supported by the driver. Default means that go with whatever default configuration driver provides.
2021-03-19 15:03:56 +05:30
Trisha Anand
217e36aaa9
Enrichment of analytics event for execute. (#3492)
* WIP : enrichment of analytics event for execute.

* Plugin level : Catch all exceptions and set request in the result
Server level : Adding new fields to analytics : `isSuccessfulExecution`, `statusCode`, `timeElapsed`

* Dont catch StaleConnectionException. Server handles the same.

* Removed class specification for onErrorResume in plugins since its supposed to catch all errors.
2021-03-11 15:40:07 +05:30
Sumit Kumar
b6961ce7a4
Add timeout failure for mongo plugin test datasource (#3431)
- Mongo plugin client driver does not return with exception upon first failure - instead it keeps retrying. Hence, adding timeout error to report failure before the client thread cancels due to delay in response.
- It seems that the mongdb connection string cannot be directly used for ping test, hence skipping it.
2021-03-10 11:11:14 +05:30
Sumit Kumar
639913703a
Fix/add mongo srv support (#3341)
Provide helpful error msg when srv url is provided to mongo plugin

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2021-03-03 18:31:04 +05:30
Sumit Kumar
e5586a590a
fix placeholderText label in form.json files (#3331)
fix placeholderText label in form.json files
2021-03-03 09:33:02 +05:30
Trisha Anand
91e308665b
Requests preparation by plugins instead of ActionService (#3159)
* Added action request in S3 plugin.

* Added request data in Dynamo plugin

* Added request in Elastic Search.

* Request in Firestore.

* Request added in Mongo

* MsSQL request added.

* Added MySQL request.

* Added Postgres request.

* Added redis request.

* Redshift doen.

* Catching AppsmithPluginExceptions at the plugin level itself to ensure that the request gets passed on as part of the result.

* Fixed failing plugin test failures

* Fixed AmazonS3 test failures.

* WIP post analytics working

* WIP : Making the request data confirm to existing analytics request data format.

* Fixed the headers in the analytics body.

* Migrations S3, Postgres to the accepted format for request in analytics

* Updated S3 action to be the query

* Migration completed for all plugins for analytics.

* Removed the old analytics event. Now sending only the new one.

* Ensuring all data is captured in S3 plugin request in case of error.

* Minor editing of firestore to ensure that the errors get caught by the plugin itself.

* Fixed test cases in Amazon S3

* Incorporated review comments.
2021-03-02 10:58:46 +05:30
Shrikant Sharat Kandula
dc146a1a16
Fix MongoDB test operation errors not being caught (#3234) 2021-02-26 12:55:54 +05:30
Shrikant Sharat Kandula
72df6fb299
Allow MongoDB datasources without username/password (#3149) 2021-02-23 16:54:27 +05:30
Shrikant Sharat Kandula
e2509ae325
Add placeholder for MongoDB datasource config's host inputs (#3145)
* Remove example indicator
2021-02-23 09:52:45 +05:30
Arpit Mohan
a973d779fd
Correcting the display message for query actions based on isExecutionSuccess flag (#3045)
Also improving the mongo error response string. Now we only send the error message instead of the entire stack trace back to the client
2021-02-15 22:10:04 +05:30
Sumit Kumar
e6b77a1299
Stop logging some AppsmithPluginException to Sentry (#2351)
1. Move package  appsmith-interfaces/src/main/java/com/appsmith/external/pluginExceptions-> appsmith-interfaces/src/main/java/com/appsmith/external/exceptions/pluginExceptions
2. Move enum AppsmithErrorAction from appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java -> appsmith-interfaces/src/main/java/com/appsmith/external/exceptions/AppsmithErrorAction.java, so that both plugin exceptions and server exceptions could use the same enum.
3. Log exception based on the error action defined for each exception.
2021-02-04 15:24:30 +05:30
Shrikant Sharat Kandula
42efb20d14
Remove unused cert fields for Mongo and Postgres plugins (#2723) 2021-01-26 18:44:01 +05:30
Sumit Kumar
6299c86f39
Add TC to test mongodb connection establishment (#2364)
1. Test that when a query is attempted to run on mongodb server but refused because of lack of authorization, then
also, it indicates a successful connection establishment.
2020-12-28 11:58:17 +05:30
Shrikant Sharat Kandula
5e04ca5c9d
Add ability to configure order of templates of plugins (#2279) 2020-12-18 20:45:08 +05:30
Nidhi
a00c144e85
Subclassing authentication (#2215)
* Sublcassing authentication

* Removed TODO

* Review changes
2020-12-17 21:38:52 +05:30
Trisha Anand
8283396056
Moved from boundedElastic to elastic to ensure that the server services the plugin execution request as soon as the request arrives. (#2090) 2020-12-08 22:04:14 +05:30
Trisha Anand
2062c60ca3
Moved all the scheduling of the plugin executions to bounded elastic instead of elastic. (#1931) 2020-11-26 17:50:43 +05:30
Sumit Kumar
2c6d1bb361
Fix mongodb datasource test. (#1783)
1. Fix mongodb datasource cypress test failure.
2. Against certain mongodb instances, we expect to receive an exception of type "unauthorized" when testing datasource. Earlier, this case was caught and whitelisted until the recent change to replace mongodb infra with reactive mongodb infra.
2020-11-18 16:55:39 +05:30
Sumit Kumar
2c2aa06e32
Add support for reactive streams with mongodb. (#1720)
Add support for reactive streams with mongodb. (fixes 1480)

1. Replace mongodb driver with reactive mongodb driver. Change APIs accordingly.
2. Use webflux + reactor framework to execute mongodb queries in event loop model.
3. Add test to test MongoPluginExecutor class' method "testDatasource".
2020-11-18 10:58:50 +05:30
akash-codemonk
9d27315213
Update datasource form config to include encrypted property (#1360) 2020-10-23 13:31:46 +05:30
dependabot[bot]
2b70011f66
Bump junit in /app/server/appsmith-plugins/mongoPlugin (#1160)
Bumps [junit](https://github.com/junit-team/junit4) from 4.11 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.11.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.11...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-13 14:35:00 +05:30
Shrikant Sharat Kandula
13ddcc0cc9
Upgrade pf4j & test containers and fix plugin tests (#1156) 2020-10-13 13:42:14 +05:30
Shrikant Sharat Kandula
4f3de3ab9f
Datasource structure support for MongoDB (#641)
* Added structure for MongoDB datasources

* Fixed tests for MongoDB template queries
2020-10-01 10:41:29 +05:30
Shrikant Sharat Kandula
6c7e45d010
Add a connection type variable for Plugin implementations (#531)
* Add a connection type variable for Plugin implementations

This type variable is intended to represent the type of the
connection object, if any, that the plugin will use. This will
help make the implementations more robust by leveraging Java's
type checking instead of rudimentary type casts over the
connection objects.

* Fix missing typevar usage
2020-09-14 20:36:47 +05:30