aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddytls/internalissuer.go
diff options
context:
space:
mode:
authorFrancis Lavoie <[email protected]>2024-01-23 19:36:59 -0500
committerGitHub <[email protected]>2024-01-23 19:36:59 -0500
commit750d0b83319ac0ea6b7f057b8270c19404c3d6fa (patch)
treed0c3fb610cde8ae9d73a0a2caba94542af099770 /modules/caddytls/internalissuer.go
parent54823f52bc9aed66a1a37f820daf6e494181211a (diff)
downloadcaddy-750d0b83319ac0ea6b7f057b8270c19404c3d6fa.tar.gz
caddy-750d0b83319ac0ea6b7f057b8270c19404c3d6fa.zip
caddyfile: Normalize & flatten all unmarshalers (#6037)
Diffstat (limited to 'modules/caddytls/internalissuer.go')
-rw-r--r--modules/caddytls/internalissuer.go45
1 files changed, 22 insertions, 23 deletions
diff --git a/modules/caddytls/internalissuer.go b/modules/caddytls/internalissuer.go
index 1cf2461ab..cdc4f493b 100644
--- a/modules/caddytls/internalissuer.go
+++ b/modules/caddytls/internalissuer.go
@@ -155,31 +155,30 @@ func (iss InternalIssuer) Issue(ctx context.Context, csr *x509.CertificateReques
// sign_with_root
// }
func (iss *InternalIssuer) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
- for d.Next() {
- for d.NextBlock(0) {
- switch d.Val() {
- case "ca":
- if !d.AllArgs(&iss.CA) {
- return d.ArgErr()
- }
-
- case "lifetime":
- if !d.NextArg() {
- return d.ArgErr()
- }
- dur, err := caddy.ParseDuration(d.Val())
- if err != nil {
- return err
- }
- iss.Lifetime = caddy.Duration(dur)
-
- case "sign_with_root":
- if d.NextArg() {
- return d.ArgErr()
- }
- iss.SignWithRoot = true
+ d.Next() // consume issuer name
+ for d.NextBlock(0) {
+ switch d.Val() {
+ case "ca":
+ if !d.AllArgs(&iss.CA) {
+ return d.ArgErr()
+ }
+ case "lifetime":
+ if !d.NextArg() {
+ return d.ArgErr()
+ }
+ dur, err := caddy.ParseDuration(d.Val())
+ if err != nil {
+ return err
}
+ iss.Lifetime = caddy.Duration(dur)
+
+ case "sign_with_root":
+ if d.NextArg() {
+ return d.ArgErr()
+ }
+ iss.SignWithRoot = true
+
}
}
return nil