@@ -386,47 +386,10 @@ type finalizationCAACheckEvent struct {
386386 Rechecked int `json:",omitempty"`
387387}
388388
389- // noRegistrationID is used for the regID parameter to GetThreshold when no
390- // registration-based overrides are necessary.
391- const noRegistrationID = - 1
392-
393- // registrationCounter is a type to abstract the use of `CountRegistrationsByIP`
394- // or `CountRegistrationsByIPRange` SA methods.
395- type registrationCounter func (context.Context , * sapb.CountRegistrationsByIPRequest , ... grpc.CallOption ) (* sapb.Count , error )
396-
397- // checkRegistrationIPLimit checks a specific registraton limit by using the
398- // provided registrationCounter function to determine if the limit has been
399- // exceeded for a given IP or IP range
400- func (ra * RegistrationAuthorityImpl ) checkRegistrationIPLimit (ctx context.Context , limit ratelimit.RateLimitPolicy , ip net.IP , counter registrationCounter ) error {
401- now := ra .clk .Now ()
402- count , err := counter (ctx , & sapb.CountRegistrationsByIPRequest {
403- Ip : ip ,
404- Range : & sapb.Range {
405- Earliest : timestamppb .New (limit .WindowBegin (now )),
406- Latest : timestamppb .New (now ),
407- },
408- })
409- if err != nil {
410- return err
411- }
412-
413- threshold , overrideKey := limit .GetThreshold (ip .String (), noRegistrationID )
414- if count .Count >= threshold {
415- return berrors .RegistrationsPerIPAddressError (0 , "too many registrations for this IP" )
416- }
417- if overrideKey != "" {
418- // We do not support overrides for the NewRegistrationsPerIPRange limit.
419- utilization := float64 (count .Count + 1 ) / float64 (threshold )
420- ra .rlOverrideUsageGauge .WithLabelValues (ratelimit .RegistrationsPerIP , overrideKey ).Set (utilization )
421- }
422-
423- return nil
424- }
425-
426389// NewRegistration constructs a new Registration from a request.
427390func (ra * RegistrationAuthorityImpl ) NewRegistration (ctx context.Context , request * corepb.Registration ) (* corepb.Registration , error ) {
428391 // Error if the request is nil, there is no account key or IP address
429- if request == nil || len (request .Key ) == 0 || len ( request . InitialIP ) == 0 {
392+ if request == nil || len (request .Key ) == 0 {
430393 return nil , errIncompleteGRPCRequest
431394 }
432395
@@ -457,7 +420,6 @@ func (ra *RegistrationAuthorityImpl) NewRegistration(ctx context.Context, reques
457420 Contact : request .Contact ,
458421 ContactsPresent : request .ContactsPresent ,
459422 Agreement : request .Agreement ,
460- InitialIP : request .InitialIP ,
461423 Status : string (core .StatusValid ),
462424 }
463425
@@ -1627,7 +1589,7 @@ func (ra *RegistrationAuthorityImpl) checkNewOrderLimits(ctx context.Context, na
16271589// Deprecated: Use UpdateRegistrationContact or UpdateRegistrationKey instead.
16281590func (ra * RegistrationAuthorityImpl ) UpdateRegistration (ctx context.Context , req * rapb.UpdateRegistrationRequest ) (* corepb.Registration , error ) {
16291591 // Error if the request is nil, there is no account key or IP address
1630- if req .Base == nil || len (req .Base .Key ) == 0 || len ( req . Base . InitialIP ) == 0 || req .Base .Id == 0 {
1592+ if req .Base == nil || len (req .Base .Key ) == 0 || req .Base .Id == 0 {
16311593 return nil , errIncompleteGRPCRequest
16321594 }
16331595
@@ -1741,7 +1703,6 @@ func mergeUpdate(base *corepb.Registration, update *corepb.Registration) (*corep
17411703 Contact : base .Contact ,
17421704 ContactsPresent : base .ContactsPresent ,
17431705 Agreement : base .Agreement ,
1744- InitialIP : base .InitialIP ,
17451706 CreatedAt : base .CreatedAt ,
17461707 Status : base .Status ,
17471708 }
0 commit comments