graphjin
graphjin copied to clipboard
PoC for allowing the admin to require specific operations in the queries via a configuration file.
The motivation behind this feature:
- The Allow List only allows prepared statements to be fired in production. This means that multiple clients of a server using graphjin would have to have their queries approved by the administrator in order to use them in production, plus in production, there would not be any freedom for a client to define the shape as he or she wants. We are looking to find a compromise between an administrator which is not allowing for select * queries to be fired, but the end user, where they still have the freedom to define the shape of the output in any environment
The way this feature works:
- We define a configuration which is an array of different types of operations such as "where", "id", orderby", etc that the administrator can require the query to have.
- The current status of this feature requires at least one of these operations to be there in the query fired.
- The code ensures that the query fired has one of the operations defined in the configuration file. If it does not, it throws an exception saying that the query is missing a required operation.
- This only applies for the top most layer at this time.