-
-
Notifications
You must be signed in to change notification settings - Fork 614
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
feat: add ACME "dns-account-01" challenge #7387
Closed
Closed
Changes from 12 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
d341dc5
Add DNS-ACCOUNT-01 support.
sheurich 1c0653f
Initial tests for DNS-ACCOUNT-01.
sheurich 72c4b09
Upgrade eggsampler/acme/v3 to v3.5.0 for DNS-ACCOUNT-01 support
sheurich bcec8c4
test(integration): add TestDNSAccountChallenge
sheurich 4489f43
fix(validateDNSAccount01): reject unsupported scopes
sheurich 14ea785
test(dns-account-01): additional unit tests
sheurich 22d2210
test(pa): add dns-account-01 to wildcard challenges
sheurich 0718a30
test(dns-account-01): add to core and ra unit tests
sheurich ece427a
feat(load-generator): add DNS-ACCOUNT-01 challenge strategy
sheurich e0fce1b
feat(ra): Allow DNS-ACCOUNT-01 authorizations to be reused for wildcards
sheurich eb7c094
rename
sheurich a948e01
fix(TestDNSAccountChallenge): only run test in config-next
sheurich 9e5e388
Merge branch 'main' into add-dns-account-01
sheurich 492ce0f
clean up challenge policy logic
sheurich 4ea3634
fix(test): add dns-01+dns-account-01 wildcard policy test
sheurich b2f90f7
doc(model): explain challTypeToUint and uintToChallType
sheurich ac488a5
bundle authz `Scope` into core.Challenge
sheurich dcc624e
Merge branch 'main' into add-dns-account-01
sheurich 4f7a8a1
Merge branch 'main' into add-dns-account-01
sheurich 18d89dc
Merge branch 'main' into add-dns-account-01
sheurich a6f87c4
- Add AccountURL and Scope to core.Authorization and protobufs
sheurich ab01878
lint
sheurich 528f6de
fix(akamai-purger): deep copy batch of purge entries
sheurich 67cfe74
remove AccountURL from Authorization; pass using Challenge instead
sheurich d2fe3e0
fix: use jws protected header for KeyID
sheurich c941420
fix: use challenge pointer for setting AccountURL in WebFrontEndImpl.…
sheurich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -394,28 +394,43 @@ func TestChallengesForWildcard(t *testing.T) { | |
Value: "*.zombo.com", | ||
} | ||
|
||
// First try to get a challenge for the wildcard ident without the | ||
// DNS-01 challenge type enabled. This should produce an error | ||
// Try to get a challenge for the wildcard ident without | ||
// DNS challenges enabled. This should error. | ||
var enabledChallenges = map[core.AcmeChallenge]bool{ | ||
core.ChallengeTypeHTTP01: true, | ||
core.ChallengeTypeDNS01: false, | ||
} | ||
pa := must.Do(New(enabledChallenges, blog.NewMock())) | ||
_, err := pa.ChallengesFor(wildcardIdent) | ||
test.AssertError(t, err, "ChallengesFor did not error for a wildcard ident "+ | ||
"when DNS-01 was disabled") | ||
"when DNS challenge types were disabled") | ||
test.AssertEquals(t, err.Error(), "Challenges requested for wildcard "+ | ||
"identifier but DNS-01 challenge type is not enabled") | ||
"identifier but a DNS-01 or DNS-ACCOUNT-01 challenge type is not enabled") | ||
|
||
// Try again with DNS-01 enabled. It should not error and | ||
// Enable DNS-01 and HTTP-01. It should not error and | ||
// should return only one DNS-01 type challenge | ||
enabledChallenges[core.ChallengeTypeDNS01] = true | ||
enabledChallenges = map[core.AcmeChallenge]bool{ | ||
core.ChallengeTypeHTTP01: true, | ||
core.ChallengeTypeDNS01: true, | ||
} | ||
pa = must.Do(New(enabledChallenges, blog.NewMock())) | ||
challenges, err := pa.ChallengesFor(wildcardIdent) | ||
test.AssertNotError(t, err, "ChallengesFor errored for a wildcard ident "+ | ||
"unexpectedly") | ||
"unexpectedly with DNS-01 enabled") | ||
test.AssertEquals(t, len(challenges), 1) | ||
test.AssertEquals(t, challenges[0].Type, core.ChallengeTypeDNS01) | ||
|
||
// Enable DNS-ACCOUNT-01 and HTTP-01. It should not error and | ||
// should return only one DNS-ACCOUNT-01 type challenge | ||
Comment on lines
+422
to
+423
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like we should also have a test case where both dns-01 and dns-account-01 are enabled? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
enabledChallenges = map[core.AcmeChallenge]bool{ | ||
core.ChallengeTypeHTTP01: true, | ||
core.ChallengeTypeDNSAccount01: true, | ||
} | ||
pa = must.Do(New(enabledChallenges, blog.NewMock())) | ||
challenges, err = pa.ChallengesFor(wildcardIdent) | ||
test.AssertNotError(t, err, "ChallengesFor errored for a wildcard ident "+ | ||
"unexpectedly with DNS-ACCOUNT-01 enabled") | ||
test.AssertEquals(t, len(challenges), 1) | ||
test.AssertEquals(t, challenges[0].Type, core.ChallengeTypeDNSAccount01) | ||
} | ||
|
||
// TestMalformedExactBlocklist tests that loading a YAML policy file with an | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,6 +124,7 @@ | |
"challenges": { | ||
"http-01": true, | ||
"dns-01": true, | ||
"dns-account-01": true, | ||
"tls-alpn-01": true | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,7 @@ | |
"challenges": { | ||
"http-01": true, | ||
"dns-01": true, | ||
"dns-account-01": true, | ||
"tls-alpn-01": true | ||
} | ||
}, | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like we can clean up this logic a little by turning it around:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.