Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to disable smallstep extensions using the cli #986

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions command/ca/provisioner/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
sshHostDefaultDurFlag,
disableRenewalFlag,
allowRenewalAfterExpiryFlag,
disableSmallstepExtensionsFlag,
//enableX509Flag,
enableSSHFlag,

Expand Down Expand Up @@ -360,8 +361,9 @@
HostDurations: &linkedca.Durations{},
Enabled: !(ctx.IsSet("ssh") && !ctx.Bool("ssh")),
},
DisableRenewal: ctx.Bool("disable-renewal"),
AllowRenewalAfterExpiry: ctx.Bool("allow-renewal-after-expiry"),
DisableRenewal: ctx.Bool("disable-renewal"),
AllowRenewalAfterExpiry: ctx.Bool("allow-renewal-after-expiry"),
DisableSmallstepExtensions: ctx.Bool("disable-smallstep-extensions"),

Check warning on line 366 in command/ca/provisioner/add.go

View check run for this annotation

Codecov / codecov/patch

command/ca/provisioner/add.go#L364-L366

Added lines #L364 - L366 were not covered by tests
}

if ctx.IsSet("x509-min-dur") {
Expand Down
4 changes: 4 additions & 0 deletions command/ca/provisioner/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns",
Name: "allow-renewal-after-expiry",
Usage: `Allow renewals for expired certificates generated by this provisioner.`,
}
disableSmallstepExtensionsFlag = cli.BoolFlag{
Name: "disable-smallstep-extensions",
Usage: `Disable the Smallstep extension for all certificates generated by this provisioner.`,
}
//enableX509Flag = cli.BoolFlag{
// Name: "x509",
// Usage: `Enable provisioning of x509 certificates.`,
Expand Down
6 changes: 5 additions & 1 deletion command/ca/provisioner/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
sshHostDefaultDurFlag,
disableRenewalFlag,
allowRenewalAfterExpiryFlag,
disableSmallstepExtensionsFlag,
//enableX509Flag,
enableSSHFlag,

Expand Down Expand Up @@ -404,8 +405,11 @@
if ctx.IsSet("allow-renewal-after-expiry") {
p.Claims.AllowRenewalAfterExpiry = ctx.Bool("allow-renewal-after-expiry")
}
claims := p.Claims
if ctx.IsSet("disable-smallstep-extensions") {
p.Claims.DisableSmallstepExtensions = ctx.Bool("disable-smallstep-extensions")
}

Check warning on line 410 in command/ca/provisioner/update.go

View check run for this annotation

Codecov / codecov/patch

command/ca/provisioner/update.go#L408-L410

Added lines #L408 - L410 were not covered by tests

claims := p.Claims

Check warning on line 412 in command/ca/provisioner/update.go

View check run for this annotation

Codecov / codecov/patch

command/ca/provisioner/update.go#L412

Added line #L412 was not covered by tests
if claims.X509 == nil {
claims.X509 = &linkedca.X509Claims{}
}
Expand Down