Skip to content
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

Templates variables #725

Merged
merged 4 commits into from Aug 17, 2022
Merged

Templates variables #725

merged 4 commits into from Aug 17, 2022

Conversation

maraino
Copy link
Collaborator

@maraino maraino commented Aug 17, 2022

Description

This PR allows to use user variables in the templates used in step certificate create and step certificate sign.

Fixes #719

@maraino maraino added this to the v0.22.0 milestone Aug 17, 2022
@maraino maraino requested a review from dopey August 17, 2022 22:17
@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Aug 17, 2022
@LecrisUT
Copy link
Contributor

Oh so --set simply creates an object accessed via .Insecure.User. Can't we have it that it completely overwrites any of the template data? This part is only used in step certificate so presumably the user wants much more control than step ca, so it shouldn't be "Insecure"

@maraino
Copy link
Collaborator Author

maraino commented Aug 17, 2022

Oh so --set simply creates an object accessed via .Insecure.User. Can't we have it that it completely overwrites any of the template data? This part is only used in step certificate so presumably the user wants much more control than step ca, so it shouldn't be "Insecure"

For consistency with other commands we should keep the --set, --set-file, and .Insecure.User as they are, so you can use the same templates.

Regarding using a flag to manually edit the configuration, that's a nice option, it won't be --set but it can be something similar.

@maraino
Copy link
Collaborator Author

maraino commented Aug 17, 2022

@LecrisUT can you add a new enhancement for that?

@LecrisUT
Copy link
Contributor

With the hints from this PR, I think I can come up with something of that sort. Just need to edit data with the appropriate input. I'll see what I can do this weekend

Copy link
Contributor

@dopey dopey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@maraino
Copy link
Collaborator Author

maraino commented Aug 17, 2022

With the hints from this PR, I think I can come up with something of that sort. Just need to edit data with the appropriate input. I'll see what I can do this weekend

@LecrisUT using data won't work directly, because that's the information available to the template, you want something that works after rendering the template, either on the template itself (probably easier) or over the resulting x509util.Certificate or x509util.CertificateRequest.

@maraino maraino merged commit 12c1ce5 into master Aug 17, 2022
@maraino maraino deleted the templates-vars branch August 17, 2022 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add set and set-file flags to step certificate commands
3 participants