Skip to content

Commit ae8aee4

Browse files
authored
Merge pull request #986 from smallstep/fix-certificates-620
Allow to disable smallstep extensions using the cli
2 parents a627a65 + b09aee2 commit ae8aee4

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

command/ca/provisioner/add.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ SCEP
167167
sshHostDefaultDurFlag,
168168
disableRenewalFlag,
169169
allowRenewalAfterExpiryFlag,
170+
disableSmallstepExtensionsFlag,
170171
//enableX509Flag,
171172
enableSSHFlag,
172173

@@ -360,8 +361,9 @@ func addAction(ctx *cli.Context) (err error) {
360361
HostDurations: &linkedca.Durations{},
361362
Enabled: !(ctx.IsSet("ssh") && !ctx.Bool("ssh")),
362363
},
363-
DisableRenewal: ctx.Bool("disable-renewal"),
364-
AllowRenewalAfterExpiry: ctx.Bool("allow-renewal-after-expiry"),
364+
DisableRenewal: ctx.Bool("disable-renewal"),
365+
AllowRenewalAfterExpiry: ctx.Bool("allow-renewal-after-expiry"),
366+
DisableSmallstepExtensions: ctx.Bool("disable-smallstep-extensions"),
365367
}
366368

367369
if ctx.IsSet("x509-min-dur") {

command/ca/provisioner/provisioner.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns",
248248
Name: "allow-renewal-after-expiry",
249249
Usage: `Allow renewals for expired certificates generated by this provisioner.`,
250250
}
251+
disableSmallstepExtensionsFlag = cli.BoolFlag{
252+
Name: "disable-smallstep-extensions",
253+
Usage: `Disable the Smallstep extension for all certificates generated by this provisioner.`,
254+
}
251255
//enableX509Flag = cli.BoolFlag{
252256
// Name: "x509",
253257
// Usage: `Enable provisioning of x509 certificates.`,

command/ca/provisioner/update.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ SCEP
166166
sshHostDefaultDurFlag,
167167
disableRenewalFlag,
168168
allowRenewalAfterExpiryFlag,
169+
disableSmallstepExtensionsFlag,
169170
//enableX509Flag,
170171
enableSSHFlag,
171172

@@ -404,8 +405,11 @@ func updateClaims(ctx *cli.Context, p *linkedca.Provisioner) {
404405
if ctx.IsSet("allow-renewal-after-expiry") {
405406
p.Claims.AllowRenewalAfterExpiry = ctx.Bool("allow-renewal-after-expiry")
406407
}
407-
claims := p.Claims
408+
if ctx.IsSet("disable-smallstep-extensions") {
409+
p.Claims.DisableSmallstepExtensions = ctx.Bool("disable-smallstep-extensions")
410+
}
408411

412+
claims := p.Claims
409413
if claims.X509 == nil {
410414
claims.X509 = &linkedca.X509Claims{}
411415
}

0 commit comments

Comments
 (0)