Skip to content

Commit

Permalink
wfe: orders link to authz IDs with acccount (letsencrypt#7790)
Browse files Browse the repository at this point in the history
This means that most traffic will go to the authz URLs with account.
After this has been deployed for 30 days (the max lifetime of an order),
we can remove support for the old paths.

Part of letsencrypt#7683
  • Loading branch information
jsha authored Nov 15, 2024
1 parent 0d70b12 commit 56f0ed6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions test/integration/otel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ func TestTraces(t *testing.T) {
httpSpan("/acme/new-acct",
redisPipelineSpan("get", wfe)),
httpSpan("/acme/new-order"),
httpSpan("/acme/authz-v3/"),
httpSpan("/acme/chall-v3/"),
httpSpan("/acme/authz/"),
httpSpan("/acme/chall/"),
httpSpan("/acme/finalize/",
rpcSpan("ra.RegistrationAuthority/FinalizeOrder", wfe, ra,
rpcSpan("ca.CertificateAuthority/IssueCertificateForPrecertificate", ra, ca))),
Expand Down
2 changes: 1 addition & 1 deletion wfe2/wfe.go
Original file line number Diff line number Diff line change
Expand Up @@ -2082,7 +2082,7 @@ func (wfe *WebFrontEndImpl) orderToOrderJSON(request *http.Request, order *corep
respObj.Error.Type = probs.ErrorNS + respObj.Error.Type
}
for _, v2ID := range order.V2Authorizations {
respObj.Authorizations = append(respObj.Authorizations, web.RelativeEndpoint(request, fmt.Sprintf("%s%d", authzPath, v2ID)))
respObj.Authorizations = append(respObj.Authorizations, web.RelativeEndpoint(request, fmt.Sprintf("%s%d/%d", authzPathWithAcct, order.RegistrationID, v2ID)))
}
if respObj.Status == core.StatusValid {
certURL := web.RelativeEndpoint(request,
Expand Down
24 changes: 12 additions & 12 deletions wfe2/wfe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2925,7 +2925,7 @@ func TestNewOrder(t *testing.T) {
{ "type": "dns", "value": "thisreallylongexampledomainisabytelongerthanthemaxcnbytelimit.com"}
],
"authorizations": [
"http://localhost/acme/authz-v3/1"
"http://localhost/acme/authz/1/1"
],
"finalize": "http://localhost/acme/finalize/1/1"
}`,
Expand All @@ -2942,7 +2942,7 @@ func TestNewOrder(t *testing.T) {
{ "type": "dns", "value": "thisreallylongexampledomainisabytelongerthanthemaxcnbytelimit.com"}
],
"authorizations": [
"http://localhost/acme/authz-v3/1"
"http://localhost/acme/authz/1/1"
],
"finalize": "http://localhost/acme/finalize/1/1"
}`,
Expand All @@ -2959,7 +2959,7 @@ func TestNewOrder(t *testing.T) {
{ "type": "dns", "value": "www.not-example.com"}
],
"authorizations": [
"http://localhost/acme/authz-v3/1"
"http://localhost/acme/authz/1/1"
],
"finalize": "http://localhost/acme/finalize/1/1"
}`,
Expand All @@ -2976,7 +2976,7 @@ func TestNewOrder(t *testing.T) {
{ "type": "dns", "value": "www.not-example.com"}
],
"authorizations": [
"http://localhost/acme/authz-v3/1"
"http://localhost/acme/authz/1/1"
],
"finalize": "http://localhost/acme/finalize/1/1"
}`,
Expand Down Expand Up @@ -3116,7 +3116,7 @@ func TestFinalizeOrder(t *testing.T) {
],
"profile": "default",
"authorizations": [
"http://localhost/acme/authz-v3/1"
"http://localhost/acme/authz/1/1"
],
"finalize": "http://localhost/acme/finalize/1/8"
}`,
Expand Down Expand Up @@ -3285,7 +3285,7 @@ func TestGetOrder(t *testing.T) {
{
Name: "Good request",
Request: makeGet("1/1"),
Response: `{"status": "valid","expires": "2000-01-01T00:00:00Z","identifiers":[{"type":"dns", "value":"example.com"}], "profile": "default", "authorizations":["http://localhost/acme/authz-v3/1"],"finalize":"http://localhost/acme/finalize/1/1","certificate":"http://localhost/acme/cert/serial"}`,
Response: `{"status": "valid","expires": "2000-01-01T00:00:00Z","identifiers":[{"type":"dns", "value":"example.com"}], "profile": "default", "authorizations":["http://localhost/acme/authz/1/1"],"finalize":"http://localhost/acme/finalize/1/1","certificate":"http://localhost/acme/cert/serial"}`,
},
{
Name: "404 request",
Expand Down Expand Up @@ -3330,7 +3330,7 @@ func TestGetOrder(t *testing.T) {
{
Name: "Valid POST-as-GET",
Request: makePost(1, "1/1", ""),
Response: `{"status": "valid","expires": "2000-01-01T00:00:00Z","identifiers":[{"type":"dns", "value":"example.com"}], "profile": "default", "authorizations":["http://localhost/acme/authz-v3/1"],"finalize":"http://localhost/acme/finalize/1/1","certificate":"http://localhost/acme/cert/serial"}`,
Response: `{"status": "valid","expires": "2000-01-01T00:00:00Z","identifiers":[{"type":"dns", "value":"example.com"}], "profile": "default", "authorizations":["http://localhost/acme/authz/1/1"],"finalize":"http://localhost/acme/finalize/1/1","certificate":"http://localhost/acme/cert/serial"}`,
},
{
Name: "GET new order",
Expand All @@ -3341,17 +3341,17 @@ func TestGetOrder(t *testing.T) {
{
Name: "GET new order from old endpoint",
Request: makeGet("1/9"),
Response: `{"status": "valid","expires": "2000-01-01T00:00:00Z","identifiers":[{"type":"dns", "value":"example.com"}], "profile": "default", "authorizations":["http://localhost/acme/authz-v3/1"],"finalize":"http://localhost/acme/finalize/1/9","certificate":"http://localhost/acme/cert/serial"}`,
Response: `{"status": "valid","expires": "2000-01-01T00:00:00Z","identifiers":[{"type":"dns", "value":"example.com"}], "profile": "default", "authorizations":["http://localhost/acme/authz/1/1"],"finalize":"http://localhost/acme/finalize/1/9","certificate":"http://localhost/acme/cert/serial"}`,
},
{
Name: "POST-as-GET new order",
Request: makePost(1, "1/9", ""),
Response: `{"status": "valid","expires": "2000-01-01T00:00:00Z","identifiers":[{"type":"dns", "value":"example.com"}], "profile": "default", "authorizations":["http://localhost/acme/authz-v3/1"],"finalize":"http://localhost/acme/finalize/1/9","certificate":"http://localhost/acme/cert/serial"}`,
Response: `{"status": "valid","expires": "2000-01-01T00:00:00Z","identifiers":[{"type":"dns", "value":"example.com"}], "profile": "default", "authorizations":["http://localhost/acme/authz/1/1"],"finalize":"http://localhost/acme/finalize/1/9","certificate":"http://localhost/acme/cert/serial"}`,
},
{
Name: "POST-as-GET processing order",
Request: makePost(1, "1/10", ""),
Response: `{"status": "processing","expires": "2000-01-01T00:00:00Z","identifiers":[{"type":"dns", "value":"example.com"}], "profile": "default", "authorizations":["http://localhost/acme/authz-v3/1"],"finalize":"http://localhost/acme/finalize/1/10"}`,
Response: `{"status": "processing","expires": "2000-01-01T00:00:00Z","identifiers":[{"type":"dns", "value":"example.com"}], "profile": "default", "authorizations":["http://localhost/acme/authz/1/1"],"finalize":"http://localhost/acme/finalize/1/10"}`,
Headers: map[string]string{"Retry-After": "3"},
},
}
Expand Down Expand Up @@ -3912,8 +3912,8 @@ func TestOrderToOrderJSONV2Authorizations(t *testing.T) {
V2Authorizations: []int64{1, 2},
})
test.AssertDeepEquals(t, orderJSON.Authorizations, []string{
"http://localhost/acme/authz-v3/1",
"http://localhost/acme/authz-v3/2",
"http://localhost/acme/authz/1/1",
"http://localhost/acme/authz/1/2",
})
}

Expand Down

0 comments on commit 56f0ed6

Please sign in to comment.