Skip to content

Commit 2deb681

Browse files
committed
Constants -> variables
1 parent bd86fd6 commit 2deb681

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

step-ca/templates.mdx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Configuring `step-ca` Templates
33
html_title: Configuring open source step-ca Templates
44
description: Learn how to configure step-ca Templates
5-
updated_at: March 25, 2025
5+
updated_at: March 26, 2025
66
---
77

88
People use private CAs for all sorts of things, in many different contexts:
@@ -42,9 +42,9 @@ A few custom [functions for ASN.1 encoding](#asn1-values) and [time formatting](
4242
<Alert severity="warning">
4343
<div>
4444
<strong>Warning: Always wrap values in <code>toJson</code></strong><br />
45-
In the templates on this page, constants are pulled into templates using <code>{`{{`} toJson .constantName {`}}`}</code>
46-
to sanitize the value of the constant.
47-
When using templates, you must sanitize all constants using <code>toJson</code> to avoid template injection vulnerabilities.
45+
In the templates on this page, variables are pulled into templates using <code>{`{{`} toJson .variableName {`}}`}</code>
46+
to sanitize the value of the variable.
47+
When using templates, you must sanitize all variables using <code>toJson</code> to avoid template injection vulnerabilities.
4848
</div>
4949
</Alert>
5050

@@ -126,8 +126,8 @@ The following snippet shows a provisioner with custom X.509 and SSH templates:
126126
location of which would be `$(step path)/templates/certs/x509/leaf.tpl`.
127127
- **_relative to the execution directory of `step-ca`_**: e.g. `./path/to/file.tpl` or `../path/to/file.tpl`
128128

129-
- **templateData**: defines constants that can be used in the template.
130-
In the example above, you are able to use the defined organizational unit as the constant `{{ .OrganizationalUnit }}`,
129+
- **templateData**: defines variables that can be used in the template.
130+
In the example above, you are able to use the defined organizational unit as the variable `{{ .OrganizationalUnit }}`,
131131
for example in a template like:
132132

133133
```json
@@ -209,15 +209,15 @@ See [the complete list of fields supported in `step-ca` templates](https://githu
209209

210210
<Alert severity="info" id="star11">
211211
<div>
212-
<strong>A note on <code>.Insecure</code> constants</strong><br />
213-
In templates, some constants are prefixed with <code>.Insecure</code>.
212+
<strong>A note on <code>.Insecure</code> variables</strong><br />
213+
In templates, some variables are prefixed with <code>.Insecure</code>.
214214
They contain information that has not been cryptographically signed
215215
by a source that the CA trusts.
216216
For example, the <code>.Insecure.CR</code> map holds the user-supplied Certificate Request.
217217
</div>
218218
</Alert>
219219

220-
Here are some constants available in X.509 certificate templates:
220+
Here are some variables available in X.509 certificate templates:
221221

222222
- **.Subject**:
223223
The subject that was passed in to `step certificate` or `step ca certificate`. Specifically,
@@ -247,7 +247,7 @@ Here are some constants available in X.509 certificate templates:
247247
this is an array of the certificate chain from the request.
248248
This chain connects the authorization certificate to the root CA configured in the provisioner.
249249

250-
- **.Insecure** These constants are marked insecure because they contain client-supplied data that is not signed by a trusted party.
250+
- **.Insecure** These variables are marked insecure because they contain client-supplied data that is not signed by a trusted party.
251251

252252
- **.Insecure.CR**<Reference id="star11" marker="*" />: ☠️
253253
This holds the Certificate Request (CSR) received from the client.
@@ -325,7 +325,7 @@ Use these functions to populate custom certificate OID `extensions`:
325325
]
326326
```
327327

328-
When applied to template constants, these functions enable dynamic OID extensions:
328+
When applied to template variables, these functions enable dynamic OID extensions:
329329

330330
```
331331
{
@@ -482,7 +482,7 @@ Here are the most relevant parameters available in SSH certificate template:
482482
- **.Insecure.CR**<Reference id="star11" marker="*" />:
483483
SSH certificate requests to `step-ca` are not CSRs in the X.509 sense.
484484
So, `step-ca` creates a virtual certificate request,
485-
and that's what this constant represents.
485+
and that's what this variable represents.
486486

487487
- **.Insecure.CR.Principals**: If you trust a host to register its own custom SANs
488488
(for example, when using the IID provisioner),
@@ -570,13 +570,13 @@ delimited by `{{` and `}}`. These are called **_actions_** - **_actions_** are
570570
data evaluations or control structures. The ones in the default template are:
571571

572572
- `{{ toJson .Subject }}`: renders `.Subject` as JSON. `toJson` is a function in
573-
Sprig that encodes the passed item into JSON. `.Subject` is a constant available
573+
Sprig that encodes the passed item into JSON. `.Subject` is a variable available
574574
in all templates that contains the `<subject>` parameter passed in the CLI, in
575575
this case, `[email protected]`, and to be more precise, this value is available
576576
in `.Subject.CommonName`.
577577

578578
- `{{ toJson .SANs }}`: renders `.SANs` (Subject Alternative Names) as JSON.
579-
The constant `.SANs` is also available in all templates and contains the list
579+
The variable `.SANs` is also available in all templates and contains the list
580580
of `SANs` passed from the CLI. If no `SANs` are specified, the
581581
`.Subject.CommonName` will be used as a default `SAN` (e.g.
582582
`[email protected]` in our example). If you add more `SANs` using the

0 commit comments

Comments
 (0)