Skip to content

sa: getAuthorizationStatuses checks results#8726

Open
jsha wants to merge 1 commit intomainfrom
checkvalidities
Open

sa: getAuthorizationStatuses checks results#8726
jsha wants to merge 1 commit intomainfrom
checkvalidities

Conversation

@jsha
Copy link
Copy Markdown
Contributor

@jsha jsha commented Apr 22, 2026

If this function gets fewer responses than expected, that means some of the authorizations were deleted before their containing order expired (or were never written due to a bug). Error out.

Fix a test that fails with this extra check in place.

If this function gets fewer responses than expected, that means some of the
authorizations were deleted before their containing order expired (or were never
written due to a bug). Error out.

Fix a test that fails with this extra check in place.
@jsha jsha marked this pull request as ready for review April 22, 2026 23:06
@jsha jsha requested a review from a team as a code owner April 22, 2026 23:06
@jsha jsha requested a review from beautifulentropy April 22, 2026 23:06
Comment thread sa/model.go
}

if len(validities) != len(ids) {
return nil, fmt.Errorf("getAuthorizationStatuses got %d results, expected %d", len(validities), len(ids))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could provide a bit more context here.

Suggested change
return nil, fmt.Errorf("getAuthorizationStatuses got %d results, expected %d", len(validities), len(ids))
return nil, fmt.Errorf("getAuthorizationStatuses got %d results, expected %d for ids %v", len(validities), len(ids), ids)

Comment thread sa/model.go
return nil, err
}

if len(validities) != len(ids) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this check in place, this method no longer tolerates duplicate ids. We don't necessarily expect duplicate ids, but previously they would not have errored. We should stipulate this requirement in the doc comment.

Comment thread sa/sa_test.go
},
NewAuthzs: []*sapb.NewAuthzRequest{
{
Identifier: &corepb.Identifier{Type: "dns", Value: "example.com"},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could use the same identifier.NewDNS("example.com").ToProto() as used above, here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants