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

Rename 'now' to 'validUntil' in GetAuthz requests #7631

Merged
merged 1 commit into from
Jul 25, 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
Rename 'now' to 'validUntil' in GetAuthz requests
  • Loading branch information
aarongable committed Jul 25, 2024
commit b8262e2f03727bfd7f9d32fd02976f1f99cddc69
6 changes: 3 additions & 3 deletions mocks/sa.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,10 @@ func (sa *StorageAuthorityReadOnly) GetValidAuthorizations2(ctx context.Context,
if req.RegistrationID != 1 && req.RegistrationID != 5 && req.RegistrationID != 4 {
return &sapb.Authorizations{}, nil
}
now := req.Now.AsTime()
expiryCutoff := req.ValidUntil.AsTime()
auths := &sapb.Authorizations{}
for _, name := range req.Domains {
exp := now.AddDate(100, 0, 0)
exp := expiryCutoff.AddDate(100, 0, 0)
authzPB, err := bgrpc.AuthzToPB(core.Authorization{
Status: core.StatusValid,
RegistrationID: req.RegistrationID,
Expand All @@ -485,7 +485,7 @@ func (sa *StorageAuthorityReadOnly) GetValidAuthorizations2(ctx context.Context,
Status: core.StatusValid,
Type: core.ChallengeTypeDNS01,
Token: "exampleToken",
Validated: &now,
Validated: &expiryCutoff,
},
},
})
Expand Down
4 changes: 2 additions & 2 deletions ra/ra.go
Original file line number Diff line number Diff line change
Expand Up @@ -2100,7 +2100,7 @@ func (ra *RegistrationAuthorityImpl) RevokeCertByApplicant(ctx context.Context,
authzMapPB, err = ra.SA.GetValidAuthorizations2(ctx, &sapb.GetValidAuthorizationsRequest{
RegistrationID: req.RegID,
Domains: cert.DNSNames,
Now: timestamppb.New(ra.clk.Now()),
ValidUntil: timestamppb.New(ra.clk.Now()),
})
if err != nil {
return nil, err
Expand Down Expand Up @@ -2528,7 +2528,7 @@ func (ra *RegistrationAuthorityImpl) NewOrder(ctx context.Context, req *rapb.New

getAuthReq := &sapb.GetAuthorizationsRequest{
RegistrationID: newOrder.RegistrationID,
Now: timestamppb.New(authzExpiryCutoff),
ValidUntil: timestamppb.New(authzExpiryCutoff),
Domains: newOrder.Names,
}
existingAuthz, err := ra.SA.GetAuthorizations2(ctx, getAuthReq)
Expand Down
Loading