Commit Graph

2852 Commits

Author SHA1 Message Date
Arpit Mohan
249bbbde39 Adding the field shouldCacheResponse to the ActionExecutionResult to make the response caching generic across various plugins 2020-02-25 11:36:02 +00:00
Arpit Mohan
a835c84582 Merge branch 'feature/embedded-datasource' into 'release'
Creating an embedded datasource for the action

Now the user can create an embedded datasource as well as a saved datasource for the action. 

This MR also fixes the import for a curl command by setting defaults when an action is created via the curl command. For now, the curl command only accepts short flags and not the long form flags.

See merge request theappsmith/internal-tools-server!204
2020-02-25 08:54:16 +00:00
Trisha Anand
609045747b Creating an embedded datasource for an action.
Also setting defaults for an action when created via a curl command.
2020-02-25 08:54:16 +00:00
Arpit Mohan
3020af632b When deleting a page, also remove it from the application page cache.
This fixes the bug where the application could not be published because it assumed a page existed when that page had been deleted.
2020-02-25 11:26:41 +05:30
Arpit Mohan
6a93b948b7 Increasing the request buffer size to 5 MB in the default application.properties file
This is required for file uploading widgets to be able to successfully upload files.
2020-02-24 14:30:11 +05:30
Arpit Mohan
786aca059e Revert "Merge branch 'feature/embedded-datasource' into 'release'"
This reverts commit 35b49833615d88bc484207670b8ddf645f70d1ad, reversing
changes made to 29bee80c426b4c469bf8e774b7febf4f63b196b4.
2020-02-24 11:31:58 +05:30
Arpit Mohan
df2d7d2b3d Increasing the maximum buffer size for requests to 5 MB 2020-02-24 10:53:45 +05:30
Trisha Anand
a7881935da This fixes the bug during refactor of name of a widget/action. This bug is recreatable if in the page there is an action with no jsonPathKeys. Handled the null pointer exception by first checking for the null pointer. 2020-02-21 07:19:46 +00:00
Trisha Anand
8ea5d6663c Making the Templates searchable by name, provider id, versionId, and Id 2020-02-19 14:07:49 +05:30
Trisha Anand
634a625906 1. Adding provider plan subscribed to and list of all the plans to Provider
2. Curl Importer should call create action instead of saving it directly so that all the defaults can be set up properly.
2020-02-17 10:08:35 +00:00
Arpit Mohan
f76d40482d Merge branch 'release' of gitlab.com:theappsmith/internal-tools-server into release 2020-02-14 14:23:13 +05:30
Arpit Mohan
a05adf4293 Adding checks to ensure that we can remove the oauth2 allowed domains from the properties file
We now create another list from the value provided in the properties file. All checks in the codebase are performed against this list. This ensures that there are no NPE and exceptions when the property oauth2.allowed-domains is removed from the properties file.
2020-02-14 14:22:59 +05:30
Trisha Anand
2e11a5c2d5 Added datasource configuration to the provider to support the provider level configurations in rapid api 2020-02-14 06:32:34 +00:00
Arpit Mohan
23641a7e9a Removing Google Auth domain restrictions for all environments
In the SaaS version, we want folks from all domains to be able to sign up to the platform
2020-02-13 10:03:25 +05:30
Arpit Mohan
b28073cd4b Merge branch 'feature/acl-unauthorized-response' into 'release'
Correcting the error response returned by the AclFilter to match the ErrorDTO...

Correcting the error response returned by the AclFilter to match the ErrorDTO returned from controller functions

This ensures consistent responses from different parts of our application. The client can then rely on the server to provide a constistent response structure.

See merge request theappsmith/internal-tools-server!194
2020-02-07 10:15:48 +00:00
Arpit Mohan
bd65ba41e0 Correcting the error response returned by the AclFilter to match the ErrorDTO returned from controller functions
This ensures consistent responses from different parts of our application. The client can then rely on the server to provide a constistent response structure.
2020-02-07 15:41:45 +05:30
Trisha Anand
8661f71a80 Mock apis for 3P frontend work 2020-02-07 09:05:14 +00:00
Arpit Mohan
5031f40897 Merge branch 'feature/pagination-type' into 'release'
Renaming isPaginated to PaginationType to support different types of pagination on the frontend

If the API is paginated via the table's page number, then the next and prev URLs in the action don't play any role. Those fields are only required when the paginationType is of type URL. In all other scenarios, the action is executed normally.

See merge request theappsmith/internal-tools-server!192
2020-02-05 09:24:06 +00:00
Arpit Mohan
ffc7328e13 Renaming isPaginated to PaginationType to support different types of pagination on the frontend
If the API is paginated via the table's page number, then the next and prev URLs in the action don't play any role. Those fields are only required when the paginationType is of type URL. In all other scenarios, the action is executed normally.
2020-02-05 14:41:53 +05:30
Arpit Mohan
3fc9c36919 Refactoring the code to fix bug where a user creating an organization wasn't getting assigned the default groups
Now, regardless of the route with which an organization is created (invitation, signup or self-create by user), the correct groups and permissions are assigned to the user.
2020-02-05 13:20:09 +05:30
Arpit Mohan
440de34857 Refactoring the code to add page archival for a given application
The code for archiving an application has been moved to ApplicationPageService so that both the PageService and ApplicationService can access it.
2020-02-05 08:37:48 +05:30
Arpit Mohan
3838338099 Adding the permission to delete pages to acl.rego file 2020-02-05 08:34:32 +05:30
Arpit Mohan
fbada3051d Adding default implementation in BaseRepositoryImpl for default JPA queries defined by Spring Data.
We override the SimpleReactiveMongoRepository with our custom implementation to add criteria for filtering soft deleted records.
Also, adding a new function to archive record instead of a hard delete.
2020-02-04 12:02:51 +00:00
Arpit Mohan
05cfa3f72f Merge branch 'bug/actions-by-orgId' into 'release'
/actions should return all the actions of the current organization only.

Added organizationId to Action. This gets set only during create operation. Whenever get is performed on actions, it is filtered using organizationId.

See merge request theappsmith/internal-tools-server!164
2020-02-01 05:09:28 +00:00
Trisha Anand
c6a18aed87 /actions should return all the actions of the current organization only. 2020-02-01 05:09:28 +00:00
Trisha Anand
5e640a3608 This ensures that the action (with any changes) is saved along with the new page id. 2020-01-31 18:10:46 +05:30
Trisha Anand
7f52c34d55 If the json path key contains the action itself, then it should be removed from the dependents. This is because otherwise we would end up in an infinite loop trying to calculate the action dependents in a recursive fashion. 2020-01-31 17:26:52 +05:30
Arpit Mohan
0e7bbe1479 WIP commit on soft deletes
ANother WIP
2020-01-31 09:34:36 +00:00
Trisha Anand
c437d7fc3c Fixed the run time issues seen with page load action dependency changes 2020-01-30 16:00:50 +05:30
Trisha Anand
77cfc0d9bd All the page load actions and their dependent page load actions now are stored as part of on page load actions 2020-01-30 09:48:48 +00:00
Trisha Anand
4ba6344cfd When user creates an organization, the user automatically gets added to the said org. 2020-01-30 09:24:31 +00:00
Arpit Mohan
15cbd266b3 Ignoring the createdAt, updatedAt and version fields in BaseDomain object.
This is because the client sends us the complete document as is. This causes conflicts in MongoDB for versioning and java Instant deserialization.
2020-01-30 12:55:33 +05:30
Arpit Mohan
d313f37f5c Adding mongo auditing to add createdAt and updatedAt timestamps to the documents in the DB.
At the moment, reactive Spring does not support AuditorAware implementation which also inserts the username of the user making the changes. Reference: https://jira.spring.io/browse/DATACMNS-1231.
2020-01-30 06:15:20 +00:00
Trisha Anand
655e26a986 Removing logs added to debug release for pagination. 2020-01-29 16:17:42 +05:30
Trisha Anand
d3769bad62 In case of duplicate key, send the application error code instead of http error code so that frontend can handle the duplicate key error gracefully 2020-01-29 10:22:21 +00:00
Arpit Mohan
8e8152ea63 Adding permission to delete the application by a user 2020-01-29 14:52:45 +05:30
Trisha Anand
c6da910c2b In case of duplicate key, send the application error code instead of http error code so that frontend can handle the duplicate key error gracefully 2020-01-29 08:50:50 +00:00
Trisha Anand
a9dd24152c Fixed the null pointer exception which is happening because of isPaginated field not being available for non paginated APIs 2020-01-29 11:04:48 +05:30
Trisha Anand
17f4a6f2e8 Handle server side pagination in action 2020-01-28 14:40:59 +00:00
Arpit Mohan
7764038ce9 Moving the form login & logout endpoints to /api/v1/login and /api/v1/logout
This is to ensure that when we deploy in production, we can add redirect rules on Nginx. Now /api and /oauth2 urls will proxy to the API server while all other URLs will proxy to the frontend server.
2020-01-28 17:12:46 +05:30
Trisha Anand
687b664011 Because the action was being saved directly, the isValid and invalid fields which are computed every time an action is updated, was not getting computed. isValid and invalids being null led to null pointer error after the action was moved. Fixed that by calling update instead of saving the action directly. 2020-01-27 09:17:45 +00:00
Trisha Anand
ff56dc9661 Added controller end point to make a page default. When creating a new application, the default page created is set to default=true. Also, when returning pages by application id and by application name, the page's default status is returned as well as part of PageNameIDDTO 2020-01-23 14:45:05 +00:00
Trisha Anand
c9cf2f4b94 Removing enum for WidgetSectionName and converting to a String
This is to ensure that the frontend can create sections as per their requirement and not be mandated by an enum in the server codebase.
2020-01-23 09:36:44 +00:00
Trisha Anand
de722fff4e UpdateLayout Null Pointer Exception : In case the layouts are null or the DSL is null, it should be handled gracefully. 2020-01-21 05:57:35 +00:00
Trisha Anand
d1c104a0e6 First attempt at refactoring widget name. Not tested. Pushing because of intellij constantly crashing 2020-01-20 12:26:13 +00:00
Arpit Mohan
ebfddeda94 Fixing minor bug in the invite flow which was causing the password to be hashed twice 2020-01-16 16:59:49 +05:30
Arpit Mohan
bf6a80074e Adding connection pooling to MongoDB to prevent too many connections from opening up 2020-01-16 15:07:15 +05:30
Trisha Anand
670ca4cb7e Added log for execute action 2020-01-15 09:13:27 +00:00
Arpit Mohan
428b93683a Merge branch 'release' of gitlab.com:theappsmith/internal-tools-server into release 2020-01-14 17:14:26 +05:30
Arpit Mohan
bb8b127e2d Fixing bug again to save the reset password token in the DB.
We need to use flatMap instead of map else the Mono will not run to save the token in the passwordResetToken collection
2020-01-14 17:13:42 +05:30
Trisha Anand
f4a2a73abe In case of non json results, set the result body as string, otherwise parse the json and then store it as jsonNode 2020-01-14 09:48:43 +00:00
Arpit Mohan
9e6c54b343 Merge branch 'hotfix/github-login-cleanup' into 'release'
Cleaning up the Github OAuth2 login flow by adding userNameAttribute to properties

This property helps define for Spring security which field in the OAuth2 user info to read in order to determine the username of the user. This is because this field is non-standard across different OAuth2 implementations. For each new OAuth2 provider that we support, this field will be required. Else the default name field will be picked up by Spring security (which is usually the id of the user).

See merge request theappsmith/internal-tools-server!156
2020-01-14 03:10:44 +00:00
Arpit Mohan
2b0a21bbab Cleaning up the Github OAuth2 login flow by adding userNameAttribute to properties
This property helps define for Spring security which field in the OAuth2 user info to read in order to determine the username of the user. This is because this field is non-standard across different OAuth2 implementations. For each new OAuth2 provider that we support, this field will be required. Else the default name field will be picked up by Spring security (which is usually the id of the user).
2020-01-14 08:36:54 +05:30
Trisha Anand
660e47a819 Mock delete application which returns the application object which was being attempted to be deleted. 2020-01-13 13:06:42 +00:00
Trisha Anand
28e20ed3bd Move action also works successfully in removing the action from the previous page's onLoadActions while moving to another page. 2020-01-13 12:07:10 +00:00
Arpit Mohan
a542abc563 Adding quick fix for email validation check before we send an email to the user.
This is because there are OAuth2 providers who don't provide an email ID of the user. In those scenarios, we cannot send a welcome email to the user.
2020-01-13 17:35:23 +05:30
Arpit Mohan
56b54e1d17 Fixing bugs in the Github login flow to check for uniqueness of user
Github auth doesn't return the email ID of the user. Hence, we need to use the `login` attribute of the user profile information.
2020-01-13 15:50:00 +05:30
Arpit Mohan
db27e7c86c Adding Github login feature. Also adding condition to limit domain access in Google OAuth2
The domain restriction has been done by adding parameter `hd` in the function CustomServerOAuth2AuthorizationRequestResolver#authorizationRequest. We still verify if the OAuth2 response has the parameter `hd` to ensure that no client side manipulation has been performed.
2020-01-13 12:13:53 +05:30
Arpit Mohan
7622d76f32 Adding the property server.use-forward headers in order for Spring security to function properly behind a Nginx load balancer
This property helps the spring security library derive the host name, protocol and port accurately even while running behind a Nginx load balancer. This is because nginx adds X-Forward-* headers that are parsed by Spring security library.
2020-01-13 10:25:43 +05:30
Arpit Mohan
f374638d98 Adding exception stack trace to the login failure scenarios for debugging. 2020-01-10 18:11:29 +05:30
Arpit Mohan
60b7c69346 Adding a check for referrer header incase we don't find the origin header in authenticationFailureHandler
This is required for OAuth2 failure handling. When the client makes an OAuth2 request, we don't receive an origin header. If the OAuth2 login fails for some reason, our failure handler will not redirect correctly unless we also check for the referer header.
2020-01-10 18:06:15 +05:30
Arpit Mohan
70e9adbef6 Correcting the redirect uri property name in the config file for custom OAuth2 redirection
This is required because when we host inside a docker container, the default host and port picked up by the code is the docker container's name & port. This will not work when Google (for example) needs to redirect back to our server after authentication is complete. Hence, we need to customize the default redirect uri for all OAuth2 endpoints.
2020-01-10 17:06:05 +05:30
Arpit Mohan
8b9d865c5a Revert "Adding logs to debug docker OAuth2 login issue"
This reverts commit e3773bdf9f1c0ee543b98a2f9ac01b07efaf1858.
2020-01-10 16:44:02 +05:30
Arpit Mohan
73a6ca13f0 Adding logs to debug docker OAuth2 login issue 2020-01-10 16:18:36 +05:30
Arpit Mohan
6f76ba99d6 Handling the case where the user tries to reset the password for a user that doesn't yet exist in the system. 2020-01-10 14:54:10 +05:30
Trisha Anand
34b170bc5c Update layout was failing for when the mustache key was {{fetchUsers2[0].}}. When the word splitting happened, it got split into fetchUsers2, 0 and '.'. This means that when each word was finally split again, there was nothing before the '.' leading to null pointer exception. This has been fixed by adding a check for the same. 2020-01-08 16:34:28 +05:30
Arpit Mohan
2dced0818e Fixing the bug which prevented the reset password token from being saved in the DB
The issue was that the chain would receive a mono instead of an object. This would cause it to not persist the token in the DB. Moving to flatMap fixes this problem as we then deal with the actual object instead of the Mono.

Also fixing the url encoding in the email to ensure that the links generated are correct. By default mustache does HTML escaping and not URL encoding.
2020-01-08 14:30:45 +05:30
Trisha Anand
6f6dcbe4d4 Added logs which must be removed in 24 hours. 2020-01-07 20:50:10 +05:30
Trisha Anand
4a7b1632ad Removed the creation of dependency graph during update layout. Instead simple mustache finding are done now to get pageload actions. 2020-01-07 11:34:44 +00:00
Arpit Mohan
36f6b35c09 Increasing the redis inactive session timeout to 30 days
Now when a user doesn't log into the Appsmith system for 30 days, they will get logged out.
2020-01-07 13:05:44 +05:30
Arpit Mohan
296ea7beee Filtering out the groups based on the user's current organization ID
Also refactoring the code to use the MultiValueMap for filter params which is a generic implementation and can support filtering on multiple fields of the domain object groups. This can be replicated to other domain objects as well.
2020-01-06 17:40:44 +05:30
Arpit Mohan
d8e9be9465 Merge branch 'feature/create-user-workspace-name' into 'release'
Ensuring that a user's personal workspace name is their first name by default.

This is because the full name makes the entire workspace name very long. If we just use the first name, it'll be a shorter string and easier to read by the end user as well.

See merge request theappsmith/internal-tools-server!142
2020-01-03 14:50:35 +00:00
Arpit Mohan
68092c19cc Ensuring that a user's personal workspace name is their first name by default.
This is because the full name makes the entire workspace name very long. If we just use the first name, it'll be a shorter string and easier to read by the end user as well.
2020-01-03 20:15:23 +05:30
Arpit Mohan
db8c88efbc Merge branch 'bug/body-replace-json' into 'release'
Action Execution should handle rest api body for mustache replacement scenario

See merge request theappsmith/internal-tools-server!141
2020-01-03 14:43:30 +00:00
Trisha Anand
934771761b Handling the json body scenario where html escaping lead to json body for rest api being incorrect. 2020-01-03 20:09:44 +05:30
Arpit Mohan
e0a03c74e5 Filtering out the groups to only query those that belong to the user's current organization 2020-01-03 15:57:31 +05:30
Arpit Mohan
b8bc4514ba Adding default flag to the group domain object so that the client can select a default permission group for the user. 2020-01-03 10:05:51 +00:00
Arpit Mohan
ca40bb842f Sending HTML template emails to users when they signup, invite another user or reset their password. 2020-01-03 09:44:17 +00:00
Trisha Anand
30b094c7a5 Curl Parsing for http. Extracts : Method, Headers, Query Params, URL (without query params). Yet to finish Body 2020-01-02 13:38:55 +00:00
Trisha Anand
cef09282eb 1. For creating the dependency graph, only APIs with HTTP method GET is used. The other actions used in the DSL are ignored.
2. Only dependencies of actions over other actions are counted. If the action is dependent on widgets, thats is not counted as a dependency and is left for the frontend to handle.
2020-01-02 13:38:40 +00:00
Arpit Mohan
2bd871a589 Send email to new user on signup 2020-01-02 13:09:05 +00:00
Arpit Mohan
99010d08dc Fixing the bug where the custom authentication failure handler wasn't being invoked
This was because we need a custom authentication entry point to override the failure handler as well.
2020-01-02 17:25:34 +05:30
Arpit Mohan
868cad2648 Modifying the logoutSuccessHandler to return success and failure JSONs instead of redirecting the client to the login page
This allows the client to invoke the logout call via a XHR request instead of a form post.
2020-01-02 16:13:19 +05:30
Arpit Mohan
08b70d0e7d Adding a logout handler to redirect the client back to the login page after the user logs out of the application. 2019-12-31 15:01:28 +05:30
Arpit Mohan
8e2fde20a5 Fixing bug where we shouldn't query the DB to find action and store cached result if it's a dry run 2019-12-31 14:14:32 +05:30
Arpit Mohan
ff6794e931 Fixing bug where we were returning all the organizations in the db instead of just the ones that belong to the user. 2019-12-31 13:25:07 +05:30
Arpit Mohan
a663d8d38a Adding the redirect back to the client's index page on successful oauth2 login by the user
We use the referer header to find the client's endpoint and redirect to that endpoint once the OAuth2 login is successful. This is implemented via CustomServerOAuth2AuthorizationRequestResolver and AuthenticationSuccessHandler
2019-12-30 18:07:30 +05:30
Arpit Mohan
8ff5c7d1fc Merge branch 'feature/401-redirect' into 'release'
Responding with 401 unauthorized http response header for all unauthenticated requests

This ensures that the client can redirect to the login page whenever it receives the http status 401 in the response header. Now, the server is no longer responsible for redirecting to the login page. All server redirects have been disabled.

See merge request theappsmith/internal-tools-server!128
2019-12-23 14:49:05 +00:00
Arpit Mohan
d32eaf11d8 Responding with 401 unauthorized http response header for all unauthenticated requests
This ensures that the client can redirect to the login page whenever it receives the http status 401 in the response header. Now, the server is no longer responsible for redirecting to the login page. All server redirects have been disabled.
2019-12-23 20:15:33 +05:30
Trisha Anand
f13356a6e2 Successful action execution results are saved in the action. 2019-12-23 20:00:46 +05:30
Arpit Mohan
2b9dadb582 Merge branch 'feature/user-invite' into 'release'
Adding the invite user flow to invite a new user into the organization.

This includes multiple APIs:
1. Invite user which creates an invite token for the user and then sends it to the new user via email. This token is valid for 1 hour (for now).
2. An endpoint to verify the invite token so that the client can pre-emptively show any errors or expired token messages. This endpoint is publicly accessible and doesn't require a session.
3. An endpoint for the new user to sign up and set their password by providing their invite token. This endpoint is publicly accessible and doesn't require a session.

Also extending the redis session timeout to 1 day instead of 30 mins.

See merge request theappsmith/internal-tools-server!125
2019-12-23 03:30:08 +00:00
Arpit Mohan
5081292fd8 Adding the invite user flow to invite a new user into the organization.
Also extending the redis session timeout to 1 day instead of 30 mins.
2019-12-23 08:54:12 +05:30
Arpit Mohan
b30626b274 Returning only the plugins installed by the user's current organization
This ensures that we don't return all the plugins available in the marketplace if they haven't been installed by the user.
2019-12-19 11:47:26 +00:00
Arpit Mohan
5ba754b430 Merge branch 'hotfix/forgot-password-duplicate' into 'release'
Handling duplicate email in forgotPassword flow.

Now if the user requests for the reset password token multiple times, we will override the previous token and save the new token against that user.

See merge request theappsmith/internal-tools-server!122
2019-12-19 07:41:40 +00:00
Arpit Mohan
7a8eacb44f Merge branch 'feature/forgot-password-authorization' into 'release'
Correcting the HTTP methods in SecurityConfig and acl.rego to fix bug in forgotPassword and resetPassword authorization.

See merge request theappsmith/internal-tools-server!121
2019-12-19 07:38:12 +00:00
Arpit Mohan
e129fecca7 Handling duplicate email in forgotPassword flow.
Now if the user requests for the reset password token multiple times, we will override the previous token and save the new token against that user.
2019-12-19 13:07:01 +05:30
Arpit Mohan
9caa6d42b8 Merge branch 'feature/email-disable' into 'release'
Adding a flag to determine if we should send emails for that particular environment

This is to prevent us from sending erroneous emails from our dev/test environments

See merge request theappsmith/internal-tools-server!120
2019-12-19 07:36:10 +00:00
Arpit Mohan
20ea476dc7 Correcting the HTTP methods for the public urls of forgotPassword & resetPassword 2019-12-19 13:04:13 +05:30
Arpit Mohan
f75331b116 Adding a flag to determine if we should send emails for that particular environment 2019-12-19 13:02:48 +05:30
Arpit Mohan
a1271d5746 Merge branch 'hotfix/update-page-layout-bug' into 'release'
Removing the logic to bind actions to pages when a dynamic binding happens.

This is because when an action is created, it is already bound to that page. This assumption will not change. Also, adding the pageId when searching for an action because the action name and pageId is a unique index. There may be actions with similar names across multiple pages.

See merge request theappsmith/internal-tools-server!119
2019-12-19 07:11:07 +00:00
Arpit Mohan
738b693d9a Removing the logic to bind actions to pages when a dynamic binding happens.
This is because when an action is created, it is already bound to that page. This assumption will not change. Also, adding the pageId when searching for an action because the action name and pageId is a unique index. There may be actions with similar names across multiple pages.
2019-12-19 12:35:43 +05:30
Arpit Mohan
a54e8b1559 Fixing bug where the public URLs need to be defined in SecurityConfig as well 2019-12-17 12:05:52 +05:30
Arpit Mohan
bcba9d3415 Creating a list of public endpoints that anonymous users can access.
OPA controls access to all endpoints and the list of authenticated resources and public URLs is defined in a single place in that file.

The url_allow function in acl.rego is an overloaded function that replicates the OR condition in Rego. Either the user is authenticated and has permissions to access those resources, or the URL is public and accessible by any user.
2019-12-17 09:28:59 +05:30
Arpit Mohan
3760849aa6 Removing basic auth from our securityConfig 2019-12-16 14:32:27 +05:30
Arpit Mohan
82a6d96b1a Upgrading to Spring boot 2.2.2 for features in Spring security
Now, we have an authenticationSuccessHandler & authenticationFailureHandler for OAuth & Form sign ups. This makes the whole flow much easier to handle.
2019-12-16 10:53:17 +05:30
Arpit Mohan
274a686e51 Modifying the form submit error handler to redirect the browser to login error page.
This is because the client cannot handle a JSON response for form submit requests. They can only be handled in Ajax requests.
2019-12-12 18:22:18 +05:30
Arpit Mohan
69e73ad240 Disabling the GET for the login page to ensure that the server login page is not loaded 2019-12-12 16:07:57 +05:30
Arpit Mohan
eb825f37e9 Adding endpoint to fetch current user's profile.
Also redirecting the browser to this user profile endpoint on username password login success. This ensures that the client fetches the profile along with setting the session ID cookie in the browser
2019-12-12 15:25:09 +05:30
Arpit Mohan
af96c11d3e On username + pwd auth success, we redirect the browser to the client's index page via the origin header. 2019-12-12 09:46:38 +00:00
Trisha Anand
d8fc726f79 Merge branch 'feature/user-login-redirect' into 'release'
Sending custom JSON in form login success and failure scenarios

See merge request theappsmith/internal-tools-server!111
2019-12-12 07:32:20 +00:00
Arpit Mohan
c12f90ca1e Sending custom JSON in form login success and failure scenarios
This involves overriding the default success and failure handlers for login in the SecurityConfig class. The handlers are defined in the filters package.
2019-12-12 12:57:23 +05:30
Trisha Anand
9c62029ff0 Removed unbinding of actions from the page if not present in the DSL. 2019-12-12 12:30:50 +05:30
Arpit Mohan
ec478e5c2a Reverting previous commit with @EnableMongoAuditing because that is causing APIs to return empty data in the API 2019-12-11 17:15:16 +05:30
Arpit Mohan
6f39d39523 Moving the annotation @EnableMongoAuditing to the CommonConfig class because it wasn't being acknowledged by Spring
This now ensures that Spring JPA inserts the createdAt and updatedAt timestamps to the MongoDB along with the document itself.
2019-12-11 16:21:14 +05:30
Trisha Anand
2a47a442be Removes pageId from actions no longer in DSL and adds pageIds for actions in DSL in actions collection 2019-12-11 10:29:12 +00:00
Arpit Mohan
614b1b3f0d Creating default groups for the user's personal organization when the new user signs up
The default groups for an organization are created by copying over data from the groups collection with the organizationId 'default-org'. This ensures that we can update the permissions in the DB and add new permissions without any code changes. The new user is then assigned to these groups so that they have all the permissions required to administer the organization.

Also adding a display name for the groups so that the UI can show a different name than the one used internally within the DB to represent the group.
2019-12-11 10:20:28 +00:00
Trisha Anand
7a3cfe2c52 Create user now also leads to creation of personal organization for the user. It also gets assigned as the default (current) workspace (or currentOrganizationId) 2019-12-10 10:58:34 +00:00
Trisha Anand
66b28e8dec LayoutOnLoadActions are now being copied to the published version. Now viewing the published page would give all three published datastructures : DSL, Layout Actions, and Layout Load Actions 2019-12-10 07:25:08 +00:00
Arpit Mohan
fe82366ace Fixing compilation issue 2019-12-08 21:20:58 +05:30
Arpit Mohan
fdba2f62ef Adding email sending capability when the user resets their password 2019-12-08 15:46:17 +00:00
Trisha Anand
046751b1ba Working version where the top feeding nodes have been discovered in the tree. These would be page load actions. 2019-12-08 13:41:15 +00:00
Trisha Anand
23dbd4c78a Create/Update user used password encoder to encode the user password before storing it in the database 2019-12-06 12:15:28 +00:00
Trisha Anand
3137b54f12 Adding query params to get actions API call 2019-12-06 09:48:31 +00:00
Trisha Anand
b16909de61 JS functions can now be stored to an action. 2019-12-05 09:19:45 +00:00
Arpit Mohan
c5ce086ace Merge branch 'feature/release-base-uri' into 'release'
Checking if the name of the user is not null. Only then inserting it that field into analytics service.

See merge request theappsmith/internal-tools-server!97
2019-11-29 13:29:11 +00:00
Arpit Mohan
d8ef880a5c Checking if the name of the user is not null. Only then inserting it that field into analytics service. 2019-11-29 18:55:07 +05:30
Arpit Mohan
11c60e8103 Merge branch 'feature/release-base-uri' into 'release'
Modifying the base uri for oauth2 for release environment

Setting the release uri to `https://release-api.appsmith.com` This ensures that it's all under the appsmith domain.

See merge request theappsmith/internal-tools-server!96
2019-11-29 09:16:27 +00:00
Arpit Mohan
ba9c2f0831 Modifying the base uri for oauth2 for release environment 2019-11-29 14:42:16 +05:30
Arpit Mohan
2b959f3af4 Renaming executorClass to packageName and adding uiComponent field to plugin object
This will allow the frontend to be able to dynamically load the component based on the configuration provided in the plugin object.
2019-11-29 13:43:13 +05:30
Trisha Anand
de2bd38e9d Dsl actions now store not just the ids but also the name, plugin type and json path keys. 2019-11-29 07:16:16 +00:00
Arpit Mohan
473bba594a Updating redis properties for heroku environment 2019-11-28 19:01:56 +05:30
Arpit Mohan
8a442d429c Dummy commit to trigger Heroku deployment 2019-11-27 16:37:03 +05:30
Arpit Mohan
fdb2f7a25d Adding query parameters to filter get API calls. Specifically adding filter by plugin type in the get plugins API. 2019-11-27 10:51:43 +00:00
Arpit Mohan
dea2efa776 Merge branch 'feature/oauth2-custom-url' into 'release'
Adding the base uri for google oauth2 redirect uri

This is required because when we host the server in a docker container, by default the baseUri picked up by Spring security is the DNS name of the appsmith server inside the docker networking bridge. These names may not be valid DNS names that Google can redirect to in the event of a successful Oauth2 login. Hence, we are overriding the base uri with our own uri for each environment.

The customer will have to provide this uri when they host it on their internal networks. This uri must be publicly accessible for Oauth2 to work.

See merge request theappsmith/internal-tools-server!90
2019-11-27 08:34:57 +00:00
Arpit Mohan
92ad45091d Adding the base uri for google oauth2 redirect uri
This is required because when we host the server in a docker container, by default the baseUri picked up by Spring security is the DNS name of the appsmith server inside the docker networking bridge. These names may not be valid DNS names that Google can redirect to in the event of a successful Oauth2 login. Hence, we are overriding the base uri with our own uri for each environment.

The customer will have to provide this uri when they host it on their internal networks. This uri must be publicly accessible for Oauth2 to work.
2019-11-27 13:57:01 +05:30
Trisha Anand
b0452b74c6 Datasources are now returned only for the organization of the current user. 2019-11-27 08:22:29 +00:00
Trisha Anand
606c09067e Fixes the test cases : create for PageService and ApplicationService is no longer used. Instead ApplicationPageService provides createPage and createApplication for the same. Updated the test cases to use the correct service to do this. 2019-11-27 08:17:46 +00:00
Arpit Mohan
e492bf2622 Fixing stupid bug in action execution timeout. Applying only on the action execution instead of the whole execute function 2019-11-27 02:10:01 +05:30
Trisha Anand
7e6e19e14e PageController : Find pages by application name instead of application id. This first fetches the application from name and then fetches pages using the application id. 2019-11-26 12:21:20 +00:00
Trisha Anand
0fd6351a76 Added timeout on the plugin execution.
Next TODO : Make the timeout duration configurable
2019-11-26 11:34:27 +00:00
Trisha Anand
4c0aa5956e Converted list to set to ensure unique action ids in the list of actions per dsl 2019-11-21 07:44:20 +00:00
Trisha Anand
781788f4a3 Extracting mustache keys from layout and finding all the action names from the same. This is then stored to the layout 2019-11-21 07:30:07 +00:00
Trisha Anand
9a4fea1c56 Updates for getting the test cases for Organization service to run. Since unique name is a new constraint added, the old test cases didnt account for the same. 2019-11-19 09:02:14 +00:00
Trisha Anand
44e17eef7b Added fields : flag isValid & string array of invalids to track if an action/datasource is invalid and what are the invalidities. This allows for the creation of actions and datasources even if they are invalid. Each update to the object leads to new computation of the validity.
When executing the isValid flag is tested and if false, the execution is stopped.
2019-11-18 12:20:10 +00:00
Arpit Mohan
c5445533f3 Merge branch 'master' into 'release'
Merging master into release to sync up the branches

See merge request theappsmith/internal-tools-server!78
2019-11-18 08:46:59 +00:00
Arpit Mohan
8fbf61502f Creating dockerfile that creates the server image.
Also modifying .gitlab-ci file to push docker image to the registry
2019-11-14 12:50:37 +00:00
Trisha Anand
31cf94f08e 1. Added datasource validator function in the plugin interface which simply returns true for all the current plugins.
2. Added static method getPluginExecutor as a util function which removes duplicate code from across different files.
2019-11-14 08:50:02 +00:00
Arpit Mohan
f62cd1f21a Endpoint to view published page using just PageId. The layoutId is no longer required. 2019-11-14 07:06:34 +00:00
Trisha Anand
0d21680f08 Action only with name now supported 2019-11-13 12:26:12 +00:00
Arpit Mohan
f4daa33493 Adding CRUD API for configurations. The name for the config will be unique across the dataset. 2019-11-13 12:17:32 +00:00
Trisha Anand
f81e22b1a5 Adding the capability to associate a user with multiple organizations 2019-11-13 10:23:23 +00:00
Trisha Anand
55a29c448c Datasource without any configuration is not valid. Deter the user from creating one in such a scenario 2019-11-13 06:08:36 +00:00
Trisha Anand
df904539ca Datasource instead of DatasourceId is expected as part of Action. During create and update action, datasource can also be created, which is automatically saved as part of datasource collection 2019-11-13 05:51:01 +00:00
Trisha Anand
41be720335 Get all actions returns them in sorted order 2019-11-12 09:59:29 +00:00
Trisha Anand
cb4493dc2d Datasource instead of DatasourceId is expected as part of Action. During create and update action, datasource can also be created, which is automatically saved as part of datasource collection 2019-11-12 09:58:14 +00:00
Trisha Anand
e6d9f1df88 Datasource instead of DatasourceId is expected as part of Action. During create and update action, datasource can also be created, which is automatically saved as part of datasource collection 2019-11-12 09:15:09 +00:00
Arpit Mohan
aac31235f6 Merge branch 'master' of gitlab.com:theappsmith/internal-tools-server
# Conflicts:
#	appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
#	appsmith-server/src/main/java/com/appsmith/server/services/ResourceContextServiceImpl.java
2019-11-07 14:28:09 +05:30
Trisha Anand
63c0f07708 Query param handling has been added to Rest API plugin using URIComponentsBuilder 2019-11-06 12:30:56 +00:00
Arpit Mohan
bcda3f0feb Renaming all the references of resource to datasource
This renaming is reflective of the entity and it's potential values in the future.
2019-11-06 16:25:08 +05:30
Trisha Anand
3c1b08d911 Page Controller now can return list of pages by application id and list of page names & ids by application id 2019-11-05 11:49:52 +00:00
Trisha Anand
3f968afac6 Page Controller now can return list of pages by application id and list of page names & ids by application id 2019-11-05 11:36:10 +00:00
Arpit Mohan
0c0956ca46 Adding ACL bundle for datasources API 2019-11-05 16:36:09 +05:30
Arpit Mohan
3622d8b0d3 Converting actionConfiguration to a string to extract mustache keys
Also making jsonPathKeys a read-only field. Cannot be written via the API.
2019-11-05 10:40:09 +00:00
Trisha Anand
00fa2e80f7 Added ActionCollectionService which would act on composite functions. Need to handle all scenarios here. 2019-11-05 09:39:54 +00:00
Trisha Anand
bd846bfc8d Fix for dsl getting rewritten 2019-11-05 07:37:39 +00:00
Trisha Anand
68e30ff297 Handles empty params in a request 2019-11-05 05:51:14 +00:00
Trisha Anand
daeba007a1 Bug/rest api 2019-11-04 11:20:18 +00:00
Arpit Mohan
023ef93969 Fixing Heroku credentials again. Need to find permanent solution to this. 2019-11-01 08:52:20 +01:00
Arpit Mohan
00cd806259 Changing the Redis credentials because Heroku changed them again 2019-10-28 13:15:02 +01:00
Arpit Mohan
d17927e1f8 Reducing data response for application publish API
Instead of sending complete application information, we now only send the boolean true or false value to indicate to the client the success or failure of the publish action
2019-10-24 15:41:38 +05:30
Arpit Mohan
2bd8113229 Moving JsonPathKeys from Page document object to Action
This is to ensure that the Action object is independent by itself and the client can derive the mustache keys by looking at the action object directly.
2019-10-24 12:38:52 +05:30
Arpit Mohan
314cdd29d9 Handling error in RedisListenerConfig
When we shut down the server, the redis subscription is not closed cleanly leading to the server to hang. Adding an error handler solves for this issue.
2019-10-23 05:20:44 +00:00
Trisha Anand
d178b1c729 Publishing an application has been implemented by introducting publishedDsl field inside Layout. On Publish, for all pages in the application, for all layouts inside each page, the dsl json object is copied into the publishedDsl json object. 2019-10-23 04:41:51 +00:00
Trisha Anand
f8dddb212f Action Service - Delete 2019-10-21 14:01:21 +00:00
Trisha Anand
8ac0203b83 Fixing stupid bug in the acl rego file 2019-10-21 18:39:41 +05:30
Arpit Mohan
6eb7311197 Adding the permissions for fetching and updating applications & groups.
Also adding permission for deleting actions
2019-10-21 12:57:36 +05:30
Trisha Anand
74a8466528 Analytics Service now caters to all the events that need to be published. Every service should now call the analytics service's sendEvent function for tracking events. 2019-10-18 13:45:18 +00:00
Trisha Anand
84837fe57f Mongo Plugin works here. Barring the scenarios where the query json contains special characters in keys ($, .) it works properly. 2019-10-18 08:27:19 +00:00
Arpit Mohan
3a9f344a51 Removing plugins from appsmith-interfaces module 2019-10-17 09:25:58 +05:30
Arpit Mohan
135b61a4bc Adding mongo seed data that will be recreated whenever docker-compose causes the containers to restart
Note that we have to delete the Mongo volume for the inidtb script to take effect. Else, it will not execute. To be used only for testing right now. Will figure out a more robust solution later.

Also using Google's JIB Maven plugin to reduce our Docker image footprint. Will make container upload and download much faster
2019-10-16 11:27:02 +00:00
Arpit Mohan
f51de50725 Adding more acl rules for properties and action controllers 2019-10-14 12:29:20 +00:00
Arpit Mohan
cf5b2c325b Adding a folder for public resources in order to serve OPA bundle
Open Policy Agent requires a bundle in the form of tar.gz in order to bootstrap itself with base policy and data. The server will serve this policy under the public domain. In the future, we will enable a Basic Authentication scheme in order to lock down this pocliy.
2019-10-14 09:24:09 +00:00
Trisha Anand
e1d59ca3a6 Multi data source support for plugins using Resource Context 2019-10-11 10:32:18 +00:00
Arpit Mohan
632aff4faa Adding basic ACL functionality with Open Policy Agent.
Currently, ACLFilter communicates with the OPA daemon to determine if the request should be validated or not based on the resource and permissions in user and group
2019-10-11 10:31:28 +00:00
Trisha Anand
7315802508 Fixing redis connection changes 2019-10-10 11:53:03 +00:00
Trisha Anand
d1bcc282f8 Adding the redis listener via spring-data-redis-reactive.
The listeners need to be configured in the RedisConfig class via Beans. These beans can then invoke complex business logic based on requirements.
2019-10-07 09:02:02 +00:00
Arpit Mohan
ad22e1a406 Adding the redis listener via spring-data-redis-reactive.
The listeners need to be configured in the RedisConfig class via Beans. These beans can then invoke complex business logic based on requirements.
2019-10-07 08:18:54 +00:00
Trisha Anand
59752254b4 On install, the plugins are loaded and started again. This ensures that we don't have to restart the server every time a new plugin is installed. Earlier the plugins were loaded and started only during the boot 2019-10-04 04:27:11 +00:00
Trisha Anand
8658df95a9 All action executions now return object of type ActionExecutionResult. RestApiPlugin returns the same object which contains statusCode, headers and body. 2019-09-30 18:17:35 +00:00
Trisha Anand
51d5c93119 Fixing minor bugs in the Segment analytics flow 2019-09-25 17:06:28 +00:00
Trisha Anand
566a245451 Segment & Rollbar Integration 2019-09-25 16:20:51 +00:00
Trisha Anand
bec8b2e0a1 Adding the docker-compose up command to the build
This should ideally run the mongo-seed container to restore the DB before each run
2019-09-24 12:14:41 +00:00
Trisha Anand
de55ec8f8e Property Pane for Widget 2019-09-24 11:40:53 +00:00
Arpit Mohan
280f8d4dcb Fixing the Cors configuration to ensure that pre-flight requests return the Access-Control-Allow-Origin header 2019-09-18 09:45:00 +00:00
Arpit Mohan
ac44e2c970 Modifying the ResponseDTO to contain the ResponseMeta object. Also moving ErrorDTO inside ResponseMeta object.
This also fixes the logic for multiple ResponseDTOs that were being sent when the service level response was a Flux. Now we only return a single array inside a Mono ResponseDTO object.
2019-09-18 08:52:14 +00:00
Arpit Mohan
0edc0f6363 Adding the executeAction API in the ActionController.
Also changed the interface for the PluginExecutor to include the resourceConfig and ActionConfig as well.
2019-09-17 12:18:23 +00:00
Trisha Anand
4498a301a6 Docker 2019-09-17 09:35:13 +00:00
Trisha Anand
14ec5260d9 Incorporated review comments from Nikhil on action 2019-09-17 07:23:30 +00:00
Trisha Anand
5468436d9f Add Page Actions to Page object. 2019-09-17 06:25:07 +00:00
Arpit Mohan
bb84e74c23 Re-arranging the files to fix bad merge that threw compile errors 2019-09-16 17:04:07 +05:30
Arpit Mohan
661111daaa Setting java version to 11 in system.properties.
This is required by Java Heroku buildpack
2019-09-16 16:54:28 +05:30
Arpit Mohan
b3c987a9f9 Convert the project into a multi-module structure
We are moving to a multi-module structure so that different parts of the codebase can be exposed to the public while others can remain private. Using pf4j for plugin framework.

Also adding a build script `build.sh` which compiles the code and creates the `dist` folder for distribution purposes. Now we can build the code via

```
$ ./build.sh -DskipTests
```
2019-09-16 11:21:57 +00:00