Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion core/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ func (ch Challenge) StringID() string {
type Authorization struct {
// An identifier for this authorization, unique across
// authorizations and certificates within this instance.
ID string `json:"-"`
ID string `json:"-"`
IDInt int64 `json:"-"`
Comment thread
ezekiel marked this conversation as resolved.
Outdated

// The identifier for which authorization is being given
Identifier identifier.ACMEIdentifier `json:"identifier"`
Expand Down
139 changes: 74 additions & 65 deletions core/proto/core.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions core/proto/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ message Registration {
}

message Authorization {
// Next unused field number: 12
// Next unused field number: 13
reserved 5, 7, 8;
string id = 1;
string id = 1; // TODO(#8722): reserve
int64 idInt = 12; // TODO(#8722): rename
int64 registrationID = 3;
// Fields specified by RFC 8555, Section 7.1.4
reserved 2; // Previously dnsName
Expand Down
2 changes: 2 additions & 0 deletions grpc/pb-marshalling.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ func AuthzToPB(authz core.Authorization) (*corepb.Authorization, error) {

return &corepb.Authorization{
Id: authz.ID,
IdInt: authz.IDInt,
Comment thread
ezekiel marked this conversation as resolved.
Outdated
Identifier: authz.Identifier.ToProto(),
RegistrationID: authz.RegistrationID,
Status: string(authz.Status),
Expand All @@ -317,6 +318,7 @@ func PBToAuthz(pb *corepb.Authorization) (core.Authorization, error) {
}
authz := core.Authorization{
ID: pb.Id,
IDInt: pb.IdInt,
Comment thread
ezekiel marked this conversation as resolved.
Outdated
Identifier: identifier.FromProto(pb.Identifier),
RegistrationID: pb.RegistrationID,
Status: core.AcmeStatus(pb.Status),
Expand Down
2 changes: 2 additions & 0 deletions grpc/pb-marshalling_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.

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.

Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ func TestAuthz(t *testing.T) {
}
inAuthz := core.Authorization{
ID: "1",
IDInt: 1,
Identifier: ident,
RegistrationID: 5,
Status: core.StatusPending,
Expand All @@ -231,6 +232,7 @@ func TestAuthz(t *testing.T) {

inAuthzNilExpires := core.Authorization{
ID: "1",
IDInt: 1,
Identifier: ident,
RegistrationID: 5,
Status: core.StatusPending,
Expand Down
Loading