Skip to content

Templates variables - #725

Merged
maraino merged 4 commits into
masterfrom
templates-vars
Aug 17, 2022
Merged

maraino merged 4 commits into
masterfrom
templates-vars

Conversation

@maraino

@maraino maraino commented Aug 17, 2022

Copy link
Copy Markdown
Collaborator

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
Comment thread command/certificate/create.go
@LecrisUT

Copy link
Copy Markdown
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"

Comment thread command/certificate/create.go
@maraino

maraino commented Aug 17, 2022

Copy link
Copy Markdown
Collaborator Author

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

maraino commented Aug 17, 2022

Copy link
Copy Markdown
Collaborator Author

@LecrisUT can you add a new enhancement for that?

@LecrisUT

Copy link
Copy Markdown
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

@dopey dopey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@maraino

maraino commented Aug 17, 2022

Copy link
Copy Markdown
Collaborator Author

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