Extract mustache keys from action object
When an action is created, we extract the mustache keys from various parts of the action and save it in the field `jsonPathKeys`. This same thing also happens in the update flow.
Since mustache library doesn't have an extraction function, we use a regex template to extract those keys.
We also modify the data type of the `body` parameter in the `ActionConfiguration` to String. This is because there are reserved characters that are not allowed as Mongo keys but are valid JSON keys. Converting to a string will remove all these problems.
Fixes#31
See merge request theappsmith/internal-tools-server!58
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
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.
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.
Create docker-compose file for custom installation
Adding the maven docker container build command via Maven. This ensures that we don't need to local Docker daemon to build the container. Also, the container layers are smaller because of the usage of `jib` a maven-plugin by Google. Read more at: https://phauer.com/2019/no-fat-jar-in-docker-image/
Also adding seed data for MongoDB that allows us to ship with existing data in the database when users install our app.
See merge request theappsmith/internal-tools-server!41
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
Serving static bundle for ACL in Open Policy Agent
Open Policy Agent requires the server to serve a static bundle (tar.gz) file that contains the list of policies and data (if any) on which the authorization will be conducted on. This has been implemented using RouterFunctions (for lack of a better implementation) and at the moment, the bundle is served without any authentication.
TODO: In the future, add authentication just for this endpoint so that only the OPA server can access this bundle.
Also optimizing the AclFilter to make a single MongoDB query instead of multiple for each group that the user is a part of.
See merge request theappsmith/internal-tools-server!39
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.