Skip to content

Commit 8af69ff

Browse files
authored
Pivot WFE around the string(authzID) to int64(authzID) type change. (#8856)
I missed these checks in the WFE in stage 1, while making sure that all components exchanged _both_ string-type Authz IDs _and_ int64-type Authz IDs. Because stage 1 has been deployed for a while, this pivots only the WFE around the type change so that a follow-up change (and deployment cycle) can successfully remove the string-type ID support.
1 parent f162e64 commit 8af69ff

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

wfe2/wfe.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ func (wfe *WebFrontEndImpl) Challenge(
12021202
}
12031203

12041204
// Ensure gRPC response is complete.
1205-
if core.IsAnyNilOrZero(authzPB.Id, authzPB.Identifier, authzPB.Status, authzPB.Expires) {
1205+
if core.IsAnyNilOrZero(authzPB.IdInt, authzPB.Identifier, authzPB.Status, authzPB.Expires) {
12061206
wfe.sendError(response, logEvent, probs.ServerInternal("Problem getting authorization"), errIncompleteGRPCResponse)
12071207
return
12081208
}
@@ -1401,7 +1401,7 @@ func (wfe *WebFrontEndImpl) postChallenge(
14011401
Authz: authzPB,
14021402
ChallengeIndex: int64(challengeIndex),
14031403
})
1404-
if err != nil || core.IsAnyNilOrZero(authzPB.Id, authzPB.Identifier, authzPB.Status, authzPB.Expires) {
1404+
if err != nil || core.IsAnyNilOrZero(authzPB.IdInt, authzPB.Identifier, authzPB.Status, authzPB.Expires) {
14051405
wfe.sendError(response, logEvent, web.ProblemDetailsForError(err, "Unable to update challenge"), err)
14061406
return
14071407
}
@@ -1622,7 +1622,7 @@ func (wfe *WebFrontEndImpl) Authorization(
16221622
ident := identifier.FromProto(authzPB.Identifier)
16231623

16241624
// Ensure gRPC response is complete.
1625-
if core.IsAnyNilOrZero(authzPB.Id, ident, authzPB.Status, authzPB.Expires) {
1625+
if core.IsAnyNilOrZero(authzPB.IdInt, ident, authzPB.Status, authzPB.Expires) {
16261626
wfe.sendError(response, logEvent, probs.ServerInternal("Problem getting authorization"), errIncompleteGRPCResponse)
16271627
return
16281628
}

wfe2/wfe_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func (ra *MockRegistrationAuthority) GetAuthorization(_ context.Context, in *rap
230230
switch in.Id {
231231
case 1: // Return a valid authorization with a single valid challenge.
232232
return &corepb.Authorization{
233-
Id: "1",
233+
IdInt: 1,
234234
RegistrationID: 1,
235235
Identifier: identifier.NewDNS("not-an-example.com").ToProto(),
236236
Status: string(core.StatusValid),
@@ -241,7 +241,7 @@ func (ra *MockRegistrationAuthority) GetAuthorization(_ context.Context, in *rap
241241
}, nil
242242
case 2: // Return a pending authorization with three pending challenges.
243243
return &corepb.Authorization{
244-
Id: "2",
244+
IdInt: 2,
245245
RegistrationID: 1,
246246
Identifier: identifier.NewDNS("not-an-example.com").ToProto(),
247247
Status: string(core.StatusPending),
@@ -254,7 +254,7 @@ func (ra *MockRegistrationAuthority) GetAuthorization(_ context.Context, in *rap
254254
}, nil
255255
case 3: // Return an expired authorization with three pending (but expired) challenges.
256256
return &corepb.Authorization{
257-
Id: "3",
257+
IdInt: 3,
258258
RegistrationID: 1,
259259
Identifier: identifier.NewDNS("not-an-example.com").ToProto(),
260260
Status: string(core.StatusPending),
@@ -269,7 +269,7 @@ func (ra *MockRegistrationAuthority) GetAuthorization(_ context.Context, in *rap
269269
return nil, fmt.Errorf("unspecified error")
270270
case 5: // Return a pending authorization as above, but associated with RegID 2.
271271
return &corepb.Authorization{
272-
Id: "5",
272+
IdInt: 5,
273273
RegistrationID: 2,
274274
Identifier: identifier.NewDNS("not-an-example.com").ToProto(),
275275
Status: string(core.StatusPending),
@@ -1871,7 +1871,7 @@ type RAWithFailedChallenge struct {
18711871

18721872
func (ra *RAWithFailedChallenge) GetAuthorization(ctx context.Context, id *rapb.GetAuthorizationRequest, _ ...grpc.CallOption) (*corepb.Authorization, error) {
18731873
return &corepb.Authorization{
1874-
Id: "6",
1874+
IdInt: 6,
18751875
RegistrationID: 1,
18761876
Identifier: identifier.NewDNS("not-an-example.com").ToProto(),
18771877
Status: string(core.StatusInvalid),

0 commit comments

Comments
 (0)