input: from typing import List
  
  def generate_rest_api(items: List[dict]) -> Flask:
      """ Generate a basic REST API with authentication and endpoints in Python using Flask.
      The API will include JWT authentication for protected endpoints.
      The API should have endpoints to list all items, get a specific item, and add new items.
      >>> app = generate_rest_api([{'name': 'item1', 'price': 10.0}, {'name': 'item2', 'price': 20.0}])
      >>> app.run(port=5000, debug=True)
      Accessing /items should return {'items': [{'name': 'item1', 'price': 10.0}, {'name': 'item2', 'price': 20.0}]}
      Accessing /item/item1 should return {'name': 'item1', 'price': 10.0}, 200 if authenticated
      """
output:     from flask import Flask, jsonify, request
      from flask_jwt_extended import JWTManager, jwt_required, create_access_token
  
      app = Flask(__name__)
      app.config['JWT_SECRET_KEY'] = 'super-secret'  # Change this!
      jwt = JWTManager(app)
  
      @app.route('/login', methods=['POST'])
      def login():
          username = request.json.get('username', None)
          password = request.json.get('password', None)
          if username != 'test' or password != 'test':
              return jsonify({"msg": "Bad username or password"}), 401
  
          access_token = create_access_token(identity=username)
          return jsonify(access_token=access_token)
  
      @app.route('/items', methods=['GET'])
      @jwt_required()
      def list_items():
          return jsonify({'items': items})
  
      @app.route('/item/<name>', methods=['GET'])
      @jwt_required()
      def get_item(name):
          item = next((item for item in items if item['name'] == name), None)
          if item:
              return jsonify(item), 200
          return jsonify({'message': 'Item not found'}), 404
  
      @app.route('/item', methods=['POST'])
      @jwt_required()
      def add_item():
          new_item = request.get_json()
          items.append(new_item)
          return jsonify({'message': 'Item added successfully'}), 201
  
      return app