diff --git a/authority/ssh.go b/authority/ssh.go index da93acaf..d5d6ce45 100644 --- a/authority/ssh.go +++ b/authority/ssh.go @@ -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}/") } diff --git a/templates/values.go b/templates/values.go index 3cace69d..c3362527 100644 --- a/templates/values.go +++ b/templates/values.go @@ -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