Commit Graph

285 Commits

Author SHA1 Message Date
Trisha Anand
f13356a6e2 Successful action execution results are saved in the action. 2019-12-23 20:00:46 +05:30
Trisha Anand
3cd5a28ed6 Merge branch 'feature/http-redirect' into 'release'
Handles http redirect upto 5 times. In case it exceeds the same, it would error out.

Closes #94

See merge request theappsmith/internal-tools-server!126
2019-12-23 09:12:15 +00:00
Trisha Anand
71a8936e10 Handles http redirect upto 5 times. In case it exceeds the same, it would error out. 2019-12-23 09:12:15 +00:00
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
0ba403b8ee Merge branch 'feature/install-default-plugin-org' into 'release'
On user signup install the default plugins in the user's personal organization

When a user signs up, a personal organization is created for that user. There are a bunch of plugins marked in the DB as with field `defaultInstall` as true. These plugins must be installed for the new organization. This ensures that the user is able to run basic actions such as executing an API, DB query etc.

Also, adding a condition in the `getPlugins` API to return only the plugins installed by the user's organization.

See merge request theappsmith/internal-tools-server!124
2019-12-19 11:47:26 +00:00
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
b32f7a23ee Merge branch 'feature/public-url-user-signup' into 'release'
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.

See merge request theappsmith/internal-tools-server!117
2019-12-17 04:02:56 +00:00
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
3e109d4d28 Merge branch 'feature/remove-basic-auth' into 'release'
Removing basic auth from our securityConfig

See merge request theappsmith/internal-tools-server!116
2019-12-16 09:08:07 +00:00
Arpit Mohan
3760849aa6 Removing basic auth from our securityConfig 2019-12-16 14:32:27 +05:30
Arpit Mohan
ccd6a7f4e6 Merge branch 'feature/spring-boot-upgrade' into 'release'
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 cleaner & easier to handle.

See merge request theappsmith/internal-tools-server!115
2019-12-16 05:28:22 +00:00
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
7f9e0b71da Merge branch 'release' into 'master'
Release

See merge request theappsmith/internal-tools-server!114
2019-12-16 05:02:50 +00:00
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
018b98df8f Merge branch 'feature/user-endpoint-me' into 'release'
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

See merge request theappsmith/internal-tools-server!113
2019-12-12 10:01:16 +00:00
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
9a1ed9a17c Merge branch 'feature/auth-success-redirect' into 'release'
Redirect to the client's homepage on success of username password login

This has been done with the express purpose of ensuring that the session ID is set correctly in the browser by the client. This can only happen when there is a 302 redirect by the browser.

See merge request theappsmith/internal-tools-server!112
2019-12-12 09:46:38 +00:00
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
Arpit Mohan
1e83f6943b Merge branch 'bug/pageid-being-deleted-on-dsl-update' into 'release'
Fixed : Unbinding action from page during DSL update leads to unbinding of all actions.

Removed unbinding of actions from the page if not present in the DSL.

See merge request theappsmith/internal-tools-server!110
2019-12-12 07:04:36 +00:00
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
3db6a94e2e Merge branch 'feature/mongo-created-timestamp' into 'release'
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.

See merge request theappsmith/internal-tools-server!109
2019-12-11 10:54:54 +00:00
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
Arpit Mohan
3c80cd4363 Merge branch 'bug/delete-pageid-action-on-dsl-update' into 'release'
Removes pageId from actions no longer in DSL in action collection

Removes pageId from actions no longer in DSL and adds pageIds for actions in DSL in actions collection.

All of these operations are now happening in bulk to improve performance

See merge request theappsmith/internal-tools-server!107
2019-12-11 10:29:12 +00:00
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
cf2ebe53b3 Merge branch 'feature/new-user-group-assignemtn' into 'release'
Assigning groups & permissions to new user signups

When a new user signs up, a new personal organization is created for that user. Default permission groups are created for this  personal organization based on the database that contains this information in the `groups` collection with organization name `default-org`. These default groups should NEVER be deleted from the DB. 

The user is then assigned to these default groups which allows him/her to administer their personal organization as org admins 
would.

Also, the `User` domain object now returns the email ID as the username of the user.

See merge request theappsmith/internal-tools-server!108
2019-12-11 10:20:29 +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
Arpit Mohan
f0af6a06fe Merge branch 'feature/signup-create-organization' into 'release'
Create personal workspace/organization on user create

Create user now also leads to creation of personal organization for the user. It also gets assigned as the default (current) workspace (or currentOrganizationId)

See merge request theappsmith/internal-tools-server!105
2019-12-10 10:58:34 +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
85303ab188 Merge branch 'release' into 'master'
Release to Master sink

See merge request theappsmith/internal-tools-server!106
2019-12-10 10:46:32 +00:00
Arpit Mohan
cebd1cfef3 Merge branch 'bug/published-actions' into 'release'
Published page has layout on load actions and layout load actions now.

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

See merge request theappsmith/internal-tools-server!104
2019-12-10 07:25:08 +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
69f77c19da Merge branch 'feature/reset-password-email' into 'release'
Adding email sending capability when the user resets their password

At the moment, the email sending is sent in the same thread that slows down the API request. Future changes should include:
1. Publish the request to send an email to Redis and actually send the email on subscribe event.
2. Disable the email sending in local environments.

See merge request theappsmith/internal-tools-server!102
2019-12-08 15:46:17 +00:00
Arpit Mohan
fdba2f62ef Adding email sending capability when the user resets their password 2019-12-08 15:46:17 +00:00
Trisha Anand
73cf8955d1 Merge branch 'feature/dsl-parsing' into 'release'
Find the page load actions

See merge request theappsmith/internal-tools-server!98
2019-12-08 13:41:15 +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