-
Notifications
You must be signed in to change notification settings - Fork 0
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
🐛 Load configuration files in YAML format #72
Conversation
Closes #71 Signed-off-by: Salim Afiune Maya <afiune@mondoo.com>
a4d5f98
to
1892d0e
Compare
go.mod
Outdated
@@ -7,11 +7,11 @@ require ( | |||
github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 | |||
github.com/stretchr/testify v1.9.0 | |||
golang.org/x/oauth2 v0.23.0 | |||
gopkg.in/yaml.v3 v3.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally we use https://github.com/kubernetes-sigs/yaml which uses json also for yaml fields. I recommend we put gokpg.in/yaml.v3 on our blocking list and use https://github.com/kubernetes-sigs/yaml instead
internal/signer/signer.go
Outdated
PrivateKey string `json:"private_key,omitempty"` | ||
Certificate string `json:"certificate,omitempty"` | ||
ApiEndpoint string `json:"api_endpoint,omitempty"` | ||
Mrn string `json:"mrn,omitempty" yaml:"mrn,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the switch to https://github.com/kubernetes-sigs/yaml this change is not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will switch! Thanks, @chris-rock 👍🏽
Signed-off-by: Salim Afiune Maya <afiune@mondoo.com>
7d55e60
to
80d435c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement, thank you for the additional tests @afiune
After this change is merged, we need to update our Terraform provider since that is
where I found this bug.
With a valid Service Account in YAML format, I got:
With this change, I am able to use the YAML config file. ⭐
Closes #71