code: func (impl *repoImpl) ListRefs(c context.Context, r *api.ListRefsRequest) (resp *api.ListRefsResponse, err error) {
  	defer func() { err = grpcutil.GRPCifyAndLogErr(c, err) }()
  
  	// Validate the request.
  	if err := common.ValidatePackageName(r.Package); err != nil {
  		return nil, status.Errorf(codes.InvalidArgument, "bad 'package' - %s", err)
  	}
  
  	// Check ACLs.
  	if _, err := impl.checkRole(c, r.Package, api.Role_READER); err != nil {
  		return nil, err
  	}
  
  	// Verify the package actually exists, per ListPackageRefs contract.
  	if err := model.CheckPackageExists(c, r.Package); err != nil {
  		return nil, err
  	}
  
  	// Actually list refs.
  	refs, err := model.ListPackageRefs(c, r.Package)
  	if err != nil {
  		return nil, errors.Annotate(err, "failed to list refs").Err()
  	}
  	resp = &api.ListRefsResponse{Refs: make([]*api.Ref, len(refs))}
  	for i, ref := range refs {
  		resp.Refs[i] = ref.Proto()
  	}
  	return resp, nil
  }
docs: // ListRefs implements the corresponding RPC method, see the proto doc.