Skip to content

Commit c07c9c4

Browse files
mjuragaoliwer
authored andcommitted
MINOR: acme: add profile keyword
Add support for the ACME profile keyword introduced in HAProxy 3.4. The profile directive requests a specific certificate profile from the CA by including a profile field in the newOrder request.
1 parent a57a887 commit c07c9c4

10 files changed

Lines changed: 29 additions & 2 deletions

File tree

config-parser/section-parsers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,7 @@ func (p *configParser) getAcmeParser() *Parsers {
10491049
addParser(parser, &sequence, &simple.Word{Name: "directory"})
10501050
addParser(parser, &sequence, &simple.Word{Name: "keytype"})
10511051
addParser(parser, &sequence, &simple.Word{Name: "map"})
1052+
addParser(parser, &sequence, &simple.Word{Name: "profile"})
10521053
addParser(parser, &sequence, &simple.OnOff{Name: "reuse-key"})
10531054
return p.createParsers(parser, sequence)
10541055
}

configuration/acme_provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ func ParseAcmeProvider(p parser.Parser, name string) (*models.AcmeProvider, erro
173173
"directory": &acme.Directory,
174174
"keytype": &acme.Keytype,
175175
"map": &acme.Map,
176+
"profile": &acme.Profile,
176177
"reuse-key": &acme.ReuseKey,
177178
}
178179

@@ -243,6 +244,7 @@ func SerializeAcmeProvider(p parser.Parser, acme *models.AcmeProvider) error {
243244
"directory": acme.Directory,
244245
"keytype": acme.Keytype,
245246
"map": acme.Map,
247+
"profile": acme.Profile,
246248
"reuse-key": onOff(acme.ReuseKey),
247249
}
248250

models/acme_provider.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/acme_provider_compare_test.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/acmeprovider_diff_generated.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/acmeprovider_equal_generated.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/build/haproxy_spec.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12115,6 +12115,12 @@ definitions:
1211512115
description: ACME provider's name
1211612116
type: string
1211712117
x-nullable: false
12118+
profile:
12119+
description: |
12120+
Request a specific certificate profile from the CA by including a 'profile'
12121+
field in the newOrder request (draft-ietf-acme-profiles). Profile names
12122+
are CA-specific short identifiers (e.g. 'classic', 'shortlived').
12123+
type: string
1211812124
reuse_key:
1211912125
description: Try to reuse the private key instead of generating a new one.
1212012126
enum:

specification/models/configuration/acme.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ acme:
5050
map:
5151
type: string
5252
description: The map which will be used to store the ACME token (key) and thumbprint
53+
profile:
54+
type: string
55+
description: |
56+
Request a specific certificate profile from the CA by including a 'profile'
57+
field in the newOrder request (draft-ietf-acme-profiles). Profile names
58+
are CA-specific short identifiers (e.g. 'classic', 'shortlived').
5359
reuse_key:
5460
type: string
5561
enum: [enabled, disabled]

test/configuration_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,7 @@ acme test
10301030
directory https://acme.example.com/directory
10311031
keytype ECDSA
10321032
map acme@t
1033+
profile shortlived
10331034
reuse-key on
10341035
10351036
crt-store cert-bunker1

test/expected/structured.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3214,6 +3214,7 @@
32143214
"directory": "https://acme.example.com/directory",
32153215
"keytype": "ECDSA",
32163216
"map": "acme@t",
3217+
"profile": "shortlived",
32173218
"reuse_key": "enabled"
32183219
}
32193220
},

0 commit comments

Comments
 (0)