-
Notifications
You must be signed in to change notification settings - Fork 56
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
Error parsing HashiCorp Vault policies #97
Comments
I can duplicate this, though I currently see a slightly different exception.
parses;
generates an exception.
lark.exceptions.UnexpectedCharacters: <exception str() failed> |
This appears to fix the problem:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have recently discovered that some of our users have been deploying Vault policies formatted like below, where the opening curly bracket is placed below the line:
However, Vault accepts that as a valid HCL whether you use CLI, UI or Terraform for the deployment. When parsing this to hcl2, it throws the following error:
We are using python-hcl2 to create a policy object and then lookup its capabilities. This works very well for most of the policies, but there are some formatted like above that can't be properly parsed. Is there a way to fix this. or an easy workaround other than manipulating the policy with some regex before pushing to hcl2?
The text was updated successfully, but these errors were encountered: