Commit Graph

204 Commits

Author SHA1 Message Date
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
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
e0f26cc5ab Updating mongo seed.js to reflect the new domain objects when a new instance of Mongo is setup via docker-compose. 2019-12-31 13:25:33 +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
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
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