Commit Graph

143 Commits

Author SHA1 Message Date
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
Nidhi
53c2d815f6
Fixes refresh token flow (#4450)
* Fixes refresh token flow

* Review comments

* Reverting mistake with CI cs url
2021-05-12 17:07:59 +05:30
dependabot[bot]
3573ea3913
Bump commons-io from 2.6 to 2.7 in /app/server/appsmith-interfaces (#4172)
Bumps commons-io from 2.6 to 2.7.

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-09 09:49:43 +05:30
Nidhi
4a288439f0
Added basic authentication type to REST APIs (#4040)
* Added basic authentication type to REST APIs

* Spacing for prefix

* Tests and json ignore for password

* Client side form changes

* Review comments
2021-05-07 17:24:05 +05:30
Nidhi
b2aaa7787c Merge branch 'release' of github.com:appsmithorg/appsmith into task/apply-encryption 2021-05-06 12:55:25 +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
Nidhi
c8b2035eeb Accessibility reset 2021-04-26 18:13:55 +05:30
Nidhi
8afac888c7 Merge branch 'release' of github.com:appsmithorg/appsmith into task/apply-encryption 2021-04-26 13:30:49 +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
Nidhi
6b31aa333b
Introducing Google Sheets Plugin (#3517)
* cherry pick -make new

* revert to enable fix from release

* attempt to hook into existing datasource editor

* gSheets plugin skeleton from Rest API

* Changes for database migration

* fix for auth code

* separate it out

* action page loads!

* add to explorer

* create action from datasource

* Editor JSON WIP

* working query form

* Editor JSON WIP

* import to

* fix toast message

* redirect from datasource and editor pages

* fix onboarding

* fix imports and constants

* refactor form out

* refactor queryForm

* Merge branch 'release' into feature/google-sheets

* Merge branch 'release' into feature/google-sheets

* initial values from settings, editor and form

* Check

* remove dangling code around lightTheme

* Safety net

* remove class

* try mouseover solve

* force click

* changes from review

* fix action form name on import

* Merge branch 'release' into feature/google-sheets

* minor cleanup

* Merge branch 'release' into feature/google-sheets

* WIP

* Google sheets changes

* Merge conflicts

* Merging and fixes, needs refactoring

* Check

* Merge branch 'release' into feature/google-sheets

* Fixed tests

* Add cloud services env variable

* Clean up saga

* Clean up

* Refactoring

* Deleted svg file

* Minor fixes

* Modified design to allow behaviour in google sheets methods (#3486)

* Modified design to allow behaviour in google sheets methods

* Review changes

* Removed sysout

* Added handling of edge cases with table data

* Merge branch 'release' into feature/google-sheets

* Fixes

* Fixes

* Added validations

* Improved tests

* Removed extraneous injected bean

* Review changes

* Fixed bug with method

* Changes to Google sheets plugin's request and response structures (#3692)

* Method changes

* Removed logging

* Renaming options

* Reverting pom version

* Modified type of collection variables, fixed errors

* Converted row offset field to one that supports dynamic bindings

* Review changes

* List SAAS plugin type actions under lightning menu apis (#3820)

* list saas plugin type actions under lightning menu apis

* combine saas plugin type actions in the other sub menu of lightning menu

Co-authored-by: Hetu Nandu <hetunandu@gmail.com>

* Fix merge issues

* Prettified query editor and a few fixes w/ ux

* Test fixes

* Reformatting request

* code for REST added (#3876)


Co-authored-by: hetunandu <hetu@appsmith.com>

* Renamed body to row object

* Renamed placeholder for range

* Renamed range heading

* Modifications to handle range semantics

* Use spreadsheet Url instead of id

* Ordering of methods

* Removed logging

* Add tests for Dynamic text controls

* Add tests for url helpers

* Fix coverage config

* Nevermind

* Interface changes

* There is no body here

* Yay to hints

* Delete row field is separately handled as row index

* placeholder support (#4001)

* Fixed tests, typos and creating new sheets with random rows

* Switched to using 'rowIndex' throughout

* binding path added for query input field (#4016)

* - Fixed QA bugs (#4032)

- Split delete sheet into two
- Removed dynamic query input types from hidden keys

* Proper exceptions

* Removed extra logging

* Throw exception if update method does not match any of the columns

* Same for bulk update

* Zero-indexed delete row

* I'm a space bound rocket ship

* Logic to register installations with cs (#4062)

* Logic to register installations with cs

* Clean up

* Casting to string

* Checking to see if this makes the test pass

* Added an extra null check

Co-authored-by: Piyush <piyush@codeitout.com>
Co-authored-by: hetunandu <hetu@appsmith.com>
Co-authored-by: Hetu Nandu <hetunandu@gmail.com>
Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 09:00:09 +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
Nidhi
963d1225dc
Reverting use of Mongo Listener since we aren't applying this yet (#4073)
* Added synchronization to encryption map

* Reverting listener for now
2021-04-20 13:58:59 +05:30
Nidhi
9e6e8e5e4b
Safe handling of alias (#4004)
* Safe handling of alias

* Unnecessary import
2021-04-15 12:14:39 +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
Nidhi
13a3e8f240 Applying AOP encryption 2021-04-08 16:58:45 +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
Nidhi
927a6a3479
Annotation based encryption (#3610)
* Annotation set up

* Removed annotation uses

* Redundant condition

* Commented out logging, retained for implementation

* Handling for Collection and Map parameterized types

* Removed comments
2021-04-07 15:27:36 +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
Trisha Anand
554c45eef8
[Bug Fix] Prepared Statement -String starting with a number recognized as JSON object instead of String (#3710)
* String starting with float like 2.1 recognized as JSON object instead of String.

* Incorporated review comments.
2021-03-29 12:22:06 +05:30
Trisha Anand
b9fd72e89d
Smart Substitution Debugging - Adding Appsmith data type to each parameter in response's request object for execute (#3716)
* Smart Substitution Debugging - Adding appsmith data type to each parameter in response's request object for execute

* Incorporated review comments.

* Fixed failing test cases.

* Fixed MS-SQL test failures.
2021-03-26 23:29:12 +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
e347b61e53
Return hint on localhost url (#3611)
- Return hint for localhost URL on the following events:
Test datasource
Save datasource
Update REST API Url
Create datasource from REST API
When page gets loaded for first time.
- Hint message returned: "You may not able to access your localhost if Appsmith is running inside a docker container or on the cloud. Please check out Appsmith's documentation to understand more."
- It has been decided as part of actions pod meeting that these messages will not be persisted.
2021-03-26 15:42:34 +05:30
Trisha Anand
c420d0207f
Supporting timestamp datatype in Prepared Statement (#3690)
* WIP : Adding timestamp datatype in Prepared Statement

* Added simple tests for commonly used data types' identification

* Added plugin level test cases for timestamp with Prepared Statement to Postgres
2021-03-26 13:19:22 +05:30
Trisha Anand
ed1a0b4045
Refactor the smart substitution code to extract common code at plugin interface level. (#3497) 2021-03-25 19:10:42 +05:30
Trisha Anand
c6e4f91ffb
[Bug fix] A lax search for presence of binding during save page to match client algorithm to reduce page save error (#3698)
* Lax mustache binding check added to match the client side check when client recognizes a field to have a dynamic binding. This would reduce/remove bad bindings from throwing a 400 during save page.

* Added a test to assert that update layout does not fail in case the binding is technically incorrect because part of the mustache's lie inside quotes. Since client has a lax way of finding a dynamic path, server also follows suite.
2021-03-25 16:00:45 +05:30
Sumit Kumar
56f22edbe8
Return hint message on identical columns (#3656)
- Return hint message if identical column names are found in SQL query for postgres, MySQL, mssql, redshift plugin.
- Add a PluginUtils class to hold general utility functions for plugins.
2021-03-24 08:22:49 +05:30
Shri
a18e569f7d
Fix data serialization in analytics (#3677)
* Serialize object fields before sending to analytics

* Push event when application is published
2021-03-23 17:13:02 +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
Shri
bb1d0059d3
Clear OAuth tokens for forked datasources (#3609)
* Clear OAuth tokens for forked datasources

* Fix datasource duplicate finder in light of oAuth tokens

* Fix potential NPE
2021-03-18 21:08:56 +05:30
Shri
e1fb1203b5
Application forking fixes and improvements (#3519)
* Clone only those datasources that are actually used

* Retry when cloning app causes a name class

* Search for an existing datasource before cloning

* Test deep matching of datasources

* Refactoring, since now the tests pass

* Allow forking of owning applications

* Don't limit datasource naming suffix number
2021-03-15 22:19:40 +05:30
Trisha Anand
9f63bfafd2
Adding JSON intelligent substitution for Rest Api plugin (#3474)
* POC : null value getting handled correctly

* Refactor code. Tested with and without quotes. This is working! Woohoo!

* Added support for mustache binding to include json objects and arrays

* Added test for smart substitution.

* Added setting to turn on/off smart substitutions in Rest API plugin

* Handling turning on smart json substitution

* Added error handling

* Added config to turn on smart substitution in JSON to make the tests pass now

* Adding a beta tag to the API setting.

* Spelling error resolved.

* Incorporated review comments.

* Catching JSON Parse exception in http call.
2021-03-11 14:10:00 +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
Trisha Anand
cd45a1dd74
Added support for Arrays in Prepared Statement in Postgres (#3421)
* Added support for Arrays in Prepared Statement

* Minor code cleanup

* Super minor code readability changes

* Incorporated review comment
2021-03-09 13:17:42 +05:30
Sumit Kumar
800d305dab
Gracefully handle the timeout overflow / out of expected range errors (#3411)
- Expect max value of timeout as 60000 ms.
- If value exceeds max value then add error message to the list of invalids. This list is returned to the client in response body.
- Detect integer overflow exception (Number format exception) and override the value to 60000 ms.
2021-03-05 17:09:29 +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
Trisha Anand
31b20da347
Adding support for NULL value parameters in Prepared Statement. (#3255) 2021-02-27 18:59:51 +05:30
Sumit Kumar
63ff3c73fa
Fix execute on page load for api on app copy (#3150)
* first draft

* added fix without TC

* cleanup

* Update app/server/appsmith-server/src/main/java/com/appsmith/server/services/NewActionServiceImpl.java

Co-authored-by: Trisha Anand <trisha@appsmith.com>

* Update app/server/appsmith-server/src/main/java/com/appsmith/server/services/NewActionServiceImpl.java

Co-authored-by: Trisha Anand <trisha@appsmith.com>

* Update app/server/appsmith-server/src/main/java/com/appsmith/server/services/NewActionServiceImpl.java

Co-authored-by: Trisha Anand <trisha@appsmith.com>

* - add TC
- minor code refactor

* fix condition

* update clone page test

Co-authored-by: Trisha Anand <trisha@appsmith.com>
2021-02-24 10:21:03 +05:30
Shrikant Sharat Kandula
68bbc4fb28
Support server-side pagination for Firestore (#3128)
* POC for Firestore server-side pagination

* Load pagination information values from action configuration

* Get execution information for Firestore plugin

* Working implementation of pagination for Firestore

* Add tests for next and previou page navigations

* Require ordering to be set when paginating

* Remove commented code

* Don't report error on bad configuration

* Error out on usupported operation

Co-authored-by: Trisha Anand <trisha@appsmith.com>

* Move constant indices to constant fields

* Use executeParameterized instead of execute

Co-authored-by: Trisha Anand <trisha@appsmith.com>
2021-02-24 10:20:08 +05:30
Trisha Anand
e5574c1945
Support Prepared Statements in Postgres (#2967)
* Pushing minor editor form changes to ensure that prepared statement could be turned off.

* Code refactor to do variable substitution in PluginExecutor instead of action service.

* WIP : Prepared Statement handling in psql plugin

* WIP Prepared Statements.

* Working version of prepared statements

* Quote trimming added for post preparing sql statements. Now the unprepared statements and prepared statements do not require edits.

* Fixed existing test cases failing.

* Code formatting.

* Super minor code cleanup.

* Added migration for the existing postgres actions.

* Fixed failing test cases in ActionServiceTest.

* Minor change in the text for turning on and off prepared statements in the postgres query pane.

* Added test cases for prepared statement.

* Some minor comments for code readability

* Moved Prepared Statement setting from Action Configuration to Plugin Specified Templates since this setting does not make sense for all the DB plugins.

* Added function level comments

* Update app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/SqlStringUtils.java

Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>

* Update app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/SqlStringUtils.java

Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>

* Incorporated review comments.

* Fixed compile time error.

Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
2021-02-18 18:33:27 +05:30
Piyush Mishra
74b013d909
Encode params toggle (#3006)
* Makes client side changes to support actionConfiguration.encodeParamsToggle setting.
* Add migration code.

Co-authored-by: Sumit Kumar <sumit@appsmith.com>
Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
2021-02-16 20:31:35 +05:30
Nidhi
afc329fd7b
Added grant type Authorization code to OAuth2 (#2992)
Co-authored-by: Piyush <piyush@codeitout.com>
2021-02-16 17:58:03 +05:30
Sumit Kumar
4df595417f
return url on file create and fix image/video file upload issues with amazons3 plugin (#3012)
1. Return url on file create.
2. Fix image/video upload/download.
3. Change error msg format to directly print error msg without adding any prefix sentence.
2021-02-12 16:01:26 +05:30
Nidhi
8823f9d407
Added client credentials grant type for OAuth2 (#2649)
* Added client credentials grant type for OAuth2

Co-authored-by: Piyush <piyush@codeitout.com>
2021-02-11 17:58:06 +05:30
Sumit Kumar
e9e30d1fa4
Enable toggle for params encoding (#2968)
Enable toggle for params encoding
1. Add toggle param to ActionConfiguration class.
2. Add TCs to test toggle on/off/null.
2021-02-11 11:02:29 +05:30
Shrikant Sharat Kandula
ed1c926c8a
Add datasource structure support for DynamoDB (#2919) 2021-02-10 13:28:35 +05:30
Nidhi
c0e44d0cd9
Added null check for error messages (#2922)
* Added null check for error messages

* Added a generic null check for future null pointers from other sources.
2021-02-09 15:00:22 +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
Trisha Anand
9e0f36a6f2
Improve Server thrown Error Messages' language (#2705)
* Improve Error Messages

* Added naming convention expansion for action name in the error

* Fixed failing test case assertion.

* Minor formatting.
2021-01-25 18:50:32 +05:30
dependabot[bot]
e781ceb30a
Bump jackson-databind in /app/server/appsmith-interfaces (#2652)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.9.10.5 to 2.9.10.7.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-21 10:48:01 +05:30