code: func (k *KVS) ListKeys(args *structs.KeyListRequest, reply *structs.IndexedKeyList) error {
  	if done, err := k.srv.forward("KVS.ListKeys", args, args, reply); done {
  		return err
  	}
  
  	aclToken, err := k.srv.ResolveToken(args.Token)
  	if err != nil {
  		return err
  	}
  
  	if aclToken != nil && k.srv.config.ACLEnableKeyListPolicy && !aclToken.KeyList(args.Prefix) {
  		return acl.ErrPermissionDenied
  	}
  
  	return k.srv.blockingQuery(
  		&args.QueryOptions,
  		&reply.QueryMeta,
  		func(ws memdb.WatchSet, state *state.Store) error {
  			index, keys, err := state.KVSListKeys(ws, args.Prefix, args.Seperator)
  			if err != nil {
  				return err
  			}
  
  			// Must provide non-zero index to prevent blocking
  			// Index 1 is impossible anyways (due to Raft internals)
  			if index == 0 {
  				reply.Index = 1
  			} else {
  				reply.Index = index
  			}
  
  			if aclToken != nil {
  				keys = FilterKeys(aclToken, keys)
  			}
  			reply.Keys = keys
  			return nil
  		})
  }
docs: // ListKeys is used to list all keys with a given prefix to a separator.