Commit Graph

117 Commits

Author SHA1 Message Date
Sumit Kumar
610d665aae
add query params to form.json (#10574) 2022-01-26 12:59:07 +05:30
Sumit Kumar
cdcb657229
add query params from datasource to URI (#9963)
Add query params from datasource to final URI used for REST API query.
2021-12-23 14:15:54 +00:00
Sumit Kumar
c858edf726
fix Mongo smart substitution for quotes around ObjectId (#9856)
- fix Mongo plugin's smart substitution feature to handle quotes around ObjectId in array. e.g. Initial replacement value: ["ObjectId(xyz)"] , final replacement value: [ObjectId(xyz)]
- unrelated: added version number to lombok dependency to stop build failures in IntelliJ.
2021-12-21 18:47:19 +05:30
Leo Thomas
77433cf62b
feat: Add support to send arbitrary form values to oAuth server during Datasource authentication (#9660)
* feat:9389  Add support to send arbitrary form values to oAuth server during Datasource authentication

* Changes related to Code Review Comments of PR 9650

* Changes implemented to set custom Key Value pairs

* Resolved Code Review comments

* Resolved Code Review comments
2021-12-21 10:12:26 +05:30
Arpit Mohan
96677ef673
fix: Updating log4j to 2.17.0 to prevent JNDI lookups (#9863)
Also making minor edit to not show "Application name updated" toast message. This is a counter-productive toast that is distracting the user
2021-12-20 16:01:08 +05:30
Leo Thomas
03afb6df22
fix: Handled a possible null key from headers - NullPointerException in sentry (#9810) 2021-12-18 22:42:00 +05:30
Nidhi
e48a51c166
fix: Ignore form data elements with null keys (#9769)
* fix: Ignore form data elements with null keys

* Added reference to constant instead of using a String
2021-12-16 09:54:38 +00:00
Nayan
28c181b59c
feat: [Feature] Upgrade spring boot version to 2.5.5 (#8932)
Upgrades spring boot version to 2.5.5
2021-12-14 16:22:37 +06:00
Nidhi
bdc6a342e6
fix: Modified multipart logic to avoid exception handling (#9246)
* Modified multipart logic to avoid exception handling

* Error handling for unknown type
2021-11-19 13:20:51 +05:30
Nidhi
54cc5b8ff4
fix: Add support for content type in create file for S3 plugin (#9021) 2021-11-10 07:44:36 +05:30
Nidhi
ec34ef9a91
fix: Added support for multiple files in multipart REST (#8986)
* fix: Added support for multiple files in multipart REST

* Added test case

* Review comment

* Review comment
2021-11-09 10:33:54 +05:30
Sumit Kumar
d7411be855
fix: show hint message on using duplicate header or query parameters in API (#8263)
* show hint message on using duplicate headers or query parameters in API.
2021-10-13 18:02:16 +05:30
Nidhi
688b75af22
Changes to introduce peader prefix in API key authentication type (#7742) 2021-09-23 13:20:44 +05:30
Nidhi
c3f4cdaa15
feat: Introducing SaaS integrations as a plugin (#7560)
* WIP client side changes

* Saas execution flow + scheduled import of remote plugins
2021-09-21 17:35:29 +05:30
Trisha Anand
7526129a3a
feat: Adding APPSMITH_PLUGIN_MAX_RESPONSE_SIZE which can be configured as an environment variable to increase plugin response size (currently only supported for Postgres Plugin) (#7126)
* Adding `APPSMITH_PLUGIN_MAX_RESPONSE_SIZE` which can be configured as an environment variable to increase plugin response size (currently only supported for Postgres Plugin)

* Updated error message + added the environment variable to the template docker env files for new installations
2021-09-05 15:38:36 +00:00
Anagh Hegde
a4434872b0
Classify the Plugin errors to Action and Datasource configuration issues (#7095) 2021-09-04 02:54:23 +05:30
Trisha Anand
f6df16bde4
fix: Json smart substitution breaks when evaluated value contains the character '?' (#7031)
* Minor refactoring

* Partial code change to replace question mark with appsmith placeholder

* Working version

* Removing unnecessary code

* Added test case to assert that when evaluated value contains a "?", the replacements are still correct

* Added test case in Mongo Plugin as well for the same scenario

* Minor change in the language of the comment
2021-09-02 12:30:04 +00:00
Nidhi
f5895872d4
Allow extra fields in multipart file data (#6689)
* Allow extra fields in multipart file data

* Remove extra annotation

* Reuse object mapper

* Reuse object mapper
2021-08-18 16:55:33 +05:30
Nidhi
f8e6854434
Correction in auth type value for OAuth2 in view mode of datasource (#6639)
* Correction in auth type value for OAuth2
2021-08-16 22:06:02 +05:30
Nidhi
57436bb2d1
Added logic to show form data requests in debugger (#6350)
* Added logic to show form data requests in debugger

* Tests and comments

* Tests
2021-08-04 10:47:41 +05:30
Nidhi
8d341a40a6
Setting ActionExecutionRequest in response from executed API call (#6147)
* Setting ActionExecutionRequest in response from executed API call

* Added logic during error state
2021-07-27 15:45:28 +05:30
Nidhi
4927f64262
Updated multipart dto (#6157) 2021-07-27 12:23:57 +05:30
Trisha Anand
1dfc624a13
[Bug Fix : Rest Api] Base64 encode binary response before sending it out to client (#5958)
* 1. For binary data in the response, base64 encoding the same before sending it out on the wire (instead of default conversion to string)
2. Added a new header which sets the data type of the response body.

* Minor code reformatting

* Fixed failing test cases

* The new header created should send the values in an array instead of a single value
2021-07-19 19:29:19 +05:30
lifeneedspassion
95d5557749
Add UTF-8 encoding in the RestApiPlugin for all invocations
The default charset is determined during virtual-machine startup and typically depends upon the locale and charset of the underlying operating system (#5788)

Co-authored-by: 王昆 <quincy@cloudtogo.cn>
2021-07-15 11:36:18 +05:30
Sumit Kumar
727f4aa4b3
Feature: return hint message to user if the expected content type is json but the api response is not a valid json. (#5666)
* return hint message to user if the expected content type is json but the api response is not a valid json.

Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-07-09 22:31:50 +05:30
Arpit Mohan
28284b7207
Setting string response if the JSON is not valid (#5642) 2021-07-06 18:07:08 +05:30
Nidhi
7da59a4afe
Content length for multipart (#5556) 2021-07-05 19:28:45 +05:30
Nidhi
def5cb5c1d
Content type and filename for multipart form data parts (#5509)
* Content type and filename for multipart form data parts

* Handling empty json

* Handling empty json
2021-07-01 15:53:53 +05:30
Sumit Kumar
b2d4454492
Feature: add api key based and bearer token based authentication options to REST API datasource (#5367)
* add api key based and bearer token based authentication options to REST API datasource
* this change is ported to release from Feature: datasource changes for api key auth, bearer token auth, combine config. #4683
2021-06-25 12:15:48 +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
Nidhi
f9a4b0e0dc
Fixes failure due to extra spaces in authorization url in OAuth2 datasource (#4818)
* Trimmed authorization url

* Using validation instead

* Update app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/helpers/DatasourceValidator.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Update app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/helpers/DatasourceValidator.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2021-06-01 13:45:04 +05:30
Nidhi
5ddd58cdfd
Added optional audience and resource fields for oauth2 datasources (#4678)
* Added optional audience and resource fields for oauth2

* Review changes

* Don't show audience and resource fields by default
2021-05-27 21:53:59 +05:30
Nidhi
2bf1fbff04
Removed check for encryption since this is not handled manually anymore (#4673)
* Removed check for encryption since this is not handled manually anymore

* Removed migration for isEncrypted
2021-05-25 20:29:57 +05:30
Arpit Mohan
b1d7258dcb
Adding support for multipart form data (#4547)
* Handling multipart form data in the CURL import flow

* Adding Cypress test for curl import with multipart/form-data

* Also fixing minor bug where the form values need not always be double-quoted
2021-05-19 10:48:51 +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
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
11556b0bbb
Add authorized check (#4222) 2021-04-30 11:10:20 +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
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
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
Arpit Mohan
60400da94a
Fixing signed URL request for AWS S3 in Rest API plugin (#3734)
* added empty byte array for request body to fix aws signed url signature match problem as detailed here - https://github.com/aws/aws-sdk-java/issues/2205

Co-authored-by: Bernard Worthy <>
2021-03-29 12:58:57 +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
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
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
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
Trisha Anand
bd18030c2d
Add request body in case http method is not GET (#3307)
* Add request body in case http method is not GET

* Incorporated review comments.
2021-03-02 12:46:20 +05:30
dependabot[bot]
9579b91fae
Bump jackson-databind in /app/server/appsmith-plugins/restApiPlugin (#3098)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.10.4 to 2.10.5.1.
- [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-02-19 08:24:07 +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