About
Hasura is a lovely and widely-used GraphQL server. An important part of most Hasura setups is the configuration of permissions for accessing and manipulating the underlying records in the database.
Metadelta allows you view these permissions in a convenient way; either in a "single" way (just point it at a Hasura metdata folder), or a "diff" way (point it at an "old" and a "new" one!)
The advantage of using Metadelta for exploring the permissions (especially the permission changes) is that, when your permission architecture gets even moderately complicated, it can be hard to get a complete and comprehensive view of all the changes: the roles impacted, the tables impacted, etc. This is where Metadelta comes in!
Features
- 👀 View the permission information for a particular metadata instance,
- 🚀 Automate the creation (via a CI step) of a diff-based view, that allows you to see the exact permission changes, on, say, a Pull Request,
- 🔎 Various filtering/grouping options to gain a complete understanding of permission changes.
Try it out!
Explore the demos
We have pre-computed a couple of diffs from the
demo-database
repository that you can explore in
the Metadelta UI.
GitHub Action integration
Whenever a PR changes permissions, this workflow will compute a diff and create a link to view that in the UI so reviewers can understand the full impact of changes.
Run Metadelta locally
If you would like to test out the Metadelta CLI locally, you can use our docker image.
As an example this invokes the diff
command on two folders in the present working directory called
"old
"
and "new
":
docker run -i \ -v $PWD:/work \ ghcr.io/invariantclub/metadelta \ diff \ -o /work/old/hasura/metadata \ -n /work/new/hasura/metadata \ >diff.json
Then you can take the diff.json
file and paste it into
the Metadelta UI.
For a more convenient workflow, we recommend using the GitHub
Action integration, which you can
see in action on our demo-database.
If you would like to just run it on a pre-made example, you can clone our demo-database repo and use the scripts:
git clone https://github.com/InvariantClub/demo-database cd demo-database/ ./scripts/compute-demo-diff.sh 98b1123 3b627cd
And again paste the resulting JSON output to the UI.
Source code
Metadelta is completely open-source, you can find the code here: InvariantClub/metadelta on GitHub.
Supporting this project
Metadelta will always be free for open-source projects, and is, while we're in beta, free for any project at all.
If you have a project that you think this would be useful for, or you have any other feedback, please reach out; either via email: noonsilk+metadelta@gmail.com or on our issue tracker: metadelta/issues.
FAQs
-
Q: Will this be compatible with Hasura V3?
A: Yes. It looks as if V3 will have some additional permission abilities that we will work to support as it comes out of alpha; but our intention is to be fully compatible.
Note: Metadelta is not an official Hasura product; it is provided and supported entirely by Invariant Club, an independent third party.