code: func New() logdog.RegistrationServer {
  	return &logdog.DecoratedRegistration{
  		Service: &server{},
  		Prelude: func(c context.Context, methodName string, req proto.Message) (context.Context, error) {
  			// Enter a datastore namespace based on the message type.
  			//
  			// We use a type switch here because this is a shared decorator. All user
  			// mesages must implement ProjectBoundMessage.
  			pbm, ok := req.(endpoints.ProjectBoundMessage)
  			if ok {
  				// Enter the requested project namespace. This validates that the
  				// current user has READ access.
  				project := types.ProjectName(pbm.GetMessageProject())
  				if project == "" {
  					return nil, grpcutil.Errf(codes.InvalidArgument, "project is required")
  				}
  
  				log.Fields{
  					"project": project,
  				}.Debugf(c, "User is accessing project.")
  				if err := coordinator.WithProjectNamespace(&c, project, coordinator.NamespaceAccessWRITE); err != nil {
  					return nil, getGRPCError(err)
  				}
  			}
  
  			return c, nil
  		},
  	}
  }
docs: // New creates a new authenticating ServicesServer instance.