Use a more distint map key to indicate template version

- make the key a variable that can be reused on the CLI side.
pull/692/head
max furman 3 years ago
parent f426c152a9
commit 507be61e8c

@ -103,7 +103,7 @@ func (a *Authority) GetSSHConfig(ctx context.Context, typ string, data map[strin
}
// Backwards compatibility for version of the cli older than v0.18.0
if o.Name == "step_includes.tpl" && (data == nil || data["Version"] != "v2") {
if o.Name == "step_includes.tpl" && (data == nil || data[templates.SSHTemplateVersionKey] != "v2") {
o.Type = templates.File
o.Path = strings.TrimPrefix(o.Path, "${STEPPATH}/")
}

@ -4,6 +4,10 @@ import (
"golang.org/x/crypto/ssh"
)
// SSHTemplateVersionKey is a key that can be submitted by a client to select
// the template version that will be returned by the server.
var SSHTemplateVersionKey = "StepSSHTemplateVersion"
// Step represents the default variables available in the CA.
type Step struct {
SSH StepSSH

Loading…
Cancel
Save