-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
permissions created via meta data api doesnt reflect in meta data files #8272
Comments
hey. just checking if you used the |
no, I don't want to use metadata-export command, lets's say we have a custom dashboard where an admin can create different roles on demand. he uses metadata API to create these roles including the right permissions on the table. my expected behavior is after the user makes the request to create different roles & permissions there is something behind the scene that keep these changes (permissions) on track and right them down to the yaml files. |
I am not sure I undertstand your use case correctly. As I understand, your admin has a local Hasura instance running via docker which is connected to a dashboard that is used to update your Hasura metadata using the metadata APIs and you would like those changes to be exported to the yaml file on the admin's local filesystem. If this isnt accurate could you elaborate a bit more on your set up? In any case, the HGE server doesnt not have access to the local file system and currently cannot write to it directly. The CLI is the tool that helps relay changes from the server to the yaml files on the filesystem. Would love to understand your use case a bit more and see if there is a way to achieve what you are looking for |
@rikinsk Thank you for the quick response. The problem is:
are we missing something? |
Thanks for sharing these details. Just a couple more question on your setup so that I have a better understanding:
|
The issue here is that the metadata api does not export metadata files (nor should it). But what you're looking for is the YAML representation of this object. Converting the JSON object to YAML is handled by the cli, but there is a util here that could help you implement this yourself. But this isn't my recommended way forward. The way the hasura cli works is that every time the metadata is changed via the console, the export metadata api will be invoked and the YAML files in the local directory will be replaced. Are your requests to the various hasura metadat apis going through a proxy? |
Version Information
Server Version: 2.1.1
CLI Version (for CLI related issue): 2.1.1
Environment
Docker container
What is the expected behaviour?
when creating permissions via metadata API applying the changes inside the related metadata tables yaml files.
for ex. if for some reason the container is down and we want to rebuild it and runing migrations from scratch I can't recover the permissions. another ex. is that we want to keep these changes under source control like git.
Keywords
api metadata docker yaml
What is the current behaviour?
creating permissions via the /v1/metadata/ is fine but to way to keep it on track inside metadata yaml files.
How to reproduce the issue?
create permissions via the api meta data -
https://hasura.io/docs/latest/graphql/core/api-reference/metadata-api/permission.html#pg-create-insert-permission
The text was updated successfully, but these errors were encountered: