Commit Graph

163 Commits

Author SHA1 Message Date
Anagh Hegde
cef530e835
Add binding query to the suggested widget to improve the experience (#6016)
* Add binding query to the suggested widget to improve the experience

* Fix test failures

* Add comments and change as per review

* Move the query template to enum class

* Change Test cases as per review

* Remove unused methods from the test class

* Remove commented code

* Use proper attributes in binding query

* Refactor suggestWidget method to support node

* Add unit tests
2021-07-23 14:29:27 +05:30
Abhijeet
9633d1e1c3
Add autogenerate field in datasource structure for each column (#6018)
* Added field to autogenerate values in DB column

* Added comment and refactor

* Autogenerate field update according to names instead of type for ArangoDB
2021-07-23 09:00:32 +05:30
Abhijeet
c5a909ddc8
Google sheet APIs for getting all the spreadsheet, getting all sheets within spreadsheet and column headers (#5875)
* API to run DB query using plugin specified templates

* Included get spreadsheet metadata in get info method

* Added TCs for checking Spreadsheet info response

* Added error message for invalid datasources

* Authentication check for datasource modified to AuthenticationStatus field
2021-07-16 16:15:29 +05:30
Trisha Anand
b8eb2f1aa5
Adding support for explicit data type casting in postgres prepared statement (#5842)
* Adding support for explicit data type casting in postgres prepared statement

* Added text and int psql data types for support in explicit typecasting

* Documenting the code
2021-07-15 19:33:32 +05:30
Anagh Hegde
99a06728d4
Suggest List of possible widgets and add exception handling (#5800)
* Add try catch block to handle the data conversion exception

* Suggest widget only in edit mode

* Add JsonNodeType to the widget suggestion logic

* Use ClassCastException instead of generic exception

* add tests for the array data type

* Suggest list of possible widgets instead of one

* Use constant in if condition to avoid possible NPE
Fix typo
2021-07-14 22:25:13 +05:30
Nidhi
597033e623
Modified error message and code for authentication failure (#5810) 2021-07-14 11:36:25 +05:30
dependabot[bot]
aafefe8ce9
Bump hibernate-validator in /app/server/appsmith-interfaces (#4937)
Bumps [hibernate-validator](https://github.com/hibernate/hibernate-validator) from 6.0.18.Final to 6.0.20.Final.
- [Release notes](https://github.com/hibernate/hibernate-validator/releases)
- [Changelog](https://github.com/hibernate/hibernate-validator/blob/6.0.20.Final/changelog.txt)
- [Commits](https://github.com/hibernate/hibernate-validator/compare/6.0.18.Final...6.0.20.Final)

---
updated-dependencies:
- dependency-name: org.hibernate.validator:hibernate-validator
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-08 18:12:58 +05:30
Sumit Kumar
d68ca405a8
Feature: integrate ArangoDB plugin (#5518)
* integrate arangoDB plugin.

Co-authored-by: Ming Fang <mingfang@mac.com>
Co-authored-by: Automated Github Action <automated@github.com>
Co-authored-by: Trisha Anand <trisha@appsmith.com>
2021-07-06 18:40:19 +05:30
Anagh Hegde
027603697a
Suggest widget after executing Action (#5574)
* Add widget suggestion to query execution flow

* Change the logic for Chart widget suggestion

* Add tests for the all the suggested widgets

* Added enum class to store widget types
2021-07-06 18:15:48 +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
Abhijeet
6ec6f9578c
API for generating a page with UI based on the structure of a given database table (#5269)
* Keymapping, Clone actions from template application, Used exported application JSON file as template app

* Delete references of widgets from action config if extra widgets not required

* Separate API added when pageId is not present with the client

* Added TCs

* Update in regex, enable reqArgsConstructor, separate DTO for CRUD page
2021-06-24 14:58:57 +05:30
Sumit Kumar
7787a0ddac
Bug Fix: Fix dynamic binding substitution failure with Firestore where condition input boxes. (#5280)
Modify dynamic binding substitution method to handle list and map types containing generic type values.
2021-06-21 19:36:06 +05:30
abhishek nayak
37708a4128
Merge pull request #5231 from appsmithorg/snyk-fix-45d4107a9d315a1ce1ee74338cb35c92
[Snyk] Fix for 26 vulnerabilities
2021-06-18 20:42:01 +05:30
Nidhi
57adbd7777
Schema info in templates query (#5244) 2021-06-18 11:31:17 +05:30
Snyk bot
5c17d962a0
[Snyk] Security upgrade net.minidev:json-smart from 2.3 to 2.4.7 (#5225)
* fix: app/server/appsmith-interfaces/pom.xml to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JAVA-NETMINIDEV-1078499
- https://snyk.io/vuln/SNYK-JAVA-NETMINIDEV-1298655

* Updating the json-smart dependency to the latest one

Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
2021-06-18 10:54:34 +05:30
snyk-bot
e8d731a21a
fix: app/server/appsmith-interfaces/pom.xml & app/server/appsmith-server/pom.xml to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1052449
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1052450
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1054588
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1056414
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1056416
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1056417
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1056418
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1056419
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1056420
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1056421
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1056424
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1056425
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1056426
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1056427
- https://snyk.io/vuln/SNYK-JAVA-COMMONSBEANUTILS-460111
- https://snyk.io/vuln/SNYK-JAVA-IONETTY-1020439
- https://snyk.io/vuln/SNYK-JAVA-IONETTY-1070799
- https://snyk.io/vuln/SNYK-JAVA-IONETTY-1082238
- https://snyk.io/vuln/SNYK-JAVA-IONETTY-1083991
- https://snyk.io/vuln/SNYK-JAVA-IONETTY-1089809
- https://snyk.io/vuln/SNYK-JAVA-IOPROJECTREACTORNETTY-559154
- https://snyk.io/vuln/SNYK-JAVA-IOPROJECTREACTORNETTY-559155
- https://snyk.io/vuln/SNYK-JAVA-ORGSPRINGFRAMEWORK-1009832
- https://snyk.io/vuln/SNYK-JAVA-ORGSPRINGFRAMEWORK-1296829
- https://snyk.io/vuln/SNYK-JAVA-ORGSPRINGFRAMEWORKSECURITY-1290497
- https://snyk.io/vuln/SNYK-JAVA-ORGYAML-537645
2021-06-17 13:27:03 +00:00
Abhijeet
51addbc963
Feature/import-export-application (#4553)
* Decryption for dbauth, basic and OAuth datasources added in exported file

* All authentications for datasources included while exporting as deserialization is done through json file otherwise cast is throwing error

* Content-Disposition header implemented 

* MongoEscapedWidget names segregated for published and unpublished layout, to prevent overwrite while exporting

* Published pages and actions explicitly handled in cases where unpublished resources are deleted
2021-06-01 17:38:26 +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
Nidhi
49c489dac0
Assume tokens with expiry have always expired (#4644) 2021-05-24 16:35:32 +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
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