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

wfe: orders link to authz IDs with acccount #7790

Merged
merged 2 commits into from
Nov 15, 2024
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
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 @@ -2924,7 +2924,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 @@ -2941,7 +2941,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 @@ -2958,7 +2958,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 @@ -2975,7 +2975,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 @@ -3115,7 +3115,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 @@ -3284,7 +3284,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 @@ -3329,7 +3329,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 @@ -3340,17 +3340,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 @@ -3911,8 +3911,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