Skip to content

Add int-type Authz ID proto fields alongside any string-type proto fields#8754

Open
ezekiel wants to merge 12 commits into
mainfrom
ezekiel/unify-authzid-type-stage1
Open

Add int-type Authz ID proto fields alongside any string-type proto fields#8754
ezekiel wants to merge 12 commits into
mainfrom
ezekiel/unify-authzid-type-stage1

Conversation

@ezekiel
Copy link
Copy Markdown
Member

@ezekiel ezekiel commented May 19, 2026

This is stage one of normalizing Authz ID to be consistently int64-type (#8722).

This is stage one of normalizing Authz ID to be consistently int64-type.
@ezekiel ezekiel requested a review from a team as a code owner May 19, 2026 15:22
@ezekiel ezekiel requested a review from jsha May 19, 2026 15:22
Comment thread va/caa.go Outdated
Comment thread core/objects.go Outdated
Comment thread grpc/pb-marshalling.go Outdated
Comment thread grpc/pb-marshalling.go Outdated
Comment thread grpc/pb-marshalling.go Outdated
ezekiel and others added 2 commits May 29, 2026 13:07
Co-authored-by: Aaron Gable <aaron@letsencrypt.org>
AuthorizationID and AuthorizationIDs in sa.proto where unreferenced and
unused. Apparent remnants from before Authz 2.
@ezekiel
Copy link
Copy Markdown
Member Author

ezekiel commented Jun 1, 2026

Still adding real fixes for load-generator.

Comment thread grpc/pb-marshalling.go
return core.Authorization{}, ErrInvalidParameters
}
authzIDInt = parsed
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
} else {
return core.Authorization{}, ErrMissingParameters
}

Copy link
Copy Markdown
Member Author

@ezekiel ezekiel Jun 4, 2026

Choose a reason for hiding this comment

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

This particular spot is very interesting - it did not historically have any protection against zero-values. When added, it causes other test failures. I'll re-add the error return here and see if there's something obvious to fix because I'd rather have the protection than not.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test file probably needs more updates than this: there should be tests for PBToAuthz with a string input, an int input, both, and neither.

Comment thread va/caa.go
return nil, berrors.MalformedError("Unable to parse Authz ID %q as integer: %v", req.AuthzID, err)
}
authzIDInt = parsed
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same else case here.

Comment thread va/caa.go
"sync"
"time"

corepb "github.com/letsencrypt/boulder/core/proto"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Imports of github.com/letsencrypt/boulder packages should always be grouped below.

Comment thread va/va_test.go
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment here: this file is going to want test cases for AuthzMeta containing just a string ID, just an int ID, both, and neither.

Comment thread ra/ra_test.go
time.Sleep(100 * time.Millisecond)

dbAuthzPB := getAuthorization(t, authzPB.Id, sa)
// TODO(#8722): Remove this when Authz ID is int64-only
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There shouldn't be any need to do this logic in the unit tests. This logic is necessary for prod because each service doesn't know what version of the other services its talking to over gRPC -- a deploy might be in progress, or might be stuck halfway, or any number of other scenarios. But here in the unit tests, this code knows that we're using the latest version of the RA code. No need for these safety rails, just use the int.

Comment thread ra/ra_test.go
test.AssertEquals(t, err.Error(), "certificate public key must be different than account key")
}

func TestDeactivateAuthorization(t *testing.T) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add cases to this test for string authz ID, int ID, both, and neither. You can probably do this by manipulating the dbAuthzPB returned by getAuthorization.

Comment thread ra/ra.go
Comment on lines +1444 to +1445
if req.Authz.Id == "" && req.Authz.IdInt == 0 {
return nil, errIncompleteGRPCRequest
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No need for this, PBToAuthz will return an error if neither is populated. But keep the TODO, so we remember to add it back to the IsAnyNilOrZero check in the followup.

Comment thread ra/ra.go
var (
errIncompleteGRPCRequest = errors.New("incomplete gRPC request message")
errIncompleteGRPCResponse = errors.New("incomplete gRPC response message")
errMalformedGRPCRequest = errors.New("malformed gRPC request message field")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This error message is only returned in once place. No need to predeclare it like this; the others are only up here for the sake of consistency, because they're returned from dozens of spots.

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